@internetarchive/histogram-date-range 1.2.2-alpha-webdev7377.7 → 1.3.0
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/.github/workflows/ci.yml +2 -2
- package/demo/index.html +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/histogram-date-range.d.ts +13 -2
- package/dist/src/histogram-date-range.js +271 -251
- package/dist/src/histogram-date-range.js.map +1 -1
- package/dist/test/histogram-date-range.test.js +254 -109
- package/dist/test/histogram-date-range.test.js.map +1 -1
- package/docs/_snowpack/pkg/common/directive-d639fc45.js +8 -0
- package/docs/_snowpack/pkg/import-map.json +1 -0
- package/docs/_snowpack/pkg/lit/directives/class-map.js +10 -0
- package/docs/_snowpack/pkg/lit/directives/live.js +3 -9
- package/docs/demo/index.html +4 -4
- package/docs/dist/src/histogram-date-range.js +25 -18
- package/index.ts +4 -4
- package/package.json +1 -1
- package/src/histogram-date-range.ts +1080 -1057
- package/test/histogram-date-range.test.ts +860 -684
package/.github/workflows/ci.yml
CHANGED
package/demo/index.html
CHANGED
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
</div>
|
|
81
81
|
|
|
82
82
|
<div class="container">
|
|
83
|
-
<div class="description">bins
|
|
83
|
+
<div class="description">bins snapped to nearest month</div>
|
|
84
84
|
<histogram-date-range
|
|
85
85
|
width="175"
|
|
86
86
|
tooltipwidth="120"
|
|
@@ -95,14 +95,14 @@
|
|
|
95
95
|
</div>
|
|
96
96
|
|
|
97
97
|
<div class="container">
|
|
98
|
-
<div class="description">bins
|
|
98
|
+
<div class="description">bins snapped to nearest year</div>
|
|
99
99
|
<histogram-date-range
|
|
100
100
|
width="175"
|
|
101
101
|
dateFormat="YYYY"
|
|
102
102
|
binSnapping="year"
|
|
103
103
|
minDate="2009"
|
|
104
|
-
maxDate="
|
|
105
|
-
bins="[100,
|
|
104
|
+
maxDate="2018"
|
|
105
|
+
bins="[100,1000,10000,100,1000,10000,100,1000,10000,100]"
|
|
106
106
|
></histogram-date-range>
|
|
107
107
|
</div>
|
|
108
108
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { HistogramDateRange, BinSnappingInterval
|
|
1
|
+
export { HistogramDateRange, BinSnappingInterval, } from './src/histogram-date-range';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,GAEnB,MAAM,4BAA4B,CAAC","sourcesContent":["export {\n HistogramDateRange,\n BinSnappingInterval
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,GAEnB,MAAM,4BAA4B,CAAC","sourcesContent":["export {\r\n HistogramDateRange,\r\n BinSnappingInterval,\r\n} from './src/histogram-date-range';\r\n"]}
|
|
@@ -16,7 +16,17 @@ export declare class HistogramDateRange extends LitElement {
|
|
|
16
16
|
bins: number[];
|
|
17
17
|
/** If true, update events will not be canceled by the date inputs receiving focus */
|
|
18
18
|
updateWhileFocused: boolean;
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* What interval bins should be snapped to for determining their time ranges.
|
|
21
|
+
* - `none` (default): Bins should each represent an identical duration of time,
|
|
22
|
+
* without regard for the actual dates represented.
|
|
23
|
+
* - `month`: Bins should each represent one or more full, non-overlapping months.
|
|
24
|
+
* The bin ranges will be "snapped" to the nearest month boundaries, which can
|
|
25
|
+
* result in bins that represent different amounts of time, particularly if the
|
|
26
|
+
* provided bins do not evenly divide the provided date range, or if the months
|
|
27
|
+
* represented are of different lengths.
|
|
28
|
+
* - `year`: Same as `month`, but snapping to year boundaries instead of months.
|
|
29
|
+
*/
|
|
20
30
|
binSnapping: BinSnappingInterval;
|
|
21
31
|
private _tooltipOffset;
|
|
22
32
|
private _tooltipContent?;
|
|
@@ -76,7 +86,8 @@ export declare class HistogramDateRange extends LitElement {
|
|
|
76
86
|
*/
|
|
77
87
|
private get snapInterval();
|
|
78
88
|
/**
|
|
79
|
-
* Offset added to the end of each bin to ensure
|
|
89
|
+
* Offset added to the end of each bin to ensure disjoint intervals,
|
|
90
|
+
* depending on whether snapping is enabled and there are multiple bins.
|
|
80
91
|
*/
|
|
81
92
|
private get snapEndOffset();
|
|
82
93
|
/**
|