billboard.js 3.3.0 → 3.3.1

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 (72) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +424 -374
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +2284 -2200
  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 +137 -92
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +138 -93
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +3 -119
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +3 -119
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +1862 -1828
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +1998 -1919
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +2000 -1921
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +1866 -1948
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +1866 -1948
  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 +426 -383
  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 +15 -15
  35. package/src/Chart/api/focus.ts +8 -8
  36. package/src/Chart/api/regions.ts +3 -3
  37. package/src/Chart/api/selection.ts +15 -15
  38. package/src/Chart/api/subchart.ts +3 -3
  39. package/src/ChartInternal/Axis/Axis.ts +13 -12
  40. package/src/ChartInternal/ChartInternal.ts +5 -6
  41. package/src/ChartInternal/data/data.ts +3 -3
  42. package/src/ChartInternal/data/load.ts +2 -2
  43. package/src/ChartInternal/interactions/drag.ts +15 -15
  44. package/src/ChartInternal/interactions/eventrect.ts +18 -18
  45. package/src/ChartInternal/interactions/interaction.ts +10 -10
  46. package/src/ChartInternal/interactions/zoom.ts +4 -4
  47. package/src/ChartInternal/internals/color.ts +4 -4
  48. package/src/ChartInternal/internals/domain.ts +1 -1
  49. package/src/ChartInternal/internals/grid.ts +32 -32
  50. package/src/ChartInternal/internals/legend.ts +27 -27
  51. package/src/ChartInternal/internals/redraw.ts +3 -3
  52. package/src/ChartInternal/internals/region.ts +3 -3
  53. package/src/ChartInternal/internals/selection.ts +16 -15
  54. package/src/ChartInternal/internals/size.ts +3 -3
  55. package/src/ChartInternal/internals/text.ts +8 -8
  56. package/src/ChartInternal/internals/title.ts +4 -4
  57. package/src/ChartInternal/internals/tooltip.ts +5 -5
  58. package/src/ChartInternal/internals/transform.ts +5 -5
  59. package/src/ChartInternal/shape/arc.ts +22 -22
  60. package/src/ChartInternal/shape/area.ts +4 -4
  61. package/src/ChartInternal/shape/bar.ts +7 -7
  62. package/src/ChartInternal/shape/candlestick.ts +8 -8
  63. package/src/ChartInternal/shape/gauge.ts +8 -8
  64. package/src/ChartInternal/shape/line.ts +7 -7
  65. package/src/ChartInternal/shape/point.ts +18 -18
  66. package/src/ChartInternal/shape/radar.ts +10 -10
  67. package/src/ChartInternal/shape/shape.ts +4 -2
  68. package/src/Plugin/sparkline/index.ts +2 -2
  69. package/src/Plugin/stanford/index.ts +3 -3
  70. package/src/Plugin/stanford/util.ts +0 -1
  71. package/src/config/classes.ts +154 -66
  72. package/src/module/util.ts +1 -2
@@ -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.1
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
 
@@ -721,7 +766,7 @@ function deepClone() {
721
766
  return objectN.map(function (v) {
722
767
  return clone(v);
723
768
  }).reduce(function (a, c) {
724
- return _objectSpread(_objectSpread({}, a), c);
769
+ return util_objectSpread(util_objectSpread({}, a), c);
725
770
  });
726
771
  }
727
772
  /**
@@ -1247,7 +1292,7 @@ var Plugin = /*#__PURE__*/function () {
1247
1292
  return Plugin;
1248
1293
  }();
1249
1294
 
1250
- Plugin.version = "3.2.2";
1295
+ Plugin.version = "3.3.0";
1251
1296
 
1252
1297
  ;// CONCATENATED MODULE: ./src/Plugin/stanford/Options.ts
1253
1298
  /**
@@ -1986,9 +2031,9 @@ var Stanford = /*#__PURE__*/function (_Plugin) {
1986
2031
 
1987
2032
  if (isEmpty(config.tooltip_contents)) {
1988
2033
  config.tooltip_contents = function (d, defaultTitleFormat, defaultValueFormat, color) {
1989
- var html = "<table class=\"" + classes.tooltip + "\"><tbody>";
2034
+ var html = "<table class=\"" + $TOOLTIP.tooltip + "\"><tbody>";
1990
2035
  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>";
2036
+ 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
2037
  });
1993
2038
  return html + "</tbody></table>";
1994
2039
  };
@@ -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.1
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.0";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}()}));
@@ -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.1
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -212,7 +212,7 @@ var Plugin = /*#__PURE__*/function () {
212
212
  return Plugin;
213
213
  }();
214
214
 
215
- Plugin.version = "3.2.2";
215
+ Plugin.version = "3.3.0";
216
216
 
217
217
  ;// CONCATENATED MODULE: ./src/Plugin/tableview/Options.ts
218
218
  /**
@@ -380,121 +380,6 @@ win.cancelIdleCallback = win.cancelIdleCallback || function (id) {
380
380
  };
381
381
 
382
382
  var doc = win == null ? void 0 : win.document;
383
- ;// CONCATENATED MODULE: ./src/config/classes.ts
384
- /**
385
- * Copyright (c) 2017 ~ present NAVER Corp.
386
- * billboard.js project is licensed under the MIT license
387
- */
388
-
389
- /**
390
- * CSS class names definition
391
- * @private
392
- */
393
- /* harmony default export */ var classes = ({
394
- arc: "bb-arc",
395
- arcLabelLine: "bb-arc-label-line",
396
- arcs: "bb-arcs",
397
- area: "bb-area",
398
- areas: "bb-areas",
399
- axis: "bb-axis",
400
- axisX: "bb-axis-x",
401
- axisXLabel: "bb-axis-x-label",
402
- axisY: "bb-axis-y",
403
- axisY2: "bb-axis-y2",
404
- axisY2Label: "bb-axis-y2-label",
405
- axisYLabel: "bb-axis-y-label",
406
- bar: "bb-bar",
407
- bars: "bb-bars",
408
- brush: "bb-brush",
409
- button: "bb-button",
410
- buttonZoomReset: "bb-zoom-reset",
411
- candlestick: "bb-candlestick",
412
- candlesticks: "bb-candlesticks",
413
- chart: "bb-chart",
414
- chartArc: "bb-chart-arc",
415
- chartArcs: "bb-chart-arcs",
416
- chartArcsBackground: "bb-chart-arcs-background",
417
- chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
418
- chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
419
- chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
420
- chartArcsTitle: "bb-chart-arcs-title",
421
- chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
422
- chartBar: "bb-chart-bar",
423
- chartBars: "bb-chart-bars",
424
- chartCandlestick: "bb-chart-candlestick",
425
- chartCandlesticks: "bb-chart-candlesticks",
426
- chartCircles: "bb-chart-circles",
427
- chartLine: "bb-chart-line",
428
- chartLines: "bb-chart-lines",
429
- chartRadar: "bb-chart-radar",
430
- chartRadars: "bb-chart-radars",
431
- chartText: "bb-chart-text",
432
- chartTexts: "bb-chart-texts",
433
- circle: "bb-circle",
434
- circles: "bb-circles",
435
- colorPattern: "bb-color-pattern",
436
- colorScale: "bb-colorscale",
437
- defocused: "bb-defocused",
438
- dragarea: "bb-dragarea",
439
- empty: "bb-empty",
440
- eventRect: "bb-event-rect",
441
- eventRects: "bb-event-rects",
442
- eventRectsMultiple: "bb-event-rects-multiple",
443
- eventRectsSingle: "bb-event-rects-single",
444
- focused: "bb-focused",
445
- gaugeValue: "bb-gauge-value",
446
- grid: "bb-grid",
447
- gridLines: "bb-grid-lines",
448
- legend: "bb-legend",
449
- legendBackground: "bb-legend-background",
450
- legendItem: "bb-legend-item",
451
- legendItemEvent: "bb-legend-item-event",
452
- legendItemFocused: "bb-legend-item-focused",
453
- legendItemHidden: "bb-legend-item-hidden",
454
- legendItemPoint: "bb-legend-item-point",
455
- legendItemTile: "bb-legend-item-tile",
456
- level: "bb-level",
457
- levels: "bb-levels",
458
- line: "bb-line",
459
- lines: "bb-lines",
460
- main: "bb-main",
461
- region: "bb-region",
462
- regions: "bb-regions",
463
- selectedCircle: "bb-selected-circle",
464
- selectedCircles: "bb-selected-circles",
465
- shape: "bb-shape",
466
- shapes: "bb-shapes",
467
- stanfordElements: "bb-stanford-elements",
468
- stanfordLine: "bb-stanford-line",
469
- stanfordLines: "bb-stanford-lines",
470
- stanfordRegion: "bb-stanford-region",
471
- stanfordRegions: "bb-stanford-regions",
472
- subchart: "bb-subchart",
473
- target: "bb-target",
474
- text: "bb-text",
475
- texts: "bb-texts",
476
- title: "bb-title",
477
- tooltip: "bb-tooltip",
478
- tooltipContainer: "bb-tooltip-container",
479
- tooltipName: "bb-tooltip-name",
480
- valueDown: "bb-value-down",
481
- valueUp: "bb-value-up",
482
- xgrid: "bb-xgrid",
483
- xgridFocus: "bb-xgrid-focus",
484
- xgridLine: "bb-xgrid-line",
485
- xgridLines: "bb-xgrid-lines",
486
- xgrids: "bb-xgrids",
487
- ygrid: "bb-ygrid",
488
- ygridFocus: "bb-ygrid-focus",
489
- ygridLine: "bb-ygrid-line",
490
- ygridLines: "bb-ygrid-lines",
491
- ygrids: "bb-ygrids",
492
- zoomBrush: "bb-zoom-brush",
493
- EXPANDED: "_expanded_",
494
- SELECTED: "_selected_",
495
- INCLUDED: "_included_",
496
- TextOverlapping: "text-overlapping"
497
- });
498
383
  ;// CONCATENATED MODULE: ./src/module/util.ts
499
384
 
500
385
 
@@ -512,7 +397,6 @@ function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i
512
397
 
513
398
 
514
399
 
515
-
516
400
  var isValue = function (v) {
517
401
  return v || v === 0;
518
402
  },
@@ -783,7 +667,7 @@ function getBrushSelection(ctx) {
783
667
  // check from event
784
668
  if (event && event.type === "brush") {
785
669
  selection = event.selection; // check from brush area selection
786
- } else if (main && (selection = main.select("." + classes.brush).node())) {
670
+ } else if (main && (selection = main.select(".bb-brush").node())) {
787
671
  selection = (0,external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_.brushSelection)(selection);
788
672
  }
789
673
 
@@ -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.1
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-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-selection","d3-brush"],e):"object"==typeof exports?exports.bb=e(require("d3-selection"),require("d3-brush")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.tableview=e(t.d3,t.d3))}(this,(function(t,e){return function(){"use strict";var n=[,function(e){e.exports=t},,function(t){t.exports=e}],r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t](i,i.exports,o),i.exports}o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var i={};return function(){function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}o.d(i,{default:function(){return $}});var r=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}();r.version="3.2.2";var c=function(){return{selector:void 0,categoryTitle:"Category",categoryFormat:function(t){var e=t;return this.$$.axis.isCategorized()?e=this.$$.categoryName(t):this.$$.axis.isTimeSeries()&&(e=t.toLocaleDateString()),e},class:void 0,style:!0,title:void 0,updateOnToggle:!0}},l="__tableview-style__",a="bb-tableview",u=".bb-tableview {\n\t\tborder-collapse:collapse;\n\t\tborder-spacing:0;\n\t\tbackground:#fff;\n\t\tmin-width:100%;\n\t\tmargin-top:10px;\n\t\tfont-family:sans-serif;\n\t\tfont-size:.9em;\n\t}\n\t.bb-tableview tr:hover {\n\t\tbackground:#eef7ff;\n\t}\n\t.bb-tableview thead tr {\n\t\tbackground:#f8f8f8;\n\t}\n\t.bb-tableview caption,.bb-tableview td,.bb-tableview th {\n\t\ttext-align: center;\n\t\tborder:1px solid silver;\n\t\tpadding:.5em;\n\t}\n\t.bb-tableview caption {\n\t\tfont-size:1.1em;\n\t\tfont-weight:700;\n\t\tmargin-bottom: -1px;\n\t}",s="<caption>{=title}</caption>\n\t\t<thead><tr>{=thead}</tr></thead>\n\t\t<tbody>{=tbody}</tbody>",f='<th scope="col">{=title}</th>',b='<th scope="row">{=value}</th>',d="<td>{=value}</td>",p=(o(1),o(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")());p.requestIdleCallback=p.requestIdleCallback||function(t){return setTimeout(t,1)},p.cancelIdleCallback=p.cancelIdleCallback||function(t){return clearTimeout(t)};var h=null==p?void 0:p.document;var v=function(t){return"number"==typeof t},g=function(t){return void 0!==t},y=function(t){return"object"==typeof 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 r=h.createEvent("MouseEvent");r.initMouseEvent(e,n.bubbles,n.cancelable,p,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),t.dispatchEvent(r)}}}();function m(t,e){var n=t;for(var r in e)n=n.replace(new RegExp("{="+r+"}","g"),e[r]);return n}function O(t){var e,n,r,o=this.config,i=function(){var t=n.shift();return t&&e&&y(e)&&t in e?(e=e[t],i()):t?void 0:e};Object.keys(o).forEach((function(c){e=t,n=c.split("_"),r=i(),g(r)&&(o[c]=r)}))}function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var n,r=1;r<arguments.length;r++)n=null!=arguments[r]?arguments[r]:{},r%2?j(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}));return e}var $=function(t){var r,o;function i(n){var r=t.call(this,n)||this;return r.config=void 0,r.element=void 0,r.config=new c,e(r)||e(r)}o=t,(r=i).prototype=Object.create(o.prototype),r.prototype.constructor=r,n(r,o);var p=i.prototype;return p.$beforeInit=function(){O.call(this,this.options)},p.$init=function(){var t,e=this.config,n=e.class,r=e.selector,o=e.style,i=document.querySelector(r||"."+(n||a));if(!i){var c=this.$$.$el.chart.node();i=document.createElement("table"),c.parentNode.insertBefore(i,c.nextSibling)}if("TABLE"!==i.tagName){var s=document.createElement("table");i.appendChild(s),i=s}if(o&&!document.getElementById(l)){var f=document.createElement("style");f.id=l,f.innerHTML=u,(document.head||document.getElementsByTagName("head")[0]).appendChild(f)}(t=i.classList).add.apply(t,[o&&a,n].filter(Boolean)),this.element=i},p.generateTable=function(){var t=this,e=this.$$,n=this.config,r=this.element,o=e.filterTargetsToShow(e.data.targets),i=m(f,{title:o.length?this.config.categoryTitle:""}),c="",l=[];o.forEach((function(t){i+=m(f,{title:t.id}),t.values.forEach((function(t,e){l[e]||(l[e]=[t.x]),l[e].push(t.value)}))})),l.forEach((function(e){c+="<tr>"+e.map((function(e,r){return m(r?d:b,{value:0===r?n.categoryFormat.bind(t)(e):v(e)?e.toLocaleString():""})})).join("")+"</tr>"}));var a=m(s,w(w({},n),{},{title:n.title||e.config.title_text||"",thead:i,tbody:c})).replace(/<[^>]+><\/[^>]+>/g,"");r.innerHTML=a},p.$redraw=function(){var t=this.$$.state;t.resizing||!this.config.updateOnToggle&&t.toggling||this.generateTable()},p.$willDestroy=function(){if(this.element.parentNode.removeChild(this.element),1===this.$$.charts.length){var t,e=document.getElementById(l);null==e||null==(t=e.parentNode)||t.removeChild(e)}},i}(r)}(),i=i.default}()}));
12
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-selection","d3-brush"],e):"object"==typeof exports?exports.bb=e(require("d3-selection"),require("d3-brush")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.tableview=e(t.d3,t.d3))}(this,(function(t,e){return function(){"use strict";var n=[,function(e){e.exports=t},,function(t){t.exports=e}],r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t](i,i.exports,o),i.exports}o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var i={};return function(){function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}o.d(i,{default:function(){return $}});var r=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}();r.version="3.3.0";var c=function(){return{selector:void 0,categoryTitle:"Category",categoryFormat:function(t){var e=t;return this.$$.axis.isCategorized()?e=this.$$.categoryName(t):this.$$.axis.isTimeSeries()&&(e=t.toLocaleDateString()),e},class:void 0,style:!0,title:void 0,updateOnToggle:!0}},l="__tableview-style__",a="bb-tableview",u=".bb-tableview {\n\t\tborder-collapse:collapse;\n\t\tborder-spacing:0;\n\t\tbackground:#fff;\n\t\tmin-width:100%;\n\t\tmargin-top:10px;\n\t\tfont-family:sans-serif;\n\t\tfont-size:.9em;\n\t}\n\t.bb-tableview tr:hover {\n\t\tbackground:#eef7ff;\n\t}\n\t.bb-tableview thead tr {\n\t\tbackground:#f8f8f8;\n\t}\n\t.bb-tableview caption,.bb-tableview td,.bb-tableview th {\n\t\ttext-align: center;\n\t\tborder:1px solid silver;\n\t\tpadding:.5em;\n\t}\n\t.bb-tableview caption {\n\t\tfont-size:1.1em;\n\t\tfont-weight:700;\n\t\tmargin-bottom: -1px;\n\t}",s="<caption>{=title}</caption>\n\t\t<thead><tr>{=thead}</tr></thead>\n\t\t<tbody>{=tbody}</tbody>",f='<th scope="col">{=title}</th>',b='<th scope="row">{=value}</th>',d="<td>{=value}</td>",p=(o(1),o(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")());p.requestIdleCallback=p.requestIdleCallback||function(t){return setTimeout(t,1)},p.cancelIdleCallback=p.cancelIdleCallback||function(t){return clearTimeout(t)};var h=null==p?void 0:p.document;var v=function(t){return"number"==typeof t},g=function(t){return void 0!==t},y=function(t){return"object"==typeof 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 r=h.createEvent("MouseEvent");r.initMouseEvent(e,n.bubbles,n.cancelable,p,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),t.dispatchEvent(r)}}}();function m(t,e){var n=t;for(var r in e)n=n.replace(new RegExp("{="+r+"}","g"),e[r]);return n}function O(t){var e,n,r,o=this.config,i=function(){var t=n.shift();return t&&e&&y(e)&&t in e?(e=e[t],i()):t?void 0:e};Object.keys(o).forEach((function(c){e=t,n=c.split("_"),r=i(),g(r)&&(o[c]=r)}))}function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var n,r=1;r<arguments.length;r++)n=null!=arguments[r]?arguments[r]:{},r%2?j(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}));return e}var $=function(t){var r,o;function i(n){var r=t.call(this,n)||this;return r.config=void 0,r.element=void 0,r.config=new c,e(r)||e(r)}o=t,(r=i).prototype=Object.create(o.prototype),r.prototype.constructor=r,n(r,o);var p=i.prototype;return p.$beforeInit=function(){O.call(this,this.options)},p.$init=function(){var t,e=this.config,n=e.class,r=e.selector,o=e.style,i=document.querySelector(r||"."+(n||a));if(!i){var c=this.$$.$el.chart.node();i=document.createElement("table"),c.parentNode.insertBefore(i,c.nextSibling)}if("TABLE"!==i.tagName){var s=document.createElement("table");i.appendChild(s),i=s}if(o&&!document.getElementById(l)){var f=document.createElement("style");f.id=l,f.innerHTML=u,(document.head||document.getElementsByTagName("head")[0]).appendChild(f)}(t=i.classList).add.apply(t,[o&&a,n].filter(Boolean)),this.element=i},p.generateTable=function(){var t=this,e=this.$$,n=this.config,r=this.element,o=e.filterTargetsToShow(e.data.targets),i=m(f,{title:o.length?this.config.categoryTitle:""}),c="",l=[];o.forEach((function(t){i+=m(f,{title:t.id}),t.values.forEach((function(t,e){l[e]||(l[e]=[t.x]),l[e].push(t.value)}))})),l.forEach((function(e){c+="<tr>"+e.map((function(e,r){return m(r?d:b,{value:0===r?n.categoryFormat.bind(t)(e):v(e)?e.toLocaleString():""})})).join("")+"</tr>"}));var a=m(s,w(w({},n),{},{title:n.title||e.config.title_text||"",thead:i,tbody:c})).replace(/<[^>]+><\/[^>]+>/g,"");r.innerHTML=a},p.$redraw=function(){var t=this.$$.state;t.resizing||!this.config.updateOnToggle&&t.toggling||this.generateTable()},p.$willDestroy=function(){if(this.element.parentNode.removeChild(this.element),1===this.$$.charts.length){var t,e=document.getElementById(l);null==e||null==(t=e.parentNode)||t.removeChild(e)}},i}(r)}(),i=i.default}()}));