@internetarchive/histogram-date-range 0.1.8-alpha.4 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/demo/js/app-root.ts +59 -59
- package/dist/demo/js/app-root.js +11 -11
- package/dist/demo/js/app-root.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/histogram-date-range.js +232 -239
- package/dist/src/histogram-date-range.js.map +1 -1
- package/dist/test/histogram-date-range.test.js +109 -109
- package/dist/test/histogram-date-range.test.js.map +1 -1
- package/index.ts +1 -1
- package/package.json +1 -1
- package/src/histogram-date-range.ts +1 -1
- package/test/histogram-date-range.test.ts +12 -12
package/demo/js/app-root.ts
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { LitElement, html, TemplateResult } from 'lit';
|
|
2
|
-
import { customElement, state } from 'lit/decorators.js';
|
|
3
|
-
import '../../src/histogram-date-range';
|
|
4
|
-
|
|
5
|
-
interface DataSource {
|
|
6
|
-
minDate: unknown;
|
|
7
|
-
maxDate: unknown;
|
|
8
|
-
minSelectedDate: unknown;
|
|
9
|
-
maxSelectedDate: unknown;
|
|
10
|
-
bins: number[];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* This is mainly to test the histogram-date-range within
|
|
15
|
-
* a lit-element.
|
|
16
|
-
*/
|
|
17
|
-
@customElement('app-root')
|
|
18
|
-
export class AppRoot extends LitElement {
|
|
19
|
-
@state() dataSource: DataSource = {
|
|
20
|
-
minDate: 1955,
|
|
21
|
-
maxDate: 2000,
|
|
22
|
-
minSelectedDate: 1955,
|
|
23
|
-
maxSelectedDate: 2000,
|
|
24
|
-
bins: [
|
|
25
|
-
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
|
26
|
-
],
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
render(): TemplateResult {
|
|
30
|
-
return html`
|
|
31
|
-
<histogram-date-range
|
|
32
|
-
.minDate=${this.dataSource?.minDate}
|
|
33
|
-
.maxDate=${this.dataSource?.maxDate}
|
|
34
|
-
.minSelectedDate=${this.dataSource?.minSelectedDate}
|
|
35
|
-
.maxSelectedDate=${this.dataSource?.maxSelectedDate}
|
|
36
|
-
.updateDelay=${1000}
|
|
37
|
-
.bins=${this.dataSource?.bins}
|
|
38
|
-
></histogram-date-range>
|
|
39
|
-
|
|
40
|
-
<button @click=${this.randomize}>Randomize</button>
|
|
41
|
-
`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
private randomize() {
|
|
45
|
-
const minDate = Math.round(Math.random() * 1000);
|
|
46
|
-
const maxDate = minDate + Math.round(Math.random() * 1000);
|
|
47
|
-
// generate random bins
|
|
48
|
-
const bins = Array.from({ length: 20 }, () =>
|
|
49
|
-
Math.floor(Math.random() * minDate)
|
|
50
|
-
);
|
|
51
|
-
this.dataSource = {
|
|
52
|
-
minDate,
|
|
53
|
-
maxDate,
|
|
54
|
-
minSelectedDate: minDate,
|
|
55
|
-
maxSelectedDate: maxDate,
|
|
56
|
-
bins: bins,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
}
|
|
1
|
+
import { LitElement, html, TemplateResult } from 'lit';
|
|
2
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
3
|
+
import '../../src/histogram-date-range';
|
|
4
|
+
|
|
5
|
+
interface DataSource {
|
|
6
|
+
minDate: unknown;
|
|
7
|
+
maxDate: unknown;
|
|
8
|
+
minSelectedDate: unknown;
|
|
9
|
+
maxSelectedDate: unknown;
|
|
10
|
+
bins: number[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* This is mainly to test the histogram-date-range within
|
|
15
|
+
* a lit-element.
|
|
16
|
+
*/
|
|
17
|
+
@customElement('app-root')
|
|
18
|
+
export class AppRoot extends LitElement {
|
|
19
|
+
@state() dataSource: DataSource = {
|
|
20
|
+
minDate: 1955,
|
|
21
|
+
maxDate: 2000,
|
|
22
|
+
minSelectedDate: 1955,
|
|
23
|
+
maxSelectedDate: 2000,
|
|
24
|
+
bins: [
|
|
25
|
+
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
render(): TemplateResult {
|
|
30
|
+
return html`
|
|
31
|
+
<histogram-date-range
|
|
32
|
+
.minDate=${this.dataSource?.minDate}
|
|
33
|
+
.maxDate=${this.dataSource?.maxDate}
|
|
34
|
+
.minSelectedDate=${this.dataSource?.minSelectedDate}
|
|
35
|
+
.maxSelectedDate=${this.dataSource?.maxSelectedDate}
|
|
36
|
+
.updateDelay=${1000}
|
|
37
|
+
.bins=${this.dataSource?.bins}
|
|
38
|
+
></histogram-date-range>
|
|
39
|
+
|
|
40
|
+
<button @click=${this.randomize}>Randomize</button>
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private randomize() {
|
|
45
|
+
const minDate = Math.round(Math.random() * 1000);
|
|
46
|
+
const maxDate = minDate + Math.round(Math.random() * 1000);
|
|
47
|
+
// generate random bins
|
|
48
|
+
const bins = Array.from({ length: 20 }, () =>
|
|
49
|
+
Math.floor(Math.random() * minDate)
|
|
50
|
+
);
|
|
51
|
+
this.dataSource = {
|
|
52
|
+
minDate,
|
|
53
|
+
maxDate,
|
|
54
|
+
minSelectedDate: minDate,
|
|
55
|
+
maxSelectedDate: maxDate,
|
|
56
|
+
bins: bins,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
package/dist/demo/js/app-root.js
CHANGED
|
@@ -21,17 +21,17 @@ let AppRoot = class AppRoot extends LitElement {
|
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
23
23
|
var _a, _b, _c, _d, _e;
|
|
24
|
-
return html `
|
|
25
|
-
<histogram-date-range
|
|
26
|
-
.minDate=${(_a = this.dataSource) === null || _a === void 0 ? void 0 : _a.minDate}
|
|
27
|
-
.maxDate=${(_b = this.dataSource) === null || _b === void 0 ? void 0 : _b.maxDate}
|
|
28
|
-
.minSelectedDate=${(_c = this.dataSource) === null || _c === void 0 ? void 0 : _c.minSelectedDate}
|
|
29
|
-
.maxSelectedDate=${(_d = this.dataSource) === null || _d === void 0 ? void 0 : _d.maxSelectedDate}
|
|
30
|
-
.updateDelay=${1000}
|
|
31
|
-
.bins=${(_e = this.dataSource) === null || _e === void 0 ? void 0 : _e.bins}
|
|
32
|
-
></histogram-date-range>
|
|
33
|
-
|
|
34
|
-
<button @click=${this.randomize}>Randomize</button>
|
|
24
|
+
return html `
|
|
25
|
+
<histogram-date-range
|
|
26
|
+
.minDate=${(_a = this.dataSource) === null || _a === void 0 ? void 0 : _a.minDate}
|
|
27
|
+
.maxDate=${(_b = this.dataSource) === null || _b === void 0 ? void 0 : _b.maxDate}
|
|
28
|
+
.minSelectedDate=${(_c = this.dataSource) === null || _c === void 0 ? void 0 : _c.minSelectedDate}
|
|
29
|
+
.maxSelectedDate=${(_d = this.dataSource) === null || _d === void 0 ? void 0 : _d.maxSelectedDate}
|
|
30
|
+
.updateDelay=${1000}
|
|
31
|
+
.bins=${(_e = this.dataSource) === null || _e === void 0 ? void 0 : _e.bins}
|
|
32
|
+
></histogram-date-range>
|
|
33
|
+
|
|
34
|
+
<button @click=${this.randomize}>Randomize</button>
|
|
35
35
|
`;
|
|
36
36
|
}
|
|
37
37
|
randomize() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-root.js","sourceRoot":"","sources":["../../../demo/js/app-root.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,gCAAgC,CAAC;AAUxC;;;GAGG;AAEH,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,UA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,eAAe,EAAE,OAAO;YACxB,IAAI,EAAE,IAAI;SACX,CAAC;IACJ,CAAC;CACF,CAAA;AAxCU;IAAR,KAAK,EAAE;2CAQN;AATS,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAyCnB;SAzCY,OAAO","sourcesContent":["import { LitElement, html, TemplateResult } from 'lit';\
|
|
1
|
+
{"version":3,"file":"app-root.js","sourceRoot":"","sources":["../../../demo/js/app-root.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,gCAAgC,CAAC;AAUxC;;;GAGG;AAEH,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,UAAU;IAAvC;;QACW,eAAU,GAAe;YAChC,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,IAAI;YACb,eAAe,EAAE,IAAI;YACrB,eAAe,EAAE,IAAI;YACrB,IAAI,EAAE;gBACJ,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;aACtE;SACF,CAAC;IAgCJ,CAAC;IA9BC,MAAM;;QACJ,OAAO,IAAI,CAAA;;mBAEI,MAAA,IAAI,CAAC,UAAU,0CAAE,OAAO;mBACxB,MAAA,IAAI,CAAC,UAAU,0CAAE,OAAO;2BAChB,MAAA,IAAI,CAAC,UAAU,0CAAE,eAAe;2BAChC,MAAA,IAAI,CAAC,UAAU,0CAAE,eAAe;uBACpC,IAAI;gBACX,MAAA,IAAI,CAAC,UAAU,0CAAE,IAAI;;;uBAGd,IAAI,CAAC,SAAS;KAChC,CAAC;IACJ,CAAC;IAEO,SAAS;QACf,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;QAC3D,uBAAuB;QACvB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAC3C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,CACpC,CAAC;QACF,IAAI,CAAC,UAAU,GAAG;YAChB,OAAO;YACP,OAAO;YACP,eAAe,EAAE,OAAO;YACxB,eAAe,EAAE,OAAO;YACxB,IAAI,EAAE,IAAI;SACX,CAAC;IACJ,CAAC;CACF,CAAA;AAxCU;IAAR,KAAK,EAAE;2CAQN;AATS,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAyCnB;SAzCY,OAAO","sourcesContent":["import { LitElement, html, TemplateResult } from 'lit';\nimport { customElement, state } from 'lit/decorators.js';\nimport '../../src/histogram-date-range';\n\ninterface DataSource {\n minDate: unknown;\n maxDate: unknown;\n minSelectedDate: unknown;\n maxSelectedDate: unknown;\n bins: number[];\n}\n\n/**\n * This is mainly to test the histogram-date-range within\n * a lit-element.\n */\n@customElement('app-root')\nexport class AppRoot extends LitElement {\n @state() dataSource: DataSource = {\n minDate: 1955,\n maxDate: 2000,\n minSelectedDate: 1955,\n maxSelectedDate: 2000,\n bins: [\n 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n ],\n };\n\n render(): TemplateResult {\n return html`\n <histogram-date-range\n .minDate=${this.dataSource?.minDate}\n .maxDate=${this.dataSource?.maxDate}\n .minSelectedDate=${this.dataSource?.minSelectedDate}\n .maxSelectedDate=${this.dataSource?.maxSelectedDate}\n .updateDelay=${1000}\n .bins=${this.dataSource?.bins}\n ></histogram-date-range>\n\n <button @click=${this.randomize}>Randomize</button>\n `;\n }\n\n private randomize() {\n const minDate = Math.round(Math.random() * 1000);\n const maxDate = minDate + Math.round(Math.random() * 1000);\n // generate random bins\n const bins = Array.from({ length: 20 }, () =>\n Math.floor(Math.random() * minDate)\n );\n this.dataSource = {\n minDate,\n maxDate,\n minSelectedDate: minDate,\n maxSelectedDate: maxDate,\n bins: bins,\n };\n }\n}\n"]}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["export { HistogramDateRange } from './src/histogram-date-range';\
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["export { HistogramDateRange } from './src/histogram-date-range';\n"]}
|