@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.
@@ -17,10 +17,10 @@ jobs:
17
17
  node-version: latest
18
18
 
19
19
  - name: Install dependencies
20
- run: yarn install
20
+ run: npm install
21
21
 
22
22
  - name: Run tests
23
- run: yarn run test
23
+ run: npm run test
24
24
 
25
25
  - name: Upload Codecov reports
26
26
  uses: codecov/codecov-action@main
package/demo/index.html CHANGED
@@ -80,7 +80,7 @@
80
80
  </div>
81
81
 
82
82
  <div class="container">
83
- <div class="description">bins rounded to nearest month</div>
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 rounded to nearest year</div>
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="2014"
105
- bins="[100,5000,2000,100,5000,2000]"
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 as BinRoundingInterval, } from './src/histogram-date-range';
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 as BinRoundingInterval,\n} from './src/histogram-date-range';\n"]}
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
- /** What interval bins should be rounded to for display */
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 disjoin intervals, if applicable.
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
  /**