@redvars/peacock 3.3.0 → 3.3.2

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.
Files changed (159) hide show
  1. package/dist/{IndividualComponent-tDnXrOLV.js → IndividualComponent-Dt5xirYG.js} +2 -2
  2. package/dist/{IndividualComponent-tDnXrOLV.js.map → IndividualComponent-Dt5xirYG.js.map} +1 -1
  3. package/dist/array-D5vjT2Xm.js +14 -0
  4. package/dist/array-D5vjT2Xm.js.map +1 -0
  5. package/dist/assets/components.css +1 -1
  6. package/dist/assets/components.css.map +1 -1
  7. package/dist/assets/styles.css +1 -1
  8. package/dist/assets/styles.css.map +1 -1
  9. package/dist/{button-BGFJfbT2.js → button-ClzS8JLq.js} +3 -4
  10. package/dist/{button-BGFJfbT2.js.map → button-ClzS8JLq.js.map} +1 -1
  11. package/dist/button-group-BMS5WvaF.js +292 -0
  12. package/dist/button-group-BMS5WvaF.js.map +1 -0
  13. package/dist/button-group.js +6 -107
  14. package/dist/button-group.js.map +1 -1
  15. package/dist/button.js +3 -4
  16. package/dist/button.js.map +1 -1
  17. package/dist/card.js +104 -0
  18. package/dist/card.js.map +1 -0
  19. package/dist/chart-bar-DbnXQgvS.js +1121 -0
  20. package/dist/chart-bar-DbnXQgvS.js.map +1 -0
  21. package/dist/chart-bar.js +259 -0
  22. package/dist/chart-bar.js.map +1 -0
  23. package/dist/chart-donut.js +4 -2
  24. package/dist/chart-donut.js.map +1 -1
  25. package/dist/chart-doughnut.js +4 -2
  26. package/dist/chart-doughnut.js.map +1 -1
  27. package/dist/chart-pie.js +4 -2
  28. package/dist/chart-pie.js.map +1 -1
  29. package/dist/chart-stacked-bar.js +401 -0
  30. package/dist/chart-stacked-bar.js.map +1 -0
  31. package/dist/{class-map-DpeNtqCn.js → class-map-59YGWLnx.js} +9 -3
  32. package/dist/class-map-59YGWLnx.js.map +1 -0
  33. package/dist/clock.js +1 -1
  34. package/dist/code-editor.js +7 -7
  35. package/dist/code-editor.js.map +1 -1
  36. package/dist/code-highlighter.js +7 -25
  37. package/dist/code-highlighter.js.map +1 -1
  38. package/dist/custom-elements-jsdocs.json +8824 -5047
  39. package/dist/custom-elements.json +7468 -4147
  40. package/dist/index.js +16 -10
  41. package/dist/index.js.map +1 -1
  42. package/dist/number-counter.js +2 -2
  43. package/dist/{observe-theme-change-BISF-Gl5.js → observe-theme-change-pALI5fmV.js} +2 -2
  44. package/dist/{observe-theme-change-BISF-Gl5.js.map → observe-theme-change-pALI5fmV.js.map} +1 -1
  45. package/dist/peacock-loader.js +42 -1016
  46. package/dist/peacock-loader.js.map +1 -1
  47. package/dist/pie-Dz0IDiPt.js +537 -0
  48. package/dist/pie-Dz0IDiPt.js.map +1 -0
  49. package/dist/{slider-Dk9CFWTG.js → snackbar-74YCdMPL.js} +6205 -3206
  50. package/dist/snackbar-74YCdMPL.js.map +1 -0
  51. package/dist/src/accordion/accordion-item.d.ts +1 -0
  52. package/dist/src/breadcrumb/breadcrumb/breadcrumb.d.ts +2 -0
  53. package/dist/src/breadcrumb/breadcrumb-item/breadcrumb-item.d.ts +1 -0
  54. package/dist/src/button/button-group/button-group.d.ts +4 -0
  55. package/dist/src/card/card.d.ts +27 -0
  56. package/dist/src/card/index.d.ts +1 -0
  57. package/dist/src/chart-bar/chart-bar.d.ts +53 -0
  58. package/dist/src/chart-bar/chart-stacked-bar.d.ts +78 -0
  59. package/dist/src/chart-bar/index.d.ts +2 -0
  60. package/dist/src/code-editor/code-editor.d.ts +4 -3
  61. package/dist/src/code-highlighter/code-highlighter.d.ts +4 -7
  62. package/dist/src/index.d.ts +9 -0
  63. package/dist/src/menu/index.d.ts +3 -0
  64. package/dist/src/menu/menu/MenuSurfaceController.d.ts +18 -0
  65. package/dist/src/menu/menu/menu.d.ts +54 -12
  66. package/dist/src/menu/menu-item/menu-item.d.ts +12 -5
  67. package/dist/src/menu/sub-menu/sub-menu.d.ts +36 -0
  68. package/dist/src/pagination/index.d.ts +1 -0
  69. package/dist/src/pagination/pagination.d.ts +38 -0
  70. package/dist/src/popover/PopoverController.d.ts +4 -1
  71. package/dist/src/snackbar/index.d.ts +1 -0
  72. package/dist/src/snackbar/snackbar.d.ts +40 -0
  73. package/dist/src/table/index.d.ts +1 -0
  74. package/dist/src/table/table.d.ts +110 -0
  75. package/dist/src/tabs/tab-group.d.ts +5 -1
  76. package/dist/src/tabs/tab-panel.d.ts +2 -0
  77. package/dist/src/tabs/tab.d.ts +3 -1
  78. package/dist/src/tabs/tabs.d.ts +2 -0
  79. package/dist/src/tooltip/tooltip.d.ts +1 -3
  80. package/dist/src/tree-view/index.d.ts +2 -0
  81. package/dist/src/tree-view/tree-node.d.ts +69 -0
  82. package/dist/src/tree-view/tree-view.d.ts +40 -0
  83. package/dist/src/tree-view/wc-tree-view.d.ts +6 -0
  84. package/dist/{style-map-CfNHEkQp.js → style-map-DcB52w-l.js} +2 -2
  85. package/dist/{style-map-CfNHEkQp.js.map → style-map-DcB52w-l.js.map} +1 -1
  86. package/dist/test/card.test.d.ts +1 -0
  87. package/dist/test/chart-bar.test.d.ts +1 -0
  88. package/dist/test/icon.test.d.ts +1 -1
  89. package/dist/test/menu.test.d.ts +1 -0
  90. package/dist/test/snackbar.test.d.ts +1 -0
  91. package/dist/test/sub-menu.test.d.ts +1 -0
  92. package/dist/test/tree-view.test.d.ts +1 -0
  93. package/dist/{transform-DRuHEvar.js → transform-DSwFSqzD.js} +13 -558
  94. package/dist/transform-DSwFSqzD.js.map +1 -0
  95. package/dist/tsconfig.tsbuildinfo +1 -1
  96. package/dist/{unsafe-html-CV6Je6HL.js → unsafe-html-C2r3PyzF.js} +2 -2
  97. package/dist/{unsafe-html-CV6Je6HL.js.map → unsafe-html-C2r3PyzF.js.map} +1 -1
  98. package/package.json +1 -1
  99. package/readme.md +40 -40
  100. package/src/accordion/accordion-item.ts +2 -1
  101. package/src/breadcrumb/breadcrumb/breadcrumb.ts +3 -0
  102. package/src/breadcrumb/breadcrumb-item/breadcrumb-item.ts +1 -0
  103. package/src/button/button-group/button-group.ts +6 -0
  104. package/src/card/card.scss +61 -0
  105. package/src/card/card.ts +38 -0
  106. package/src/card/index.ts +1 -0
  107. package/src/chart-bar/chart-bar.scss +58 -0
  108. package/src/chart-bar/chart-bar.ts +306 -0
  109. package/src/chart-bar/chart-stacked-bar.ts +402 -0
  110. package/src/chart-bar/index.ts +2 -0
  111. package/src/code-editor/code-editor.ts +4 -3
  112. package/src/code-highlighter/code-highlighter.ts +4 -22
  113. package/src/divider/divider.scss +2 -2
  114. package/src/empty-state/empty-state.scss +1 -1
  115. package/src/empty-state/empty-state.ts +1 -1
  116. package/src/index.ts +11 -2
  117. package/src/menu/index.ts +3 -0
  118. package/src/menu/menu/MenuSurfaceController.ts +61 -0
  119. package/src/menu/{menu-list/menu-list.scss → menu/menu.scss} +19 -4
  120. package/src/menu/menu/menu.ts +389 -81
  121. package/src/menu/menu-item/menu-item.ts +115 -36
  122. package/src/menu/sub-menu/sub-menu.scss +7 -0
  123. package/src/menu/sub-menu/sub-menu.ts +243 -0
  124. package/src/pagination/index.ts +1 -0
  125. package/src/pagination/pagination.scss +59 -0
  126. package/src/pagination/pagination.ts +135 -0
  127. package/src/peacock-loader.ts +39 -11
  128. package/src/popover/PopoverController.ts +13 -7
  129. package/src/snackbar/demo/index.html +29 -0
  130. package/src/snackbar/index.ts +1 -0
  131. package/src/snackbar/snackbar.scss +73 -0
  132. package/src/snackbar/snackbar.ts +151 -0
  133. package/src/table/index.ts +1 -0
  134. package/src/table/table.scss +174 -0
  135. package/src/table/table.ts +475 -0
  136. package/src/tabs/tab-group.ts +63 -28
  137. package/src/tabs/tab-panel.scss +3 -3
  138. package/src/tabs/tab-panel.ts +3 -0
  139. package/src/tabs/tab.scss +76 -2
  140. package/src/tabs/tab.ts +29 -6
  141. package/src/tabs/tabs.scss +6 -5
  142. package/src/tabs/tabs.ts +19 -5
  143. package/src/text/text.css-component.scss +6 -3
  144. package/src/tooltip/tooltip.scss +16 -13
  145. package/src/tooltip/tooltip.ts +7 -9
  146. package/src/tree-view/demo/index.html +57 -0
  147. package/src/tree-view/index.ts +2 -0
  148. package/src/tree-view/tree-node.scss +101 -0
  149. package/src/tree-view/tree-node.ts +268 -0
  150. package/src/tree-view/tree-view.scss +12 -0
  151. package/src/tree-view/tree-view.ts +182 -0
  152. package/src/tree-view/wc-tree-view.ts +9 -0
  153. package/dist/class-map-DpeNtqCn.js.map +0 -1
  154. package/dist/slider-Dk9CFWTG.js.map +0 -1
  155. package/dist/src/menu/menu-list/menu-list.d.ts +0 -22
  156. package/dist/state-8v48Exzh.js +0 -10
  157. package/dist/state-8v48Exzh.js.map +0 -1
  158. package/dist/transform-DRuHEvar.js.map +0 -1
  159. package/src/menu/menu-list/menu-list.ts +0 -48
@@ -0,0 +1,1121 @@
1
+ import { a as constant, i as interpolateNumber, b as color, d as interpolateRgb, e as interpolateString, o as ordinal, f as initRange } from './transform-DSwFSqzD.js';
2
+ import { a as i } from './IndividualComponent-Dt5xirYG.js';
3
+
4
+ function ascending(a, b) {
5
+ return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
6
+ }
7
+
8
+ function descending(a, b) {
9
+ return a == null || b == null ? NaN
10
+ : b < a ? -1
11
+ : b > a ? 1
12
+ : b >= a ? 0
13
+ : NaN;
14
+ }
15
+
16
+ function bisector(f) {
17
+ let compare1, compare2, delta;
18
+
19
+ // If an accessor is specified, promote it to a comparator. In this case we
20
+ // can test whether the search value is (self-) comparable. We can’t do this
21
+ // for a comparator (except for specific, known comparators) because we can’t
22
+ // tell if the comparator is symmetric, and an asymmetric comparator can’t be
23
+ // used to test whether a single value is comparable.
24
+ if (f.length !== 2) {
25
+ compare1 = ascending;
26
+ compare2 = (d, x) => ascending(f(d), x);
27
+ delta = (d, x) => f(d) - x;
28
+ } else {
29
+ compare1 = f === ascending || f === descending ? f : zero;
30
+ compare2 = f;
31
+ delta = f;
32
+ }
33
+
34
+ function left(a, x, lo = 0, hi = a.length) {
35
+ if (lo < hi) {
36
+ if (compare1(x, x) !== 0) return hi;
37
+ do {
38
+ const mid = (lo + hi) >>> 1;
39
+ if (compare2(a[mid], x) < 0) lo = mid + 1;
40
+ else hi = mid;
41
+ } while (lo < hi);
42
+ }
43
+ return lo;
44
+ }
45
+
46
+ function right(a, x, lo = 0, hi = a.length) {
47
+ if (lo < hi) {
48
+ if (compare1(x, x) !== 0) return hi;
49
+ do {
50
+ const mid = (lo + hi) >>> 1;
51
+ if (compare2(a[mid], x) <= 0) lo = mid + 1;
52
+ else hi = mid;
53
+ } while (lo < hi);
54
+ }
55
+ return lo;
56
+ }
57
+
58
+ function center(a, x, lo = 0, hi = a.length) {
59
+ const i = left(a, x, lo, hi - 1);
60
+ return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
61
+ }
62
+
63
+ return {left, center, right};
64
+ }
65
+
66
+ function zero() {
67
+ return 0;
68
+ }
69
+
70
+ function number$2(x) {
71
+ return x === null ? NaN : +x;
72
+ }
73
+
74
+ const ascendingBisect = bisector(ascending);
75
+ const bisectRight = ascendingBisect.right;
76
+ bisector(number$2).center;
77
+
78
+ const e10 = Math.sqrt(50),
79
+ e5 = Math.sqrt(10),
80
+ e2 = Math.sqrt(2);
81
+
82
+ function tickSpec(start, stop, count) {
83
+ const step = (stop - start) / Math.max(0, count),
84
+ power = Math.floor(Math.log10(step)),
85
+ error = step / Math.pow(10, power),
86
+ factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
87
+ let i1, i2, inc;
88
+ if (power < 0) {
89
+ inc = Math.pow(10, -power) / factor;
90
+ i1 = Math.round(start * inc);
91
+ i2 = Math.round(stop * inc);
92
+ if (i1 / inc < start) ++i1;
93
+ if (i2 / inc > stop) --i2;
94
+ inc = -inc;
95
+ } else {
96
+ inc = Math.pow(10, power) * factor;
97
+ i1 = Math.round(start / inc);
98
+ i2 = Math.round(stop / inc);
99
+ if (i1 * inc < start) ++i1;
100
+ if (i2 * inc > stop) --i2;
101
+ }
102
+ if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);
103
+ return [i1, i2, inc];
104
+ }
105
+
106
+ function ticks(start, stop, count) {
107
+ stop = +stop, start = +start, count = +count;
108
+ if (!(count > 0)) return [];
109
+ if (start === stop) return [start];
110
+ const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);
111
+ if (!(i2 >= i1)) return [];
112
+ const n = i2 - i1 + 1, ticks = new Array(n);
113
+ if (reverse) {
114
+ if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;
115
+ else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;
116
+ } else {
117
+ if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;
118
+ else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;
119
+ }
120
+ return ticks;
121
+ }
122
+
123
+ function tickIncrement(start, stop, count) {
124
+ stop = +stop, start = +start, count = +count;
125
+ return tickSpec(start, stop, count)[2];
126
+ }
127
+
128
+ function tickStep(start, stop, count) {
129
+ stop = +stop, start = +start, count = +count;
130
+ const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);
131
+ return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
132
+ }
133
+
134
+ function max(values, valueof) {
135
+ let max;
136
+ if (valueof === undefined) {
137
+ for (const value of values) {
138
+ if (value != null
139
+ && (max < value || (max === undefined && value >= value))) {
140
+ max = value;
141
+ }
142
+ }
143
+ } else {
144
+ let index = -1;
145
+ for (let value of values) {
146
+ if ((value = valueof(value, ++index, values)) != null
147
+ && (max < value || (max === undefined && value >= value))) {
148
+ max = value;
149
+ }
150
+ }
151
+ }
152
+ return max;
153
+ }
154
+
155
+ function range(start, stop, step) {
156
+ start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
157
+
158
+ var i = -1,
159
+ n = Math.max(0, Math.ceil((stop - start) / step)) | 0,
160
+ range = new Array(n);
161
+
162
+ while (++i < n) {
163
+ range[i] = start + i * step;
164
+ }
165
+
166
+ return range;
167
+ }
168
+
169
+ function identity$2(x) {
170
+ return x;
171
+ }
172
+
173
+ var top = 1,
174
+ right = 2,
175
+ bottom = 3,
176
+ left = 4,
177
+ epsilon = 1e-6;
178
+
179
+ function translateX(x) {
180
+ return "translate(" + x + ",0)";
181
+ }
182
+
183
+ function translateY(y) {
184
+ return "translate(0," + y + ")";
185
+ }
186
+
187
+ function number$1(scale) {
188
+ return d => +scale(d);
189
+ }
190
+
191
+ function center(scale, offset) {
192
+ offset = Math.max(0, scale.bandwidth() - offset * 2) / 2;
193
+ if (scale.round()) offset = Math.round(offset);
194
+ return d => +scale(d) + offset;
195
+ }
196
+
197
+ function entering() {
198
+ return !this.__axis;
199
+ }
200
+
201
+ function axis(orient, scale) {
202
+ var tickArguments = [],
203
+ tickValues = null,
204
+ tickFormat = null,
205
+ tickSizeInner = 6,
206
+ tickSizeOuter = 6,
207
+ tickPadding = 3,
208
+ offset = typeof window !== "undefined" && window.devicePixelRatio > 1 ? 0 : 0.5,
209
+ k = orient === top || orient === left ? -1 : 1,
210
+ x = orient === left || orient === right ? "x" : "y",
211
+ transform = orient === top || orient === bottom ? translateX : translateY;
212
+
213
+ function axis(context) {
214
+ var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,
215
+ format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity$2) : tickFormat,
216
+ spacing = Math.max(tickSizeInner, 0) + tickPadding,
217
+ range = scale.range(),
218
+ range0 = +range[0] + offset,
219
+ range1 = +range[range.length - 1] + offset,
220
+ position = (scale.bandwidth ? center : number$1)(scale.copy(), offset),
221
+ selection = context.selection ? context.selection() : context,
222
+ path = selection.selectAll(".domain").data([null]),
223
+ tick = selection.selectAll(".tick").data(values, scale).order(),
224
+ tickExit = tick.exit(),
225
+ tickEnter = tick.enter().append("g").attr("class", "tick"),
226
+ line = tick.select("line"),
227
+ text = tick.select("text");
228
+
229
+ path = path.merge(path.enter().insert("path", ".tick")
230
+ .attr("class", "domain")
231
+ .attr("stroke", "currentColor"));
232
+
233
+ tick = tick.merge(tickEnter);
234
+
235
+ line = line.merge(tickEnter.append("line")
236
+ .attr("stroke", "currentColor")
237
+ .attr(x + "2", k * tickSizeInner));
238
+
239
+ text = text.merge(tickEnter.append("text")
240
+ .attr("fill", "currentColor")
241
+ .attr(x, k * spacing)
242
+ .attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em"));
243
+
244
+ if (context !== selection) {
245
+ path = path.transition(context);
246
+ tick = tick.transition(context);
247
+ line = line.transition(context);
248
+ text = text.transition(context);
249
+
250
+ tickExit = tickExit.transition(context)
251
+ .attr("opacity", epsilon)
252
+ .attr("transform", function(d) { return isFinite(d = position(d)) ? transform(d + offset) : this.getAttribute("transform"); });
253
+
254
+ tickEnter
255
+ .attr("opacity", epsilon)
256
+ .attr("transform", function(d) { var p = this.parentNode.__axis; return transform((p && isFinite(p = p(d)) ? p : position(d)) + offset); });
257
+ }
258
+
259
+ tickExit.remove();
260
+
261
+ path
262
+ .attr("d", orient === left || orient === right
263
+ ? (tickSizeOuter ? "M" + k * tickSizeOuter + "," + range0 + "H" + offset + "V" + range1 + "H" + k * tickSizeOuter : "M" + offset + "," + range0 + "V" + range1)
264
+ : (tickSizeOuter ? "M" + range0 + "," + k * tickSizeOuter + "V" + offset + "H" + range1 + "V" + k * tickSizeOuter : "M" + range0 + "," + offset + "H" + range1));
265
+
266
+ tick
267
+ .attr("opacity", 1)
268
+ .attr("transform", function(d) { return transform(position(d) + offset); });
269
+
270
+ line
271
+ .attr(x + "2", k * tickSizeInner);
272
+
273
+ text
274
+ .attr(x, k * spacing)
275
+ .text(format);
276
+
277
+ selection.filter(entering)
278
+ .attr("fill", "none")
279
+ .attr("font-size", 10)
280
+ .attr("font-family", "sans-serif")
281
+ .attr("text-anchor", orient === right ? "start" : orient === left ? "end" : "middle");
282
+
283
+ selection
284
+ .each(function() { this.__axis = position; });
285
+ }
286
+
287
+ axis.scale = function(_) {
288
+ return arguments.length ? (scale = _, axis) : scale;
289
+ };
290
+
291
+ axis.ticks = function() {
292
+ return tickArguments = Array.from(arguments), axis;
293
+ };
294
+
295
+ axis.tickArguments = function(_) {
296
+ return arguments.length ? (tickArguments = _ == null ? [] : Array.from(_), axis) : tickArguments.slice();
297
+ };
298
+
299
+ axis.tickValues = function(_) {
300
+ return arguments.length ? (tickValues = _ == null ? null : Array.from(_), axis) : tickValues && tickValues.slice();
301
+ };
302
+
303
+ axis.tickFormat = function(_) {
304
+ return arguments.length ? (tickFormat = _, axis) : tickFormat;
305
+ };
306
+
307
+ axis.tickSize = function(_) {
308
+ return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;
309
+ };
310
+
311
+ axis.tickSizeInner = function(_) {
312
+ return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;
313
+ };
314
+
315
+ axis.tickSizeOuter = function(_) {
316
+ return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;
317
+ };
318
+
319
+ axis.tickPadding = function(_) {
320
+ return arguments.length ? (tickPadding = +_, axis) : tickPadding;
321
+ };
322
+
323
+ axis.offset = function(_) {
324
+ return arguments.length ? (offset = +_, axis) : offset;
325
+ };
326
+
327
+ return axis;
328
+ }
329
+
330
+ function axisBottom(scale) {
331
+ return axis(bottom, scale);
332
+ }
333
+
334
+ function axisLeft(scale) {
335
+ return axis(left, scale);
336
+ }
337
+
338
+ function numberArray(a, b) {
339
+ if (!b) b = [];
340
+ var n = a ? Math.min(b.length, a.length) : 0,
341
+ c = b.slice(),
342
+ i;
343
+ return function(t) {
344
+ for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
345
+ return c;
346
+ };
347
+ }
348
+
349
+ function isNumberArray(x) {
350
+ return ArrayBuffer.isView(x) && !(x instanceof DataView);
351
+ }
352
+
353
+ function genericArray(a, b) {
354
+ var nb = b ? b.length : 0,
355
+ na = a ? Math.min(nb, a.length) : 0,
356
+ x = new Array(na),
357
+ c = new Array(nb),
358
+ i;
359
+
360
+ for (i = 0; i < na; ++i) x[i] = interpolate(a[i], b[i]);
361
+ for (; i < nb; ++i) c[i] = b[i];
362
+
363
+ return function(t) {
364
+ for (i = 0; i < na; ++i) c[i] = x[i](t);
365
+ return c;
366
+ };
367
+ }
368
+
369
+ function date(a, b) {
370
+ var d = new Date;
371
+ return a = +a, b = +b, function(t) {
372
+ return d.setTime(a * (1 - t) + b * t), d;
373
+ };
374
+ }
375
+
376
+ function object(a, b) {
377
+ var i = {},
378
+ c = {},
379
+ k;
380
+
381
+ if (a === null || typeof a !== "object") a = {};
382
+ if (b === null || typeof b !== "object") b = {};
383
+
384
+ for (k in b) {
385
+ if (k in a) {
386
+ i[k] = interpolate(a[k], b[k]);
387
+ } else {
388
+ c[k] = b[k];
389
+ }
390
+ }
391
+
392
+ return function(t) {
393
+ for (k in i) c[k] = i[k](t);
394
+ return c;
395
+ };
396
+ }
397
+
398
+ function interpolate(a, b) {
399
+ var t = typeof b, c;
400
+ return b == null || t === "boolean" ? constant(b)
401
+ : (t === "number" ? interpolateNumber
402
+ : t === "string" ? ((c = color(b)) ? (b = c, interpolateRgb) : interpolateString)
403
+ : b instanceof color ? interpolateRgb
404
+ : b instanceof Date ? date
405
+ : isNumberArray(b) ? numberArray
406
+ : Array.isArray(b) ? genericArray
407
+ : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
408
+ : interpolateNumber)(a, b);
409
+ }
410
+
411
+ function interpolateRound(a, b) {
412
+ return a = +a, b = +b, function(t) {
413
+ return Math.round(a * (1 - t) + b * t);
414
+ };
415
+ }
416
+
417
+ function formatDecimal(x) {
418
+ return Math.abs(x = Math.round(x)) >= 1e21
419
+ ? x.toLocaleString("en").replace(/,/g, "")
420
+ : x.toString(10);
421
+ }
422
+
423
+ // Computes the decimal coefficient and exponent of the specified number x with
424
+ // significant digits p, where x is positive and p is in [1, 21] or undefined.
425
+ // For example, formatDecimalParts(1.23) returns ["123", 0].
426
+ function formatDecimalParts(x, p) {
427
+ if (!isFinite(x) || x === 0) return null; // NaN, ±Infinity, ±0
428
+ var i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e"), coefficient = x.slice(0, i);
429
+
430
+ // The string returned by toExponential either has the form \d\.\d+e[-+]\d+
431
+ // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
432
+ return [
433
+ coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
434
+ +x.slice(i + 1)
435
+ ];
436
+ }
437
+
438
+ function exponent(x) {
439
+ return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;
440
+ }
441
+
442
+ function formatGroup(grouping, thousands) {
443
+ return function(value, width) {
444
+ var i = value.length,
445
+ t = [],
446
+ j = 0,
447
+ g = grouping[0],
448
+ length = 0;
449
+
450
+ while (i > 0 && g > 0) {
451
+ if (length + g + 1 > width) g = Math.max(1, width - length);
452
+ t.push(value.substring(i -= g, i + g));
453
+ if ((length += g + 1) > width) break;
454
+ g = grouping[j = (j + 1) % grouping.length];
455
+ }
456
+
457
+ return t.reverse().join(thousands);
458
+ };
459
+ }
460
+
461
+ function formatNumerals(numerals) {
462
+ return function(value) {
463
+ return value.replace(/[0-9]/g, function(i) {
464
+ return numerals[+i];
465
+ });
466
+ };
467
+ }
468
+
469
+ // [[fill]align][sign][symbol][0][width][,][.precision][~][type]
470
+ var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
471
+
472
+ function formatSpecifier(specifier) {
473
+ if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
474
+ var match;
475
+ return new FormatSpecifier({
476
+ fill: match[1],
477
+ align: match[2],
478
+ sign: match[3],
479
+ symbol: match[4],
480
+ zero: match[5],
481
+ width: match[6],
482
+ comma: match[7],
483
+ precision: match[8] && match[8].slice(1),
484
+ trim: match[9],
485
+ type: match[10]
486
+ });
487
+ }
488
+
489
+ formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
490
+
491
+ function FormatSpecifier(specifier) {
492
+ this.fill = specifier.fill === undefined ? " " : specifier.fill + "";
493
+ this.align = specifier.align === undefined ? ">" : specifier.align + "";
494
+ this.sign = specifier.sign === undefined ? "-" : specifier.sign + "";
495
+ this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + "";
496
+ this.zero = !!specifier.zero;
497
+ this.width = specifier.width === undefined ? undefined : +specifier.width;
498
+ this.comma = !!specifier.comma;
499
+ this.precision = specifier.precision === undefined ? undefined : +specifier.precision;
500
+ this.trim = !!specifier.trim;
501
+ this.type = specifier.type === undefined ? "" : specifier.type + "";
502
+ }
503
+
504
+ FormatSpecifier.prototype.toString = function() {
505
+ return this.fill
506
+ + this.align
507
+ + this.sign
508
+ + this.symbol
509
+ + (this.zero ? "0" : "")
510
+ + (this.width === undefined ? "" : Math.max(1, this.width | 0))
511
+ + (this.comma ? "," : "")
512
+ + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0))
513
+ + (this.trim ? "~" : "")
514
+ + this.type;
515
+ };
516
+
517
+ // Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.
518
+ function formatTrim(s) {
519
+ out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {
520
+ switch (s[i]) {
521
+ case ".": i0 = i1 = i; break;
522
+ case "0": if (i0 === 0) i0 = i; i1 = i; break;
523
+ default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;
524
+ }
525
+ }
526
+ return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
527
+ }
528
+
529
+ var prefixExponent;
530
+
531
+ function formatPrefixAuto(x, p) {
532
+ var d = formatDecimalParts(x, p);
533
+ if (!d) return prefixExponent = undefined, x.toPrecision(p);
534
+ var coefficient = d[0],
535
+ exponent = d[1],
536
+ i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
537
+ n = coefficient.length;
538
+ return i === n ? coefficient
539
+ : i > n ? coefficient + new Array(i - n + 1).join("0")
540
+ : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i)
541
+ : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!
542
+ }
543
+
544
+ function formatRounded(x, p) {
545
+ var d = formatDecimalParts(x, p);
546
+ if (!d) return x + "";
547
+ var coefficient = d[0],
548
+ exponent = d[1];
549
+ return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient
550
+ : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1)
551
+ : coefficient + new Array(exponent - coefficient.length + 2).join("0");
552
+ }
553
+
554
+ var formatTypes = {
555
+ "%": (x, p) => (x * 100).toFixed(p),
556
+ "b": (x) => Math.round(x).toString(2),
557
+ "c": (x) => x + "",
558
+ "d": formatDecimal,
559
+ "e": (x, p) => x.toExponential(p),
560
+ "f": (x, p) => x.toFixed(p),
561
+ "g": (x, p) => x.toPrecision(p),
562
+ "o": (x) => Math.round(x).toString(8),
563
+ "p": (x, p) => formatRounded(x * 100, p),
564
+ "r": formatRounded,
565
+ "s": formatPrefixAuto,
566
+ "X": (x) => Math.round(x).toString(16).toUpperCase(),
567
+ "x": (x) => Math.round(x).toString(16)
568
+ };
569
+
570
+ function identity$1(x) {
571
+ return x;
572
+ }
573
+
574
+ var map = Array.prototype.map,
575
+ prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];
576
+
577
+ function formatLocale(locale) {
578
+ var group = locale.grouping === undefined || locale.thousands === undefined ? identity$1 : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""),
579
+ currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "",
580
+ currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "",
581
+ decimal = locale.decimal === undefined ? "." : locale.decimal + "",
582
+ numerals = locale.numerals === undefined ? identity$1 : formatNumerals(map.call(locale.numerals, String)),
583
+ percent = locale.percent === undefined ? "%" : locale.percent + "",
584
+ minus = locale.minus === undefined ? "−" : locale.minus + "",
585
+ nan = locale.nan === undefined ? "NaN" : locale.nan + "";
586
+
587
+ function newFormat(specifier, options) {
588
+ specifier = formatSpecifier(specifier);
589
+
590
+ var fill = specifier.fill,
591
+ align = specifier.align,
592
+ sign = specifier.sign,
593
+ symbol = specifier.symbol,
594
+ zero = specifier.zero,
595
+ width = specifier.width,
596
+ comma = specifier.comma,
597
+ precision = specifier.precision,
598
+ trim = specifier.trim,
599
+ type = specifier.type;
600
+
601
+ // The "n" type is an alias for ",g".
602
+ if (type === "n") comma = true, type = "g";
603
+
604
+ // The "" type, and any invalid type, is an alias for ".12~g".
605
+ else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g";
606
+
607
+ // If zero fill is specified, padding goes after sign and before digits.
608
+ if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "=";
609
+
610
+ // Compute the prefix and suffix.
611
+ // For SI-prefix, the suffix is lazily computed.
612
+ var prefix = (options && options.prefix !== undefined ? options.prefix : "") + (symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : ""),
613
+ suffix = (symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "") + (options && options.suffix !== undefined ? options.suffix : "");
614
+
615
+ // What format function should we use?
616
+ // Is this an integer type?
617
+ // Can this type generate exponential notation?
618
+ var formatType = formatTypes[type],
619
+ maybeSuffix = /[defgprs%]/.test(type);
620
+
621
+ // Set the default precision if not specified,
622
+ // or clamp the specified precision to the supported range.
623
+ // For significant precision, it must be in [1, 21].
624
+ // For fixed precision, it must be in [0, 20].
625
+ precision = precision === undefined ? 6
626
+ : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))
627
+ : Math.max(0, Math.min(20, precision));
628
+
629
+ function format(value) {
630
+ var valuePrefix = prefix,
631
+ valueSuffix = suffix,
632
+ i, n, c;
633
+
634
+ if (type === "c") {
635
+ valueSuffix = formatType(value) + valueSuffix;
636
+ value = "";
637
+ } else {
638
+ value = +value;
639
+
640
+ // Determine the sign. -0 is not less than 0, but 1 / -0 is!
641
+ var valueNegative = value < 0 || 1 / value < 0;
642
+
643
+ // Perform the initial formatting.
644
+ value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
645
+
646
+ // Trim insignificant zeros.
647
+ if (trim) value = formatTrim(value);
648
+
649
+ // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.
650
+ if (valueNegative && +value === 0 && sign !== "+") valueNegative = false;
651
+
652
+ // Compute the prefix and suffix.
653
+ valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
654
+ valueSuffix = (type === "s" && !isNaN(value) && prefixExponent !== undefined ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
655
+
656
+ // Break the formatted value into the integer “value” part that can be
657
+ // grouped, and fractional or exponential “suffix” part that is not.
658
+ if (maybeSuffix) {
659
+ i = -1, n = value.length;
660
+ while (++i < n) {
661
+ if (c = value.charCodeAt(i), 48 > c || c > 57) {
662
+ valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
663
+ value = value.slice(0, i);
664
+ break;
665
+ }
666
+ }
667
+ }
668
+ }
669
+
670
+ // If the fill character is not "0", grouping is applied before padding.
671
+ if (comma && !zero) value = group(value, Infinity);
672
+
673
+ // Compute the padding.
674
+ var length = valuePrefix.length + value.length + valueSuffix.length,
675
+ padding = length < width ? new Array(width - length + 1).join(fill) : "";
676
+
677
+ // If the fill character is "0", grouping is applied after padding.
678
+ if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
679
+
680
+ // Reconstruct the final output based on the desired alignment.
681
+ switch (align) {
682
+ case "<": value = valuePrefix + value + valueSuffix + padding; break;
683
+ case "=": value = valuePrefix + padding + value + valueSuffix; break;
684
+ case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;
685
+ default: value = padding + valuePrefix + value + valueSuffix; break;
686
+ }
687
+
688
+ return numerals(value);
689
+ }
690
+
691
+ format.toString = function() {
692
+ return specifier + "";
693
+ };
694
+
695
+ return format;
696
+ }
697
+
698
+ function formatPrefix(specifier, value) {
699
+ var e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
700
+ k = Math.pow(10, -e),
701
+ f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier), {suffix: prefixes[8 + e / 3]});
702
+ return function(value) {
703
+ return f(k * value);
704
+ };
705
+ }
706
+
707
+ return {
708
+ format: newFormat,
709
+ formatPrefix: formatPrefix
710
+ };
711
+ }
712
+
713
+ var locale;
714
+ var format;
715
+ var formatPrefix;
716
+
717
+ defaultLocale({
718
+ thousands: ",",
719
+ grouping: [3],
720
+ currency: ["$", ""]
721
+ });
722
+
723
+ function defaultLocale(definition) {
724
+ locale = formatLocale(definition);
725
+ format = locale.format;
726
+ formatPrefix = locale.formatPrefix;
727
+ return locale;
728
+ }
729
+
730
+ function precisionFixed(step) {
731
+ return Math.max(0, -exponent(Math.abs(step)));
732
+ }
733
+
734
+ function precisionPrefix(step, value) {
735
+ return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
736
+ }
737
+
738
+ function precisionRound(step, max) {
739
+ step = Math.abs(step), max = Math.abs(max) - step;
740
+ return Math.max(0, exponent(max) - exponent(step)) + 1;
741
+ }
742
+
743
+ function band() {
744
+ var scale = ordinal().unknown(undefined),
745
+ domain = scale.domain,
746
+ ordinalRange = scale.range,
747
+ r0 = 0,
748
+ r1 = 1,
749
+ step,
750
+ bandwidth,
751
+ round = false,
752
+ paddingInner = 0,
753
+ paddingOuter = 0,
754
+ align = 0.5;
755
+
756
+ delete scale.unknown;
757
+
758
+ function rescale() {
759
+ var n = domain().length,
760
+ reverse = r1 < r0,
761
+ start = reverse ? r1 : r0,
762
+ stop = reverse ? r0 : r1;
763
+ step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
764
+ if (round) step = Math.floor(step);
765
+ start += (stop - start - step * (n - paddingInner)) * align;
766
+ bandwidth = step * (1 - paddingInner);
767
+ if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);
768
+ var values = range(n).map(function(i) { return start + step * i; });
769
+ return ordinalRange(reverse ? values.reverse() : values);
770
+ }
771
+
772
+ scale.domain = function(_) {
773
+ return arguments.length ? (domain(_), rescale()) : domain();
774
+ };
775
+
776
+ scale.range = function(_) {
777
+ return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
778
+ };
779
+
780
+ scale.rangeRound = function(_) {
781
+ return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();
782
+ };
783
+
784
+ scale.bandwidth = function() {
785
+ return bandwidth;
786
+ };
787
+
788
+ scale.step = function() {
789
+ return step;
790
+ };
791
+
792
+ scale.round = function(_) {
793
+ return arguments.length ? (round = !!_, rescale()) : round;
794
+ };
795
+
796
+ scale.padding = function(_) {
797
+ return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
798
+ };
799
+
800
+ scale.paddingInner = function(_) {
801
+ return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
802
+ };
803
+
804
+ scale.paddingOuter = function(_) {
805
+ return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
806
+ };
807
+
808
+ scale.align = function(_) {
809
+ return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
810
+ };
811
+
812
+ scale.copy = function() {
813
+ return band(domain(), [r0, r1])
814
+ .round(round)
815
+ .paddingInner(paddingInner)
816
+ .paddingOuter(paddingOuter)
817
+ .align(align);
818
+ };
819
+
820
+ return initRange.apply(rescale(), arguments);
821
+ }
822
+
823
+ function constants(x) {
824
+ return function() {
825
+ return x;
826
+ };
827
+ }
828
+
829
+ function number(x) {
830
+ return +x;
831
+ }
832
+
833
+ var unit = [0, 1];
834
+
835
+ function identity(x) {
836
+ return x;
837
+ }
838
+
839
+ function normalize(a, b) {
840
+ return (b -= (a = +a))
841
+ ? function(x) { return (x - a) / b; }
842
+ : constants(isNaN(b) ? NaN : 0.5);
843
+ }
844
+
845
+ function clamper(a, b) {
846
+ var t;
847
+ if (a > b) t = a, a = b, b = t;
848
+ return function(x) { return Math.max(a, Math.min(b, x)); };
849
+ }
850
+
851
+ // normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
852
+ // interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
853
+ function bimap(domain, range, interpolate) {
854
+ var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
855
+ if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
856
+ else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
857
+ return function(x) { return r0(d0(x)); };
858
+ }
859
+
860
+ function polymap(domain, range, interpolate) {
861
+ var j = Math.min(domain.length, range.length) - 1,
862
+ d = new Array(j),
863
+ r = new Array(j),
864
+ i = -1;
865
+
866
+ // Reverse descending domains.
867
+ if (domain[j] < domain[0]) {
868
+ domain = domain.slice().reverse();
869
+ range = range.slice().reverse();
870
+ }
871
+
872
+ while (++i < j) {
873
+ d[i] = normalize(domain[i], domain[i + 1]);
874
+ r[i] = interpolate(range[i], range[i + 1]);
875
+ }
876
+
877
+ return function(x) {
878
+ var i = bisectRight(domain, x, 1, j) - 1;
879
+ return r[i](d[i](x));
880
+ };
881
+ }
882
+
883
+ function copy(source, target) {
884
+ return target
885
+ .domain(source.domain())
886
+ .range(source.range())
887
+ .interpolate(source.interpolate())
888
+ .clamp(source.clamp())
889
+ .unknown(source.unknown());
890
+ }
891
+
892
+ function transformer() {
893
+ var domain = unit,
894
+ range = unit,
895
+ interpolate$1 = interpolate,
896
+ transform,
897
+ untransform,
898
+ unknown,
899
+ clamp = identity,
900
+ piecewise,
901
+ output,
902
+ input;
903
+
904
+ function rescale() {
905
+ var n = Math.min(domain.length, range.length);
906
+ if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);
907
+ piecewise = n > 2 ? polymap : bimap;
908
+ output = input = null;
909
+ return scale;
910
+ }
911
+
912
+ function scale(x) {
913
+ return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate$1)))(transform(clamp(x)));
914
+ }
915
+
916
+ scale.invert = function(y) {
917
+ return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));
918
+ };
919
+
920
+ scale.domain = function(_) {
921
+ return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();
922
+ };
923
+
924
+ scale.range = function(_) {
925
+ return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
926
+ };
927
+
928
+ scale.rangeRound = function(_) {
929
+ return range = Array.from(_), interpolate$1 = interpolateRound, rescale();
930
+ };
931
+
932
+ scale.clamp = function(_) {
933
+ return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;
934
+ };
935
+
936
+ scale.interpolate = function(_) {
937
+ return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1;
938
+ };
939
+
940
+ scale.unknown = function(_) {
941
+ return arguments.length ? (unknown = _, scale) : unknown;
942
+ };
943
+
944
+ return function(t, u) {
945
+ transform = t, untransform = u;
946
+ return rescale();
947
+ };
948
+ }
949
+
950
+ function continuous() {
951
+ return transformer()(identity, identity);
952
+ }
953
+
954
+ function tickFormat(start, stop, count, specifier) {
955
+ var step = tickStep(start, stop, count),
956
+ precision;
957
+ specifier = formatSpecifier(specifier == null ? ",f" : specifier);
958
+ switch (specifier.type) {
959
+ case "s": {
960
+ var value = Math.max(Math.abs(start), Math.abs(stop));
961
+ if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;
962
+ return formatPrefix(specifier, value);
963
+ }
964
+ case "":
965
+ case "e":
966
+ case "g":
967
+ case "p":
968
+ case "r": {
969
+ if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
970
+ break;
971
+ }
972
+ case "f":
973
+ case "%": {
974
+ if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
975
+ break;
976
+ }
977
+ }
978
+ return format(specifier);
979
+ }
980
+
981
+ function linearish(scale) {
982
+ var domain = scale.domain;
983
+
984
+ scale.ticks = function(count) {
985
+ var d = domain();
986
+ return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
987
+ };
988
+
989
+ scale.tickFormat = function(count, specifier) {
990
+ var d = domain();
991
+ return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
992
+ };
993
+
994
+ scale.nice = function(count) {
995
+ if (count == null) count = 10;
996
+
997
+ var d = domain();
998
+ var i0 = 0;
999
+ var i1 = d.length - 1;
1000
+ var start = d[i0];
1001
+ var stop = d[i1];
1002
+ var prestep;
1003
+ var step;
1004
+ var maxIter = 10;
1005
+
1006
+ if (stop < start) {
1007
+ step = start, start = stop, stop = step;
1008
+ step = i0, i0 = i1, i1 = step;
1009
+ }
1010
+
1011
+ while (maxIter-- > 0) {
1012
+ step = tickIncrement(start, stop, count);
1013
+ if (step === prestep) {
1014
+ d[i0] = start;
1015
+ d[i1] = stop;
1016
+ return domain(d);
1017
+ } else if (step > 0) {
1018
+ start = Math.floor(start / step) * step;
1019
+ stop = Math.ceil(stop / step) * step;
1020
+ } else if (step < 0) {
1021
+ start = Math.ceil(start * step) / step;
1022
+ stop = Math.floor(stop * step) / step;
1023
+ } else {
1024
+ break;
1025
+ }
1026
+ prestep = step;
1027
+ }
1028
+
1029
+ return scale;
1030
+ };
1031
+
1032
+ return scale;
1033
+ }
1034
+
1035
+ function linear() {
1036
+ var scale = continuous();
1037
+
1038
+ scale.copy = function() {
1039
+ return copy(scale, linear());
1040
+ };
1041
+
1042
+ initRange.apply(scale, arguments);
1043
+
1044
+ return linearish(scale);
1045
+ }
1046
+
1047
+ var css_248z = i`* {
1048
+ box-sizing: border-box;
1049
+ }
1050
+
1051
+ .screen-reader-only {
1052
+ display: none !important;
1053
+ }
1054
+
1055
+ :host {
1056
+ display: block;
1057
+ color: var(--color-on-surface);
1058
+ }
1059
+
1060
+ .chart-frame {
1061
+ background: var(--color-surface-container-low);
1062
+ border: 1px solid var(--color-outline-variant);
1063
+ border-radius: var(--shape-corner-medium);
1064
+ padding: var(--spacing-300);
1065
+ box-shadow: var(--md-sys-elevation-1);
1066
+ }
1067
+
1068
+ svg {
1069
+ width: 100%;
1070
+ height: 100%;
1071
+ }
1072
+
1073
+ .axis-label {
1074
+ font-family: var(--typography-label-medium-font-family) !important;
1075
+ font-size: var(--typography-label-medium-font-size) !important;
1076
+ font-weight: var(--typography-label-medium-font-weight) !important;
1077
+ line-height: var(--typography-label-medium-line-height) !important;
1078
+ letter-spacing: var(--typography-label-medium-letter-spacing) !important;
1079
+ fill: var(--color-on-surface-variant);
1080
+ }
1081
+
1082
+ .value-label {
1083
+ font-family: var(--typography-label-small-font-family) !important;
1084
+ font-size: var(--typography-label-small-font-size) !important;
1085
+ font-weight: var(--typography-label-small-font-weight) !important;
1086
+ line-height: var(--typography-label-small-line-height) !important;
1087
+ letter-spacing: var(--typography-label-small-letter-spacing) !important;
1088
+ fill: var(--color-on-surface);
1089
+ }
1090
+
1091
+ .gridline {
1092
+ stroke: var(--color-outline-variant);
1093
+ opacity: 0.6;
1094
+ }
1095
+
1096
+ .legend {
1097
+ display: flex;
1098
+ flex-wrap: wrap;
1099
+ gap: var(--spacing-200);
1100
+ margin-top: var(--spacing-200);
1101
+ color: var(--color-on-surface);
1102
+ font-family: var(--typography-label-medium-font-family) !important;
1103
+ font-size: var(--typography-label-medium-font-size) !important;
1104
+ font-weight: var(--typography-label-medium-font-weight) !important;
1105
+ line-height: var(--typography-label-medium-line-height) !important;
1106
+ letter-spacing: var(--typography-label-medium-letter-spacing) !important;
1107
+ }
1108
+ .legend .legend-item {
1109
+ display: inline-flex;
1110
+ align-items: center;
1111
+ gap: var(--spacing-150);
1112
+ }
1113
+ .legend .legend-item .swatch {
1114
+ width: 12px;
1115
+ height: 12px;
1116
+ border-radius: var(--shape-corner-full);
1117
+ border: 1px solid var(--color-outline-variant);
1118
+ }`;
1119
+
1120
+ export { axisLeft as a, band as b, css_248z as c, axisBottom as d, linear as l, max as m };
1121
+ //# sourceMappingURL=chart-bar-DbnXQgvS.js.map