billboard.js 3.3.0 → 3.3.3

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 (75) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +489 -399
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +2491 -2239
  6. package/dist/billboard.pkgd.min.js +2 -2
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +166 -103
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +166 -103
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +32 -130
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +32 -130
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +2004 -1842
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +2168 -1943
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +2170 -1945
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +2036 -1972
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +2037 -1973
  22. package/dist/theme/datalab.css +1 -1
  23. package/dist/theme/datalab.min.css +2 -2
  24. package/dist/theme/graph.css +1 -1
  25. package/dist/theme/graph.min.css +2 -2
  26. package/dist/theme/insight.css +1 -1
  27. package/dist/theme/insight.min.css +2 -2
  28. package/dist-esm/billboard.js +481 -412
  29. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -4
  30. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +129 -77
  31. package/dist-esm/plugin/billboardjs-plugin-stanford.js +135 -80
  32. package/dist-esm/plugin/billboardjs-plugin-tableview.js +4 -8
  33. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -7
  34. package/package.json +28 -28
  35. package/src/Chart/api/chart.ts +1 -1
  36. package/src/Chart/api/focus.ts +8 -8
  37. package/src/Chart/api/regions.ts +3 -3
  38. package/src/Chart/api/selection.ts +15 -15
  39. package/src/Chart/api/subchart.ts +10 -10
  40. package/src/ChartInternal/Axis/Axis.ts +16 -14
  41. package/src/ChartInternal/ChartInternal.ts +7 -8
  42. package/src/ChartInternal/data/data.ts +3 -3
  43. package/src/ChartInternal/data/load.ts +2 -2
  44. package/src/ChartInternal/interactions/drag.ts +15 -15
  45. package/src/ChartInternal/interactions/eventrect.ts +18 -18
  46. package/src/ChartInternal/interactions/interaction.ts +10 -10
  47. package/src/ChartInternal/interactions/zoom.ts +4 -4
  48. package/src/ChartInternal/internals/color.ts +4 -4
  49. package/src/ChartInternal/internals/domain.ts +1 -1
  50. package/src/ChartInternal/internals/format.ts +9 -4
  51. package/src/ChartInternal/internals/grid.ts +32 -32
  52. package/src/ChartInternal/internals/legend.ts +27 -27
  53. package/src/ChartInternal/internals/redraw.ts +6 -5
  54. package/src/ChartInternal/internals/region.ts +3 -3
  55. package/src/ChartInternal/internals/selection.ts +16 -15
  56. package/src/ChartInternal/internals/size.ts +3 -3
  57. package/src/ChartInternal/internals/text.ts +8 -8
  58. package/src/ChartInternal/internals/title.ts +4 -4
  59. package/src/ChartInternal/internals/tooltip.ts +5 -5
  60. package/src/ChartInternal/internals/transform.ts +5 -5
  61. package/src/ChartInternal/shape/arc.ts +22 -22
  62. package/src/ChartInternal/shape/area.ts +4 -4
  63. package/src/ChartInternal/shape/bar.ts +7 -7
  64. package/src/ChartInternal/shape/candlestick.ts +8 -8
  65. package/src/ChartInternal/shape/gauge.ts +8 -8
  66. package/src/ChartInternal/shape/line.ts +7 -7
  67. package/src/ChartInternal/shape/point.ts +18 -18
  68. package/src/ChartInternal/shape/radar.ts +10 -10
  69. package/src/ChartInternal/shape/shape.ts +4 -2
  70. package/src/Plugin/sparkline/index.ts +2 -2
  71. package/src/Plugin/stanford/index.ts +3 -3
  72. package/src/Plugin/stanford/util.ts +0 -1
  73. package/src/config/Options/common/tooltip.ts +10 -1
  74. package/src/config/classes.ts +154 -66
  75. package/src/module/util.ts +21 -13
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.3.0
8
+ * @version 3.3.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -151,7 +151,28 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
151
151
  var external_commonjs_d3_color_commonjs2_d3_color_amd_d3_color_root_d3_ = __webpack_require__(6);
152
152
  // EXTERNAL MODULE: external {"commonjs":"d3-scale","commonjs2":"d3-scale","amd":"d3-scale","root":"d3"}
153
153
  var external_commonjs_d3_scale_commonjs2_d3_scale_amd_d3_scale_root_d3_ = __webpack_require__(7);
154
+ ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
155
+ function _defineProperty(obj, key, value) {
156
+ if (key in obj) {
157
+ Object.defineProperty(obj, key, {
158
+ value: value,
159
+ enumerable: true,
160
+ configurable: true,
161
+ writable: true
162
+ });
163
+ } else {
164
+ obj[key] = value;
165
+ }
166
+
167
+ return obj;
168
+ }
154
169
  ;// CONCATENATED MODULE: ./src/config/classes.ts
170
+
171
+
172
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
173
+
174
+ function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
175
+
155
176
  /**
156
177
  * Copyright (c) 2017 ~ present NAVER Corp.
157
178
  * billboard.js project is licensed under the MIT license
@@ -161,126 +182,151 @@ var external_commonjs_d3_scale_commonjs2_d3_scale_amd_d3_scale_root_d3_ = __webp
161
182
  * CSS class names definition
162
183
  * @private
163
184
  */
164
- /* harmony default export */ var classes = ({
185
+ var $COMMON = {
186
+ button: "bb-button",
187
+ chart: "bb-chart",
188
+ empty: "bb-empty",
189
+ main: "bb-main",
190
+ target: "bb-target",
191
+ EXPANDED: "_expanded_"
192
+ };
193
+ var $ARC = {
165
194
  arc: "bb-arc",
166
195
  arcLabelLine: "bb-arc-label-line",
167
196
  arcs: "bb-arcs",
197
+ chartArc: "bb-chart-arc",
198
+ chartArcs: "bb-chart-arcs",
199
+ chartArcsBackground: "bb-chart-arcs-background",
200
+ chartArcsTitle: "bb-chart-arcs-title"
201
+ };
202
+ var $AREA = {
168
203
  area: "bb-area",
169
- areas: "bb-areas",
204
+ areas: "bb-areas"
205
+ };
206
+ var $AXIS = {
170
207
  axis: "bb-axis",
171
208
  axisX: "bb-axis-x",
172
209
  axisXLabel: "bb-axis-x-label",
173
210
  axisY: "bb-axis-y",
174
211
  axisY2: "bb-axis-y2",
175
212
  axisY2Label: "bb-axis-y2-label",
176
- axisYLabel: "bb-axis-y-label",
213
+ axisYLabel: "bb-axis-y-label"
214
+ };
215
+ var $BAR = {
177
216
  bar: "bb-bar",
178
217
  bars: "bb-bars",
179
- brush: "bb-brush",
180
- button: "bb-button",
181
- buttonZoomReset: "bb-zoom-reset",
218
+ chartBar: "bb-chart-bar",
219
+ chartBars: "bb-chart-bars"
220
+ };
221
+ var $CANDLESTICK = {
182
222
  candlestick: "bb-candlestick",
183
223
  candlesticks: "bb-candlesticks",
184
- chart: "bb-chart",
185
- chartArc: "bb-chart-arc",
186
- chartArcs: "bb-chart-arcs",
187
- chartArcsBackground: "bb-chart-arcs-background",
188
- chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
189
- chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
190
- chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
191
- chartArcsTitle: "bb-chart-arcs-title",
192
- chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
193
- chartBar: "bb-chart-bar",
194
- chartBars: "bb-chart-bars",
195
224
  chartCandlestick: "bb-chart-candlestick",
196
225
  chartCandlesticks: "bb-chart-candlesticks",
226
+ valueDown: "bb-value-down",
227
+ valueUp: "bb-value-up"
228
+ };
229
+ var $CIRCLE = {
197
230
  chartCircles: "bb-chart-circles",
198
- chartLine: "bb-chart-line",
199
- chartLines: "bb-chart-lines",
200
- chartRadar: "bb-chart-radar",
201
- chartRadars: "bb-chart-radars",
202
- chartText: "bb-chart-text",
203
- chartTexts: "bb-chart-texts",
204
231
  circle: "bb-circle",
205
- circles: "bb-circles",
232
+ circles: "bb-circles"
233
+ };
234
+ var $COLOR = {
206
235
  colorPattern: "bb-color-pattern",
207
- colorScale: "bb-colorscale",
208
- defocused: "bb-defocused",
236
+ colorScale: "bb-colorscale"
237
+ };
238
+ var $DRAG = {
209
239
  dragarea: "bb-dragarea",
210
- empty: "bb-empty",
211
- eventRect: "bb-event-rect",
212
- eventRects: "bb-event-rects",
213
- eventRectsMultiple: "bb-event-rects-multiple",
214
- eventRectsSingle: "bb-event-rects-single",
215
- focused: "bb-focused",
216
- gaugeValue: "bb-gauge-value",
217
- grid: "bb-grid",
218
- gridLines: "bb-grid-lines",
240
+ INCLUDED: "_included_"
241
+ };
242
+ var $GAUGE = {
243
+ chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
244
+ chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
245
+ chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
246
+ chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
247
+ gaugeValue: "bb-gauge-value"
248
+ };
249
+ var $LEGEND = {
219
250
  legend: "bb-legend",
220
251
  legendBackground: "bb-legend-background",
221
252
  legendItem: "bb-legend-item",
222
253
  legendItemEvent: "bb-legend-item-event",
223
- legendItemFocused: "bb-legend-item-focused",
224
254
  legendItemHidden: "bb-legend-item-hidden",
225
255
  legendItemPoint: "bb-legend-item-point",
226
- legendItemTile: "bb-legend-item-tile",
227
- level: "bb-level",
228
- levels: "bb-levels",
256
+ legendItemTile: "bb-legend-item-tile"
257
+ };
258
+ var $LINE = {
259
+ chartLine: "bb-chart-line",
260
+ chartLines: "bb-chart-lines",
229
261
  line: "bb-line",
230
- lines: "bb-lines",
231
- main: "bb-main",
262
+ lines: "bb-lines"
263
+ };
264
+ var $EVENT = {
265
+ eventRect: "bb-event-rect",
266
+ eventRects: "bb-event-rects",
267
+ eventRectsMultiple: "bb-event-rects-multiple",
268
+ eventRectsSingle: "bb-event-rects-single"
269
+ };
270
+ var $FOCUS = {
271
+ focused: "bb-focused",
272
+ defocused: "bb-defocused",
273
+ legendItemFocused: "bb-legend-item-focused",
274
+ xgridFocus: "bb-xgrid-focus",
275
+ ygridFocus: "bb-ygrid-focus"
276
+ };
277
+ var $GRID = {
278
+ grid: "bb-grid",
279
+ gridLines: "bb-grid-lines",
280
+ xgrid: "bb-xgrid",
281
+ xgridLine: "bb-xgrid-line",
282
+ xgridLines: "bb-xgrid-lines",
283
+ xgrids: "bb-xgrids",
284
+ ygrid: "bb-ygrid",
285
+ ygridLine: "bb-ygrid-line",
286
+ ygridLines: "bb-ygrid-lines",
287
+ ygrids: "bb-ygrids"
288
+ };
289
+ var $RADAR = {
290
+ chartRadar: "bb-chart-radar",
291
+ chartRadars: "bb-chart-radars",
292
+ level: "bb-level",
293
+ levels: "bb-levels"
294
+ };
295
+ var $REGION = {
232
296
  region: "bb-region",
233
- regions: "bb-regions",
297
+ regions: "bb-regions"
298
+ };
299
+ var $SELECT = {
234
300
  selectedCircle: "bb-selected-circle",
235
301
  selectedCircles: "bb-selected-circles",
302
+ SELECTED: "_selected_"
303
+ };
304
+ var $SHAPE = {
236
305
  shape: "bb-shape",
237
- shapes: "bb-shapes",
238
- stanfordElements: "bb-stanford-elements",
239
- stanfordLine: "bb-stanford-line",
240
- stanfordLines: "bb-stanford-lines",
241
- stanfordRegion: "bb-stanford-region",
242
- stanfordRegions: "bb-stanford-regions",
243
- subchart: "bb-subchart",
244
- target: "bb-target",
306
+ shapes: "bb-shapes"
307
+ };
308
+ var $SUBCHART = {
309
+ brush: "bb-brush",
310
+ subchart: "bb-subchart"
311
+ };
312
+ var $TEXT = {
313
+ chartText: "bb-chart-text",
314
+ chartTexts: "bb-chart-texts",
245
315
  text: "bb-text",
246
316
  texts: "bb-texts",
247
317
  title: "bb-title",
318
+ TextOverlapping: "text-overlapping"
319
+ };
320
+ var $TOOLTIP = {
248
321
  tooltip: "bb-tooltip",
249
322
  tooltipContainer: "bb-tooltip-container",
250
- tooltipName: "bb-tooltip-name",
251
- valueDown: "bb-value-down",
252
- valueUp: "bb-value-up",
253
- xgrid: "bb-xgrid",
254
- xgridFocus: "bb-xgrid-focus",
255
- xgridLine: "bb-xgrid-line",
256
- xgridLines: "bb-xgrid-lines",
257
- xgrids: "bb-xgrids",
258
- ygrid: "bb-ygrid",
259
- ygridFocus: "bb-ygrid-focus",
260
- ygridLine: "bb-ygrid-line",
261
- ygridLines: "bb-ygrid-lines",
262
- ygrids: "bb-ygrids",
263
- zoomBrush: "bb-zoom-brush",
264
- EXPANDED: "_expanded_",
265
- SELECTED: "_selected_",
266
- INCLUDED: "_included_",
267
- TextOverlapping: "text-overlapping"
268
- });
269
- ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
270
- function _defineProperty(obj, key, value) {
271
- if (key in obj) {
272
- Object.defineProperty(obj, key, {
273
- value: value,
274
- enumerable: true,
275
- configurable: true,
276
- writable: true
277
- });
278
- } else {
279
- obj[key] = value;
280
- }
281
-
282
- return obj;
283
- }
323
+ tooltipName: "bb-tooltip-name"
324
+ };
325
+ var $ZOOM = {
326
+ buttonZoomReset: "bb-zoom-reset",
327
+ zoomBrush: "bb-zoom-brush"
328
+ };
329
+ /* harmony default export */ var classes = (_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, $COMMON), $ARC), $AREA), $AXIS), $BAR), $CANDLESTICK), $CIRCLE), $COLOR), $DRAG), $GAUGE), $LEGEND), $LINE), $EVENT), $FOCUS), $GRID), $RADAR), $REGION), $SELECT), $SHAPE), $SUBCHART), $TEXT), $TOOLTIP), $ZOOM));
284
330
  // EXTERNAL MODULE: external {"commonjs":"d3-selection","commonjs2":"d3-selection","amd":"d3-selection","root":"d3"}
285
331
  var external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_ = __webpack_require__(1);
286
332
  // EXTERNAL MODULE: external {"commonjs":"d3-brush","commonjs2":"d3-brush","amd":"d3-brush","root":"d3"}
@@ -319,9 +365,9 @@ var doc = win == null ? void 0 : win.document;
319
365
  ;// CONCATENATED MODULE: ./src/module/util.ts
320
366
 
321
367
 
322
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
368
+ function util_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
323
369
 
324
- function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
370
+ function util_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? util_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : util_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
325
371
 
326
372
  /**
327
373
  * Copyright (c) 2017 ~ present NAVER Corp.
@@ -333,7 +379,6 @@ function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i
333
379
 
334
380
 
335
381
 
336
-
337
382
  var isValue = function (v) {
338
383
  return v || v === 0;
339
384
  },
@@ -604,7 +649,7 @@ function getBrushSelection(ctx) {
604
649
  // check from event
605
650
  if (event && event.type === "brush") {
606
651
  selection = event.selection; // check from brush area selection
607
- } else if (main && (selection = main.select("." + classes.brush).node())) {
652
+ } else if (main && (selection = main.select(".bb-brush").node())) {
608
653
  selection = (0,external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_.brushSelection)(selection);
609
654
  }
610
655
 
@@ -626,17 +671,27 @@ function getBoundingRect(node) {
626
671
  /**
627
672
  * Retrun random number
628
673
  * @param {boolean} asStr Convert returned value as string
674
+ * @param {number} min Minimum value
675
+ * @param {number} max Maximum value
629
676
  * @returns {number|string}
630
677
  * @private
631
678
  */
632
679
 
633
680
 
634
- function getRandom(asStr) {
681
+ function getRandom(asStr, min, max) {
635
682
  if (asStr === void 0) {
636
683
  asStr = !0;
637
684
  }
638
685
 
639
- var rand = Math.random();
686
+ if (min === void 0) {
687
+ min = 0;
688
+ }
689
+
690
+ if (max === void 0) {
691
+ max = 1e4;
692
+ }
693
+
694
+ var rand = Math.floor(Math.random() * (max - min) + min);
640
695
  return asStr ? rand + "" : rand;
641
696
  }
642
697
  /**
@@ -721,7 +776,7 @@ function deepClone() {
721
776
  return objectN.map(function (v) {
722
777
  return clone(v);
723
778
  }).reduce(function (a, c) {
724
- return _objectSpread(_objectSpread({}, a), c);
779
+ return util_objectSpread(util_objectSpread({}, a), c);
725
780
  });
726
781
  }
727
782
  /**
@@ -1110,19 +1165,27 @@ function isTabVisible() {
1110
1165
 
1111
1166
 
1112
1167
  function convertInputType(mouse, touch) {
1113
- var isMobile = !1; // https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop
1168
+ var hasTouch = !1;
1114
1169
 
1115
- if (/Mobi/.test(win.navigator.userAgent) && touch) {
1170
+ if (touch) {
1116
1171
  // Some Edge desktop return true: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/20417074/
1117
- var hasTouchPoints = win.navigator && "maxTouchPoints" in win.navigator && win.navigator.maxTouchPoints > 0,
1118
- hasTouch = "ontouchmove" in win || win.DocumentTouch && doc instanceof win.DocumentTouch; // Ref: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js
1119
- // On IE11 with IE9 emulation mode, ('ontouchstart' in window) is returning true
1172
+ if (win.navigator && "maxTouchPoints" in win.navigator) {
1173
+ hasTouch = win.navigator.maxTouchPoints > 0; // Ref: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js
1174
+ // On IE11 with IE9 emulation mode, ('ontouchstart' in window) is returning true
1175
+ } else if ("ontouchmove" in win || win.DocumentTouch && doc instanceof win.DocumentTouch) {
1176
+ hasTouch = !0;
1177
+ } else {
1178
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#avoiding_user_agent_detection
1179
+ var mQ = win.matchMedia && matchMedia("(pointer:coarse)");
1120
1180
 
1121
- isMobile = hasTouchPoints || hasTouch;
1181
+ if (mQ && mQ.media === "(pointer:coarse)") {
1182
+ hasTouch = !!mQ.matches;
1183
+ }
1184
+ }
1122
1185
  }
1123
1186
 
1124
- var hasMouse = mouse && !isMobile ? "onmouseover" in win : !1;
1125
- return hasMouse && "mouse" || isMobile && "touch" || null;
1187
+ var hasMouse = mouse && !hasTouch ? "onmouseover" in win : !1;
1188
+ return hasMouse && "mouse" || hasTouch && "touch" || null;
1126
1189
  }
1127
1190
  ;// CONCATENATED MODULE: ./src/config/config.ts
1128
1191
  /**
@@ -1247,7 +1310,7 @@ var Plugin = /*#__PURE__*/function () {
1247
1310
  return Plugin;
1248
1311
  }();
1249
1312
 
1250
- Plugin.version = "3.2.2";
1313
+ Plugin.version = "3.3.3";
1251
1314
 
1252
1315
  ;// CONCATENATED MODULE: ./src/Plugin/stanford/Options.ts
1253
1316
  /**
@@ -1986,9 +2049,9 @@ var Stanford = /*#__PURE__*/function (_Plugin) {
1986
2049
 
1987
2050
  if (isEmpty(config.tooltip_contents)) {
1988
2051
  config.tooltip_contents = function (d, defaultTitleFormat, defaultValueFormat, color) {
1989
- var html = "<table class=\"" + classes.tooltip + "\"><tbody>";
2052
+ var html = "<table class=\"" + $TOOLTIP.tooltip + "\"><tbody>";
1990
2053
  d.forEach(function (v) {
1991
- html += "<tr>\n\t\t\t\t\t\t\t<th>" + defaultTitleFormat(config.data_x) + "</th>\n\t\t\t\t\t\t\t<th class=\"value\">" + defaultValueFormat(v.x) + "</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>" + defaultTitleFormat(v.id) + "</th>\n\t\t\t\t\t\t\t<th class=\"value\">" + defaultValueFormat(v.value) + "</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"" + classes.tooltipName + "-" + v.id + "\">\n\t\t\t\t\t\t\t<td class=\"name\"><span style=\"background-color:" + color(v) + "\"></span>" + defaultTitleFormat("Epochs") + "</td>\n\t\t\t\t\t\t\t<td class=\"value\">" + defaultValueFormat(v.epochs) + "</td>\n\t\t\t\t\t\t</tr>";
2054
+ html += "<tr>\n\t\t\t\t\t\t\t<th>" + defaultTitleFormat(config.data_x) + "</th>\n\t\t\t\t\t\t\t<th class=\"value\">" + defaultValueFormat(v.x) + "</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>" + defaultTitleFormat(v.id) + "</th>\n\t\t\t\t\t\t\t<th class=\"value\">" + defaultValueFormat(v.value) + "</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"" + $TOOLTIP.tooltipName + "-" + v.id + "\">\n\t\t\t\t\t\t\t<td class=\"name\"><span style=\"background-color:" + color(v) + "\"></span>" + defaultTitleFormat("Epochs") + "</td>\n\t\t\t\t\t\t\t<td class=\"value\">" + defaultValueFormat(v.epochs) + "</td>\n\t\t\t\t\t\t</tr>";
1992
2055
  });
1993
2056
  return html + "</tbody></table>";
1994
2057
  };
@@ -5,8 +5,8 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.3.0
8
+ * @version 3.3.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
12
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):"function"==typeof define&&define.amd?define("bb",["d3-interpolate","d3-color","d3-scale","d3-selection","d3-brush","d3-axis","d3-format"],e):"object"==typeof exports?exports.bb=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.stanford=e(t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3))}(this,(function(t,e,n,o,r,i,a){return function(){"use strict";var s=[,function(t){t.exports=o},,function(t){t.exports=r},,function(e){e.exports=t},function(t){t.exports=e},function(t){t.exports=n},function(t){t.exports=i},function(t){t.exports=a}],c={};function l(t){var e=c[t];if(void 0!==e)return e.exports;var n=c[t]={exports:{}};return s[t](n,n.exports,l),n.exports}l.d=function(t,e){for(var n in e)l.o(e,n)&&!l.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},l.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var u={};return function(){function t(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function e(t,n){return e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(t,n)}l.d(u,{default:function(){return F}});var n=l(5),o=l(6),r=l(7),i="bb-tooltip",a="bb-tooltip-name";l(1),l(3);var s="object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")();s.requestIdleCallback=s.requestIdleCallback||function(t){return setTimeout(t,1)},s.cancelIdleCallback=s.cancelIdleCallback||function(t){return clearTimeout(t)};var c=null==s?void 0:s.document;var d=function(t){return"function"==typeof t},f=function(t){return"string"==typeof t},p=function(t){return"number"==typeof t},h=function(t){return void 0!==t},g=function(t){return"object"==typeof t},v=function(t){return void 0===t||null===t||f(t)&&0===t.length||g(t)&&!(t instanceof Date)&&0===Object.keys(t).length||p(t)&&isNaN(t)};!function(){try{new MouseEvent("t")}catch(t){return function(t,e,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var o=c.createEvent("MouseEvent");o.initMouseEvent(e,n.bubbles,n.cancelable,s,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),t.dispatchEvent(o)}}}();function b(t){var e;if(t instanceof Date)e=t;else if(f(t)){var n=this.config;e=this.format.dataTime(n.data_xFormat)(t)}else p(t)&&!isNaN(t)&&(e=new Date(+t));return e&&!isNaN(+e)||console&&console.error&&console.error("Failed to parse x '"+t+"' to Date object"),e}function x(t){var e,n,o,r=this.config,i=function(){var t=n.shift();return t&&e&&g(e)&&t in e?(e=e[t],i()):t?void 0:e};Object.keys(r).forEach((function(a){e=t,n=a.split("_"),o=i(),h(o)&&(r[a]=o)}))}var y=function(){function t(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var e=t.prototype;return e.$beforeInit=function(){},e.$init=function(){},e.$afterInit=function(){},e.$redraw=function(){},e.$willDestroy=function(){var t=this;Object.keys(this).forEach((function(e){t[e]=null,delete t[e]}))},t}();y.version="3.2.2";var m=function(){return{colors:void 0,epochs:[],lines:[],scale_min:void 0,scale_max:void 0,scale_width:20,scale_format:void 0,padding_top:0,padding_right:0,padding_bottom:0,padding_left:0,regions:[]}},S="bb-colorscale",w="bb-stanford-elements",_="bb-stanford-line",$="bb-stanford-lines",C="bb-stanford-region",E="bb-stanford-regions";function j(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function M(t){for(var e,n=function(t){for(var e,n,o=0,r=0,i=t.length,a=i-1;r<i;a=r,r++)e=t[r],n=t[a],o+=e.x*n.y,o-=e.y*n.x;return o/2}(t),o=0,r=0,i=0,a=t.length,s=a-1;i<a;s=i,i++){var c=t[i],l=t[s];e=c.x*l.y-l.x*c.y,o+=(c.x+l.x)*e,r+=(c.y+l.y)*e}return{x:o/(e=6*n),y:r/e}}var q=function(){function t(t){this.owner=void 0,this.owner=t;var e=t.$$.$el.main.select(".bb-chart").append("g").attr("class",w);e.append("g").attr("class",$),e.append("g").attr("class",E)}var e=t.prototype;return e.updateStanfordLines=function(t){var e=this.owner.$$,n=e.config,o=e.$el.main,r=n.axis_rotated,i=this.xvCustom.bind(e),a=this.yvCustom.bind(e),s=o.select("."+$).style("shape-rendering","geometricprecision").selectAll("."+_).data(this.owner.config.lines);s.exit().transition().duration(t).style("opacity","0").remove();var c=s.enter().append("g");c.append("line").style("opacity","0"),c.merge(s).attr("class",(function(t){return _+(t.class?" "+t.class:"")})).select("line").transition().duration(t).attr("x1",(function(t){return r?a(t,"y1"):i(t,"x1")})).attr("x2",(function(t){return r?a(t,"y2"):i(t,"x2")})).attr("y1",(function(t){return r?i(t,"x1"):a(t,"y1")})).attr("y2",(function(t){return r?i(t,"x2"):a(t,"y2")})).transition().style("opacity",null)},e.updateStanfordRegions=function(t){var e=this.owner.$$,n=e.config,o=e.$el.main,r=n.axis_rotated,i=this.xvCustom.bind(e),a=this.yvCustom.bind(e),s=this.owner.countEpochsInRegion.bind(e),c=o.select("."+E).selectAll("."+C).data(this.owner.config.regions);c.exit().transition().duration(t).style("opacity","0").remove();var l=c.enter().append("g");l.append("polygon").style("opacity","0"),l.append("text").attr("transform",r?"rotate(-90)":"").style("opacity","0"),(c=l.merge(c)).attr("class",(function(t){return C+(t.class?" "+t.class:"")})).select("polygon").transition().duration(t).attr("points",(function(t){return t.points.map((function(t){return[r?a(t,"y"):i(t,"x"),r?i(t,"x"):a(t,"y")].join(",")})).join(" ")})).transition().style("opacity",(function(t){return(t.opacity?t.opacity:.2)+""})),c.select("text").transition().duration(t).attr("x",(function(t){return r?a(M(t.points),"y"):i(M(t.points),"x")})).attr("y",(function(t){return r?i(M(t.points),"x"):a(M(t.points),"y")})).text((function(t){if(t.text){var e=s(t.points),n=e.value,o=e.percentage;return t.text(n,o)}return""})).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)},e.updateStanfordElements=function(t){void 0===t&&(t=0),this.updateStanfordLines(t),this.updateStanfordRegions(t)},e.xvCustom=function(t,e){var n=this,o=n.axis,r=n.config,i=e?t[e]:n.getBaseValue(t);return o.isTimeSeries()?i=b.call(n,i):o.isCategorized()&&f(i)&&(i=r.axis_x_categories.indexOf(t.value)),Math.ceil(n.scale.x(i))},e.yvCustom=function(t,e){var n=this,o=t.axis&&"y2"===t.axis?n.scale.y2:n.scale.y,r=e?t[e]:n.getBaseValue(t);return Math.ceil(o(r))},t}(),O=l(8),k=l(9),N=function(){function t(t){this.owner=void 0,this.colorScale=void 0,this.owner=t}var e=t.prototype;return e.drawColorScale=function(){var t=this.owner,e=t.$$,n=t.config,o=e.data.targets[0],i=e.state.height-n.padding_bottom-n.padding_top,a=n.scale_width,s=function(t,e,n){void 0===n&&(n=1);for(var o=[],r=0|Math.max(0,Math.ceil((e-t)/n)),i=t;i<r;i++)o.push(t+i*n);return o}(n.padding_bottom,i,5),c=(0,r.scaleSequential)(o.colors).domain([s[s.length-1],s[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=e.$el.svg.append("g").attr("width",50).attr("height",i).attr("class",S),this.colorScale.append("g").attr("transform","translate(0, "+n.padding_top+")").selectAll("bars").data(s).enter().append("rect").attr("y",(function(t,e){return 5*e})).attr("x",0).attr("width",a).attr("height",5).attr("fill",(function(t){return c(t)}));var l=(0,r.scaleLog)().domain([o.minEpochs,o.maxEpochs]).range([s[0]+n.padding_top+s[s.length-1]+5-1,s[0]+n.padding_top]),u=(0,O.axisRight)(l),f=n.scale_format;"pow10"===f?u.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):d(f)?u.tickFormat(f):u.tickFormat((0,k.format)("d"));var p=this.colorScale.append("g").attr("class","legend axis").attr("transform","translate("+a+",0)").call(u);"pow10"===f&&p.selectAll(".tick text").text(null).filter((function(t){return t/Math.pow(10,Math.ceil(Math.log(t)/Math.LN10-1e-12))==1})).text(10).append("tspan").attr("dy","-.7em").text((function(t){return Math.round(Math.log(t)/Math.LN10)})),this.colorScale.attr("transform","translate("+(e.state.current.width-this.xForColorScale())+", 0)")},e.xForColorScale=function(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width},e.getColorScalePadding=function(){return this.xForColorScale()+this.owner.config.padding_left+20},t}(),F=function(s){var c,l;function u(e){var n=s.call(this,e)||this;return n.config=void 0,n.colorScale=void 0,n.elements=void 0,n.config=new m,t(n)||t(n)}l=s,(c=u).prototype=Object.create(l.prototype),c.prototype.constructor=c,e(c,l);var p=u.prototype;return p.$beforeInit=function(){var t=this,e=this.$$;e.config.data_xSort=!1,e.isMultipleX=function(){return!0},e.showGridFocus=function(){},e.labelishData=function(t){return t.values},e.opacityForCircle=function(){return 1};var n=e.getCurrentPaddingRight.bind(e);e.getCurrentPaddingRight=function(){return n()+(t.colorScale?t.colorScale.getColorScalePadding():0)}},p.$init=function(){var t=this.$$;x.call(this,this.options),t.color=this.getStanfordPointColor.bind(t),this.colorScale=new N(this),this.elements=new q(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),this.$redraw()},p.$redraw=function(t){var e,n;null==(e=this.colorScale)||e.drawColorScale(),null==(n=this.elements)||n.updateStanfordElements(t)},p.getOptions=function(){return new m},p.convertData=function(){var t=this.$$.data.targets,e=this.options.epochs;t.forEach((function(t){t.values.forEach((function(t,n){t.epochs=e[n]})),t.minEpochs=void 0,t.maxEpochs=void 0,t.colors=void 0,t.colorscale=void 0}))},p.xvCustom=function(t,e){var n=this,o=n.axis,r=n.config,i=e?t[e]:n.getBaseValue(t);return o.isTimeSeries()?i=b.call(n,i):o.isCategorized()&&f(i)&&(i=r.axis_x_categories.indexOf(t.value)),Math.ceil(n.scale.x(i))},p.yvCustom=function(t,e){var n=this.scale,o=t.axis&&"y2"===t.axis?n.y2:n.y,r=e?t[e]:this.getBaseValue(t);return Math.ceil(o(r))},p.initStanfordData=function(){var t=this.config,e=this.$$.data.targets[0];e.values.sort(j);var i=e.values.map((function(t){return t.epochs}));e.minEpochs=isNaN(t.scale_min)?Math.min.apply(Math,i):t.scale_min,e.maxEpochs=isNaN(t.scale_max)?Math.max.apply(Math,i):t.scale_max,e.colors=d(t.colors)?t.colors:(0,n.interpolateHslLong)((0,o.hsl)(250,1,.5),(0,o.hsl)(0,1,.5)),e.colorscale=(0,r.scaleSequentialLog)(e.colors).domain([e.minEpochs,e.maxEpochs])},p.getStanfordPointColor=function(t){return this.data.targets[0].colorscale(t.epochs)},p.setStanfordTooltip=function(){var t=this.$$.config;v(t.tooltip_contents)&&(t.tooltip_contents=function(e,n,o,r){var s='<table class="'+i+'"><tbody>';return e.forEach((function(e){s+="<tr>\n\t\t\t\t\t\t\t<th>"+n(t.data_x)+'</th>\n\t\t\t\t\t\t\t<th class="value">'+o(e.x)+"</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>"+n(e.id)+'</th>\n\t\t\t\t\t\t\t<th class="value">'+o(e.value)+'</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class="'+a+"-"+e.id+'">\n\t\t\t\t\t\t\t<td class="name"><span style="background-color:'+r(e)+'"></span>'+n("Epochs")+'</td>\n\t\t\t\t\t\t\t<td class="value">'+o(e.epochs)+"</td>\n\t\t\t\t\t\t</tr>"})),s+"</tbody></table>"})},p.countEpochsInRegion=function(t){var e=this.data.targets[0],n=e.values.reduce((function(t,e){return t+ +e.epochs}),0),o=e.values.reduce((function(e,n){return function(t,e){for(var n=t.x,o=t.value,r=!1,i=0,a=e.length-1;i<e.length;a=i++){var s=e[i].x,c=e[i].y,l=e[a].x,u=e[a].y;c>o!=u>o&&n<(l-s)*(o-c)/(u-c)+s&&(r=!r)}return r}(n,t)?e+ +n.epochs:e}),0);return{value:o,percentage:0!==o?+(o/n*100).toFixed(1):0}},u}(y)}(),u=u.default}()}));
12
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):"function"==typeof define&&define.amd?define("bb",["d3-interpolate","d3-color","d3-scale","d3-selection","d3-brush","d3-axis","d3-format"],e):"object"==typeof exports?exports.bb=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.stanford=e(t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3))}(this,(function(t,e,r,n,a,o,i){return function(){"use strict";var c=[,function(t){t.exports=n},,function(t){t.exports=a},,function(e){e.exports=t},function(t){t.exports=e},function(t){t.exports=r},function(t){t.exports=o},function(t){t.exports=i}],s={};function l(t){var e=s[t];if(void 0!==e)return e.exports;var r=s[t]={exports:{}};return c[t](r,r.exports,l),r.exports}l.d=function(t,e){for(var r in e)l.o(e,r)&&!l.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},l.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var u={};return function(){function t(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function e(t,r){return e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(t,r)}l.d(u,{default:function(){return T}});var r=l(5),n=l(6),a=l(7);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e,r=1;r<arguments.length;r++)e=null!=arguments[r]?arguments[r]:{},r%2?i(Object(e),!0).forEach((function(r){o(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):i(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}));return t}var s={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},b=(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c({},{button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_"}),{arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title"}),{area:"bb-area",areas:"bb-areas"}),{axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label"}),{bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars"}),{candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"}),{chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"}),{colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"}),{dragarea:"bb-dragarea",INCLUDED:"_included_"}),{chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"}),{legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"}),{chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"}),{eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"}),{focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"}),{grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"}),{chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars",level:"bb-level",levels:"bb-levels"}),{region:"bb-region",regions:"bb-regions"}),{selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"}),{shape:"bb-shape",shapes:"bb-shapes"}),{brush:"bb-brush",subchart:"bb-subchart"}),{chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",TextOverlapping:"text-overlapping"}),s),{buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"}),l(1),l(3),"object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")());b.requestIdleCallback=b.requestIdleCallback||function(t){return setTimeout(t,1)},b.cancelIdleCallback=b.cancelIdleCallback||function(t){return clearTimeout(t)};var d=null==b?void 0:b.document;var h=function(t){return"function"==typeof t},f=function(t){return"string"==typeof t},p=function(t){return"number"==typeof t},g=function(t){return void 0!==t},v=function(t){return"object"==typeof t},x=function(t){return void 0===t||null===t||f(t)&&0===t.length||v(t)&&!(t instanceof Date)&&0===Object.keys(t).length||p(t)&&isNaN(t)};!function(){try{new MouseEvent("t")}catch(t){return function(t,e,r){void 0===r&&(r={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var n=d.createEvent("MouseEvent");n.initMouseEvent(e,r.bubbles,r.cancelable,b,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}}();function y(t){var e;if(t instanceof Date)e=t;else if(f(t)){var r=this.config;e=this.format.dataTime(r.data_xFormat)(t)}else p(t)&&!isNaN(t)&&(e=new Date(+t));return e&&!isNaN(+e)||console&&console.error&&console.error("Failed to parse x '"+t+"' to Date object"),e}function m(t){var e,r,n,a=this.config,o=function(){var t=r.shift();return t&&e&&v(e)&&t in e?(e=e[t],o()):t?void 0:e};Object.keys(a).forEach((function(i){e=t,r=i.split("_"),n=o(),g(n)&&(a[i]=n)}))}var w=function(){function t(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var e=t.prototype;return e.$beforeInit=function(){},e.$init=function(){},e.$afterInit=function(){},e.$redraw=function(){},e.$willDestroy=function(){var t=this;Object.keys(this).forEach((function(e){t[e]=null,delete t[e]}))},t}();w.version="3.3.3";var S=function(){return{colors:void 0,epochs:[],lines:[],scale_min:void 0,scale_max:void 0,scale_width:20,scale_format:void 0,padding_top:0,padding_right:0,padding_bottom:0,padding_left:0,regions:[]}},_="bb-colorscale",O="bb-stanford-elements",j="bb-stanford-line",C="bb-stanford-lines",E="bb-stanford-region",$="bb-stanford-regions";function k(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function M(t){for(var e,r=function(t){for(var e,r,n=0,a=0,o=t.length,i=o-1;a<o;i=a,a++)e=t[a],r=t[i],n+=e.x*r.y,n-=e.y*r.x;return n/2}(t),n=0,a=0,o=0,i=t.length,c=i-1;o<i;c=o,o++){var s=t[o],l=t[c];e=s.x*l.y-l.x*s.y,n+=(s.x+l.x)*e,a+=(s.y+l.y)*e}return{x:n/(e=6*r),y:a/e}}var L=function(){function t(t){this.owner=void 0,this.owner=t;var e=t.$$.$el.main.select(".bb-chart").append("g").attr("class",O);e.append("g").attr("class",C),e.append("g").attr("class",$)}var e=t.prototype;return e.updateStanfordLines=function(t){var e=this.owner.$$,r=e.config,n=e.$el.main,a=r.axis_rotated,o=this.xvCustom.bind(e),i=this.yvCustom.bind(e),c=n.select("."+C).style("shape-rendering","geometricprecision").selectAll("."+j).data(this.owner.config.lines);c.exit().transition().duration(t).style("opacity","0").remove();var s=c.enter().append("g");s.append("line").style("opacity","0"),s.merge(c).attr("class",(function(t){return j+(t.class?" "+t.class:"")})).select("line").transition().duration(t).attr("x1",(function(t){return a?i(t,"y1"):o(t,"x1")})).attr("x2",(function(t){return a?i(t,"y2"):o(t,"x2")})).attr("y1",(function(t){return a?o(t,"x1"):i(t,"y1")})).attr("y2",(function(t){return a?o(t,"x2"):i(t,"y2")})).transition().style("opacity",null)},e.updateStanfordRegions=function(t){var e=this.owner.$$,r=e.config,n=e.$el.main,a=r.axis_rotated,o=this.xvCustom.bind(e),i=this.yvCustom.bind(e),c=this.owner.countEpochsInRegion.bind(e),s=n.select("."+$).selectAll("."+E).data(this.owner.config.regions);s.exit().transition().duration(t).style("opacity","0").remove();var l=s.enter().append("g");l.append("polygon").style("opacity","0"),l.append("text").attr("transform",a?"rotate(-90)":"").style("opacity","0"),(s=l.merge(s)).attr("class",(function(t){return E+(t.class?" "+t.class:"")})).select("polygon").transition().duration(t).attr("points",(function(t){return t.points.map((function(t){return[a?i(t,"y"):o(t,"x"),a?o(t,"x"):i(t,"y")].join(",")})).join(" ")})).transition().style("opacity",(function(t){return(t.opacity?t.opacity:.2)+""})),s.select("text").transition().duration(t).attr("x",(function(t){return a?i(M(t.points),"y"):o(M(t.points),"x")})).attr("y",(function(t){return a?o(M(t.points),"x"):i(M(t.points),"y")})).text((function(t){if(t.text){var e=c(t.points),r=e.value,n=e.percentage;return t.text(r,n)}return""})).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)},e.updateStanfordElements=function(t){void 0===t&&(t=0),this.updateStanfordLines(t),this.updateStanfordRegions(t)},e.xvCustom=function(t,e){var r=this,n=r.axis,a=r.config,o=e?t[e]:r.getBaseValue(t);return n.isTimeSeries()?o=y.call(r,o):n.isCategorized()&&f(o)&&(o=a.axis_x_categories.indexOf(t.value)),Math.ceil(r.scale.x(o))},e.yvCustom=function(t,e){var r=this,n=t.axis&&"y2"===t.axis?r.scale.y2:r.scale.y,a=e?t[e]:r.getBaseValue(t);return Math.ceil(n(a))},t}(),P=l(8),D=l(9),q=function(){function t(t){this.owner=void 0,this.colorScale=void 0,this.owner=t}var e=t.prototype;return e.drawColorScale=function(){var t=this.owner,e=t.$$,r=t.config,n=e.data.targets[0],o=e.state.height-r.padding_bottom-r.padding_top,i=r.scale_width,c=function(t,e,r){void 0===r&&(r=1);for(var n=[],a=0|Math.max(0,Math.ceil((e-t)/r)),o=t;o<a;o++)n.push(t+o*r);return n}(r.padding_bottom,o,5),s=(0,a.scaleSequential)(n.colors).domain([c[c.length-1],c[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=e.$el.svg.append("g").attr("width",50).attr("height",o).attr("class",_),this.colorScale.append("g").attr("transform","translate(0, "+r.padding_top+")").selectAll("bars").data(c).enter().append("rect").attr("y",(function(t,e){return 5*e})).attr("x",0).attr("width",i).attr("height",5).attr("fill",(function(t){return s(t)}));var l=(0,a.scaleLog)().domain([n.minEpochs,n.maxEpochs]).range([c[0]+r.padding_top+c[c.length-1]+5-1,c[0]+r.padding_top]),u=(0,P.axisRight)(l),b=r.scale_format;"pow10"===b?u.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):h(b)?u.tickFormat(b):u.tickFormat((0,D.format)("d"));var d=this.colorScale.append("g").attr("class","legend axis").attr("transform","translate("+i+",0)").call(u);"pow10"===b&&d.selectAll(".tick text").text(null).filter((function(t){return t/Math.pow(10,Math.ceil(Math.log(t)/Math.LN10-1e-12))==1})).text(10).append("tspan").attr("dy","-.7em").text((function(t){return Math.round(Math.log(t)/Math.LN10)})),this.colorScale.attr("transform","translate("+(e.state.current.width-this.xForColorScale())+", 0)")},e.xForColorScale=function(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width},e.getColorScalePadding=function(){return this.xForColorScale()+this.owner.config.padding_left+20},t}(),T=function(o){var i,c;function l(e){var r=o.call(this,e)||this;return r.config=void 0,r.colorScale=void 0,r.elements=void 0,r.config=new S,t(r)||t(r)}c=o,(i=l).prototype=Object.create(c.prototype),i.prototype.constructor=i,e(i,c);var u=l.prototype;return u.$beforeInit=function(){var t=this,e=this.$$;e.config.data_xSort=!1,e.isMultipleX=function(){return!0},e.showGridFocus=function(){},e.labelishData=function(t){return t.values},e.opacityForCircle=function(){return 1};var r=e.getCurrentPaddingRight.bind(e);e.getCurrentPaddingRight=function(){return r()+(t.colorScale?t.colorScale.getColorScalePadding():0)}},u.$init=function(){var t=this.$$;m.call(this,this.options),t.color=this.getStanfordPointColor.bind(t),this.colorScale=new q(this),this.elements=new L(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),this.$redraw()},u.$redraw=function(t){var e,r;null==(e=this.colorScale)||e.drawColorScale(),null==(r=this.elements)||r.updateStanfordElements(t)},u.getOptions=function(){return new S},u.convertData=function(){var t=this.$$.data.targets,e=this.options.epochs;t.forEach((function(t){t.values.forEach((function(t,r){t.epochs=e[r]})),t.minEpochs=void 0,t.maxEpochs=void 0,t.colors=void 0,t.colorscale=void 0}))},u.xvCustom=function(t,e){var r=this,n=r.axis,a=r.config,o=e?t[e]:r.getBaseValue(t);return n.isTimeSeries()?o=y.call(r,o):n.isCategorized()&&f(o)&&(o=a.axis_x_categories.indexOf(t.value)),Math.ceil(r.scale.x(o))},u.yvCustom=function(t,e){var r=this.scale,n=t.axis&&"y2"===t.axis?r.y2:r.y,a=e?t[e]:this.getBaseValue(t);return Math.ceil(n(a))},u.initStanfordData=function(){var t=this.config,e=this.$$.data.targets[0];e.values.sort(k);var o=e.values.map((function(t){return t.epochs}));e.minEpochs=isNaN(t.scale_min)?Math.min.apply(Math,o):t.scale_min,e.maxEpochs=isNaN(t.scale_max)?Math.max.apply(Math,o):t.scale_max,e.colors=h(t.colors)?t.colors:(0,r.interpolateHslLong)((0,n.hsl)(250,1,.5),(0,n.hsl)(0,1,.5)),e.colorscale=(0,a.scaleSequentialLog)(e.colors).domain([e.minEpochs,e.maxEpochs])},u.getStanfordPointColor=function(t){return this.data.targets[0].colorscale(t.epochs)},u.setStanfordTooltip=function(){var t=this.$$.config;x(t.tooltip_contents)&&(t.tooltip_contents=function(e,r,n,a){var o='<table class="'+s.tooltip+'"><tbody>';return e.forEach((function(e){o+="<tr>\n\t\t\t\t\t\t\t<th>"+r(t.data_x)+'</th>\n\t\t\t\t\t\t\t<th class="value">'+n(e.x)+"</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>"+r(e.id)+'</th>\n\t\t\t\t\t\t\t<th class="value">'+n(e.value)+'</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class="'+s.tooltipName+"-"+e.id+'">\n\t\t\t\t\t\t\t<td class="name"><span style="background-color:'+a(e)+'"></span>'+r("Epochs")+'</td>\n\t\t\t\t\t\t\t<td class="value">'+n(e.epochs)+"</td>\n\t\t\t\t\t\t</tr>"})),o+"</tbody></table>"})},u.countEpochsInRegion=function(t){var e=this.data.targets[0],r=e.values.reduce((function(t,e){return t+ +e.epochs}),0),n=e.values.reduce((function(e,r){return function(t,e){for(var r=t.x,n=t.value,a=!1,o=0,i=e.length-1;o<e.length;i=o++){var c=e[o].x,s=e[o].y,l=e[i].x,u=e[i].y;s>n!=u>n&&r<(l-c)*(n-s)/(u-s)+c&&(a=!a)}return a}(r,t)?e+ +r.epochs:e}),0);return{value:n,percentage:0!==n?+(n/r*100).toFixed(1):0}},l}(w)}(),u=u.default}()}));