billboard.js 3.2.2 → 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 (100) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +818 -468
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +4765 -3104
  6. package/dist/billboard.pkgd.min.js +4 -4
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.d.ts +7 -0
  11. package/dist/plugin/billboardjs-plugin-sparkline.js +145 -99
  12. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-stanford.d.ts +7 -0
  14. package/dist/plugin/billboardjs-plugin-stanford.js +144 -98
  15. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-tableview.d.ts +7 -0
  17. package/dist/plugin/billboardjs-plugin-tableview.js +13 -128
  18. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  19. package/dist/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
  20. package/dist/plugin/billboardjs-plugin-textoverlap.js +11 -126
  21. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  22. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +3980 -2669
  23. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +4119 -2762
  24. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +4117 -2760
  25. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +3970 -2774
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +3969 -2773
  27. package/dist/theme/datalab.css +1 -1
  28. package/dist/theme/datalab.min.css +2 -2
  29. package/dist/theme/graph.css +1 -1
  30. package/dist/theme/graph.min.css +2 -2
  31. package/dist/theme/insight.css +1 -1
  32. package/dist/theme/insight.min.css +2 -2
  33. package/dist-esm/billboard.js +787 -464
  34. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
  35. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -4
  36. package/dist-esm/plugin/billboardjs-plugin-sparkline.d.ts +7 -0
  37. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +131 -79
  38. package/dist-esm/plugin/billboardjs-plugin-stanford.d.ts +7 -0
  39. package/dist-esm/plugin/billboardjs-plugin-stanford.js +135 -80
  40. package/dist-esm/plugin/billboardjs-plugin-tableview.d.ts +7 -0
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +4 -8
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
  43. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -7
  44. package/package.json +45 -44
  45. package/src/Chart/api/chart.ts +7 -1
  46. package/src/Chart/api/data.ts +3 -4
  47. package/src/Chart/api/focus.ts +8 -8
  48. package/src/Chart/api/regions.ts +3 -3
  49. package/src/Chart/api/selection.ts +15 -15
  50. package/src/Chart/api/subchart.ts +3 -3
  51. package/src/ChartInternal/Axis/Axis.ts +26 -19
  52. package/src/ChartInternal/ChartInternal.ts +18 -8
  53. package/src/ChartInternal/data/IData.ts +9 -0
  54. package/src/ChartInternal/data/convert.ts +1 -1
  55. package/src/ChartInternal/data/data.ts +29 -12
  56. package/src/ChartInternal/data/load.ts +2 -2
  57. package/src/ChartInternal/interactions/drag.ts +15 -15
  58. package/src/ChartInternal/interactions/eventrect.ts +18 -18
  59. package/src/ChartInternal/interactions/interaction.ts +46 -14
  60. package/src/ChartInternal/interactions/zoom.ts +4 -4
  61. package/src/ChartInternal/internals/color.ts +4 -4
  62. package/src/ChartInternal/internals/domain.ts +5 -3
  63. package/src/ChartInternal/internals/grid.ts +32 -32
  64. package/src/ChartInternal/internals/legend.ts +27 -27
  65. package/src/ChartInternal/internals/redraw.ts +3 -3
  66. package/src/ChartInternal/internals/region.ts +3 -3
  67. package/src/ChartInternal/internals/scale.ts +3 -2
  68. package/src/ChartInternal/internals/selection.ts +16 -15
  69. package/src/ChartInternal/internals/size.ts +35 -4
  70. package/src/ChartInternal/internals/text.ts +10 -10
  71. package/src/ChartInternal/internals/title.ts +4 -4
  72. package/src/ChartInternal/internals/tooltip.ts +9 -6
  73. package/src/ChartInternal/internals/transform.ts +5 -5
  74. package/src/ChartInternal/shape/arc.ts +24 -22
  75. package/src/ChartInternal/shape/area.ts +4 -4
  76. package/src/ChartInternal/shape/bar.ts +87 -40
  77. package/src/ChartInternal/shape/candlestick.ts +8 -8
  78. package/src/ChartInternal/shape/gauge.ts +8 -8
  79. package/src/ChartInternal/shape/line.ts +7 -7
  80. package/src/ChartInternal/shape/point.ts +18 -18
  81. package/src/ChartInternal/shape/radar.ts +12 -10
  82. package/src/ChartInternal/shape/shape.ts +76 -13
  83. package/src/Plugin/sparkline/index.ts +4 -4
  84. package/src/Plugin/stanford/index.ts +3 -3
  85. package/src/Plugin/stanford/util.ts +0 -1
  86. package/src/Plugin/tableview/index.ts +1 -1
  87. package/src/config/Options/axis/x.ts +27 -7
  88. package/src/config/Options/axis/y.ts +24 -3
  89. package/src/config/Options/axis/y2.ts +24 -3
  90. package/src/config/Options/common/main.ts +11 -1
  91. package/src/config/Options/data/data.ts +22 -0
  92. package/src/config/Options/shape/bar.ts +9 -2
  93. package/src/config/classes.ts +154 -66
  94. package/src/module/util.ts +17 -17
  95. package/types/axis.d.ts +22 -8
  96. package/types/chart.d.ts +1 -1
  97. package/types/options.d.ts +40 -33
  98. package/types/plugin/tableview/index.d.ts +3 -3
  99. package/types/plugin/tableview/options.d.ts +1 -1
  100. package/types/types.d.ts +4 -4
package/dist/billboard.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.2.2
8
+ * @version 3.3.1
9
9
  */
10
10
  (function webpackUniversalModuleDefinition(root, factory) {
11
11
  if(typeof exports === 'object' && typeof module === 'object')
@@ -314,127 +314,12 @@ function _defineProperty(obj, key, value) {
314
314
  }
315
315
  // EXTERNAL MODULE: external {"commonjs":"d3-brush","commonjs2":"d3-brush","amd":"d3-brush","root":"d3"}
316
316
  var external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_ = __webpack_require__(3);
317
- ;// CONCATENATED MODULE: ./src/config/classes.ts
318
- /**
319
- * Copyright (c) 2017 ~ present NAVER Corp.
320
- * billboard.js project is licensed under the MIT license
321
- */
322
-
323
- /**
324
- * CSS class names definition
325
- * @private
326
- */
327
- /* harmony default export */ var config_classes = ({
328
- arc: "bb-arc",
329
- arcLabelLine: "bb-arc-label-line",
330
- arcs: "bb-arcs",
331
- area: "bb-area",
332
- areas: "bb-areas",
333
- axis: "bb-axis",
334
- axisX: "bb-axis-x",
335
- axisXLabel: "bb-axis-x-label",
336
- axisY: "bb-axis-y",
337
- axisY2: "bb-axis-y2",
338
- axisY2Label: "bb-axis-y2-label",
339
- axisYLabel: "bb-axis-y-label",
340
- bar: "bb-bar",
341
- bars: "bb-bars",
342
- brush: "bb-brush",
343
- button: "bb-button",
344
- buttonZoomReset: "bb-zoom-reset",
345
- candlestick: "bb-candlestick",
346
- candlesticks: "bb-candlesticks",
347
- chart: "bb-chart",
348
- chartArc: "bb-chart-arc",
349
- chartArcs: "bb-chart-arcs",
350
- chartArcsBackground: "bb-chart-arcs-background",
351
- chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
352
- chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
353
- chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
354
- chartArcsTitle: "bb-chart-arcs-title",
355
- chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
356
- chartBar: "bb-chart-bar",
357
- chartBars: "bb-chart-bars",
358
- chartCandlestick: "bb-chart-candlestick",
359
- chartCandlesticks: "bb-chart-candlesticks",
360
- chartCircles: "bb-chart-circles",
361
- chartLine: "bb-chart-line",
362
- chartLines: "bb-chart-lines",
363
- chartRadar: "bb-chart-radar",
364
- chartRadars: "bb-chart-radars",
365
- chartText: "bb-chart-text",
366
- chartTexts: "bb-chart-texts",
367
- circle: "bb-circle",
368
- circles: "bb-circles",
369
- colorPattern: "bb-color-pattern",
370
- colorScale: "bb-colorscale",
371
- defocused: "bb-defocused",
372
- dragarea: "bb-dragarea",
373
- empty: "bb-empty",
374
- eventRect: "bb-event-rect",
375
- eventRects: "bb-event-rects",
376
- eventRectsMultiple: "bb-event-rects-multiple",
377
- eventRectsSingle: "bb-event-rects-single",
378
- focused: "bb-focused",
379
- gaugeValue: "bb-gauge-value",
380
- grid: "bb-grid",
381
- gridLines: "bb-grid-lines",
382
- legend: "bb-legend",
383
- legendBackground: "bb-legend-background",
384
- legendItem: "bb-legend-item",
385
- legendItemEvent: "bb-legend-item-event",
386
- legendItemFocused: "bb-legend-item-focused",
387
- legendItemHidden: "bb-legend-item-hidden",
388
- legendItemPoint: "bb-legend-item-point",
389
- legendItemTile: "bb-legend-item-tile",
390
- level: "bb-level",
391
- levels: "bb-levels",
392
- line: "bb-line",
393
- lines: "bb-lines",
394
- main: "bb-main",
395
- region: "bb-region",
396
- regions: "bb-regions",
397
- selectedCircle: "bb-selected-circle",
398
- selectedCircles: "bb-selected-circles",
399
- shape: "bb-shape",
400
- shapes: "bb-shapes",
401
- stanfordElements: "bb-stanford-elements",
402
- stanfordLine: "bb-stanford-line",
403
- stanfordLines: "bb-stanford-lines",
404
- stanfordRegion: "bb-stanford-region",
405
- stanfordRegions: "bb-stanford-regions",
406
- subchart: "bb-subchart",
407
- target: "bb-target",
408
- text: "bb-text",
409
- texts: "bb-texts",
410
- title: "bb-title",
411
- tooltip: "bb-tooltip",
412
- tooltipContainer: "bb-tooltip-container",
413
- tooltipName: "bb-tooltip-name",
414
- valueDown: "bb-value-down",
415
- valueUp: "bb-value-up",
416
- xgrid: "bb-xgrid",
417
- xgridFocus: "bb-xgrid-focus",
418
- xgridLine: "bb-xgrid-line",
419
- xgridLines: "bb-xgrid-lines",
420
- xgrids: "bb-xgrids",
421
- ygrid: "bb-ygrid",
422
- ygridFocus: "bb-ygrid-focus",
423
- ygridLine: "bb-ygrid-line",
424
- ygridLines: "bb-ygrid-lines",
425
- ygrids: "bb-ygrids",
426
- zoomBrush: "bb-zoom-brush",
427
- EXPANDED: "_expanded_",
428
- SELECTED: "_selected_",
429
- INCLUDED: "_included_",
430
- TextOverlapping: "text-overlapping"
431
- });
432
317
  ;// CONCATENATED MODULE: ./src/module/util.ts
433
318
 
434
319
 
435
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
320
+ 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; }
436
321
 
437
- function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
322
+ 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; }
438
323
 
439
324
  /**
440
325
  * Copyright (c) 2017 ~ present NAVER Corp.
@@ -446,7 +331,6 @@ function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i
446
331
 
447
332
 
448
333
 
449
-
450
334
  var isValue = function (v) {
451
335
  return v || v === 0;
452
336
  },
@@ -524,18 +408,19 @@ function hasValue(dict, value) {
524
408
  /**
525
409
  * Call function with arguments
526
410
  * @param {Function} fn Function to be called
527
- * @param {*} args Arguments
411
+ * @param {*} thisArg "this" value for fn
412
+ * @param {*} args Arguments for fn
528
413
  * @returns {boolean} true: fn is function, false: fn is not function
529
414
  * @private
530
415
  */
531
416
 
532
417
 
533
- function callFn(fn) {
534
- for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
535
- args[_key - 1] = arguments[_key];
418
+ function callFn(fn, thisArg) {
419
+ for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
420
+ args[_key - 2] = arguments[_key];
536
421
  }
537
422
 
538
- isFn && fn.call.apply(fn, args);
423
+ isFn && fn.call.apply(fn, [thisArg].concat(args));
539
424
  return isFn;
540
425
  }
541
426
  /**
@@ -716,7 +601,7 @@ function getBrushSelection(ctx) {
716
601
  // check from event
717
602
  if (event && event.type === "brush") {
718
603
  selection = event.selection; // check from brush area selection
719
- } else if (main && (selection = main.select("." + config_classes.brush).node())) {
604
+ } else if (main && (selection = main.select(".bb-brush").node())) {
720
605
  selection = (0,external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_.brushSelection)(selection);
721
606
  }
722
607
 
@@ -1294,6 +1179,167 @@ function logError(head, tail) {
1294
1179
 
1295
1180
  throw Error(prefix + " " + head.replace(/\%c([a-z-]+)/i, "'$1' ") + " " + tail);
1296
1181
  }
1182
+ ;// CONCATENATED MODULE: ./src/config/classes.ts
1183
+
1184
+
1185
+ function classes_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; }
1186
+
1187
+ function classes_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? classes_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : classes_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1188
+
1189
+ /**
1190
+ * Copyright (c) 2017 ~ present NAVER Corp.
1191
+ * billboard.js project is licensed under the MIT license
1192
+ */
1193
+
1194
+ /**
1195
+ * CSS class names definition
1196
+ * @private
1197
+ */
1198
+ var $COMMON = {
1199
+ button: "bb-button",
1200
+ chart: "bb-chart",
1201
+ empty: "bb-empty",
1202
+ main: "bb-main",
1203
+ target: "bb-target",
1204
+ EXPANDED: "_expanded_"
1205
+ };
1206
+ var $ARC = {
1207
+ arc: "bb-arc",
1208
+ arcLabelLine: "bb-arc-label-line",
1209
+ arcs: "bb-arcs",
1210
+ chartArc: "bb-chart-arc",
1211
+ chartArcs: "bb-chart-arcs",
1212
+ chartArcsBackground: "bb-chart-arcs-background",
1213
+ chartArcsTitle: "bb-chart-arcs-title"
1214
+ };
1215
+ var $AREA = {
1216
+ area: "bb-area",
1217
+ areas: "bb-areas"
1218
+ };
1219
+ var $AXIS = {
1220
+ axis: "bb-axis",
1221
+ axisX: "bb-axis-x",
1222
+ axisXLabel: "bb-axis-x-label",
1223
+ axisY: "bb-axis-y",
1224
+ axisY2: "bb-axis-y2",
1225
+ axisY2Label: "bb-axis-y2-label",
1226
+ axisYLabel: "bb-axis-y-label"
1227
+ };
1228
+ var $BAR = {
1229
+ bar: "bb-bar",
1230
+ bars: "bb-bars",
1231
+ chartBar: "bb-chart-bar",
1232
+ chartBars: "bb-chart-bars"
1233
+ };
1234
+ var $CANDLESTICK = {
1235
+ candlestick: "bb-candlestick",
1236
+ candlesticks: "bb-candlesticks",
1237
+ chartCandlestick: "bb-chart-candlestick",
1238
+ chartCandlesticks: "bb-chart-candlesticks",
1239
+ valueDown: "bb-value-down",
1240
+ valueUp: "bb-value-up"
1241
+ };
1242
+ var $CIRCLE = {
1243
+ chartCircles: "bb-chart-circles",
1244
+ circle: "bb-circle",
1245
+ circles: "bb-circles"
1246
+ };
1247
+ var $COLOR = {
1248
+ colorPattern: "bb-color-pattern",
1249
+ colorScale: "bb-colorscale"
1250
+ };
1251
+ var $DRAG = {
1252
+ dragarea: "bb-dragarea",
1253
+ INCLUDED: "_included_"
1254
+ };
1255
+ var $GAUGE = {
1256
+ chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
1257
+ chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
1258
+ chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
1259
+ chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
1260
+ gaugeValue: "bb-gauge-value"
1261
+ };
1262
+ var $LEGEND = {
1263
+ legend: "bb-legend",
1264
+ legendBackground: "bb-legend-background",
1265
+ legendItem: "bb-legend-item",
1266
+ legendItemEvent: "bb-legend-item-event",
1267
+ legendItemHidden: "bb-legend-item-hidden",
1268
+ legendItemPoint: "bb-legend-item-point",
1269
+ legendItemTile: "bb-legend-item-tile"
1270
+ };
1271
+ var $LINE = {
1272
+ chartLine: "bb-chart-line",
1273
+ chartLines: "bb-chart-lines",
1274
+ line: "bb-line",
1275
+ lines: "bb-lines"
1276
+ };
1277
+ var $EVENT = {
1278
+ eventRect: "bb-event-rect",
1279
+ eventRects: "bb-event-rects",
1280
+ eventRectsMultiple: "bb-event-rects-multiple",
1281
+ eventRectsSingle: "bb-event-rects-single"
1282
+ };
1283
+ var $FOCUS = {
1284
+ focused: "bb-focused",
1285
+ defocused: "bb-defocused",
1286
+ legendItemFocused: "bb-legend-item-focused",
1287
+ xgridFocus: "bb-xgrid-focus",
1288
+ ygridFocus: "bb-ygrid-focus"
1289
+ };
1290
+ var $GRID = {
1291
+ grid: "bb-grid",
1292
+ gridLines: "bb-grid-lines",
1293
+ xgrid: "bb-xgrid",
1294
+ xgridLine: "bb-xgrid-line",
1295
+ xgridLines: "bb-xgrid-lines",
1296
+ xgrids: "bb-xgrids",
1297
+ ygrid: "bb-ygrid",
1298
+ ygridLine: "bb-ygrid-line",
1299
+ ygridLines: "bb-ygrid-lines",
1300
+ ygrids: "bb-ygrids"
1301
+ };
1302
+ var $RADAR = {
1303
+ chartRadar: "bb-chart-radar",
1304
+ chartRadars: "bb-chart-radars",
1305
+ level: "bb-level",
1306
+ levels: "bb-levels"
1307
+ };
1308
+ var $REGION = {
1309
+ region: "bb-region",
1310
+ regions: "bb-regions"
1311
+ };
1312
+ var $SELECT = {
1313
+ selectedCircle: "bb-selected-circle",
1314
+ selectedCircles: "bb-selected-circles",
1315
+ SELECTED: "_selected_"
1316
+ };
1317
+ var $SHAPE = {
1318
+ shape: "bb-shape",
1319
+ shapes: "bb-shapes"
1320
+ };
1321
+ var $SUBCHART = {
1322
+ brush: "bb-brush",
1323
+ subchart: "bb-subchart"
1324
+ };
1325
+ var $TEXT = {
1326
+ chartText: "bb-chart-text",
1327
+ chartTexts: "bb-chart-texts",
1328
+ text: "bb-text",
1329
+ texts: "bb-texts",
1330
+ title: "bb-title",
1331
+ TextOverlapping: "text-overlapping"
1332
+ };
1333
+ var $TOOLTIP = {
1334
+ tooltip: "bb-tooltip",
1335
+ tooltipContainer: "bb-tooltip-container",
1336
+ tooltipName: "bb-tooltip-name"
1337
+ };
1338
+ var $ZOOM = {
1339
+ buttonZoomReset: "bb-zoom-reset",
1340
+ zoomBrush: "bb-zoom-brush"
1341
+ };
1342
+ /* harmony default export */ var classes = (classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread(classes_objectSpread({}, $COMMON), $ARC), $AREA), $AXIS), $BAR), $CANDLESTICK), $CIRCLE), $COLOR), $DRAG), $GAUGE), $LEGEND), $LINE), $EVENT), $FOCUS), $GRID), $RADAR), $REGION), $SELECT), $SHAPE), $SUBCHART), $TEXT), $TOOLTIP), $ZOOM));
1297
1343
  ;// CONCATENATED MODULE: ./src/config/Store/Element.ts
1298
1344
  /**
1299
1345
  * Copyright (c) 2017 ~ present NAVER Corp.
@@ -1542,7 +1588,7 @@ var State = function () {
1542
1588
 
1543
1589
  // mapping
1544
1590
 
1545
- var classes = {
1591
+ var Store_classes = {
1546
1592
  element: Element,
1547
1593
  state: State
1548
1594
  };
@@ -1557,8 +1603,8 @@ var Store = /*#__PURE__*/function () {
1557
1603
  function Store() {
1558
1604
  var _this = this;
1559
1605
 
1560
- Object.keys(classes).forEach(function (v) {
1561
- _this[v] = new classes[v]();
1606
+ Object.keys(Store_classes).forEach(function (v) {
1607
+ _this[v] = new Store_classes[v]();
1562
1608
  });
1563
1609
  }
1564
1610
 
@@ -1685,12 +1731,21 @@ var Store = /*#__PURE__*/function () {
1685
1731
  * @name padding
1686
1732
  * @memberof Options
1687
1733
  * @type {object}
1688
- * @property {object} [padding] padding object
1734
+ * @property {object|boolean} [padding=true] Set padding of chart, and accepts object or boolean type.
1735
+ * - `Object`: Specify each side's padding.
1736
+ * - `false`: Remove padding completely and make shape to fully occupy the container element.
1737
+ * - In this case, axes and subchart will be hidden.
1738
+ * - To adjust some padding from this state, use `axis.[x|y].padding` option.
1689
1739
  * @property {number} [padding.top] padding on the top of chart
1690
1740
  * @property {number} [padding.right] padding on the right of chart
1691
1741
  * @property {number} [padding.bottom] padding on the bottom of chart
1692
1742
  * @property {number} [padding.left] padding on the left of chart
1743
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#ChartOptions.Padding)
1693
1744
  * @example
1745
+ * // remove padding completely.
1746
+ * padding: false,
1747
+ *
1748
+ * // or specify padding value for each side
1694
1749
  * padding: {
1695
1750
  * top: 20,
1696
1751
  * right: 20,
@@ -1698,6 +1753,7 @@ var Store = /*#__PURE__*/function () {
1698
1753
  * left: 20
1699
1754
  * }
1700
1755
  */
1756
+ padding: !0,
1701
1757
  padding_left: undefined,
1702
1758
  padding_right: undefined,
1703
1759
  padding_top: undefined,
@@ -2556,6 +2612,18 @@ var Store = /*#__PURE__*/function () {
2556
2612
  * ]
2557
2613
  * }
2558
2614
  *
2615
+ * // for 'bar' type, data can contain:
2616
+ * // - an array of [start, end] data following the order
2617
+ * data: {
2618
+ * rows: [
2619
+ * ["data1", "data2"],
2620
+ * [[100, 150], 120],
2621
+ * [[200, 300], 55],
2622
+ * [[-400, 500], 60]
2623
+ * ],
2624
+ * type: "bar"
2625
+ * }
2626
+ *
2559
2627
  * // for 'range' types('area-line-range' or 'area-spline-range'), data should contain:
2560
2628
  * // - an array of [high, mid, low] data following the order
2561
2629
  * // - or an object with 'high', 'mid' and 'low' key value
@@ -2632,6 +2700,16 @@ var Store = /*#__PURE__*/function () {
2632
2700
  * ]
2633
2701
  * }
2634
2702
  *
2703
+ * // for 'bar' type, data can contain:
2704
+ * // - an array of [start, end] data following the order
2705
+ * data: {
2706
+ * columns: [
2707
+ * ["data1", -100, 50, [100, 200], [200, 300]],
2708
+ * ["data2", -200, 300, [-100, 100], [-50, -30]],
2709
+ * ],
2710
+ * type: "bar"
2711
+ * }
2712
+ *
2635
2713
  * // for 'range' types('area-line-range' or 'area-spline-range'), data should contain:
2636
2714
  * // - an array of [high, mid, low] data following the order
2637
2715
  * // - or an object with 'high', 'mid' and 'low' key value
@@ -3248,9 +3326,9 @@ var Store = /*#__PURE__*/function () {
3248
3326
  ;// CONCATENATED MODULE: ./src/config/Options/Options.ts
3249
3327
 
3250
3328
 
3251
- function Options_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
3329
+ function Options_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; }
3252
3330
 
3253
- function Options_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { Options_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { Options_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
3331
+ function Options_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Options_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Options_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3254
3332
 
3255
3333
  /**
3256
3334
  * Copyright (c) 2017 ~ present NAVER Corp.
@@ -3991,7 +4069,7 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
3991
4069
 
3992
4070
  if (filterNull) {
3993
4071
  value = value.filter(function (v) {
3994
- return isValue(v.value);
4072
+ return v && "value" in v && isValue(v.value);
3995
4073
  });
3996
4074
  }
3997
4075
 
@@ -4425,6 +4503,7 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
4425
4503
 
4426
4504
  /**
4427
4505
  * Sort targets data
4506
+ * Note: For stacked bar, will sort from the total sum of data series, not for each stacked bar
4428
4507
  * @param {Array} targetsValue Target value
4429
4508
  * @returns {Array}
4430
4509
  * @private
@@ -4461,8 +4540,8 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
4461
4540
  };
4462
4541
 
4463
4542
  fn = function (t1, t2) {
4464
- var t1Sum = t1.values.reduce(reducer, 0),
4465
- t2Sum = t2.values.reduce(reducer, 0);
4543
+ var t1Sum = "values" in t1 ? t1.values.reduce(reducer, 0) : t1.value,
4544
+ t2Sum = "values" in t2 ? t2.values.reduce(reducer, 0) : t2.value;
4466
4545
  return isArc ? orderAsc ? t1Sum - t2Sum : t2Sum - t1Sum : orderAsc ? t2Sum - t1Sum : t1Sum - t2Sum;
4467
4546
  };
4468
4547
  } else if (isFunction(order)) {
@@ -4576,19 +4655,20 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
4576
4655
  }),
4577
4656
  minDist = config.point_sensitivity,
4578
4657
  closest;
4579
- // find mouseovering bar
4658
+ // find mouseovering bar/candlestick
4659
+ // https://github.com/naver/billboard.js/issues/2434
4580
4660
  data.filter(function (v) {
4581
- return $$.isBarType(v.id);
4661
+ return $$.isBarType(v.id) || $$.isCandlestickType(v.id);
4582
4662
  }).forEach(function (v) {
4583
- var shape = main.select("." + config_classes.bars + $$.getTargetSelectorSuffix(v.id) + " ." + config_classes.bar + "-" + v.index).node();
4663
+ var selector = $$.isBarType(v.id) ? "." + $BAR.chartBar + "." + $COMMON.target + $$.getTargetSelectorSuffix(v.id) + " ." + $BAR.bar + "-" + v.index : "." + $CANDLESTICK.chartCandlestick + "." + $COMMON.target + $$.getTargetSelectorSuffix(v.id) + " ." + $CANDLESTICK.candlestick + "-" + v.index + " path";
4584
4664
 
4585
- if (!closest && $$.isWithinBar(shape)) {
4665
+ if (!closest && $$.isWithinBar(main.select(selector).node())) {
4586
4666
  closest = v;
4587
4667
  }
4588
- }); // find closest point from non-bar
4668
+ }); // find closest point from non-bar/candlestick
4589
4669
 
4590
4670
  data.filter(function (v) {
4591
- return !$$.isBarType(v.id);
4671
+ return !$$.isBarType(v.id) && !$$.isCandlestickType(v.id);
4592
4672
  }).forEach(function (v) {
4593
4673
  var d = $$.dist(v, pos);
4594
4674
 
@@ -4821,6 +4901,20 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
4821
4901
  return $$.isBubbleType(d) && (isObject(d.value) && ("z" in d.value || "y" in d.value) || isArray(d.value) && d.value.length === 2);
4822
4902
  },
4823
4903
 
4904
+ /**
4905
+ * Determine if bar has ranged data
4906
+ * @param {Array} d data value
4907
+ * @returns {boolean}
4908
+ * @private
4909
+ */
4910
+ isBarRangeType: function isBarRangeType(d) {
4911
+ var $$ = this,
4912
+ value = d.value;
4913
+ return $$.isBarType(d) && isArray(value) && value.length === 2 && value.every(function (v) {
4914
+ return isNumber(v);
4915
+ });
4916
+ },
4917
+
4824
4918
  /**
4825
4919
  * Get data object by id
4826
4920
  * @param {string} id data id
@@ -4937,7 +5031,7 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
4937
5031
  state.withoutFadeIn[id] = !1; // Remove target's elements
4938
5032
 
4939
5033
  if ($el.legend) {
4940
- $el.legend.selectAll("." + config_classes.legendItem + $$.getTargetSelectorSuffix(id)).remove();
5034
+ $el.legend.selectAll("." + $LEGEND.legendItem + $$.getTargetSelectorSuffix(id)).remove();
4941
5035
  } // Remove target
4942
5036
 
4943
5037
 
@@ -4981,8 +5075,8 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
4981
5075
  }
4982
5076
  }
4983
5077
 
4984
- main.selectAll("." + config_classes.shape + "-" + index).each(function () {
4985
- (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed(config_classes.EXPANDED, !0);
5078
+ main.selectAll("." + $SHAPE.shape + "-" + index).each(function () {
5079
+ (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed($COMMON.EXPANDED, !0);
4986
5080
 
4987
5081
  if (isSelectionEnabled) {
4988
5082
  eventRect.style("cursor", isSelectionGrouped ? "pointer" : null);
@@ -5047,8 +5141,8 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5047
5141
  ["bar", "candlestick"].filter(function (v) {
5048
5142
  return $$.$el[v];
5049
5143
  }).forEach(function (v) {
5050
- reset && $$.$el[v].classed(config_classes.EXPANDED, !1);
5051
- $$.getShapeByIndex(v, i, id).classed(config_classes.EXPANDED, expand);
5144
+ reset && $$.$el[v].classed($COMMON.EXPANDED, !1);
5145
+ $$.getShapeByIndex(v, i, id).classed($COMMON.EXPANDED, expand);
5052
5146
  });
5053
5147
  },
5054
5148
 
@@ -5071,10 +5165,10 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5071
5165
  config.color_onover && $$.setOverColor(isOver, d, isArc);
5072
5166
 
5073
5167
  if (isArc) {
5074
- callback(d, main.select("." + config_classes.arc + $$.getTargetSelectorSuffix(d.id)).node());
5168
+ callback(d, main.select("." + $ARC.arc + $$.getTargetSelectorSuffix(d.id)).node());
5075
5169
  } else if (!config.tooltip_grouped) {
5076
5170
  var last = $$.cache.get(KEY.setOverOut) || [],
5077
- shape = main.selectAll("." + config_classes.shape + "-" + d).filter(function (d) {
5171
+ shape = main.selectAll("." + $SHAPE.shape + "-" + d).filter(function (d) {
5078
5172
  return $$.isWithinShape(this, d);
5079
5173
  });
5080
5174
  shape.each(function (d) {
@@ -5102,7 +5196,7 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5102
5196
  config.point_focus_only && hasRadar ? $$.showCircleFocus($$.getAllValuesOnIndex(d, !0)) : $$.setExpand(d, null, !0);
5103
5197
  }
5104
5198
 
5105
- $$.isMultipleX() || main.selectAll("." + config_classes.shape + "-" + d).each(function (d) {
5199
+ $$.isMultipleX() || main.selectAll("." + $SHAPE.shape + "-" + d).each(function (d) {
5106
5200
  callback(d, this);
5107
5201
  });
5108
5202
  }
@@ -5165,7 +5259,7 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5165
5259
  arcs = _$$$$el.arcs,
5166
5260
  radar = _$$$$el.radar,
5167
5261
  isMultipleX = $$.isMultipleX(),
5168
- element = (hasRadar ? radar.axes.select("." + config_classes.axis + "-" + index + " text") : eventRect || arcs.selectAll("." + config_classes.target + " path").filter(function (d, i) {
5262
+ element = (hasRadar ? radar.axes.select("." + $AXIS.axis + "-" + index + " text") : eventRect || arcs.selectAll("." + $COMMON.target + " path").filter(function (d, i) {
5169
5263
  return i === index;
5170
5264
  })).node(),
5171
5265
  _element$getBoundingC = element.getBoundingClientRect(),
@@ -5198,14 +5292,40 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5198
5292
  * @private
5199
5293
  */
5200
5294
  unbindZoomEvent: function unbindZoomEvent() {
5201
- var _zoomResetBtn,
5295
+ var _eventRect,
5296
+ _zoomResetBtn,
5202
5297
  $$ = this,
5203
5298
  _$$$$el2 = $$.$el,
5204
5299
  eventRect = _$$$$el2.eventRect,
5205
5300
  zoomResetBtn = _$$$$el2.zoomResetBtn;
5206
5301
 
5207
- eventRect.on(".zoom", null).on(".drag", null);
5208
- (_zoomResetBtn = zoomResetBtn) == null ? void 0 : _zoomResetBtn.style("display", "none");
5302
+ (_eventRect = eventRect) == null ? void 0 : _eventRect.on(".zoom wheel.zoom .drag", null);
5303
+ (_zoomResetBtn = zoomResetBtn) == null ? void 0 : _zoomResetBtn.on("click", null).style("display", "none");
5304
+ },
5305
+
5306
+ /**
5307
+ * Unbind all attached events
5308
+ * @private
5309
+ */
5310
+ unbindAllEvents: function unbindAllEvents() {
5311
+ var _region,
5312
+ _brush,
5313
+ _arcs,
5314
+ _legend,
5315
+ $$ = this,
5316
+ _$$$$el3 = $$.$el,
5317
+ arcs = _$$$$el3.arcs,
5318
+ eventRect = _$$$$el3.eventRect,
5319
+ legend = _$$$$el3.legend,
5320
+ region = _$$$$el3.region,
5321
+ svg = _$$$$el3.svg,
5322
+ brush = $$.brush;
5323
+
5324
+ // detach all possible event types
5325
+ [svg, eventRect, (_region = region) == null ? void 0 : _region.list, (_brush = brush) == null ? void 0 : _brush.getSelection(), (_arcs = arcs) == null ? void 0 : _arcs.selectAll("path"), (_legend = legend) == null ? void 0 : _legend.selectAll("g")].forEach(function (v) {
5326
+ return v == null ? void 0 : v.on("wheel click mouseover mousemove mouseout touchstart touchmove touchend touchstart.eventRect touchmove.eventRect touchend.eventRect .brush .drag .zoom wheel.zoom dblclick.zoom", null);
5327
+ });
5328
+ $$.unbindZoomEvent == null ? void 0 : $$.unbindZoomEvent();
5209
5329
  }
5210
5330
  });
5211
5331
  ;// CONCATENATED MODULE: ./src/ChartInternal/internals/class.ts
@@ -5234,7 +5354,7 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5234
5354
 
5235
5355
  return function (d) {
5236
5356
  var data = d.data || d,
5237
- result = (withShape ? _this.generateClass(config_classes[isPlural ? "shapes" : "shape"], data[key]) : "") + _this.generateClass(config_classes[type], data[useIdKey ? "id" : key]);
5357
+ result = (withShape ? _this.generateClass(classes[isPlural ? "shapes" : "shape"], data[key]) : "") + _this.generateClass(classes[type], data[useIdKey ? "id" : key]);
5238
5358
 
5239
5359
  return result.trim();
5240
5360
  };
@@ -5250,7 +5370,7 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5250
5370
  var _this2 = this;
5251
5371
 
5252
5372
  return function (d) {
5253
- return config_classes["chart" + type] + _this2.classTarget((d.data ? d.data : d).id);
5373
+ return classes["chart" + type] + _this2.classTarget((d.data ? d.data : d).id);
5254
5374
  };
5255
5375
  },
5256
5376
  generateExtraLineClass: function generateExtraLineClass() {
@@ -5269,26 +5389,26 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5269
5389
  };
5270
5390
  },
5271
5391
  classRegion: function classRegion(d, i) {
5272
- return this.generateClass(config_classes.region, i) + " " + ("class" in d ? d.class : "");
5392
+ return this.generateClass(classes.region, i) + " " + ("class" in d ? d.class : "");
5273
5393
  },
5274
5394
  classTarget: function classTarget(id) {
5275
5395
  var additionalClassSuffix = this.config.data_classes[id],
5276
5396
  additionalClass = "";
5277
5397
 
5278
5398
  if (additionalClassSuffix) {
5279
- additionalClass = " " + config_classes.target + "-" + additionalClassSuffix;
5399
+ additionalClass = " " + classes.target + "-" + additionalClassSuffix;
5280
5400
  }
5281
5401
 
5282
- return this.generateClass(config_classes.target, id) + additionalClass;
5402
+ return this.generateClass(classes.target, id) + additionalClass;
5283
5403
  },
5284
5404
  classFocus: function classFocus(d) {
5285
5405
  return this.classFocused(d) + this.classDefocused(d);
5286
5406
  },
5287
5407
  classFocused: function classFocused(d) {
5288
- return " " + (this.state.focusedTargetIds.indexOf(d.id) >= 0 ? config_classes.focused : "");
5408
+ return " " + (this.state.focusedTargetIds.indexOf(d.id) >= 0 ? classes.focused : "");
5289
5409
  },
5290
5410
  classDefocused: function classDefocused(d) {
5291
- return " " + (this.state.defocusedTargetIds.indexOf(d.id) >= 0 ? config_classes.defocused : "");
5411
+ return " " + (this.state.defocusedTargetIds.indexOf(d.id) >= 0 ? classes.defocused : "");
5292
5412
  },
5293
5413
  getTargetSelectorSuffix: function getTargetSelectorSuffix(targetId) {
5294
5414
  var targetStr = targetId || targetId === 0 ? "-" + targetId : "";
@@ -5298,7 +5418,7 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5298
5418
  var pfx = prefix || "",
5299
5419
  target = this.getTargetSelectorSuffix(id);
5300
5420
  // select target & circle
5301
- return pfx + "." + (config_classes.target + target) + ", " + pfx + "." + (config_classes.circles + target);
5421
+ return pfx + "." + (classes.target + target) + ", " + pfx + "." + (classes.circles + target);
5302
5422
  },
5303
5423
  selectorTargets: function selectorTargets(idsValue, prefix) {
5304
5424
  var _this3 = this,
@@ -5309,7 +5429,7 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5309
5429
  }) : null;
5310
5430
  },
5311
5431
  selectorLegend: function selectorLegend(id) {
5312
- return "." + (config_classes.legendItem + this.getTargetSelectorSuffix(id));
5432
+ return "." + (classes.legendItem + this.getTargetSelectorSuffix(id));
5313
5433
  },
5314
5434
  selectorLegends: function selectorLegends(ids) {
5315
5435
  var _this4 = this;
@@ -5385,7 +5505,7 @@ var colorizePattern = function (pattern, color, id) {
5385
5505
 
5386
5506
  if (!pattern) {
5387
5507
  var span = browser_doc.createElement("span");
5388
- span.className = config_classes.colorPattern;
5508
+ span.className = $COLOR.colorPattern;
5389
5509
  span.style.display = "none";
5390
5510
  body.appendChild(span);
5391
5511
  var content = win.getComputedStyle(span).backgroundImage;
@@ -5525,7 +5645,7 @@ var colorizePattern = function (pattern, color, id) {
5525
5645
  }
5526
5646
 
5527
5647
  main.selectAll(isObject(d) ? // when is Arc type
5528
- "." + config_classes.arc + $$.getTargetSelectorSuffix(d.id) : "." + config_classes.shape + "-" + d).style("fill", color);
5648
+ "." + $ARC.arc + $$.getTargetSelectorSuffix(d.id) : "." + $SHAPE.shape + "-" + d).style("fill", color);
5529
5649
  }
5530
5650
  });
5531
5651
  ;// CONCATENATED MODULE: ./src/ChartInternal/internals/domain.ts
@@ -5639,7 +5759,7 @@ var colorizePattern = function (pattern, color, id) {
5639
5759
  yDomainMax = $$.getYDomainMinMax(yTargets, "max"),
5640
5760
  isZeroBased = [TYPE.BAR, TYPE.BUBBLE, TYPE.SCATTER].concat(TYPE_BY_CATEGORY.Line).some(function (v) {
5641
5761
  var type = v.indexOf("area") > -1 ? "area" : v;
5642
- return $$.hasType(v, yTargets) && config[type + "_zerobased"];
5762
+ return $$.hasType(v, yTargets, !0) && config[type + "_zerobased"];
5643
5763
  });
5644
5764
  // MEMO: avoid inverting domain unexpectedly
5645
5765
  yDomainMin = isValue(yMin) ? yMin : isValue(yMax) ? yDomainMin < yMax ? yDomainMin : yMax - 10 : yDomainMin;
@@ -5699,9 +5819,10 @@ var colorizePattern = function (pattern, color, id) {
5699
5819
  ["bottom", "top"].forEach(function (v, i) {
5700
5820
  padding[v] += $$.convertPixelToScale("y", lengths[i], domainLength);
5701
5821
  });
5702
- } // if padding is set, the domain will be updated relative the current domain value
5703
- // ex) $$.height=300, padding.top=150, domainLength=4 --> domain=6
5822
+ }
5704
5823
 
5824
+ padding = $$.getResettedPadding(padding); // if padding is set, the domain will be updated relative the current domain value
5825
+ // ex) $$.height=300, padding.top=150, domainLength=4 --> domain=6
5705
5826
 
5706
5827
  var p = config[pfx + "_padding"];
5707
5828
 
@@ -5765,7 +5886,7 @@ var colorizePattern = function (pattern, color, id) {
5765
5886
  var maxDataCount = $$.getMaxDataCount();
5766
5887
  defaultValue = maxDataCount > 1 ? diff / (maxDataCount - 1) / 2 : .5;
5767
5888
  } else {
5768
- defaultValue = diff * .01;
5889
+ defaultValue = $$.getResettedPadding(diff * .01);
5769
5890
  }
5770
5891
 
5771
5892
  var _ref = isNumber(padding) ? {
@@ -6034,7 +6155,7 @@ function getFormat($$, typeValue, v) {
6034
6155
 
6035
6156
  if (config.legend_show) {
6036
6157
  if (!config.legend_contents_bindto) {
6037
- $el.legend = $$.$el.svg.append("g").classed(config_classes.legend, !0).attr("transform", $$.getTranslate("legend"));
6158
+ $el.legend = $$.$el.svg.append("g").classed($LEGEND.legend, !0).attr("transform", $$.getTranslate("legend"));
6038
6159
  } // MEMO: call here to update legend box and translate for all
6039
6160
  // MEMO: translate will be updated by this, so transform not needed in updateLegend()
6040
6161
 
@@ -6073,7 +6194,7 @@ function getFormat($$, typeValue, v) {
6073
6194
  } // toggle legend state
6074
6195
 
6075
6196
 
6076
- $el.legend.selectAll("." + config_classes.legendItem).classed(config_classes.legendItemHidden, function (id) {
6197
+ $el.legend.selectAll("." + $LEGEND.legendItem).classed($LEGEND.legendItemHidden, function (id) {
6077
6198
  var hide = !$$.isTargetToShow(id);
6078
6199
 
6079
6200
  if (hide) {
@@ -6201,7 +6322,7 @@ function getFormat($$, typeValue, v) {
6201
6322
  var legend = this.$el.legend;
6202
6323
 
6203
6324
  if (legend) {
6204
- legend.select("." + config_classes.legendItem + "-" + id + " line").style("stroke", color);
6325
+ legend.select("." + $LEGEND.legendItem + "-" + id + " line").style("stroke", color);
6205
6326
  }
6206
6327
  },
6207
6328
 
@@ -6243,7 +6364,7 @@ function getFormat($$, typeValue, v) {
6243
6364
  * @private
6244
6365
  */
6245
6366
  opacityForUnfocusedLegend: function opacityForUnfocusedLegend(legendItem) {
6246
- return legendItem.classed(config_classes.legendItemHidden) ? null : "0.3";
6367
+ return legendItem.classed($LEGEND.legendItemHidden) ? null : "0.3";
6247
6368
  },
6248
6369
 
6249
6370
  /**
@@ -6257,9 +6378,9 @@ function getFormat($$, typeValue, v) {
6257
6378
  legend = $$.$el.legend,
6258
6379
  $T = $$.$T,
6259
6380
  targetIdz = $$.mapToTargetIds(targetIds);
6260
- legend && $T(legend.selectAll("." + config_classes.legendItem).filter(function (id) {
6381
+ legend && $T(legend.selectAll("." + $LEGEND.legendItem).filter(function (id) {
6261
6382
  return targetIdz.indexOf(id) >= 0;
6262
- }).classed(config_classes.legendItemFocused, focus)).style("opacity", function () {
6383
+ }).classed($FOCUS.legendItemFocused, focus)).style("opacity", function () {
6263
6384
  return focus ? null : $$.opacityForUnfocusedLegend.call($$, (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this));
6264
6385
  });
6265
6386
  },
@@ -6272,7 +6393,7 @@ function getFormat($$, typeValue, v) {
6272
6393
  var $$ = this,
6273
6394
  legend = $$.$el.legend,
6274
6395
  $T = $$.$T;
6275
- legend && $T(legend.selectAll("." + config_classes.legendItem).classed(config_classes.legendItemFocused, !1)).style("opacity", null);
6396
+ legend && $T(legend.selectAll("." + $LEGEND.legendItem).classed($FOCUS.legendItemFocused, !1)).style("opacity", null);
6276
6397
  },
6277
6398
 
6278
6399
  /**
@@ -6333,7 +6454,7 @@ function getFormat($$, typeValue, v) {
6333
6454
  data = !state.redrawing && cache.get(cacheKey) || {};
6334
6455
 
6335
6456
  if (!data[id]) {
6336
- data[id] = $$.getTextRect(textElement, config_classes.legendItem);
6457
+ data[id] = $$.getTextRect(textElement, $LEGEND.legendItem);
6337
6458
  cache.add(cacheKey, data);
6338
6459
  }
6339
6460
 
@@ -6358,7 +6479,7 @@ function getFormat($$, typeValue, v) {
6358
6479
  item.attr("class", function (id) {
6359
6480
  var node = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
6360
6481
  itemClass = !node.empty() && node.attr("class") || "";
6361
- return itemClass + $$.generateClass(config_classes.legendItem, id);
6482
+ return itemClass + $$.generateClass($LEGEND.legendItem, id);
6362
6483
  }).style("visibility", function (id) {
6363
6484
  return $$.isLegendToShow(id) ? null : "hidden";
6364
6485
  });
@@ -6371,7 +6492,7 @@ function getFormat($$, typeValue, v) {
6371
6492
  api.show(id);
6372
6493
  } else {
6373
6494
  api.toggle(id);
6374
- (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed(config_classes.legendItemFocused, !1);
6495
+ (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed($FOCUS.legendItemFocused, !1);
6375
6496
  }
6376
6497
  }
6377
6498
 
@@ -6379,20 +6500,20 @@ function getFormat($$, typeValue, v) {
6379
6500
  });
6380
6501
  isTouch || item.on("mouseout", function (event, id) {
6381
6502
  if (!callFn(config.legend_item_onout, api, id)) {
6382
- (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed(config_classes.legendItemFocused, !1);
6503
+ (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed($FOCUS.legendItemFocused, !1);
6383
6504
 
6384
6505
  if (hasGauge) {
6385
- $$.undoMarkOverlapped($$, "." + config_classes.gaugeValue);
6506
+ $$.undoMarkOverlapped($$, "." + $GAUGE.gaugeValue);
6386
6507
  }
6387
6508
 
6388
6509
  $$.api.revert();
6389
6510
  }
6390
6511
  }).on("mouseover", function (event, id) {
6391
6512
  if (!callFn(config.legend_item_onover, api, id)) {
6392
- (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed(config_classes.legendItemFocused, !0);
6513
+ (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed($FOCUS.legendItemFocused, !0);
6393
6514
 
6394
6515
  if (hasGauge) {
6395
- $$.markOverlapped(id, $$, "." + config_classes.gaugeValue);
6516
+ $$.markOverlapped(id, $$, "." + $GAUGE.gaugeValue);
6396
6517
  }
6397
6518
 
6398
6519
  if (!state.transiting && $$.isTargetToShow(id)) {
@@ -6563,7 +6684,7 @@ function getFormat($$, typeValue, v) {
6563
6684
  return yForLegend(id, i) + 4;
6564
6685
  },
6565
6686
  pos = -200,
6566
- l = legend.selectAll("." + config_classes.legendItem).data(targetIdz).enter().append("g");
6687
+ l = legend.selectAll("." + $LEGEND.legendItem).data(targetIdz).enter().append("g");
6567
6688
 
6568
6689
  $$.setLegendItem(l);
6569
6690
  l.append("text").text(function (id) {
@@ -6571,7 +6692,7 @@ function getFormat($$, typeValue, v) {
6571
6692
  }).each(function (id, i) {
6572
6693
  updatePositions(this, id, i);
6573
6694
  }).style("pointer-events", "none").attr("x", isLegendRightOrInset ? xForLegendText : pos).attr("y", isLegendRightOrInset ? pos : yForLegendText);
6574
- l.append("rect").attr("class", config_classes.legendItemEvent).style("fill-opacity", "0").attr("x", isLegendRightOrInset ? xForLegendRect : pos).attr("y", isLegendRightOrInset ? pos : yForLegendRect);
6695
+ l.append("rect").attr("class", $LEGEND.legendItemEvent).style("fill-opacity", "0").attr("x", isLegendRightOrInset ? xForLegendRect : pos).attr("y", isLegendRightOrInset ? pos : yForLegendRect);
6575
6696
 
6576
6697
  var getColor = function (id) {
6577
6698
  var data = $$.getDataById(id);
@@ -6591,21 +6712,21 @@ function getFormat($$, typeValue, v) {
6591
6712
  }
6592
6713
 
6593
6714
  return browser_doc.createElementNS(external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.namespaces.svg, "hasValidPointType" in $$ && $$.hasValidPointType(point) ? point : "use");
6594
- }).attr("class", config_classes.legendItemPoint).style("fill", getColor).style("pointer-events", "none").attr("href", function (data, idx, selection) {
6715
+ }).attr("class", $LEGEND.legendItemPoint).style("fill", getColor).style("pointer-events", "none").attr("href", function (data, idx, selection) {
6595
6716
  var node = selection[idx],
6596
6717
  nodeName = node.nodeName.toLowerCase(),
6597
6718
  id = $$.getTargetSelectorSuffix(data);
6598
6719
  return nodeName === "use" ? "#" + state.datetimeId + "-point" + id : undefined;
6599
6720
  });
6600
6721
  } else {
6601
- l.append("line").attr("class", config_classes.legendItemTile).style("stroke", getColor).style("pointer-events", "none").attr("x1", isLegendRightOrInset ? x1ForLegendTile : pos).attr("y1", isLegendRightOrInset ? pos : yForLegendTile).attr("x2", isLegendRightOrInset ? x2ForLegendTile : pos).attr("y2", isLegendRightOrInset ? pos : yForLegendTile).attr("stroke-width", config.legend_item_tile_height);
6722
+ l.append("line").attr("class", $LEGEND.legendItemTile).style("stroke", getColor).style("pointer-events", "none").attr("x1", isLegendRightOrInset ? x1ForLegendTile : pos).attr("y1", isLegendRightOrInset ? pos : yForLegendTile).attr("x2", isLegendRightOrInset ? x2ForLegendTile : pos).attr("y2", isLegendRightOrInset ? pos : yForLegendTile).attr("stroke-width", config.legend_item_tile_height);
6602
6723
  } // Set background for inset legend
6603
6724
 
6604
6725
 
6605
- background = legend.select("." + config_classes.legendBackground + " rect");
6726
+ background = legend.select("." + $LEGEND.legendBackground + " rect");
6606
6727
 
6607
6728
  if (state.isLegendInset && maxWidth > 0 && background.size() === 0) {
6608
- background = legend.insert("g", "." + config_classes.legendItem).attr("class", config_classes.legendBackground).append("rect");
6729
+ background = legend.insert("g", "." + $LEGEND.legendItem).attr("class", $LEGEND.legendBackground).append("rect");
6609
6730
  }
6610
6731
 
6611
6732
  var texts = legend.selectAll("text").data(targetIdz).text(function (id) {
@@ -6615,7 +6736,7 @@ function getFormat($$, typeValue, v) {
6615
6736
  updatePositions(this, id, i);
6616
6737
  });
6617
6738
  $T(texts, withTransition).attr("x", xForLegendText).attr("y", yForLegendText);
6618
- var rects = legend.selectAll("rect." + config_classes.legendItemEvent).data(targetIdz);
6739
+ var rects = legend.selectAll("rect." + $LEGEND.legendItemEvent).data(targetIdz);
6619
6740
  $T(rects, withTransition).attr("width", function (id) {
6620
6741
  return widths[id];
6621
6742
  }).attr("height", function (id) {
@@ -6623,7 +6744,7 @@ function getFormat($$, typeValue, v) {
6623
6744
  }).attr("x", xForLegendRect).attr("y", yForLegendRect);
6624
6745
 
6625
6746
  if (usePoint) {
6626
- var tiles = legend.selectAll("." + config_classes.legendItemPoint).data(targetIdz);
6747
+ var tiles = legend.selectAll("." + $LEGEND.legendItemPoint).data(targetIdz);
6627
6748
  $T(tiles, withTransition).each(function () {
6628
6749
  var nodeName = this.nodeName.toLowerCase(),
6629
6750
  pointR = config.point_r,
@@ -6657,7 +6778,7 @@ function getFormat($$, typeValue, v) {
6657
6778
  }).attr("r", radius).attr("width", width).attr("height", height);
6658
6779
  });
6659
6780
  } else {
6660
- var _tiles = legend.selectAll("line." + config_classes.legendItemTile).data(targetIdz);
6781
+ var _tiles = legend.selectAll("line." + $LEGEND.legendItemTile).data(targetIdz);
6661
6782
 
6662
6783
  $T(_tiles, withTransition).style("stroke", getColor).attr("x1", x1ForLegendTile).attr("y1", yForLegendTile).attr("x2", x2ForLegendTile).attr("y2", yForLegendTile);
6663
6784
  }
@@ -6727,7 +6848,7 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
6727
6848
  // @TODO: Make 'init' state to be accessible everywhere not passing as argument.
6728
6849
  $$.axis.redrawAxis(targetsToShow, wth, transitions, flow, initializing); // Data empty label positioning and text.
6729
6850
 
6730
- config.data_empty_label_text && main.select("text." + config_classes.text + "." + config_classes.empty).attr("x", state.width / 2).attr("y", state.height / 2).text(config.data_empty_label_text).style("display", targetsToShow.length ? "none" : null); // grid
6851
+ config.data_empty_label_text && main.select("text." + $TEXT.text + "." + $COMMON.empty).attr("x", state.width / 2).attr("y", state.height / 2).text(config.data_empty_label_text).style("display", targetsToShow.length ? "none" : null); // grid
6731
6852
 
6732
6853
  $$.hasGrid() && $$.updateGrid(); // rect for regions
6733
6854
 
@@ -6740,7 +6861,7 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
6740
6861
  }
6741
6862
  }); // circles for select
6742
6863
 
6743
- $el.text && main.selectAll("." + config_classes.selectedCircles).filter($$.isBarType.bind($$)).selectAll("circle").remove(); // event rects will redrawn when flow called
6864
+ $el.text && main.selectAll("." + $SELECT.selectedCircles).filter($$.isBarType.bind($$)).selectAll("circle").remove(); // event rects will redrawn when flow called
6744
6865
 
6745
6866
  if (config.interaction_enabled && !flow && wth.EventRect) {
6746
6867
  $$.redrawEventRect();
@@ -7077,15 +7198,16 @@ function getScale(type, min, max) {
7077
7198
  if (hasAxis) {
7078
7199
  var _scale$x,
7079
7200
  isRotated = config.axis_rotated,
7201
+ resettedPadding = $$.getResettedPadding(1),
7080
7202
  min = {
7081
- x: isRotated ? 1 : 0,
7203
+ x: isRotated ? resettedPadding : 0,
7082
7204
  y: isRotated ? 0 : height,
7083
7205
  subX: isRotated ? 1 : 0,
7084
7206
  subY: isRotated ? 0 : height2
7085
7207
  },
7086
7208
  max = {
7087
7209
  x: isRotated ? height : width,
7088
- y: isRotated ? width : 1,
7210
+ y: isRotated ? width : resettedPadding,
7089
7211
  subX: isRotated ? height : width,
7090
7212
  subY: isRotated ? width2 : 1
7091
7213
  },
@@ -7218,6 +7340,20 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7218
7340
 
7219
7341
  return shape;
7220
7342
  },
7343
+
7344
+ /**
7345
+ * Get shape's indices according it's position
7346
+ *
7347
+ * From the below example, indices will be:
7348
+ * ==> {data1: 0, data2: 0, data3: 1, data4: 1, __max__: 1}
7349
+ *
7350
+ * data1 data3 data1 data3
7351
+ * data2 data4 data2 data4
7352
+ * -------------------------
7353
+ * 0 1
7354
+ * @param {Function} typeFilter Chart type filter function
7355
+ * @returns {object} Indices object with its position
7356
+ */
7221
7357
  getShapeIndices: function getShapeIndices(typeFilter) {
7222
7358
  var $$ = this,
7223
7359
  config = $$.config,
@@ -7263,12 +7399,30 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7263
7399
  /**
7264
7400
  * Get indices value based on data ID value
7265
7401
  * @param {object} indices Indices object
7266
- * @param {string} id Data id value
7402
+ * @param {object} d Data row
7403
+ * @param {string} caller Caller function name (Used only for 'sparkline' plugin)
7267
7404
  * @returns {object} Indices object
7268
7405
  * @private
7269
7406
  */
7270
- getIndices: function getIndices(indices, id) {
7271
- var xs = this.config.data_xs;
7407
+ getIndices: function getIndices(indices, d) {
7408
+ // eslint-disable-line
7409
+ var $$ = this,
7410
+ _$$$config = $$.config,
7411
+ xs = _$$$config.data_xs,
7412
+ removeNull = _$$$config.bar_indices_removeNull,
7413
+ id = d.id,
7414
+ index = d.index;
7415
+
7416
+ if ($$.isBarType(id) && removeNull) {
7417
+ var ind = {}; // redefine bar indices order
7418
+
7419
+ $$.getAllValuesOnIndex(index, !0).forEach(function (v, i) {
7420
+ ind[v.id] = i;
7421
+ ind.__max__ = i;
7422
+ });
7423
+ return ind;
7424
+ }
7425
+
7272
7426
  return notEmpty(xs) ? indices[xs[id]] : indices;
7273
7427
  },
7274
7428
 
@@ -7298,7 +7452,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7298
7452
  halfWidth = isObjectType(offset) && (offset._$total.length ? offset._$total.reduce(sum) / 2 : 0);
7299
7453
 
7300
7454
  return function (d) {
7301
- var ind = $$.getIndices(indices, d.id, "getShapeX"),
7455
+ var ind = $$.getIndices(indices, d, "getShapeX"),
7302
7456
  index = d.id in ind ? ind[d.id] : 0,
7303
7457
  targetsNum = (ind.__max__ || 0) + 1,
7304
7458
  x = 0;
@@ -7341,6 +7495,9 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7341
7495
  value = $$.getRatio("index", d, !0);
7342
7496
  } else if ($$.isBubbleZType(d)) {
7343
7497
  value = $$.getBubbleZData(d.value, "y");
7498
+ } else if ($$.isBarRangeType(d)) {
7499
+ // TODO use range.getEnd() like method
7500
+ value = value[1];
7344
7501
  }
7345
7502
 
7346
7503
  return $$.getYScaleById(d.id, isSub)(value);
@@ -7355,11 +7512,13 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7355
7512
  */
7356
7513
  getShapeYMin: function getShapeYMin(id) {
7357
7514
  var $$ = this,
7358
- scale = $$.scale[$$.axis.getId(id)],
7515
+ axisId = $$.axis.getId(id),
7516
+ scale = $$.scale[axisId],
7359
7517
  _scale$domain = scale.domain(),
7360
- yMin = _scale$domain[0];
7518
+ yMin = _scale$domain[0],
7519
+ inverted = $$.config["axis_" + axisId + "_inverted"];
7361
7520
 
7362
- return !$$.isGrouped(id) && yMin > 0 ? yMin : 0;
7521
+ return !$$.isGrouped(id) && !inverted && yMin > 0 ? yMin : 0;
7363
7522
  },
7364
7523
 
7365
7524
  /**
@@ -7413,9 +7572,15 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7413
7572
  var id = d.id,
7414
7573
  value = d.value,
7415
7574
  x = d.x,
7416
- ind = $$.getIndices(indices, id),
7417
- scale = $$.getYScaleById(id, isSub),
7418
- y0 = scale($$.getShapeYMin(id)),
7575
+ ind = $$.getIndices(indices, d),
7576
+ scale = $$.getYScaleById(id, isSub);
7577
+
7578
+ if ($$.isBarRangeType(d)) {
7579
+ // TODO use range.getStart()
7580
+ return scale(value[0]);
7581
+ }
7582
+
7583
+ var y0 = scale($$.getShapeYMin(id)),
7419
7584
  dataXAsNumber = +x,
7420
7585
  offset = y0;
7421
7586
  shapeOffsetTargets.filter(function (t) {
@@ -7424,7 +7589,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7424
7589
  var tid = t.id,
7425
7590
  rowValueMapByXValue = t.rowValueMapByXValue,
7426
7591
  rowValues = t.rowValues,
7427
- tvalues = t.values;
7592
+ tvalues = t.values; // for same stacked group (ind[tid] === ind[id])
7428
7593
 
7429
7594
  if (ind[tid] === ind[id] && indexMapByTargetId[tid] < indexMapByTargetId[id]) {
7430
7595
  var _row,
@@ -7504,7 +7669,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7504
7669
  return isValue(i) ? d.index === i : !0;
7505
7670
  });
7506
7671
  } else {
7507
- shape = (id ? $el.main.selectAll("." + config_classes[shapeName + "s"] + $$.getTargetSelectorSuffix(id)) : $el.main).selectAll("." + config_classes[shapeName] + suffix);
7672
+ shape = (id ? $el.main.selectAll("." + classes[shapeName + "s"] + $$.getTargetSelectorSuffix(id)) : $el.main).selectAll("." + classes[shapeName] + suffix);
7508
7673
  }
7509
7674
 
7510
7675
  return shape;
@@ -7519,7 +7684,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7519
7684
  } else if ($$.hasValidPointType != null && $$.hasValidPointType(that.nodeName)) {
7520
7685
  isWithin = $$.isStepType(d) ? $$.isWithinStep(that, $$.getYScaleById(d.id)(d.value)) : $$.isWithinCircle(that, $$.isBubbleType(d) ? $$.pointSelectR(d) * 1.5 : 0);
7521
7686
  } else if (that.nodeName === "path") {
7522
- isWithin = shape.classed(config_classes.bar) ? $$.isWithinBar(that) : !0;
7687
+ isWithin = shape.classed(classes.bar) ? $$.isWithinBar(that) : !0;
7523
7688
  }
7524
7689
 
7525
7690
  return isWithin;
@@ -7554,6 +7719,22 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7554
7719
  type = config.spline_interpolation_type,
7555
7720
  interpolation = $$.isInterpolationType(type) ? type : "cardinal";
7556
7721
  return $$.isSplineType(d) ? interpolation : $$.isStepType(d) ? config.line_step_type : "linear";
7722
+ },
7723
+ isWithinBar: function isWithinBar(that) {
7724
+ var mouse = getPointer(this.state.event, that),
7725
+ list = getRectSegList(that),
7726
+ _list = list,
7727
+ seg0 = _list[0],
7728
+ seg1 = _list[1],
7729
+ x = Math.min(seg0.x, seg1.x),
7730
+ y = Math.min(seg0.y, seg1.y),
7731
+ offset = this.config.bar_sensitivity,
7732
+ _that$getBBox = that.getBBox(),
7733
+ width = _that$getBBox.width,
7734
+ height = _that$getBBox.height,
7735
+ isWithin = x - offset < mouse[0] && mouse[0] < x + width + offset && y - offset < mouse[1] && mouse[1] < y + height + offset;
7736
+
7737
+ return isWithin;
7557
7738
  }
7558
7739
  });
7559
7740
  ;// CONCATENATED MODULE: ./src/ChartInternal/internals/size.ts
@@ -7713,7 +7894,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7713
7894
  config = $$.config,
7714
7895
  $el = $$.$el,
7715
7896
  hasLeftAxisRect = config.axis_rotated || !config.axis_rotated && !config.axis_y_inner,
7716
- leftAxisClass = config.axis_rotated ? config_classes.axisX : config_classes.axisY,
7897
+ leftAxisClass = config.axis_rotated ? $AXIS.axisX : $AXIS.axisY,
7717
7898
  leftAxis = $el.main.select("." + leftAxisClass).node(),
7718
7899
  svgRect = leftAxis && hasLeftAxisRect ? leftAxis.getBoundingClientRect() : {
7719
7900
  right: 0
@@ -7752,7 +7933,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7752
7933
  svg.attr("width", current.width).attr("height", current.height);
7753
7934
 
7754
7935
  if (hasAxis) {
7755
- var brush = svg.select("." + config_classes.brush + " .overlay"),
7936
+ var brush = svg.select("." + $SUBCHART.brush + " .overlay"),
7756
7937
  brushSize = {
7757
7938
  width: 0,
7758
7939
  height: 0
@@ -7770,6 +7951,31 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7770
7951
  }
7771
7952
  },
7772
7953
 
7954
+ /**
7955
+ * Get resetted padding values when 'padding=false' option is set
7956
+ * https://github.com/naver/billboard.js/issues/2367
7957
+ * @param {number|object} v Padding values to be resetted
7958
+ * @returns {number|object} Padding value
7959
+ * @private
7960
+ */
7961
+ getResettedPadding: function getResettedPadding(v) {
7962
+ var $$ = this,
7963
+ config = $$.config,
7964
+ isNum = isNumber(v),
7965
+ p = isNum ? 0 : {};
7966
+
7967
+ if (config.padding === !1) {
7968
+ isNum || Object.keys(v).forEach(function (key) {
7969
+ // when data.lables=true, do not reset top padding
7970
+ p[key] = !isEmpty(config.data_labels) && config.data_labels !== !1 && key === "top" ? v[key] : 0;
7971
+ });
7972
+ } else {
7973
+ p = v;
7974
+ }
7975
+
7976
+ return p;
7977
+ },
7978
+
7773
7979
  /**
7774
7980
  * Update size values
7775
7981
  * @param {boolean} isInit If is called at initialization
@@ -7808,7 +8014,8 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7808
8014
  right: hasArc ? 0 : $$.getCurrentPaddingRight(!0),
7809
8015
  bottom: xAxisHeight + subchartHeight + legendHeightForBottom + $$.getCurrentPaddingBottom(),
7810
8016
  left: hasArc ? 0 : $$.getCurrentPaddingLeft()
7811
- }; // for subchart
8017
+ };
8018
+ state.margin = $$.getResettedPadding(state.margin); // for subchart
7812
8019
 
7813
8020
  state.margin2 = isRotated ? {
7814
8021
  top: state.margin.top,
@@ -7889,7 +8096,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7889
8096
  */
7890
8097
  initText: function initText() {
7891
8098
  var $el = this.$el;
7892
- $el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartTexts);
8099
+ $el.main.select("." + $COMMON.chart).append("g").attr("class", $TEXT.chartTexts);
7893
8100
  },
7894
8101
 
7895
8102
  /**
@@ -7902,7 +8109,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7902
8109
  classChartText = $$.getChartClass("Text"),
7903
8110
  classTexts = $$.getClass("texts", "id"),
7904
8111
  classFocus = $$.classFocus.bind($$),
7905
- mainTextUpdate = $$.$el.main.select("." + config_classes.chartTexts).selectAll("." + config_classes.chartText).data(targets).attr("class", function (d) {
8112
+ mainTextUpdate = $$.$el.main.select("." + $TEXT.chartTexts).selectAll("." + $TEXT.chartText).data(targets).attr("class", function (d) {
7906
8113
  return classChartText(d) + classFocus(d);
7907
8114
  }),
7908
8115
  mainTextEnter = mainTextUpdate.enter().append("g").style("opacity", "0").attr("class", classChartText).style("pointer-events", "none");
@@ -7919,7 +8126,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7919
8126
  $T = $$.$T,
7920
8127
  config = $$.config,
7921
8128
  classText = $$.getClass("text", "index"),
7922
- text = $el.main.selectAll("." + config_classes.texts).selectAll("." + config_classes.text).data($$.labelishData.bind($$));
8129
+ text = $el.main.selectAll("." + $TEXT.texts).selectAll("." + $TEXT.text).data($$.labelishData.bind($$));
7923
8130
  $T(text.exit()).style("fill-opacity", "0").remove();
7924
8131
  $el.text = text.enter().append("text").merge(text).attr("class", classText).attr("text-anchor", function (d) {
7925
8132
  // when value is negative or
@@ -8147,9 +8354,11 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
8147
8354
  isRotated = config.axis_rotated,
8148
8355
  xPos = points[0][0];
8149
8356
 
8150
- if ($$.hasType("candlestick")) {
8357
+ if ($$.isCandlestickType(d)) {
8151
8358
  if (isRotated) {
8152
- xPos = $$.getCandlestickData(d)._isUp ? points[2][2] + 4 : points[2][1] - 4;
8359
+ var _$$$getCandlestickDat;
8360
+
8361
+ xPos = (_$$$getCandlestickDat = $$.getCandlestickData(d)) != null && _$$$getCandlestickDat._isUp ? points[2][2] + 4 : points[2][1] - 4;
8153
8362
  } else {
8154
8363
  xPos += (points[1][0] - xPos) / 2;
8155
8364
  }
@@ -8280,7 +8489,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
8280
8489
  nodeForWidth = calcHypo(translate.e, translate.f) > calcHypo(coordinate.e, coordinate.f) ? textNode : filteredTextNode,
8281
8490
  overlapsX = Math.ceil(Math.abs(translate.e - coordinate.e)) < Math.ceil(nodeForWidth.node().getComputedTextLength()),
8282
8491
  overlapsY = Math.ceil(Math.abs(translate.f - coordinate.f)) < parseInt(textNode.style("font-size"), 10);
8283
- filteredTextNode.classed(config_classes.TextOverlapping, overlapsX && overlapsY);
8492
+ filteredTextNode.classed($TEXT.TextOverlapping, overlapsX && overlapsY);
8284
8493
  });
8285
8494
  },
8286
8495
 
@@ -8293,7 +8502,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
8293
8502
  */
8294
8503
  undoMarkOverlapped: function undoMarkOverlapped($$, selector) {
8295
8504
  $$.$el.arcs.selectAll(selector).each(function () {
8296
- (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.selectAll)([this, this.previousSibling]).classed(config_classes.TextOverlapping, !1);
8505
+ (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.selectAll)([this, this.previousSibling]).classed($TEXT.TextOverlapping, !1);
8297
8506
  });
8298
8507
  },
8299
8508
 
@@ -8361,7 +8570,7 @@ function getTextPos(pos, width) {
8361
8570
 
8362
8571
  if (config.title_text) {
8363
8572
  $el.title = $el.svg.append("g");
8364
- var text = $el.title.append("text").style("text-anchor", getTextPos(config.title_position)).attr("class", config_classes.title);
8573
+ var text = $el.title.append("text").style("text-anchor", getTextPos(config.title_position)).attr("class", $TEXT.title);
8365
8574
  setTextValue(text, config.title_text, [.3, 1.5]);
8366
8575
  }
8367
8576
  },
@@ -8397,7 +8606,7 @@ function getTextPos(pos, width) {
8397
8606
  config = $$.config,
8398
8607
  current = $$.state.current,
8399
8608
  position = config.title_position || "left",
8400
- textRectWidth = $$.getTextRect($$.$el.title, config_classes.title).width,
8609
+ textRectWidth = $$.getTextRect($$.$el.title, $TEXT.title).width,
8401
8610
  x;
8402
8611
 
8403
8612
  if (/(right|center)/.test(position)) {
@@ -8423,7 +8632,7 @@ function getTextPos(pos, width) {
8423
8632
  */
8424
8633
  yForTitle: function yForTitle() {
8425
8634
  var $$ = this;
8426
- return ($$.config.title_padding.top || 0) + $$.getTextRect($$.$el.title, config_classes.title).height;
8635
+ return ($$.config.title_padding.top || 0) + $$.getTextRect($$.$el.title, $TEXT.title).height;
8427
8636
  },
8428
8637
 
8429
8638
  /**
@@ -8457,7 +8666,7 @@ function getTextPos(pos, width) {
8457
8666
  $el.tooltip = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(config.tooltip_contents.bindto);
8458
8667
 
8459
8668
  if ($el.tooltip.empty()) {
8460
- $el.tooltip = $el.chart.style("position", "relative").append("div").attr("class", config_classes.tooltipContainer).style("position", "absolute").style("pointer-events", "none").style("display", "none");
8669
+ $el.tooltip = $el.chart.append("div").attr("class", $TOOLTIP.tooltipContainer).style("position", "absolute").style("pointer-events", "none").style("display", "none");
8461
8670
  }
8462
8671
 
8463
8672
  $$.bindTooltipResizePos();
@@ -8610,13 +8819,13 @@ function getTextPos(pos, width) {
8610
8819
  if (isUndefined(text)) {
8611
8820
  var title = (state.hasAxis || state.hasRadar) && sanitise(titleFormat ? titleFormat(row.x) : row.x);
8612
8821
  text = tplProcess(tpl[0], {
8613
- CLASS_TOOLTIP: config_classes.tooltip,
8822
+ CLASS_TOOLTIP: $TOOLTIP.tooltip,
8614
8823
  TITLE: isValue(title) ? tplStr ? title : "<tr><th colspan=\"2\">" + title + "</th></tr>" : ""
8615
8824
  });
8616
8825
  }
8617
8826
 
8618
8827
  if (!row.ratio && $$.$el.arcs) {
8619
- row.ratio = $$.getRatio("arc", $$.$el.arcs.select("path." + config_classes.arc + "-" + row.id).data()[0]);
8828
+ row.ratio = $$.getRatio("arc", $$.$el.arcs.select("path." + $ARC.arc + "-" + row.id).data()[0]);
8620
8829
  }
8621
8830
 
8622
8831
  param = [row.ratio, row.id, row.index, d];
@@ -8641,6 +8850,11 @@ function getTextPos(pos, width) {
8641
8850
  volume = _map3[4];
8642
8851
 
8643
8852
  value = "<b>Open:</b> " + open + " <b>High:</b> " + _high + " <b>Low:</b> " + _low + " <b>Close:</b> " + close + (volume ? " <b>Volume:</b> " + volume : "");
8853
+ } else if ($$.isBarRangeType(row)) {
8854
+ var _row$value = row.value,
8855
+ start = _row$value[0],
8856
+ end = _row$value[1];
8857
+ value = valueFormat(start) + " ~ " + valueFormat(end);
8644
8858
  }
8645
8859
 
8646
8860
  if (value !== undefined) {
@@ -8653,7 +8867,7 @@ function getTextPos(pos, width) {
8653
8867
  var name = sanitise(nameFormat.apply(void 0, [row.name].concat(param))),
8654
8868
  color = getBgColor(row),
8655
8869
  contentValue = {
8656
- CLASS_TOOLTIP_NAME: config_classes.tooltipName + $$.getTargetSelectorSuffix(row.id),
8870
+ CLASS_TOOLTIP_NAME: $TOOLTIP.tooltipName + $$.getTargetSelectorSuffix(row.id),
8657
8871
  COLOR: tplStr || !$$.patterns ? color : "<svg><rect style=\"fill:" + color + "\" width=\"10\" height=\"10\"></rect></svg>",
8658
8872
  NAME: name,
8659
8873
  VALUE: value
@@ -8991,14 +9205,14 @@ function getTextPos(pos, width) {
8991
9205
  var $$ = this,
8992
9206
  main = $$.$el.main,
8993
9207
  $T = $$.$T,
8994
- xAxis = transitions != null && transitions.axisX ? transitions.axisX : $T(main.select("." + config_classes.axisX), withTransition),
8995
- yAxis = transitions != null && transitions.axisY ? transitions.axisY : $T(main.select("." + config_classes.axisY), withTransition),
8996
- y2Axis = transitions != null && transitions.axisY2 ? transitions.axisY2 : $T(main.select("." + config_classes.axisY2), withTransition);
9208
+ xAxis = transitions != null && transitions.axisX ? transitions.axisX : $T(main.select("." + $AXIS.axisX), withTransition),
9209
+ yAxis = transitions != null && transitions.axisY ? transitions.axisY : $T(main.select("." + $AXIS.axisY), withTransition),
9210
+ y2Axis = transitions != null && transitions.axisY2 ? transitions.axisY2 : $T(main.select("." + $AXIS.axisY2), withTransition);
8997
9211
  $T(main, withTransition).attr("transform", $$.getTranslate("main"));
8998
9212
  xAxis.attr("transform", $$.getTranslate("x"));
8999
9213
  yAxis.attr("transform", $$.getTranslate("y"));
9000
9214
  y2Axis.attr("transform", $$.getTranslate("y2"));
9001
- main.select("." + config_classes.chartArcs).attr("transform", $$.getTranslate("arc"));
9215
+ main.select("." + $ARC.chartArcs).attr("transform", $$.getTranslate("arc"));
9002
9216
  },
9003
9217
  transformAll: function transformAll(withTransition, transitions) {
9004
9218
  var $$ = this,
@@ -9407,7 +9621,15 @@ var ChartInternal = /*#__PURE__*/function () {
9407
9621
  $el = $$.$el;
9408
9622
  checkModuleImport($$);
9409
9623
  state.hasAxis = !$$.hasArcType();
9410
- state.hasRadar = !state.hasAxis && $$.hasType("radar");
9624
+ state.hasRadar = !state.hasAxis && $$.hasType("radar"); // when 'padding=false' is set, disable axes and subchart. Because they are useless.
9625
+
9626
+ if (config.padding === !1) {
9627
+ config.axis_x_show = !1;
9628
+ config.axis_y_show = !1;
9629
+ config.axis_y2_show = !1;
9630
+ config.subchart_show = !1;
9631
+ }
9632
+
9411
9633
  $$.initParams();
9412
9634
  var bindto = {
9413
9635
  element: config.bindto,
@@ -9426,7 +9648,7 @@ var ChartInternal = /*#__PURE__*/function () {
9426
9648
  $el.chart = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(browser_doc.body.appendChild(browser_doc.createElement("div")));
9427
9649
  }
9428
9650
 
9429
- $el.chart.html("").classed(bindto.classname, !0);
9651
+ $el.chart.html("").classed(bindto.classname, !0).style("position", "relative");
9430
9652
  $$.initToRender();
9431
9653
  }
9432
9654
  /**
@@ -9503,7 +9725,8 @@ var ChartInternal = /*#__PURE__*/function () {
9503
9725
  state.isLegendInset = config.legend_position === "inset";
9504
9726
  state.isLegendTop = config.legend_inset_anchor === "top-left" || config.legend_inset_anchor === "top-right";
9505
9727
  state.isLegendLeft = config.legend_inset_anchor === "top-left" || config.legend_inset_anchor === "bottom-left";
9506
- state.rotatedPaddingRight = isRotated && !config.axis_x_show ? 0 : 30;
9728
+ state.rotatedPadding.top = $$.getResettedPadding(state.rotatedPadding.top);
9729
+ state.rotatedPadding.right = isRotated && !config.axis_x_show ? 0 : 30;
9507
9730
  state.inputType = convertInputType(config.interaction_inputType_mouse, config.interaction_inputType_touch);
9508
9731
  };
9509
9732
 
@@ -9610,7 +9833,7 @@ var ChartInternal = /*#__PURE__*/function () {
9610
9833
 
9611
9834
  $$.bindResize(); // Define regions
9612
9835
 
9613
- var main = $el.svg.append("g").classed(config_classes.main, !0).attr("transform", $$.getTranslate("main"));
9836
+ var main = $el.svg.append("g").classed($COMMON.main, !0).attr("transform", $$.getTranslate("main"));
9614
9837
  $el.main = main; // initialize subchart when subchart show option is set
9615
9838
 
9616
9839
  config.subchart_show && $$.initSubchart();
@@ -9620,7 +9843,7 @@ var ChartInternal = /*#__PURE__*/function () {
9620
9843
  // text when empty
9621
9844
 
9622
9845
  if (config.data_empty_label_text) {
9623
- main.append("text").attr("class", config_classes.text + " " + config_classes.empty).attr("text-anchor", "middle") // horizontal centering of text at x position in all browsers.
9846
+ main.append("text").attr("class", $TEXT.text + " " + $COMMON.empty).attr("text-anchor", "middle") // horizontal centering of text at x position in all browsers.
9624
9847
  .attr("dominant-baseline", "middle"); // vertical centering of text at y position in all browsers, except IE.
9625
9848
  }
9626
9849
 
@@ -9632,7 +9855,7 @@ var ChartInternal = /*#__PURE__*/function () {
9632
9855
  } // Define g for chart area
9633
9856
 
9634
9857
 
9635
- main.append("g").attr("class", config_classes.chart).attr("clip-path", state.clip.path);
9858
+ main.append("g").attr("class", $COMMON.chart).attr("clip-path", state.clip.path);
9636
9859
  $$.callPluginHook("$init");
9637
9860
 
9638
9861
  if (hasAxis) {
@@ -9831,7 +10054,7 @@ var ChartInternal = /*#__PURE__*/function () {
9831
10054
  var $$ = this,
9832
10055
  svg = $$.$el.svg,
9833
10056
  $T = $$.$T;
9834
- $T(svg.selectAll("." + config_classes.target).filter(function (d) {
10057
+ $T(svg.selectAll("." + $COMMON.target).filter(function (d) {
9835
10058
  return $$.isTargetToShow(d.id);
9836
10059
  })).style("opacity", null);
9837
10060
  };
@@ -10083,12 +10306,14 @@ function loadConfig(config) {
10083
10306
 
10084
10307
  if (notEmpty($$)) {
10085
10308
  $$.callPluginHook("$willDestroy");
10086
- $$.charts.splice($$.charts.indexOf(this), 1); // clear timers && pending transition
10309
+ $$.charts.splice($$.charts.indexOf(this), 1); // detach events
10310
+
10311
+ $$.unbindAllEvents(); // clear timers && pending transition
10087
10312
 
10088
10313
  svg.select("*").interrupt();
10089
10314
  $$.resizeFunction.clear();
10090
10315
  win.removeEventListener("resize", $$.resizeFunction);
10091
- chart.classed("bb", !1).html(""); // releasing own references
10316
+ chart.classed("bb", !1).style("position", null).selectChildren().remove(); // releasing own references
10092
10317
 
10093
10318
  Object.keys(this).forEach(function (key) {
10094
10319
  key === "internal" && Object.keys($$).forEach(function (k) {
@@ -10533,11 +10758,11 @@ function nodeToSvgDataUrl(node, option, orgSize) {
10533
10758
  candidates = $$.$el.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$)));
10534
10759
  this.revert();
10535
10760
  this.defocus();
10536
- candidates.classed(config_classes.focused, !0).classed(config_classes.defocused, !1);
10761
+ candidates.classed($FOCUS.focused, !0).classed($FOCUS.defocused, !1);
10537
10762
 
10538
10763
  if ($$.hasArcType() && !state.hasRadar) {
10539
10764
  $$.expandArc(targetIds);
10540
- $$.hasType("gauge") && $$.markOverlapped(targetIdsValue, $$, "." + config_classes.gaugeValue);
10765
+ $$.hasType("gauge") && $$.markOverlapped(targetIdsValue, $$, "." + $GAUGE.gaugeValue);
10541
10766
  }
10542
10767
 
10543
10768
  $$.toggleFocusLegend(targetIds, !0);
@@ -10569,11 +10794,11 @@ function nodeToSvgDataUrl(node, option, orgSize) {
10569
10794
  state = $$.state,
10570
10795
  targetIds = $$.mapToTargetIds(targetIdsValue),
10571
10796
  candidates = $$.$el.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$)));
10572
- candidates.classed(config_classes.focused, !1).classed(config_classes.defocused, !0);
10797
+ candidates.classed($FOCUS.focused, !1).classed($FOCUS.defocused, !0);
10573
10798
 
10574
10799
  if ($$.hasArcType()) {
10575
10800
  $$.unexpandArc(targetIds);
10576
- $$.hasType("gauge") && $$.undoMarkOverlapped($$, "." + config_classes.gaugeValue);
10801
+ $$.hasType("gauge") && $$.undoMarkOverlapped($$, "." + $GAUGE.gaugeValue);
10577
10802
  }
10578
10803
 
10579
10804
  $$.toggleFocusLegend(targetIds, !1);
@@ -10608,14 +10833,14 @@ function nodeToSvgDataUrl(node, option, orgSize) {
10608
10833
  targetIds = $$.mapToTargetIds(targetIdsValue),
10609
10834
  candidates = $el.svg.selectAll($$.selectorTargets(targetIds));
10610
10835
  // should be for all targets
10611
- candidates.classed(config_classes.focused, !1).classed(config_classes.defocused, !1);
10836
+ candidates.classed($FOCUS.focused, !1).classed($FOCUS.defocused, !1);
10612
10837
  $$.hasArcType() && $$.unexpandArc(targetIds);
10613
10838
 
10614
10839
  if (config.legend_show) {
10615
10840
  $$.showLegend(targetIds.filter($$.isLegendToShow.bind($$)));
10616
10841
  $el.legend.selectAll($$.selectorLegends(targetIds)).filter(function () {
10617
- return (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed(config_classes.legendItemFocused);
10618
- }).classed(config_classes.legendItemFocused, !1);
10842
+ return (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed($FOCUS.legendItemFocused);
10843
+ }).classed($FOCUS.legendItemFocused, !1);
10619
10844
  }
10620
10845
 
10621
10846
  state.focusedTargetIds = [];
@@ -11854,8 +12079,8 @@ extend(regions, {
11854
12079
  config = $$.config,
11855
12080
  $T = $$.$T,
11856
12081
  options = optionsValue || {},
11857
- classes = getOption(options, "classes", [config_classes.region]),
11858
- regions = $$.$el.main.select("." + config_classes.regions).selectAll(classes.map(function (c) {
12082
+ classes = getOption(options, "classes", [$REGION.region]),
12083
+ regions = $$.$el.main.select("." + $REGION.regions).selectAll(classes.map(function (c) {
11859
12084
  return "." + c;
11860
12085
  }));
11861
12086
  $T(regions).style("opacity", "0").remove();
@@ -12848,7 +13073,7 @@ var Axis_Axis = /*#__PURE__*/function () {
12848
13073
  var _proto = Axis.prototype;
12849
13074
 
12850
13075
  _proto.getAxisClassName = function getAxisClassName(id) {
12851
- return config_classes.axis + " " + config_classes["axis" + capitalize(id)];
13076
+ return $AXIS.axis + " " + $AXIS["axis" + capitalize(id)];
12852
13077
  };
12853
13078
 
12854
13079
  _proto.isHorizontal = function isHorizontal($$, forHorizontal) {
@@ -12918,7 +13143,7 @@ var Axis_Axis = /*#__PURE__*/function () {
12918
13143
  config.axis_y2_show && target.push("y2");
12919
13144
  target.forEach(function (v) {
12920
13145
  var classAxis = _this.getAxisClassName(v),
12921
- classLabel = config_classes["axis" + v.toUpperCase() + "Label"];
13146
+ classLabel = $AXIS["axis" + v.toUpperCase() + "Label"];
12922
13147
 
12923
13148
  axis[v] = main.append("g").attr("class", classAxis).attr("clip-path", function () {
12924
13149
  var res = null;
@@ -13005,7 +13230,8 @@ var Axis_Axis = /*#__PURE__*/function () {
13005
13230
  var _this2 = this,
13006
13231
  $$ = this.owner,
13007
13232
  config = $$.config,
13008
- main = $$.$el.main;
13233
+ main = $$.$el.main,
13234
+ $T = $$.$T;
13009
13235
 
13010
13236
  Object.keys(this.axesList).forEach(function (id) {
13011
13237
  var axesConfig = config["axis_" + id + "_axes"],
@@ -13029,7 +13255,7 @@ var Axis_Axis = /*#__PURE__*/function () {
13029
13255
  g = main.append("g").attr("class", className).style("visibility", config["axis_" + id + "_show"] ? null : "hidden").call(v);
13030
13256
  } else {
13031
13257
  axesConfig[i].domain && scale.domain(axesConfig[i].domain);
13032
- $$.$T(g).call(v.scale(scale));
13258
+ $T(g).call(v.scale(scale));
13033
13259
  }
13034
13260
 
13035
13261
  g.attr("transform", $$.getTranslate(id, i + 1));
@@ -13485,9 +13711,9 @@ var Axis_Axis = /*#__PURE__*/function () {
13485
13711
  main = $$.$el.main,
13486
13712
  $T = $$.$T,
13487
13713
  labels = {
13488
- x: main.select("." + config_classes.axisX + " ." + config_classes.axisXLabel),
13489
- y: main.select("." + config_classes.axisY + " ." + config_classes.axisYLabel),
13490
- y2: main.select("." + config_classes.axisY2 + " ." + config_classes.axisY2Label)
13714
+ x: main.select("." + $AXIS.axisX + " ." + $AXIS.axisXLabel),
13715
+ y: main.select("." + $AXIS.axisY + " ." + $AXIS.axisYLabel),
13716
+ y2: main.select("." + $AXIS.axisY2 + " ." + $AXIS.axisY2Label)
13491
13717
  };
13492
13718
 
13493
13719
  Object.keys(labels).filter(function (id) {
@@ -13648,11 +13874,12 @@ var Axis_Axis = /*#__PURE__*/function () {
13648
13874
  }
13649
13875
 
13650
13876
  ["y", "y2"].forEach(function (key) {
13651
- var axisScale = scale[key];
13877
+ var prefix = "axis_" + key + "_",
13878
+ axisScale = scale[key];
13652
13879
 
13653
- if (axisScale) {
13654
- var tickValues = config["axis_" + key + "_tick_values"],
13655
- tickCount = config["axis_" + key + "_tick_count"];
13880
+ if (config[prefix + "show"] && axisScale) {
13881
+ var tickValues = config[prefix + "tick_values"],
13882
+ tickCount = config[prefix + "tick_count"];
13656
13883
  axisScale.domain($$.getYDomain(targetsToShow, key, xDomainForZoom));
13657
13884
 
13658
13885
  if (!tickValues && tickCount) {
@@ -13698,13 +13925,15 @@ var Axis_Axis = /*#__PURE__*/function () {
13698
13925
  ["subX", "x", "y", "y2"].forEach(function (type) {
13699
13926
  var axis = $el.axis[type],
13700
13927
  id = type === "subX" ? "x" : type,
13701
- toCull = config["axis_" + id + "_tick_culling"]; // subchart x axis should be aligned with x axis culling
13928
+ cullingOptionPrefix = "axis_" + id + "_tick_culling",
13929
+ toCull = config[cullingOptionPrefix]; // subchart x axis should be aligned with x axis culling
13702
13930
 
13703
13931
  if (axis && toCull) {
13704
- var tickText = axis.selectAll(".tick text"),
13705
- tickValues = sortValue(tickText.data()),
13932
+ var tickNodes = axis.selectAll(".tick"),
13933
+ tickValues = sortValue(tickNodes.data()),
13706
13934
  tickSize = tickValues.length,
13707
- cullingMax = config["axis_" + id + "_tick_culling_max"],
13935
+ cullingMax = config[cullingOptionPrefix + "_max"],
13936
+ lines = config[cullingOptionPrefix + "_lines"],
13708
13937
  intervalForCulling;
13709
13938
 
13710
13939
  if (tickSize) {
@@ -13715,17 +13944,19 @@ var Axis_Axis = /*#__PURE__*/function () {
13715
13944
  }
13716
13945
  }
13717
13946
 
13718
- tickText.each(function (d) {
13719
- this.style.display = tickValues.indexOf(d) % intervalForCulling ? "none" : null;
13947
+ tickNodes.each(function (d) {
13948
+ if (tickValues.indexOf(d) % intervalForCulling) {
13949
+ (lines ? this.querySelector("text") : this).style.display = "none";
13950
+ }
13720
13951
  });
13721
13952
  } else {
13722
- tickText.style("display", null);
13953
+ tickNodes.style("display", null);
13723
13954
  } // set/unset x_axis_tick_clippath
13724
13955
 
13725
13956
 
13726
13957
  if (type === "x") {
13727
13958
  var clipPath = current.maxTickWidths.x.clipPath ? clip.pathXAxisTickTexts : null;
13728
- $el.svg.selectAll("." + config_classes.axisX + " .tick text").attr("clip-path", clipPath);
13959
+ $el.svg.selectAll("." + $AXIS.axisX + " .tick text").attr("clip-path", clipPath);
13729
13960
  }
13730
13961
  }
13731
13962
  });
@@ -13748,7 +13979,7 @@ var Axis_Axis = /*#__PURE__*/function () {
13748
13979
  */
13749
13980
  initEventRect: function initEventRect() {
13750
13981
  var $$ = this;
13751
- $$.$el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.eventRects).style("fill-opacity", "0");
13982
+ $$.$el.main.select("." + $COMMON.chart).append("g").attr("class", $EVENT.eventRects).style("fill-opacity", "0");
13752
13983
  },
13753
13984
 
13754
13985
  /**
@@ -13765,8 +13996,8 @@ var Axis_Axis = /*#__PURE__*/function () {
13765
13996
  if ($el.eventRect) {
13766
13997
  $$.updateEventRect($el.eventRect, !0);
13767
13998
  } else {
13768
- var eventRects = $$.$el.main.select("." + config_classes.eventRects).style("cursor", config.zoom_enabled && config.zoom_type !== "drag" ? config.axis_rotated ? "ns-resize" : "ew-resize" : null).classed(config_classes.eventRectsMultiple, isMultipleX).classed(config_classes.eventRectsSingle, !isMultipleX),
13769
- eventRectUpdate = eventRects.selectAll("." + config_classes.eventRect).data([0]).enter().append("rect"); // append event <rect>
13999
+ var eventRects = $$.$el.main.select("." + $EVENT.eventRects).style("cursor", config.zoom_enabled && config.zoom_type !== "drag" ? config.axis_rotated ? "ns-resize" : "ew-resize" : null).classed($EVENT.eventRectsMultiple, isMultipleX).classed($EVENT.eventRectsSingle, !isMultipleX),
14000
+ eventRectUpdate = eventRects.selectAll("." + $EVENT.eventRect).data([0]).enter().append("rect"); // append event <rect>
13770
14001
 
13771
14002
  $$.updateEventRect(eventRectUpdate); // bind event to <rect> element
13772
14003
 
@@ -13844,7 +14075,7 @@ var Axis_Axis = /*#__PURE__*/function () {
13844
14075
  }).on("touchstart.eventRect touchmove.eventRect", function (event) {
13845
14076
  state.event = event;
13846
14077
 
13847
- if (!eventRect.empty() && eventRect.classed(config_classes.eventRect)) {
14078
+ if (!eventRect.empty() && eventRect.classed($EVENT.eventRect)) {
13848
14079
  // if touch points are > 1, means doing zooming interaction. In this case do not execute tooltip codes.
13849
14080
  if (state.dragging || state.flowing || $$.hasArcType() || event.touches.length > 1) {
13850
14081
  return;
@@ -13858,7 +14089,7 @@ var Axis_Axis = /*#__PURE__*/function () {
13858
14089
  }, !0).on("touchend.eventRect", function (event) {
13859
14090
  state.event = event;
13860
14091
 
13861
- if (!eventRect.empty() && eventRect.classed(config_classes.eventRect)) {
14092
+ if (!eventRect.empty() && eventRect.classed($EVENT.eventRect)) {
13862
14093
  if ($$.hasArcType() || !$$.toggleShape || state.cancelClick) {
13863
14094
  state.cancelClick && (state.cancelClick = !1);
13864
14095
  }
@@ -13900,7 +14131,7 @@ var Axis_Axis = /*#__PURE__*/function () {
13900
14131
  rectElement.attr("x", 0).attr("y", 0).attr("width", width).attr("height", height); // only for init
13901
14132
 
13902
14133
  if (!rendered) {
13903
- rectElement.attr("class", config_classes.eventRect);
14134
+ rectElement.attr("class", $EVENT.eventRect);
13904
14135
  }
13905
14136
  }
13906
14137
 
@@ -14041,7 +14272,7 @@ var Axis_Axis = /*#__PURE__*/function () {
14041
14272
  $$.showGridFocus(selectedData); // Show cursor as pointer if point is close to mouse position
14042
14273
 
14043
14274
  if ($$.isBarType(closest.id) || $$.dist(closest, mouse) < config.point_sensitivity) {
14044
- $$.$el.svg.select("." + config_classes.eventRect).style("cursor", "pointer");
14275
+ $$.$el.svg.select("." + $EVENT.eventRect).style("cursor", "pointer");
14045
14276
 
14046
14277
  if (!state.mouseover) {
14047
14278
  config.data_onover.call($$.api, closest);
@@ -14060,7 +14291,7 @@ var Axis_Axis = /*#__PURE__*/function () {
14060
14291
  _$$$$el2 = $$.$el,
14061
14292
  circle = _$$$$el2.circle,
14062
14293
  tooltip = _$$$$el2.tooltip;
14063
- $$.$el.svg.select("." + config_classes.eventRect).style("cursor", null);
14294
+ $$.$el.svg.select("." + $EVENT.eventRect).style("cursor", null);
14064
14295
  $$.hideGridFocus();
14065
14296
 
14066
14297
  if (tooltip) {
@@ -14076,8 +14307,8 @@ var Axis_Axis = /*#__PURE__*/function () {
14076
14307
  /**
14077
14308
  * Create eventRect for each data on the x-axis.
14078
14309
  * Register touch and drag events.
14079
- * @param {object} eventRectEnter d3.select(CLASS.eventRects) object.
14080
- * @returns {object} d3.select(CLASS.eventRects) object.
14310
+ * @param {object} eventRectEnter d3.select($EVENT.eventRects) object.
14311
+ * @returns {object} d3.select($EVENT.eventRects) object.
14081
14312
  * @private
14082
14313
  */
14083
14314
  generateEventRectsForSingleX: function generateEventRectsForSingleX(eventRectEnter) {
@@ -14169,7 +14400,7 @@ var Axis_Axis = /*#__PURE__*/function () {
14169
14400
  }
14170
14401
 
14171
14402
  var index = d.index;
14172
- main.selectAll("." + config_classes.shape + "-" + index).each(function (d2) {
14403
+ main.selectAll("." + $SHAPE.shape + "-" + index).each(function (d2) {
14173
14404
  if (config.data_selection_grouped || $$.isWithinShape(this, d2)) {
14174
14405
  $$.toggleShape == null ? void 0 : $$.toggleShape(this, d2, index);
14175
14406
  config.data_onclick.bind($$.api)(d2, this);
@@ -14180,7 +14411,7 @@ var Axis_Axis = /*#__PURE__*/function () {
14180
14411
  /**
14181
14412
  * Create an eventRect,
14182
14413
  * Register touch and drag events.
14183
- * @param {object} eventRectEnter d3.select(CLASS.eventRects) object.
14414
+ * @param {object} eventRectEnter d3.select($EVENT.eventRects) object.
14184
14415
  * @private
14185
14416
  */
14186
14417
  generateEventRectsForMultipleXs: function generateEventRectsForMultipleXs(eventRectEnter) {
@@ -14225,7 +14456,7 @@ var Axis_Axis = /*#__PURE__*/function () {
14225
14456
 
14226
14457
 
14227
14458
  if ($$.isBarType(closest.id) || $$.dist(closest, mouse) < config.point_sensitivity) {
14228
- $$.$el.main.selectAll("." + config_classes.shapes + $$.getTargetSelectorSuffix(closest.id)).selectAll("." + config_classes.shape + "-" + closest.index).each(function () {
14459
+ $$.$el.main.selectAll("." + $SHAPE.shapes + $$.getTargetSelectorSuffix(closest.id)).selectAll("." + $SHAPE.shape + "-" + closest.index).each(function () {
14229
14460
  if (config.data_selection_grouped || $$.isWithinShape(this, closest)) {
14230
14461
  $$.toggleShape == null ? void 0 : $$.toggleShape(this, closest, closest.index);
14231
14462
  config.data_onclick.bind($$.api)(closest, this);
@@ -14360,13 +14591,13 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
14360
14591
  var target = [];
14361
14592
 
14362
14593
  for (var i = 0; i < flowLength; i++) {
14363
- target.push("." + config_classes[v] + "-" + i);
14594
+ target.push("." + classes[v] + "-" + i);
14364
14595
  }
14365
14596
 
14366
- svg.selectAll("." + config_classes[v + "s"]) // circles, shapes, texts, eventRects
14597
+ svg.selectAll("." + classes[v + "s"]) // circles, shapes, texts, eventRects
14367
14598
  .selectAll(target).remove();
14368
14599
  });
14369
- svg.select("." + config_classes.xgrid).remove();
14600
+ svg.select("." + classes.xgrid).remove();
14370
14601
  } // draw again for removing flowed elements and reverting attr
14371
14602
 
14372
14603
 
@@ -14659,9 +14890,9 @@ function smoothLines(el, type) {
14659
14890
  $el = $$.$el;
14660
14891
 
14661
14892
  if (config.grid_x_lines.length || config.grid_y_lines.length) {
14662
- $el.gridLines.main = $el.main.insert("g", "." + config_classes.chart + (config.grid_lines_front ? " + *" : "")).attr("clip-path", clip.pathGrid).attr("class", config_classes.grid + " " + config_classes.gridLines);
14663
- $el.gridLines.main.append("g").attr("class", config_classes.xgridLines);
14664
- $el.gridLines.main.append("g").attr("class", config_classes.ygridLines);
14893
+ $el.gridLines.main = $el.main.insert("g", "." + $COMMON.chart + (config.grid_lines_front ? " + *" : "")).attr("clip-path", clip.pathGrid).attr("class", $GRID.grid + " " + $GRID.gridLines);
14894
+ $el.gridLines.main.append("g").attr("class", $GRID.xgridLines);
14895
+ $el.gridLines.main.append("g").attr("class", $GRID.ygridLines);
14665
14896
  $el.gridLines.x = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.selectAll)([]);
14666
14897
  }
14667
14898
  },
@@ -14691,9 +14922,9 @@ function smoothLines(el, type) {
14691
14922
  "y1": 0,
14692
14923
  "y2": state.height
14693
14924
  };
14694
- grid.x = main.select("." + config_classes.xgrids).selectAll("." + config_classes.xgrid).data(xgridData);
14925
+ grid.x = main.select("." + $GRID.xgrids).selectAll("." + $GRID.xgrid).data(xgridData);
14695
14926
  grid.x.exit().remove();
14696
- grid.x = grid.x.enter().append("line").attr("class", config_classes.xgrid).merge(grid.x);
14927
+ grid.x = grid.x.enter().append("line").attr("class", $GRID.xgrid).merge(grid.x);
14697
14928
 
14698
14929
  if (!withoutUpdate) {
14699
14930
  grid.x.each(function () {
@@ -14719,9 +14950,9 @@ function smoothLines(el, type) {
14719
14950
  return Math.ceil($$.scale.y(d));
14720
14951
  };
14721
14952
 
14722
- grid.y = main.select("." + config_classes.ygrids).selectAll("." + config_classes.ygrid).data(gridValues);
14953
+ grid.y = main.select("." + $GRID.ygrids).selectAll("." + $GRID.ygrid).data(gridValues);
14723
14954
  grid.y.exit().remove();
14724
- grid.y = grid.y.enter().append("line").attr("class", config_classes.ygrid).merge(grid.y);
14955
+ grid.y = grid.y.enter().append("line").attr("class", $GRID.ygrid).merge(grid.y);
14725
14956
  grid.y.attr("x1", isRotated ? pos : 0).attr("x2", isRotated ? pos : state.width).attr("y1", isRotated ? 0 : pos).attr("y2", isRotated ? state.height : pos);
14726
14957
  smoothLines(grid.y, "grid");
14727
14958
  },
@@ -14751,7 +14982,7 @@ function smoothLines(el, type) {
14751
14982
  $T = $$.$T,
14752
14983
  isRotated = config.axis_rotated;
14753
14984
  config.grid_x_show && $$.updateXGrid();
14754
- var xLines = main.select("." + config_classes.xgridLines).selectAll("." + config_classes.xgridLine).data(config.grid_x_lines); // exit
14985
+ var xLines = main.select("." + $GRID.xgridLines).selectAll("." + $GRID.xgridLine).data(config.grid_x_lines); // exit
14755
14986
 
14756
14987
  $T(xLines.exit()).style("opacity", "0").remove(); // enter
14757
14988
 
@@ -14760,7 +14991,7 @@ function smoothLines(el, type) {
14760
14991
  xgridLine.append("text").attr("transform", isRotated ? "" : "rotate(-90)").attr("dy", -5).style("opacity", "0");
14761
14992
  xLines = xgridLine.merge(xLines);
14762
14993
  $T(xLines.attr("class", function (d) {
14763
- return (config_classes.xgridLine + " " + (d.class || "")).trim();
14994
+ return ($GRID.xgridLine + " " + (d.class || "")).trim();
14764
14995
  }).select("text").attr("text-anchor", getGridTextAnchor).attr("dx", getGridTextDx)).text(function (d) {
14765
14996
  return d.text;
14766
14997
  }).style("opacity", null);
@@ -14781,7 +15012,7 @@ function smoothLines(el, type) {
14781
15012
  $T = $$.$T,
14782
15013
  isRotated = config.axis_rotated;
14783
15014
  config.grid_y_show && $$.updateYGrid();
14784
- var ygridLines = $el.main.select("." + config_classes.ygridLines).selectAll("." + config_classes.ygridLine).data(config.grid_y_lines); // exit
15015
+ var ygridLines = $el.main.select("." + $GRID.ygridLines).selectAll("." + $GRID.ygridLine).data(config.grid_y_lines); // exit
14785
15016
 
14786
15017
  $T(ygridLines.exit()).style("opacity", "0").remove(); // enter
14787
15018
 
@@ -14792,7 +15023,7 @@ function smoothLines(el, type) {
14792
15023
 
14793
15024
  var yv = $$.yv.bind($$);
14794
15025
  $T(ygridLines.attr("class", function (d) {
14795
- return (config_classes.ygridLine + " " + (d.class || "")).trim();
15026
+ return ($GRID.ygridLine + " " + (d.class || "")).trim();
14796
15027
  }).select("line")).attr("x1", isRotated ? yv : 0).attr("x2", isRotated ? yv : width).attr("y1", isRotated ? 0 : yv).attr("y2", isRotated ? height : yv).style("opacity", null);
14797
15028
  $T(ygridLines.select("text").attr("text-anchor", getGridTextAnchor).attr("dx", getGridTextDx)).attr("dy", -5).attr("x", getGridTextX(isRotated, width, height)).attr("y", yv).text(function (d) {
14798
15029
  return d.text;
@@ -14822,17 +15053,17 @@ function smoothLines(el, type) {
14822
15053
  clip = $$.state.clip,
14823
15054
  $el = $$.$el,
14824
15055
  isFront = config.grid_front,
14825
- className = "." + config_classes[isFront && $el.gridLines.main ? "gridLines" : "chart"] + (isFront ? " + *" : ""),
14826
- grid = $el.main.insert("g", className).attr("clip-path", clip.pathGrid).attr("class", config_classes.grid);
15056
+ className = "." + (isFront && $el.gridLines.main ? $GRID.gridLines : $COMMON.chart) + (isFront ? " + *" : ""),
15057
+ grid = $el.main.insert("g", className).attr("clip-path", clip.pathGrid).attr("class", $GRID.grid);
14827
15058
  $el.grid.main = grid;
14828
- config.grid_x_show && grid.append("g").attr("class", config_classes.xgrids);
14829
- config.grid_y_show && grid.append("g").attr("class", config_classes.ygrids);
15059
+ config.grid_x_show && grid.append("g").attr("class", $GRID.xgrids);
15060
+ config.grid_y_show && grid.append("g").attr("class", $GRID.ygrids);
14830
15061
 
14831
15062
  if (config.interaction_enabled && config.grid_focus_show) {
14832
- grid.append("g").attr("class", config_classes.xgridFocus).append("line").attr("class", config_classes.xgridFocus); // to show xy focus grid line, should be 'tooltip.grouped=false'
15063
+ grid.append("g").attr("class", $FOCUS.xgridFocus).append("line").attr("class", $FOCUS.xgridFocus); // to show xy focus grid line, should be 'tooltip.grouped=false'
14833
15064
 
14834
15065
  if (config.grid_focus_y && !config.tooltip_grouped) {
14835
- grid.append("g").attr("class", config_classes.ygridFocus).append("line").attr("class", config_classes.ygridFocus);
15066
+ grid.append("g").attr("class", $FOCUS.ygridFocus).append("line").attr("class", $FOCUS.ygridFocus);
14836
15067
  }
14837
15068
  }
14838
15069
  },
@@ -14849,7 +15080,7 @@ function smoothLines(el, type) {
14849
15080
  width = _$$$state3.width,
14850
15081
  height = _$$$state3.height,
14851
15082
  isRotated = config.axis_rotated,
14852
- focusEl = $$.$el.main.selectAll("line." + config_classes.xgridFocus + ", line." + config_classes.ygridFocus),
15083
+ focusEl = $$.$el.main.selectAll("line." + $FOCUS.xgridFocus + ", line." + $FOCUS.ygridFocus),
14853
15084
  dataToShow = (data || [focusEl.datum()]).filter(function (d) {
14854
15085
  return d && isValue($$.getBaseValue(d));
14855
15086
  });
@@ -14869,7 +15100,7 @@ function smoothLines(el, type) {
14869
15100
  },
14870
15101
  xy;
14871
15102
 
14872
- if (el.classed(config_classes.xgridFocus)) {
15103
+ if (el.classed($FOCUS.xgridFocus)) {
14873
15104
  // will contain 'x1, y1, x2, y2' order
14874
15105
  xy = isRotated ? [null, // x1
14875
15106
  pos.x, // y1
@@ -14900,7 +15131,7 @@ function smoothLines(el, type) {
14900
15131
  main = $$.$el.main;
14901
15132
 
14902
15133
  if (inputType === "mouse" || !resizing) {
14903
- main.selectAll("line." + config_classes.xgridFocus + ", line." + config_classes.ygridFocus).style("visibility", "hidden");
15134
+ main.selectAll("line." + $FOCUS.xgridFocus + ", line." + $FOCUS.ygridFocus).style("visibility", "hidden");
14904
15135
  $$.hideCircleFocus == null ? void 0 : $$.hideCircleFocus();
14905
15136
  }
14906
15137
  },
@@ -14912,7 +15143,7 @@ function smoothLines(el, type) {
14912
15143
  height = _$$$state5.height,
14913
15144
  resizing = _$$$state5.resizing,
14914
15145
  grid = $$.$el.grid,
14915
- xgridFocus = grid.main.select("line." + config_classes.xgridFocus);
15146
+ xgridFocus = grid.main.select("line." + $FOCUS.xgridFocus);
14916
15147
 
14917
15148
  if (inputType === "touch") {
14918
15149
  if (xgridFocus.empty()) {
@@ -14931,7 +15162,7 @@ function smoothLines(el, type) {
14931
15162
  },
14932
15163
  generateGridData: function generateGridData(type, scale) {
14933
15164
  var $$ = this,
14934
- tickNum = $$.$el.main.select("." + config_classes.axisX).selectAll(".tick").size(),
15165
+ tickNum = $$.$el.main.select("." + $AXIS.axisX).selectAll(".tick").size(),
14935
15166
  gridData = [];
14936
15167
 
14937
15168
  if (type === "year") {
@@ -14976,8 +15207,8 @@ function smoothLines(el, type) {
14976
15207
  config = $$.config,
14977
15208
  $T = $$.$T,
14978
15209
  toRemove = $$.getGridFilterToRemove(params),
14979
- classLines = forX ? config_classes.xgridLines : config_classes.ygridLines,
14980
- classLine = forX ? config_classes.xgridLine : config_classes.ygridLine;
15210
+ classLines = forX ? $GRID.xgridLines : $GRID.ygridLines,
15211
+ classLine = forX ? $GRID.xgridLine : $GRID.ygridLine;
14981
15212
  $T($$.$el.main.select("." + classLines).selectAll("." + classLine).filter(toRemove)).style("opacity", "0").remove();
14982
15213
  var gridLines = "grid_" + (forX ? "x" : "y") + "_lines";
14983
15214
  config[gridLines] = config[gridLines].filter(function toShow(line) {
@@ -14998,7 +15229,7 @@ function smoothLines(el, type) {
14998
15229
  initRegion: function initRegion() {
14999
15230
  var $$ = this,
15000
15231
  $el = $$.$el;
15001
- $el.region.main = $el.main.insert("g", ":first-child").attr("clip-path", $$.state.clip.path).attr("class", config_classes.regions);
15232
+ $el.region.main = $el.main.insert("g", ":first-child").attr("clip-path", $$.state.clip.path).attr("class", $REGION.regions);
15002
15233
  },
15003
15234
  updateRegion: function updateRegion() {
15004
15235
  var $$ = this,
@@ -15013,7 +15244,7 @@ function smoothLines(el, type) {
15013
15244
 
15014
15245
  region.main.style("visibility", $$.hasArcType() ? "hidden" : null); // select <g> element
15015
15246
 
15016
- var list = region.main.selectAll("." + config_classes.region).data(config.regions);
15247
+ var list = region.main.selectAll("." + $REGION.region).data(config.regions);
15017
15248
  $T(list.exit()).style("opacity", "0").remove();
15018
15249
  list = list.enter().append("g").merge(list).attr("class", $$.classRegion.bind($$));
15019
15250
  list.append("rect").style("fill-opacity", "0");
@@ -15530,15 +15761,16 @@ function smoothLines(el, type) {
15530
15761
  axis_x_tick_format: undefined,
15531
15762
 
15532
15763
  /**
15533
- * Setting for culling ticks.<br><br>
15534
- * If true is set, the ticks will be culled, then only limitted tick text will be shown. This option does not hide the tick lines. If false is set, all of ticks will be shown.<br><br>
15535
- * We can change the number of ticks to be shown by axis.x.tick.culling.max.
15764
+ * Setting for culling ticks.
15765
+ * - `true`: the ticks will be culled, then only limited tick text will be shown.<br>
15766
+ * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.x.tick.culling.lines=false`.
15767
+ * - `false`: all of ticks will be shown.<br><br>
15768
+ * The number of ticks to be shown can be chaned by `axis.x.tick.culling.max`.
15536
15769
  * @name axis․x․tick․culling
15537
15770
  * @memberof Options
15538
15771
  * @type {boolean}
15539
15772
  * @default
15540
- * - true for indexed axis and timeseries axis
15541
- * - false for category axis
15773
+ * `true` for indexed axis and timeseries axis, `false` for category axis
15542
15774
  * @example
15543
15775
  * axis: {
15544
15776
  * x: {
@@ -15569,6 +15801,25 @@ function smoothLines(el, type) {
15569
15801
  */
15570
15802
  axis_x_tick_culling_max: 10,
15571
15803
 
15804
+ /**
15805
+ * Control visibility of tick lines within culling option, along with tick text.
15806
+ * @name axis․x․tick․culling․lines
15807
+ * @memberof Options
15808
+ * @type {boolean}
15809
+ * @default true
15810
+ * @example
15811
+ * axis: {
15812
+ * x: {
15813
+ * tick: {
15814
+ * culling: {
15815
+ * lines: false,
15816
+ * }
15817
+ * }
15818
+ * }
15819
+ * }
15820
+ */
15821
+ axis_x_tick_culling_lines: !0,
15822
+
15572
15823
  /**
15573
15824
  * The number of x axis ticks to show.<br><br>
15574
15825
  * This option hides tick lines together with tick text. If this option is used on timeseries axis, the ticks position will be determined precisely and not nicely positioned (e.g. it will have rough second value).
@@ -15652,8 +15903,8 @@ function smoothLines(el, type) {
15652
15903
 
15653
15904
  /**
15654
15905
  * Fit x axis ticks.
15655
- * - **true**: ticks will be positioned nicely to have same intervals.
15656
- * - **false**: ticks will be positioned according to x value of the data points.
15906
+ * - **true**: ticks will be shown according to x value of the data points.
15907
+ * - **false**: ticks will be shown as to have same intervals.
15657
15908
  * @name axis․x․tick․fit
15658
15909
  * @memberof Options
15659
15910
  * @type {boolean}
@@ -16242,9 +16493,11 @@ function smoothLines(el, type) {
16242
16493
  axis_y_tick_format: undefined,
16243
16494
 
16244
16495
  /**
16245
- * Setting for culling ticks.<br><br>
16246
- * If true is set, the ticks will be culled, then only limitted tick text will be shown. This option does not hide the tick lines. If false is set, all of ticks will be shown.<br><br>
16247
- * We can change the number of ticks to be shown by axis.y.tick.culling.max.
16496
+ * Setting for culling ticks.
16497
+ * - `true`: the ticks will be culled, then only limited tick text will be shown.<br>
16498
+ * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.y.tick.culling.lines=false`.
16499
+ * - `false`: all of ticks will be shown.<br><br>
16500
+ * The number of ticks to be shown can be chaned by `axis.y.tick.culling.max`.
16248
16501
  * @name axis․y․tick․culling
16249
16502
  * @memberof Options
16250
16503
  * @type {boolean}
@@ -16279,6 +16532,25 @@ function smoothLines(el, type) {
16279
16532
  */
16280
16533
  axis_y_tick_culling_max: 5,
16281
16534
 
16535
+ /**
16536
+ * Control visibility of tick lines within culling option, along with tick text.
16537
+ * @name axis․y․tick․culling․lines
16538
+ * @memberof Options
16539
+ * @type {boolean}
16540
+ * @default true
16541
+ * @example
16542
+ * axis: {
16543
+ * y: {
16544
+ * tick: {
16545
+ * culling: {
16546
+ * lines: false,
16547
+ * }
16548
+ * }
16549
+ * }
16550
+ * }
16551
+ */
16552
+ axis_y_tick_culling_lines: !0,
16553
+
16282
16554
  /**
16283
16555
  * Show y axis outer tick.
16284
16556
  * @name axis․y․tick․outer
@@ -16722,9 +16994,11 @@ function smoothLines(el, type) {
16722
16994
  axis_y2_tick_format: undefined,
16723
16995
 
16724
16996
  /**
16725
- * Setting for culling ticks.<br><br>
16726
- * If true is set, the ticks will be culled, then only limitted tick text will be shown. This option does not hide the tick lines. If false is set, all of ticks will be shown.<br><br>
16727
- * We can change the number of ticks to be shown by axis.y.tick.culling.max.
16997
+ * Setting for culling ticks.
16998
+ * - `true`: the ticks will be culled, then only limited tick text will be shown.<br>
16999
+ * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.y2.tick.culling.lines=false`.
17000
+ * - `false`: all of ticks will be shown.<br><br>
17001
+ * The number of ticks to be shown can be chaned by `axis.y2.tick.culling.max`.
16728
17002
  * @name axis․y2․tick․culling
16729
17003
  * @memberof Options
16730
17004
  * @type {boolean}
@@ -16759,6 +17033,25 @@ function smoothLines(el, type) {
16759
17033
  */
16760
17034
  axis_y2_tick_culling_max: 5,
16761
17035
 
17036
+ /**
17037
+ * Control visibility of tick lines within culling option, along with tick text.
17038
+ * @name axis․y2․tick․culling․lines
17039
+ * @memberof Options
17040
+ * @type {boolean}
17041
+ * @default true
17042
+ * @example
17043
+ * axis: {
17044
+ * y2: {
17045
+ * tick: {
17046
+ * culling: {
17047
+ * lines: false,
17048
+ * }
17049
+ * }
17050
+ * }
17051
+ * }
17052
+ */
17053
+ axis_y2_tick_culling_lines: !0,
17054
+
16762
17055
  /**
16763
17056
  * Show or hide y2 axis outer tick.
16764
17057
  * @name axis․y2․tick․outer
@@ -17002,9 +17295,9 @@ function smoothLines(el, type) {
17002
17295
  ;// CONCATENATED MODULE: ./src/config/Options/axis/axis.ts
17003
17296
 
17004
17297
 
17005
- function axis_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
17298
+ function axis_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; }
17006
17299
 
17007
- function axis_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { axis_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { axis_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
17300
+ function axis_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? axis_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : axis_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17008
17301
 
17009
17302
  /**
17010
17303
  * Copyright (c) 2017 ~ present NAVER Corp.
@@ -17453,14 +17746,14 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
17453
17746
  var interval = setInterval(function () {
17454
17747
  if (!transiting) {
17455
17748
  clearInterval(interval);
17456
- $el.legend.selectAll("." + config_classes.legendItemFocused).size() > 0 && $$.expandArc(targetIds);
17749
+ $el.legend.selectAll("." + $FOCUS.legendItemFocused).size() > 0 && $$.expandArc(targetIds);
17457
17750
  }
17458
17751
  }, 10);
17459
17752
  return;
17460
17753
  }
17461
17754
 
17462
17755
  var newTargetIds = $$.mapToTargetIds(targetIds);
17463
- $el.svg.selectAll($$.selectorTargets(newTargetIds, "." + config_classes.chartArc)).each(function (d) {
17756
+ $el.svg.selectAll($$.selectorTargets(newTargetIds, "." + $ARC.chartArc)).each(function (d) {
17464
17757
  if (!$$.shouldExpand(d.data.id)) {
17465
17758
  return;
17466
17759
  }
@@ -17480,10 +17773,10 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
17480
17773
  }
17481
17774
 
17482
17775
  var newTargetIds = $$.mapToTargetIds(targetIds);
17483
- svg.selectAll($$.selectorTargets(newTargetIds, "." + config_classes.chartArc)).selectAll("path").transition().duration(function (d) {
17776
+ svg.selectAll($$.selectorTargets(newTargetIds, "." + $ARC.chartArc)).selectAll("path").transition().duration(function (d) {
17484
17777
  return $$.getExpandConfig(d.data.id, "duration");
17485
17778
  }).attr("d", $$.svgArc);
17486
- svg.selectAll("" + config_classes.arc).style("opacity", null);
17779
+ svg.selectAll("" + $ARC.arc).style("opacity", null);
17487
17780
  },
17488
17781
 
17489
17782
  /**
@@ -17548,20 +17841,20 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
17548
17841
  classChartArc = $$.getChartClass("Arc"),
17549
17842
  classArcs = $$.getClass("arcs", !0),
17550
17843
  classFocus = $$.classFocus.bind($$),
17551
- chartArcs = $el.main.select("." + config_classes.chartArcs),
17552
- mainPieUpdate = chartArcs.selectAll("." + config_classes.chartArc).data($$.pie(targets)).attr("class", function (d) {
17844
+ chartArcs = $el.main.select("." + $ARC.chartArcs),
17845
+ mainPieUpdate = chartArcs.selectAll("." + $ARC.chartArc).data($$.pie(targets)).attr("class", function (d) {
17553
17846
  return classChartArc(d) + classFocus(d.data);
17554
17847
  }),
17555
17848
  mainPieEnter = mainPieUpdate.enter().append("g").attr("class", classChartArc);
17556
17849
  mainPieEnter.append("g").attr("class", classArcs).merge(mainPieUpdate);
17557
17850
  mainPieEnter.append("text").attr("dy", hasGauge && !$$.hasMultiTargets() ? "-.1em" : ".35em").style("opacity", "0").style("text-anchor", "middle").style("pointer-events", "none");
17558
- $el.text = chartArcs.selectAll("." + config_classes.target + " text"); // MEMO: can not keep same color..., but not bad to update color in redraw
17851
+ $el.text = chartArcs.selectAll("." + $COMMON.target + " text"); // MEMO: can not keep same color..., but not bad to update color in redraw
17559
17852
  // mainPieUpdate.exit().remove();
17560
17853
  },
17561
17854
  initArc: function initArc() {
17562
17855
  var $$ = this,
17563
17856
  $el = $$.$el;
17564
- $el.arcs = $el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartArcs).attr("transform", $$.getTranslate("arc"));
17857
+ $el.arcs = $el.main.select("." + $COMMON.chart).append("g").attr("class", $ARC.chartArcs).attr("transform", $$.getTranslate("arc"));
17565
17858
  $$.setArcTitle();
17566
17859
  },
17567
17860
 
@@ -17575,7 +17868,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
17575
17868
  hasGauge = $$.hasType("gauge");
17576
17869
 
17577
17870
  if (title) {
17578
- var text = $$.$el.arcs.append("text").attr("class", config_classes[hasGauge ? "chartArcsGaugeTitle" : "chartArcsTitle"]).style("text-anchor", "middle");
17871
+ var text = $$.$el.arcs.append("text").attr("class", hasGauge ? $GAUGE.chartArcsGaugeTitle : $ARC.chartArcsTitle).style("text-anchor", "middle");
17579
17872
  hasGauge && text.attr("dy", "-0.3em");
17580
17873
  setTextValue(text, title, hasGauge ? undefined : [-.6, 1.35], !0);
17581
17874
  }
@@ -17587,7 +17880,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
17587
17880
  main = $$.$el.main,
17588
17881
  hasInteraction = config.interaction_enabled,
17589
17882
  isSelectable = hasInteraction && config.data_selection_isselectable,
17590
- mainArc = main.selectAll("." + config_classes.arcs).selectAll("." + config_classes.arc).data($$.arcData.bind($$));
17883
+ mainArc = main.selectAll("." + $ARC.arcs).selectAll("." + $ARC.arc).data($$.arcData.bind($$));
17591
17884
  mainArc.exit().transition().duration(durationForExit).style("opacity", "0").remove();
17592
17885
  mainArc = mainArc.enter().append("path").attr("class", $$.getClass("arc", !0)).style("fill", function (d) {
17593
17886
  return $$.color(d.data);
@@ -17676,13 +17969,13 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
17676
17969
  isFullCircle = config.gauge_fullCircle,
17677
17970
  startAngle = $$.getStartAngle(),
17678
17971
  endAngle = isFullCircle ? startAngle + $$.getArcLength() : startAngle * -1,
17679
- backgroundArc = $$.$el.arcs.select((hasMultiArcGauge ? "g" : "") + "." + config_classes.chartArcsBackground);
17972
+ backgroundArc = $$.$el.arcs.select((hasMultiArcGauge ? "g" : "") + "." + $ARC.chartArcsBackground);
17680
17973
 
17681
17974
  if (hasMultiArcGauge) {
17682
17975
  var index = 0;
17683
- backgroundArc = backgroundArc.selectAll("path." + config_classes.chartArcsBackground).data($$.data.targets);
17976
+ backgroundArc = backgroundArc.selectAll("path." + $ARC.chartArcsBackground).data($$.data.targets);
17684
17977
  backgroundArc.enter().append("path").attr("class", function (d, i) {
17685
- return config_classes.chartArcsBackground + " " + config_classes.chartArcsBackground + "-" + i;
17978
+ return $ARC.chartArcsBackground + " " + $ARC.chartArcsBackground + "-" + i;
17686
17979
  }).merge(backgroundArc).style("fill", config.gauge_background || null).attr("d", function (_ref2) {
17687
17980
  var id = _ref2.id;
17688
17981
 
@@ -17800,6 +18093,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
17800
18093
  return;
17801
18094
  }
17802
18095
 
18096
+ state.event = event;
17803
18097
  var eventArc = getEventArc(event),
17804
18098
  datum = eventArc.datum(),
17805
18099
  updated = (_datum = datum) != null && _datum.data && datum.data.id ? $$.updateAngle(datum) : null,
@@ -17823,8 +18117,8 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
17823
18117
 
17824
18118
  // for gauge type, update text when has no title & multi data
17825
18119
  if (!(hasGauge && $$.data.targets.length === 1 && config.gauge_title)) {
17826
- text = main.selectAll("." + config_classes.chartArc).select("text").style("opacity", "0").attr("class", function (d) {
17827
- return $$.isGaugeType(d.data) ? config_classes.gaugeValue : null;
18120
+ text = main.selectAll("." + $ARC.chartArc).select("text").style("opacity", "0").attr("class", function (d) {
18121
+ return $$.isGaugeType(d.data) ? $GAUGE.gaugeValue : null;
17828
18122
  }).call($$.textForArcLabel.bind($$)).attr("transform", $$.transformForArcLabel.bind($$)).style("font-size", function (d) {
17829
18123
  return $$.isGaugeType(d.data) && $$.data.targets.length === 1 && !hasMultiArcGauge ? Math.round(state.radius / 5) + "px" : null;
17830
18124
  }).transition().duration(duration).style("opacity", function (d) {
@@ -17833,7 +18127,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
17833
18127
  hasMultiArcGauge && text.attr("dy", "-.1em");
17834
18128
  }
17835
18129
 
17836
- main.select("." + config_classes.chartArcsTitle).style("opacity", $$.hasType("donut") || hasGauge ? null : "0");
18130
+ main.select("." + $ARC.chartArcsTitle).style("opacity", $$.hasType("donut") || hasGauge ? null : "0");
17837
18131
 
17838
18132
  if (hasGauge) {
17839
18133
  var _text,
@@ -17842,10 +18136,10 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
17842
18136
  isFullCircle && ((_text = text) == null ? void 0 : _text.attr("dy", "" + (hasMultiArcGauge ? 0 : Math.round(state.radius / 14))));
17843
18137
 
17844
18138
  if (config.gauge_label_show) {
17845
- arcs.select("." + config_classes.chartArcsGaugeUnit).attr("dy", (isFullCircle ? 1.5 : .75) + "em").text(config.gauge_units);
17846
- arcs.select("." + config_classes.chartArcsGaugeMin).attr("dx", -1 * (state.innerRadius + (state.radius - state.innerRadius) / (isFullCircle ? 1 : 2)) + "px").attr("dy", "1.2em").text($$.textForGaugeMinMax(config.gauge_min, !1)); // show max text when isn't fullCircle
18139
+ arcs.select("." + $GAUGE.chartArcsGaugeUnit).attr("dy", (isFullCircle ? 1.5 : .75) + "em").text(config.gauge_units);
18140
+ arcs.select("." + $GAUGE.chartArcsGaugeMin).attr("dx", -1 * (state.innerRadius + (state.radius - state.innerRadius) / (isFullCircle ? 1 : 2)) + "px").attr("dy", "1.2em").text($$.textForGaugeMinMax(config.gauge_min, !1)); // show max text when isn't fullCircle
17847
18141
 
17848
- isFullCircle || arcs.select("." + config_classes.chartArcsGaugeMax).attr("dx", state.innerRadius + (state.radius - state.innerRadius) / 2 + "px").attr("dy", "1.2em").text($$.textForGaugeMinMax(config.gauge_max, !0));
18142
+ isFullCircle || arcs.select("." + $GAUGE.chartArcsGaugeMax).attr("dx", state.innerRadius + (state.radius - state.innerRadius) / 2 + "px").attr("dy", "1.2em").text($$.textForGaugeMinMax(config.gauge_max, !0));
17849
18143
  }
17850
18144
  }
17851
18145
  }
@@ -17863,7 +18157,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
17863
18157
  initArea: function initArea(mainLine) {
17864
18158
  var $$ = this,
17865
18159
  config = $$.config;
17866
- mainLine.insert("g", "." + config_classes[config.area_front ? "circles" : "lines"]).attr("class", $$.getClass("areas", !0));
18160
+ mainLine.insert("g", "." + (config.area_front ? $CIRCLE.circles : $LINE.lines)).attr("class", $$.getClass("areas", !0));
17867
18161
  },
17868
18162
  updateAreaGradient: function updateAreaGradient() {
17869
18163
  var $$ = this,
@@ -17913,7 +18207,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
17913
18207
  $T = $$.$T,
17914
18208
  $root = isSub ? $el.subchart : $el;
17915
18209
  config.area_linearGradient && $$.updateAreaGradient();
17916
- var area = $root.main.selectAll("." + config_classes.areas).selectAll("." + config_classes.area).data($$.lineData.bind($$));
18210
+ var area = $root.main.selectAll("." + $AREA.areas).selectAll("." + $AREA.area).data($$.lineData.bind($$));
17917
18211
  $T(area.exit(), withTransition).style("opacity", "0").remove();
17918
18212
  $root.area = area.enter().append("path").attr("class", $$.getClass("area", !0)).style("fill", $$.updateAreaColor.bind($$)).style("opacity", function () {
17919
18213
  state.orgAreaOpacity = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).style("opacity");
@@ -18040,8 +18334,8 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
18040
18334
  var $el = this.$el,
18041
18335
  config = this.config,
18042
18336
  clip = this.state.clip;
18043
- $el.bar = $el.main.select("." + config_classes.chart) // should positioned at the beginning of the shape node to not overlap others
18044
- .insert("g", ":first-child").attr("class", config_classes.chartBars); // set clip-path attribute when condition meet
18337
+ $el.bar = $el.main.select("." + $COMMON.chart) // should positioned at the beginning of the shape node to not overlap others
18338
+ .insert("g", ":first-child").attr("class", $BAR.chartBars); // set clip-path attribute when condition meet
18045
18339
  // https://github.com/naver/billboard.js/issues/2421
18046
18340
 
18047
18341
  if (config.clipPath === !1 && (config.bar_radius || config.bar_radius_ratio)) {
@@ -18061,10 +18355,10 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
18061
18355
  $$.initBar();
18062
18356
  }
18063
18357
 
18064
- var mainBarUpdate = $$.$el.main.select("." + config_classes.chartBars).selectAll("." + config_classes.chartBar).data( // remove
18358
+ var mainBarUpdate = $$.$el.main.select("." + $BAR.chartBars).selectAll("." + $BAR.chartBar).data( // remove
18065
18359
  targets.filter(function (v) {
18066
- return !v.values.every(function (d) {
18067
- return !isNumber(d.value);
18360
+ return v.values.some(function (d) {
18361
+ return isNumber(d.value) || $$.isBarRangeType(d);
18068
18362
  });
18069
18363
  })).attr("class", function (d) {
18070
18364
  return classChartBar(d) + classFocus(d);
@@ -18095,14 +18389,14 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
18095
18389
  $root = isSub ? $el.subchart : $el,
18096
18390
  classBar = $$.getClass("bar", !0),
18097
18391
  initialOpacity = $$.initialOpacity.bind($$),
18098
- bar = $root.main.selectAll("." + config_classes.bars).selectAll("." + config_classes.bar).data($$.labelishData.bind($$));
18392
+ bar = $root.main.selectAll("." + $BAR.bars).selectAll("." + $BAR.bar).data($$.labelishData.bind($$));
18099
18393
  $T(bar.exit(), withTransition).style("opacity", "0").remove();
18100
18394
  $root.bar = bar.enter().append("path").attr("class", classBar).style("fill", $$.color).merge(bar).style("opacity", initialOpacity);
18101
18395
  },
18102
18396
 
18103
18397
  /**
18104
18398
  * Redraw function
18105
- * @param {Function} drawFn Retuned functino from .generateDrawCandlestick()
18399
+ * @param {Function} drawFn Retuned function from .getDrawShape() => .generateDrawBar()
18106
18400
  * @param {boolean} withTransition With or without transition
18107
18401
  * @param {boolean} isSub Subchart draw
18108
18402
  * @returns {Array}
@@ -18117,15 +18411,35 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
18117
18411
  bar = _ref.bar;
18118
18412
 
18119
18413
  return [$$.$T(bar, withTransition, getRandom()).attr("d", function (d) {
18120
- return isNumber(d.value) && drawFn(d);
18414
+ return (isNumber(d.value) || $$.isBarRangeType(d)) && drawFn(d);
18121
18415
  }).style("fill", this.color).style("opacity", null)];
18122
18416
  },
18417
+
18418
+ /**
18419
+ * Generate draw function
18420
+ * @param {object} barIndices data order within x axis.
18421
+ * barIndices ==> {data1: 0, data2: 0, data3: 1, data4: 1, __max__: 1}
18422
+ *
18423
+ * When gropus given as:
18424
+ * groups: [
18425
+ * ["data1", "data2"],
18426
+ * ["data3", "data4"]
18427
+ * ],
18428
+ *
18429
+ * Will be rendered as:
18430
+ * data1 data3 data1 data3
18431
+ * data2 data4 data2 data4
18432
+ * -------------------------
18433
+ * 0 1
18434
+ * @param {boolean} isSub If is for subchart
18435
+ * @returns {Function}
18436
+ * @private
18437
+ */
18123
18438
  generateDrawBar: function generateDrawBar(barIndices, isSub) {
18124
18439
  var $$ = this,
18125
18440
  config = $$.config,
18126
18441
  getPoints = $$.generateGetBarPoints(barIndices, isSub),
18127
18442
  isRotated = config.axis_rotated,
18128
- isGrouped = config.data_groups.length,
18129
18443
  barRadius = config.bar_radius,
18130
18444
  barRadiusRatio = config.bar_radius_ratio,
18131
18445
  getRadius = isNumber(barRadius) && barRadius > 0 ? function () {
@@ -18140,9 +18454,12 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
18140
18454
  indexY = +!indexX,
18141
18455
  isNegative = d.value < 0,
18142
18456
  pathRadius = ["", ""],
18143
- radius = 0; // switch points if axis is rotated, not applicable for sub chart
18457
+ radius = 0,
18458
+ isGrouped = $$.isGrouped(d.id),
18459
+ hasRadius = d.value !== 0 && getRadius,
18460
+ isRadiusData = hasRadius && isGrouped ? $$.isStackingRadiusData(d) : !1; // switch points if axis is rotated, not applicable for sub chart
18144
18461
 
18145
- if (d.value !== 0 && getRadius && !isGrouped) {
18462
+ if (hasRadius && (!isGrouped || isRadiusData)) {
18146
18463
  var index = isRotated ? indexY : indexX,
18147
18464
  barW = points[2][index] - points[0][index];
18148
18465
  radius = getRadius(barW);
@@ -18158,6 +18475,43 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
18158
18475
  return "M" + points[0][indexX] + "," + points[0][indexY] + path + "z";
18159
18476
  };
18160
18477
  },
18478
+
18479
+ /**
18480
+ * Determine if given stacking bar data is radius type
18481
+ * @param {Object} d Data row
18482
+ * @returns {boolean}
18483
+ */
18484
+ isStackingRadiusData: function isStackingRadiusData(d) {
18485
+ var $$ = this,
18486
+ config = $$.config,
18487
+ data = $$.data,
18488
+ id = d.id,
18489
+ index = d.index,
18490
+ value = d.value,
18491
+ keys = config.data_groups.find(function (v) {
18492
+ return v.indexOf(id) > -1;
18493
+ }),
18494
+ sortedList = $$.orderTargets($$.filterTargetsToShow(data.targets.filter($$.isBarType, $$))).filter(function (v) {
18495
+ return keys.indexOf(v.id) > -1;
18496
+ }),
18497
+ sortedIds = sortedList.map(function (v) {
18498
+ return v.values.filter(function (v2) {
18499
+ return v2.index === index && (value > 0 ? v2.value > 0 : v2.value < 0);
18500
+ })[0];
18501
+ }).filter(Boolean).map(function (v) {
18502
+ return v.id;
18503
+ });
18504
+ // If the given id stays in the last position, then radius should be applied.
18505
+ return value !== 0 && sortedIds.indexOf(id) === sortedIds.length - 1;
18506
+ },
18507
+
18508
+ /**
18509
+ * Generate bar coordinate points data
18510
+ * @param {object} barIndices Data order within x axis.
18511
+ * @param {boolean} isSub If is for subchart
18512
+ * @returns {Array} Array of coordinate points
18513
+ * @private
18514
+ */
18161
18515
  generateGetBarPoints: function generateGetBarPoints(barIndices, isSub) {
18162
18516
  var $$ = this,
18163
18517
  config = $$.config,
@@ -18180,35 +18534,22 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
18180
18534
  posY = y0;
18181
18535
  }
18182
18536
 
18183
- posY -= y0 - offset;
18537
+ if (!$$.isBarRangeType(d)) {
18538
+ posY -= y0 - offset;
18539
+ }
18540
+
18184
18541
  var startPosX = posX + width; // 4 points that make a bar
18185
18542
 
18186
18543
  return [[posX, offset], [posX, posY], [startPosX, posY], [startPosX, offset]];
18187
18544
  };
18188
- },
18189
- isWithinBar: function isWithinBar(that) {
18190
- var mouse = getPointer(this.state.event, that),
18191
- list = getRectSegList(that),
18192
- _list = list,
18193
- seg0 = _list[0],
18194
- seg1 = _list[1],
18195
- x = Math.min(seg0.x, seg1.x),
18196
- y = Math.min(seg0.y, seg1.y),
18197
- offset = this.config.bar_sensitivity,
18198
- _that$getBBox = that.getBBox(),
18199
- width = _that$getBBox.width,
18200
- height = _that$getBBox.height,
18201
- isWithin = x - offset < mouse[0] && mouse[0] < x + width + offset && y - offset < mouse[1] && mouse[1] < y + height + offset;
18202
-
18203
- return isWithin;
18204
18545
  }
18205
18546
  });
18206
18547
  ;// CONCATENATED MODULE: ./src/ChartInternal/shape/candlestick.ts
18207
18548
 
18208
18549
 
18209
- function candlestick_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
18550
+ function candlestick_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; }
18210
18551
 
18211
- function candlestick_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { candlestick_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { candlestick_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
18552
+ function candlestick_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? candlestick_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : candlestick_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18212
18553
 
18213
18554
  /**
18214
18555
  * Copyright (c) 2017 ~ present NAVER Corp.
@@ -18220,8 +18561,8 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
18220
18561
  /* harmony default export */ var candlestick = ({
18221
18562
  initCandlestick: function initCandlestick() {
18222
18563
  var $el = this.$el;
18223
- $el.candlestick = $el.main.select("." + config_classes.chart) // should positioned at the beginning of the shape node to not overlap others
18224
- .append("g").attr("class", config_classes.chartCandlesticks);
18564
+ $el.candlestick = $el.main.select("." + $COMMON.chart) // should positioned at the beginning of the shape node to not overlap others
18565
+ .append("g").attr("class", $CANDLESTICK.chartCandlesticks);
18225
18566
  },
18226
18567
 
18227
18568
  /**
@@ -18240,7 +18581,7 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
18240
18581
  $$.initCandlestick();
18241
18582
  }
18242
18583
 
18243
- var mainUpdate = $$.$el.main.select("." + config_classes.chartCandlesticks).selectAll("." + config_classes.chartCandlestick).data(targets).attr("class", function (d) {
18584
+ var mainUpdate = $$.$el.main.select("." + $CANDLESTICK.chartCandlesticks).selectAll("." + $CANDLESTICK.chartCandlestick).data(targets).attr("class", function (d) {
18244
18585
  return classChart(d) + classFocus(d);
18245
18586
  });
18246
18587
  mainUpdate.enter().append("g").attr("class", classChart).style("pointer-events", "none");
@@ -18263,7 +18604,7 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
18263
18604
  $root = isSub ? $el.subchart : $el,
18264
18605
  classSetter = $$.getClass("candlestick", !0),
18265
18606
  initialOpacity = $$.initialOpacity.bind($$),
18266
- candlestick = $root.main.selectAll("." + config_classes.chartCandlestick).selectAll("." + config_classes.candlestick).data($$.labelishData.bind($$));
18607
+ candlestick = $root.main.selectAll("." + $CANDLESTICK.chartCandlestick).selectAll("." + $CANDLESTICK.candlestick).data($$.labelishData.bind($$));
18267
18608
  $T(candlestick.exit(), withTransition).style("opacity", "0").remove();
18268
18609
  var candlestickEnter = candlestick.enter().filter(function (d) {
18269
18610
  return d.value;
@@ -18299,7 +18640,7 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
18299
18640
  indexX = +isRotated;
18300
18641
 
18301
18642
  if (g.classed) {
18302
- g.classed(config_classes[isUp ? "valueUp" : "valueDown"], !0);
18643
+ g.classed($CANDLESTICK[isUp ? "valueUp" : "valueDown"], !0);
18303
18644
  }
18304
18645
 
18305
18646
  var path = isRotated ? "H" + points[1][1] + " V" + points[1][0] + " H" + points[0][1] : "V" + points[1][1] + " H" + points[1][0] + " V" + points[0][1];
@@ -18468,12 +18809,12 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
18468
18809
 
18469
18810
  if ($$.hasType("gauge")) {
18470
18811
  var hasMulti = $$.hasMultiArcGauge();
18471
- arcs.append(hasMulti ? "g" : "path").attr("class", config_classes.chartArcsBackground).style("fill", !hasMulti && config.gauge_background || null);
18472
- config.gauge_units && appendText(config_classes.chartArcsGaugeUnit);
18812
+ arcs.append(hasMulti ? "g" : "path").attr("class", $ARC.chartArcsBackground).style("fill", !hasMulti && config.gauge_background || null);
18813
+ config.gauge_units && appendText($GAUGE.chartArcsGaugeUnit);
18473
18814
 
18474
18815
  if (config.gauge_label_show) {
18475
- appendText(config_classes.chartArcsGaugeMin);
18476
- config.gauge_fullCircle || appendText(config_classes.chartArcsGaugeMax);
18816
+ appendText($GAUGE.chartArcsGaugeMin);
18817
+ config.gauge_fullCircle || appendText($GAUGE.chartArcsGaugeMax);
18477
18818
  }
18478
18819
  }
18479
18820
  },
@@ -18495,9 +18836,9 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
18495
18836
  state = $$.state,
18496
18837
  $el = $$.$el,
18497
18838
  hiddenTargetIds = $$.state.hiddenTargetIds,
18498
- arcLabelLines = $el.main.selectAll("." + config_classes.arcs).selectAll("." + config_classes.arcLabelLine).data($$.arcData.bind($$)),
18839
+ arcLabelLines = $el.main.selectAll("." + $ARC.arcs).selectAll("." + $ARC.arcLabelLine).data($$.arcData.bind($$)),
18499
18840
  mainArcLabelLine = arcLabelLines.enter().append("rect").attr("class", function (d) {
18500
- return config_classes.arcLabelLine + " " + config_classes.target + " " + config_classes.target + "-" + d.data.id;
18841
+ return $ARC.arcLabelLine + " " + $COMMON.target + " " + $COMMON.target + "-" + d.data.id;
18501
18842
  }).merge(arcLabelLines);
18502
18843
  mainArcLabelLine.style("fill", function (d) {
18503
18844
  return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data);
@@ -18628,7 +18969,7 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
18628
18969
  /* harmony default export */ var line = ({
18629
18970
  initLine: function initLine() {
18630
18971
  var $el = this.$el;
18631
- $el.line = $el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartLines);
18972
+ $el.line = $el.main.select("." + $COMMON.chart).append("g").attr("class", $LINE.chartLines);
18632
18973
  },
18633
18974
  updateTargetsForLine: function updateTargetsForLine(t) {
18634
18975
  var $$ = this,
@@ -18647,7 +18988,7 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
18647
18988
  var targets = t.filter(function (d) {
18648
18989
  return !($$.isScatterType(d) || $$.isBubbleType(d));
18649
18990
  }),
18650
- mainLineUpdate = main.select("." + config_classes.chartLines).selectAll("." + config_classes.chartLine).data(targets).attr("class", function (d) {
18991
+ mainLineUpdate = main.select("." + $LINE.chartLines).selectAll("." + $LINE.chartLine).data(targets).attr("class", function (d) {
18651
18992
  return classChartLine(d) + classFocus(d);
18652
18993
  }),
18653
18994
  mainLineEnter = mainLineUpdate.enter().append("g").attr("class", classChartLine).style("opacity", "0").style("pointer-events", "none");
@@ -18677,7 +19018,7 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
18677
19018
  $el = $$.$el,
18678
19019
  $T = $$.$T,
18679
19020
  $root = isSub ? $el.subchart : $el,
18680
- line = $root.main.selectAll("." + config_classes.lines).selectAll("." + config_classes.line).data($$.lineData.bind($$));
19021
+ line = $root.main.selectAll("." + $LINE.lines).selectAll("." + $LINE.line).data($$.lineData.bind($$));
18681
19022
  $T(line.exit(), withTransition).style("opacity", "0").remove();
18682
19023
  $root.line = line.enter().append("path").attr("class", function (d) {
18683
19024
  return $$.getClass("line", !0)(d) + " " + (extraLineClasses(d) || "");
@@ -18969,8 +19310,8 @@ var getTransitionName = function () {
18969
19310
  main = $$.$el.main;
18970
19311
  $$.point = $$.generatePoint();
18971
19312
 
18972
- if (($$.hasType("bubble") || $$.hasType("scatter")) && main.select("." + config_classes.chartCircles).empty()) {
18973
- main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartCircles);
19313
+ if (($$.hasType("bubble") || $$.hasType("scatter")) && main.select("." + $CIRCLE.chartCircles).empty()) {
19314
+ main.select("." + $COMMON.chart).append("g").attr("class", $CIRCLE.chartCircles);
18974
19315
  }
18975
19316
  },
18976
19317
  updateTargetForCircle: function updateTargetForCircle(targetsValue, enterNodeValue) {
@@ -18996,21 +19337,21 @@ var getTransitionName = function () {
18996
19337
  targets = data.targets.filter(function (d) {
18997
19338
  return _this.isScatterType(d) || _this.isBubbleType(d);
18998
19339
  });
18999
- var mainCircle = $el.main.select("." + config_classes.chartCircles).style("pointer-events", "none").selectAll("." + config_classes.circles).data(targets).attr("class", classCircles);
19340
+ var mainCircle = $el.main.select("." + $CIRCLE.chartCircles).style("pointer-events", "none").selectAll("." + $CIRCLE.circles).data(targets).attr("class", classCircles);
19000
19341
  mainCircle.exit().remove();
19001
19342
  enterNode = mainCircle.enter();
19002
19343
  } // Circles for each data point on lines
19003
19344
 
19004
19345
 
19005
19346
  selectionEnabled && enterNode.append("g").attr("class", function (d) {
19006
- return $$.generateClass(config_classes.selectedCircles, d.id);
19347
+ return $$.generateClass($SELECT.selectedCircles, d.id);
19007
19348
  });
19008
19349
  enterNode.append("g").attr("class", classCircles).style("cursor", function (d) {
19009
19350
  return isFunction(isSelectable) && isSelectable(d) ? "pointer" : null;
19010
19351
  }); // Update date for selected circles
19011
19352
 
19012
19353
  selectionEnabled && targets.forEach(function (t) {
19013
- $el.main.selectAll("." + config_classes.selectedCircles + $$.getTargetSelectorSuffix(t.id)).selectAll("" + config_classes.selectedCircle).each(function (d) {
19354
+ $el.main.selectAll("." + $SELECT.selectedCircles + $$.getTargetSelectorSuffix(t.id)).selectAll("" + $SELECT.selectedCircle).each(function (d) {
19014
19355
  d.value = t.values[d.index].value;
19015
19356
  });
19016
19357
  });
@@ -19028,12 +19369,12 @@ var getTransitionName = function () {
19028
19369
  $root = isSub ? $el.subchart : $el;
19029
19370
 
19030
19371
  if (config.point_show && !state.toggling) {
19031
- var circles = $root.main.selectAll("." + config_classes.circles).selectAll("." + config_classes.circle).data(function (d) {
19372
+ var circles = $root.main.selectAll("." + $CIRCLE.circles).selectAll("." + $CIRCLE.circle).data(function (d) {
19032
19373
  return $$.isLineType(d) && $$.shouldDrawPointsForLine(d) || $$.isBubbleType(d) || $$.isRadarType(d) || $$.isScatterType(d) ? focusOnly ? [d.values[0]] : d.values : [];
19033
19374
  });
19034
19375
  circles.exit().remove();
19035
19376
  circles.enter().filter(Boolean).append($$.point("create", this, $$.pointR.bind($$), $$.color));
19036
- $root.circle = $root.main.selectAll("." + config_classes.circles + " ." + config_classes.circle).style("stroke", $$.color).style("opacity", $$.initialOpacityForCircle.bind($$));
19377
+ $root.circle = $root.main.selectAll("." + $CIRCLE.circles + " ." + $CIRCLE.circle).style("stroke", $$.color).style("opacity", $$.initialOpacityForCircle.bind($$));
19037
19378
  }
19038
19379
  },
19039
19380
  redrawCircle: function redrawCircle(cx, cy, withTransition, flow, isSub) {
@@ -19046,7 +19387,7 @@ var getTransitionName = function () {
19046
19387
  $el = $$.$el,
19047
19388
  $T = $$.$T,
19048
19389
  $root = isSub ? $el.subchart : $el,
19049
- selectedCircles = $root.main.selectAll("." + config_classes.selectedCircle);
19390
+ selectedCircles = $root.main.selectAll("." + $SELECT.selectedCircle);
19050
19391
 
19051
19392
  if (!$$.config.point_show) {
19052
19393
  return [];
@@ -19146,7 +19487,7 @@ var getTransitionName = function () {
19146
19487
  var $$ = this,
19147
19488
  r = $$.pointExpandedR.bind($$);
19148
19489
  reset && $$.unexpandCircles();
19149
- var circles = $$.getShapeByIndex("circle", i, id).classed(config_classes.EXPANDED, !0),
19490
+ var circles = $$.getShapeByIndex("circle", i, id).classed($COMMON.EXPANDED, !0),
19150
19491
  scale = r(circles) / $$.config.point_r,
19151
19492
  ratio = 1 - scale;
19152
19493
 
@@ -19175,8 +19516,8 @@ var getTransitionName = function () {
19175
19516
  var $$ = this,
19176
19517
  r = $$.pointR.bind($$),
19177
19518
  circles = $$.getShapeByIndex("circle", i).filter(function () {
19178
- return (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed(config_classes.EXPANDED);
19179
- }).classed(config_classes.EXPANDED, !1);
19519
+ return (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed($COMMON.EXPANDED);
19520
+ }).classed($COMMON.EXPANDED, !1);
19180
19521
  circles.attr("r", r);
19181
19522
  $$.isCirclePoint() || circles.attr("transform", "scale(" + r(circles) / $$.config.point_r + ")");
19182
19523
  },
@@ -19268,8 +19609,8 @@ var getTransitionName = function () {
19268
19609
  pointClass = d === !0 ? circle.each(function (d) {
19269
19610
  var className = $$.getClass("circle", !0)(d);
19270
19611
 
19271
- if (this.getAttribute("class").indexOf(config_classes.EXPANDED) > -1) {
19272
- className += " " + config_classes.EXPANDED;
19612
+ if (this.getAttribute("class").indexOf($COMMON.EXPANDED) > -1) {
19613
+ className += " " + $COMMON.EXPANDED;
19273
19614
  }
19274
19615
 
19275
19616
  this.setAttribute("class", className);
@@ -19462,13 +19803,13 @@ var cacheKey = KEY.radarPoints;
19462
19803
  $el = $$.$el;
19463
19804
 
19464
19805
  if ($$.hasType("radar")) {
19465
- $el.radar = $el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartRadars); // level
19806
+ $el.radar = $el.main.select("." + $COMMON.chart).append("g").attr("class", $RADAR.chartRadars); // level
19466
19807
 
19467
- $el.radar.levels = $el.radar.append("g").attr("class", config_classes.levels); // axis
19808
+ $el.radar.levels = $el.radar.append("g").attr("class", $RADAR.levels); // axis
19468
19809
 
19469
- $el.radar.axes = $el.radar.append("g").attr("class", config_classes.axis); // shapes
19810
+ $el.radar.axes = $el.radar.append("g").attr("class", $AXIS.axis); // shapes
19470
19811
 
19471
- $el.radar.shapes = $el.radar.append("g").attr("class", config_classes.shapes);
19812
+ $el.radar.shapes = $el.radar.append("g").attr("class", $SHAPE.shapes);
19472
19813
  current.dataMax = config.radar_axis_max || $$.getMinMaxData().max[0].value;
19473
19814
  }
19474
19815
  },
@@ -19546,7 +19887,7 @@ var cacheKey = KEY.radarPoints;
19546
19887
  // Adjust radar, circles and texts' position
19547
19888
  if (translate) {
19548
19889
  radar.attr("transform", translate);
19549
- main.select("." + config_classes.chartTexts).attr("transform", translate);
19890
+ main.select("." + $TEXT.chartTexts).attr("transform", translate);
19550
19891
  $$.generateRadarPoints();
19551
19892
  $$.updateRadarLevel();
19552
19893
  $$.updateRadarAxes();
@@ -19585,11 +19926,11 @@ var cacheKey = KEY.radarPoints;
19585
19926
  });
19586
19927
  return pos.join(" ");
19587
19928
  }),
19588
- level = radarLevels.selectAll("." + config_classes.level).data(levelData);
19929
+ level = radarLevels.selectAll("." + $RADAR.level).data(levelData);
19589
19930
 
19590
19931
  level.exit().remove();
19591
19932
  var levelEnter = level.enter().append("g").attr("class", function (d, i) {
19592
- return config_classes.level + " " + config_classes.level + "-" + i;
19933
+ return $RADAR.level + " " + $RADAR.level + "-" + i;
19593
19934
  });
19594
19935
  levelEnter.append("polygon").style("visibility", config.radar_level_show ? null : "hidden");
19595
19936
 
@@ -19631,7 +19972,7 @@ var cacheKey = KEY.radarPoints;
19631
19972
 
19632
19973
  axis.exit().remove();
19633
19974
  var axisEnter = axis.enter().append("g").attr("class", function (d, i) {
19634
- return config_classes.axis + "-" + i;
19975
+ return $AXIS.axis + "-" + i;
19635
19976
  });
19636
19977
  config.radar_axis_line_show && axisEnter.append("line");
19637
19978
  config.radar_axis_text_show && axisEnter.append("text");
@@ -19717,6 +20058,7 @@ var cacheKey = KEY.radarPoints;
19717
20058
  return d && Object.keys(d).length === 1 ? d.index : undefined;
19718
20059
  },
19719
20060
  hide = function (event) {
20061
+ state.event = event;
19720
20062
  var index = getIndex(event),
19721
20063
  noIndex = isUndefined(index);
19722
20064
 
@@ -19968,10 +20310,10 @@ var cacheKey = KEY.radarPoints;
19968
20310
  * @memberof Options
19969
20311
  * @type {object}
19970
20312
  * @property {object} bar Bar object
20313
+ * @property {number} [bar.indices.removeNull=false] Remove nullish data on bar indices positions.
19971
20314
  * @property {number} [bar.label.threshold=0] Set threshold ratio to show/hide labels.
19972
20315
  * @property {number} [bar.padding=0] The padding pixel value between each bar.
19973
20316
  * @property {number} [bar.radius] Set the radius of bar edge in pixel.
19974
- * - **NOTE:** Works only for non-stacked bar
19975
20317
  * @property {number} [bar.radius.ratio] Set the radius ratio of bar edge in relative the bar's width.
19976
20318
  * @property {number} [bar.sensitivity=2] The senstivity offset value for interaction boundary.
19977
20319
  * @property {number} [bar.width] Change the width of bar chart.
@@ -19984,15 +20326,21 @@ var cacheKey = KEY.radarPoints;
19984
20326
  * @property {number} [bar.width.dataname.ratio=0.6] Change the width of bar chart by ratio.
19985
20327
  * @property {number} [bar.width.dataname.max] The maximum width value for ratio.
19986
20328
  * @property {boolean} [bar.zerobased=true] Set if min or max value will be 0 on bar chart.
20329
+ * @see [Demo: bar indices](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarIndices)
19987
20330
  * @see [Demo: bar padding](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarPadding)
19988
20331
  * @see [Demo: bar radius](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarRadius)
19989
20332
  * @see [Demo: bar width](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarWidth)
19990
20333
  * @see [Demo: bar width variant](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarWidthVariant)
19991
20334
  * @example
19992
20335
  * bar: {
20336
+ * // remove nullish data on bar indices postions
20337
+ * indices: {
20338
+ * removeNull: true
20339
+ * },
20340
+ *
19993
20341
  * padding: 1,
19994
20342
  *
19995
- * // the 'radius' option can be used only for non-stacking bars
20343
+ * // bar radius
19996
20344
  * radius: 10,
19997
20345
  * // or
19998
20346
  * radius: {
@@ -20029,6 +20377,7 @@ var cacheKey = KEY.radarPoints;
20029
20377
  * }
20030
20378
  */
20031
20379
  bar_label_threshold: 0,
20380
+ bar_indices_removeNull: !1,
20032
20381
  bar_padding: 0,
20033
20382
  bar_radius: undefined,
20034
20383
  bar_radius_ratio: undefined,
@@ -20849,8 +21198,8 @@ var _area = function area() {
20849
21198
  selected: function selected(targetId) {
20850
21199
  var $$ = this.internal,
20851
21200
  dataPoint = [];
20852
- $$.$el.main.selectAll("." + (config_classes.shapes + $$.getTargetSelectorSuffix(targetId))).selectAll("." + config_classes.shape).filter(function () {
20853
- return (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed(config_classes.SELECTED);
21201
+ $$.$el.main.selectAll("." + ($SHAPE.shapes + $$.getTargetSelectorSuffix(targetId))).selectAll("." + $SHAPE.shape).filter(function () {
21202
+ return (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed($SELECT.SELECTED);
20854
21203
  }).each(function (d) {
20855
21204
  return dataPoint.push(d);
20856
21205
  });
@@ -20890,25 +21239,25 @@ var _area = function area() {
20890
21239
  return;
20891
21240
  }
20892
21241
 
20893
- $el.main.selectAll("." + config_classes.shapes).selectAll("." + config_classes.shape).each(function (d, i) {
21242
+ $el.main.selectAll("." + $SHAPE.shapes).selectAll("." + $SHAPE.shape).each(function (d, i) {
20894
21243
  var shape = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
20895
21244
  id = d.data ? d.data.id : d.id,
20896
21245
  toggle = $$.getToggle(this, d).bind($$),
20897
21246
  isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
20898
21247
  isTargetIndex = !indices || indices.indexOf(i) >= 0,
20899
- isSelected = shape.classed(config_classes.SELECTED);
21248
+ isSelected = shape.classed($SELECT.SELECTED);
20900
21249
 
20901
21250
  // line/area selection not supported yet
20902
- if (shape.classed(config_classes.line) || shape.classed(config_classes.area)) {
21251
+ if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
20903
21252
  return;
20904
21253
  }
20905
21254
 
20906
21255
  if (isTargetId && isTargetIndex) {
20907
21256
  if (config.data_selection_isselectable.bind($$.api)(d) && !isSelected) {
20908
- toggle(!0, shape.classed(config_classes.SELECTED, !0), d, i);
21257
+ toggle(!0, shape.classed($SELECT.SELECTED, !0), d, i);
20909
21258
  }
20910
21259
  } else if (isDefined(resetOther) && resetOther && isSelected) {
20911
- toggle(!1, shape.classed(config_classes.SELECTED, !1), d, i);
21260
+ toggle(!1, shape.classed($SELECT.SELECTED, !1), d, i);
20912
21261
  }
20913
21262
  });
20914
21263
  },
@@ -20939,21 +21288,21 @@ var _area = function area() {
20939
21288
  return;
20940
21289
  }
20941
21290
 
20942
- $el.main.selectAll("." + config_classes.shapes).selectAll("." + config_classes.shape).each(function (d, i) {
21291
+ $el.main.selectAll("." + $SHAPE.shapes).selectAll("." + $SHAPE.shape).each(function (d, i) {
20943
21292
  var shape = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
20944
21293
  id = d.data ? d.data.id : d.id,
20945
21294
  toggle = $$.getToggle(this, d).bind($$),
20946
21295
  isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
20947
21296
  isTargetIndex = !indices || indices.indexOf(i) >= 0,
20948
- isSelected = shape.classed(config_classes.SELECTED);
21297
+ isSelected = shape.classed($SELECT.SELECTED);
20949
21298
 
20950
21299
  // line/area selection not supported yet
20951
- if (shape.classed(config_classes.line) || shape.classed(config_classes.area)) {
21300
+ if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
20952
21301
  return;
20953
21302
  }
20954
21303
 
20955
21304
  if (isTargetId && isTargetIndex && config.data_selection_isselectable.bind($$.api)(d) && isSelected) {
20956
- toggle(!1, shape.classed(config_classes.SELECTED, !1), d, i);
21305
+ toggle(!1, shape.classed($SELECT.SELECTED, !1), d, i);
20957
21306
  }
20958
21307
  });
20959
21308
  }
@@ -21000,12 +21349,12 @@ var _area = function area() {
21000
21349
  $$.unbindZoomEvent();
21001
21350
  config.subchart_show = !show;
21002
21351
  subchart.main || $$.initSubchart();
21003
- var $target = subchart.main.selectAll("." + config_classes.target); // need to cover when new data has been loaded
21352
+ var $target = subchart.main.selectAll("." + $COMMON.target); // need to cover when new data has been loaded
21004
21353
 
21005
21354
  if ($$.data.targets.length !== $target.size()) {
21006
21355
  $$.updateSizes();
21007
21356
  $$.updateTargetsForSubchart($$.data.targets);
21008
- $target = subchart.main.selectAll("." + config_classes.target);
21357
+ $target = subchart.main.selectAll("." + $COMMON.target);
21009
21358
  }
21010
21359
 
21011
21360
  $target.style("opacity", null);
@@ -21345,25 +21694,25 @@ extend(zoom, {
21345
21694
  minY = isSelectionGrouped ? state.margin.top : Math.min(sy, my),
21346
21695
  maxY = isSelectionGrouped ? state.height : Math.max(sy, my);
21347
21696
 
21348
- main.select("." + config_classes.dragarea).attr("x", minX).attr("y", minY).attr("width", maxX - minX).attr("height", maxY - minY); // TODO: binary search when multiple xs
21697
+ main.select("." + $DRAG.dragarea).attr("x", minX).attr("y", minY).attr("width", maxX - minX).attr("height", maxY - minY); // TODO: binary search when multiple xs
21349
21698
 
21350
- main.selectAll("." + config_classes.shapes).selectAll("." + config_classes.shape).filter(function (d) {
21699
+ main.selectAll("." + $SHAPE.shapes).selectAll("." + $SHAPE.shape).filter(function (d) {
21351
21700
  var _isSelectable;
21352
21701
 
21353
21702
  return (_isSelectable = isSelectable) == null ? void 0 : _isSelectable.bind($$.api)(d);
21354
21703
  }).each(function (d, i) {
21355
21704
  var shape = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
21356
- isSelected = shape.classed(config_classes.SELECTED),
21357
- isIncluded = shape.classed(config_classes.INCLUDED),
21705
+ isSelected = shape.classed($SELECT.SELECTED),
21706
+ isIncluded = shape.classed($DRAG.INCLUDED),
21358
21707
  isWithin = !1,
21359
21708
  toggle;
21360
21709
 
21361
- if (shape.classed(config_classes.circle)) {
21710
+ if (shape.classed($CIRCLE.circle)) {
21362
21711
  var x = +shape.attr("cx") * 1,
21363
21712
  y = +shape.attr("cy") * 1;
21364
21713
  toggle = $$.togglePoint;
21365
21714
  isWithin = minX < x && x < maxX && minY < y && y < maxY;
21366
- } else if (shape.classed(config_classes.bar)) {
21715
+ } else if (shape.classed($BAR.bar)) {
21367
21716
  var _getPathBox = getPathBox(this),
21368
21717
  _x = _getPathBox.x,
21369
21718
  y = _getPathBox.y,
@@ -21379,9 +21728,9 @@ extend(zoom, {
21379
21728
 
21380
21729
 
21381
21730
  if (isWithin ^ isIncluded) {
21382
- shape.classed(config_classes.INCLUDED, !isIncluded); // TODO: included/unincluded callback here
21731
+ shape.classed($DRAG.INCLUDED, !isIncluded); // TODO: included/unincluded callback here
21383
21732
 
21384
- shape.classed(config_classes.SELECTED, !isSelected);
21733
+ shape.classed($SELECT.SELECTED, !isSelected);
21385
21734
  toggle.call($$, !isSelected, shape, d, i);
21386
21735
  }
21387
21736
  });
@@ -21404,7 +21753,7 @@ extend(zoom, {
21404
21753
  }
21405
21754
 
21406
21755
  state.dragStart = mouse;
21407
- main.select("." + config_classes.chart).append("rect").attr("class", config_classes.dragarea).style("opacity", "0.1");
21756
+ main.select("." + $COMMON.chart).append("rect").attr("class", $DRAG.dragarea).style("opacity", "0.1");
21408
21757
  $$.setDragStatus(!0);
21409
21758
  },
21410
21759
 
@@ -21424,17 +21773,17 @@ extend(zoom, {
21424
21773
  return;
21425
21774
  }
21426
21775
 
21427
- $T(main.select("." + config_classes.dragarea)).style("opacity", "0").remove();
21428
- main.selectAll("." + config_classes.shape).classed(config_classes.INCLUDED, !1);
21776
+ $T(main.select("." + $DRAG.dragarea)).style("opacity", "0").remove();
21777
+ main.selectAll("." + $SHAPE.shape).classed($DRAG.INCLUDED, !1);
21429
21778
  $$.setDragStatus(!1);
21430
21779
  }
21431
21780
  });
21432
21781
  ;// CONCATENATED MODULE: ./src/ChartInternal/internals/selection.ts
21433
21782
 
21434
21783
 
21435
- function selection_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
21784
+ function selection_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; }
21436
21785
 
21437
- function selection_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { selection_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { selection_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
21786
+ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? selection_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : selection_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
21438
21787
 
21439
21788
  /**
21440
21789
  * Copyright (c) 2017 ~ present NAVER Corp.
@@ -21463,8 +21812,8 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
21463
21812
  r = $$.pointSelectR.bind($$);
21464
21813
  callFn(config.data_onselected, $$.api, d, target.node()); // add selected-circle on low layer g
21465
21814
 
21466
- $T(main.select("." + config_classes.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll("." + config_classes.selectedCircle + "-" + i).data([d]).enter().append("circle").attr("class", function () {
21467
- return $$.generateClass(config_classes.selectedCircle, i);
21815
+ $T(main.select("." + $SELECT.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll("." + $SELECT.selectedCircle + "-" + i).data([d]).enter().append("circle").attr("class", function () {
21816
+ return $$.generateClass($SELECT.selectedCircle, i);
21468
21817
  }).attr("cx", cx).attr("cy", cy).attr("stroke", $$.color).attr("r", function (d2) {
21469
21818
  return $$.pointSelectR(d2) * 1.4;
21470
21819
  })).attr("r", r);
@@ -21484,7 +21833,7 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
21484
21833
  $T = $$.$T;
21485
21834
  callFn(config.data_onunselected, $$.api, d, target.node()); // remove selected-circle from low layer g
21486
21835
 
21487
- $T(main.select("." + config_classes.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll("." + config_classes.selectedCircle + "-" + i)).attr("r", 0).remove();
21836
+ $T(main.select("." + $SELECT.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll("." + $SELECT.selectedCircle + "-" + i)).attr("r", 0).remove();
21488
21837
  },
21489
21838
 
21490
21839
  /**
@@ -21567,32 +21916,33 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
21567
21916
  toggleShape: function toggleShape(that, d, i) {
21568
21917
  var $$ = this,
21569
21918
  config = $$.config,
21570
- main = $$.$el.main,
21571
- shape = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(that),
21572
- isSelected = shape.classed(config_classes.SELECTED),
21573
- toggle = $$.getToggle(that, d).bind($$),
21574
- toggledShape;
21919
+ main = $$.$el.main;
21575
21920
 
21576
21921
  if (config.data_selection_enabled && config.data_selection_isselectable.bind($$.api)(d)) {
21922
+ var shape = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(that),
21923
+ isSelected = shape.classed($SELECT.SELECTED),
21924
+ toggle = $$.getToggle(that, d).bind($$),
21925
+ toggledShape;
21926
+
21577
21927
  if (!config.data_selection_multiple) {
21578
- var selector = "." + config_classes.shapes;
21928
+ var selector = "." + $SHAPE.shapes;
21579
21929
 
21580
21930
  if (config.data_selection_grouped) {
21581
21931
  selector += $$.getTargetSelectorSuffix(d.id);
21582
21932
  }
21583
21933
 
21584
- main.selectAll(selector).selectAll("." + config_classes.shape).each(function (d, i) {
21934
+ main.selectAll(selector).selectAll("." + $SHAPE.shape).each(function (d, i) {
21585
21935
  var shape = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this);
21586
21936
 
21587
- if (shape.classed(config_classes.SELECTED)) {
21937
+ if (shape.classed($SELECT.SELECTED)) {
21588
21938
  toggledShape = shape;
21589
- toggle(!1, shape.classed(config_classes.SELECTED, !1), d, i);
21939
+ toggle(!1, shape.classed($SELECT.SELECTED, !1), d, i);
21590
21940
  }
21591
21941
  });
21592
21942
  }
21593
21943
 
21594
21944
  if (!toggledShape || toggledShape.node() !== shape.node()) {
21595
- shape.classed(config_classes.SELECTED, !isSelected);
21945
+ shape.classed($SELECT.SELECTED, !isSelected);
21596
21946
  toggle(!isSelected, shape, d, i);
21597
21947
  }
21598
21948
  }
@@ -21624,7 +21974,7 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
21624
21974
  $$.brush = (isRotated ? (0,external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_.brushY)() : (0,external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_.brushX)()).handleSize(5);
21625
21975
 
21626
21976
  var getBrushSize = function () {
21627
- var brush = $$.$el.svg.select("." + config_classes.brush + " .overlay"),
21977
+ var brush = $$.$el.svg.select("." + classes.brush + " .overlay"),
21628
21978
  brushSize = {
21629
21979
  width: 0,
21630
21980
  height: 0
@@ -21688,7 +22038,7 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
21688
22038
  }).length === 0) {
21689
22039
  var _subchart$main;
21690
22040
 
21691
- (_subchart$main = subchart.main) == null ? void 0 : _subchart$main.select("." + config_classes.brush).call(this);
22041
+ (_subchart$main = subchart.main) == null ? void 0 : _subchart$main.select("." + classes.brush).call(this);
21692
22042
  }
21693
22043
 
21694
22044
  return this;
@@ -21717,7 +22067,7 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
21717
22067
 
21718
22068
  $$.brush.getSelection = function () {
21719
22069
  return (// @ts-ignore
21720
- subchart.main ? subchart.main.select("." + config_classes.brush) : (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)([])
22070
+ subchart.main ? subchart.main.select("." + classes.brush) : (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)([])
21721
22071
  );
21722
22072
  };
21723
22073
  },
@@ -21748,18 +22098,18 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
21748
22098
  clip.idSubchart = clipId;
21749
22099
  $$.appendClip(defs, clipId);
21750
22100
  $$.initBrush();
21751
- subchart.main = svg.append("g").classed(config_classes.subchart, !0).attr("transform", $$.getTranslate("context"));
22101
+ subchart.main = svg.append("g").classed(classes.subchart, !0).attr("transform", $$.getTranslate("context"));
21752
22102
  var main = subchart.main;
21753
22103
  main.style("visibility", visibility); // Define g for chart area
21754
22104
 
21755
- main.append("g").attr("clip-path", clipPath).attr("class", config_classes.chart); // Define g for chart types area
22105
+ main.append("g").attr("clip-path", clipPath).attr("class", classes.chart); // Define g for chart types area
21756
22106
 
21757
22107
  ["bar", "line", "bubble", "candlestick", "scatter"].forEach(function (v) {
21758
22108
  var type = capitalize(/^(bubble|scatter)$/.test(v) ? "circle" : v);
21759
22109
 
21760
22110
  if ($$.hasType(v) || $$.hasTypeOf(type)) {
21761
- var chart = main.select("." + config_classes.chart),
21762
- chartClassName = config_classes["chart" + type + "s"];
22111
+ var chart = main.select("." + classes.chart),
22112
+ chartClassName = classes["chart" + type + "s"];
21763
22113
 
21764
22114
  if (chart.select("." + chartClassName).empty()) {
21765
22115
  chart.append("g").attr("class", chartClassName);
@@ -21767,11 +22117,11 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
21767
22117
  }
21768
22118
  }); // Add extent rect for Brush
21769
22119
 
21770
- var brush = main.append("g").attr("clip-path", clipPath).attr("class", config_classes.brush).call($$.brush);
22120
+ var brush = main.append("g").attr("clip-path", clipPath).attr("class", classes.brush).call($$.brush);
21771
22121
  config.subchart_showHandle && $$.addBrushHandle(brush); // ATTENTION: This must be called AFTER chart added
21772
22122
  // Add Axis
21773
22123
 
21774
- axis.subX = main.append("g").attr("class", config_classes.axisX).attr("transform", $$.getTranslate("subX")).attr("clip-path", config.axis_rotated ? "" : clip.pathXAxis).style("visibility", config.subchart_axis_x_show ? visibility : "hidden");
22124
+ axis.subX = main.append("g").attr("class", classes.axisX).attr("transform", $$.getTranslate("subX")).attr("clip-path", config.axis_rotated ? "" : clip.pathXAxis).style("visibility", config.subchart_axis_x_show ? visibility : "hidden");
21775
22125
  },
21776
22126
 
21777
22127
  /**
@@ -21819,14 +22169,14 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
21819
22169
  name = capitalize(isPointType ? "circle" : v),
21820
22170
  chartClass = $$.getChartClass(name, !0),
21821
22171
  shapeClass = $$.getClass(isPointType ? "circles" : v + "s", !0),
21822
- shapeChart = main.select("." + config_classes["chart" + (name + "s")]);
22172
+ shapeChart = main.select("." + classes["chart" + (name + "s")]);
21823
22173
 
21824
22174
  if (isPointType) {
21825
- var circle = shapeChart.selectAll("." + config_classes.circles).data(targets.filter($$["is" + capitalize(v) + "Type"].bind($$))).attr("class", shapeClass);
22175
+ var circle = shapeChart.selectAll("." + classes.circles).data(targets.filter($$["is" + capitalize(v) + "Type"].bind($$))).attr("class", shapeClass);
21826
22176
  circle.exit().remove();
21827
22177
  circle.enter().append("g").attr("class", shapeClass);
21828
22178
  } else {
21829
- var shapeUpdate = shapeChart.selectAll("." + config_classes["chart" + name]).attr("class", chartClass).data(targets.filter($$["is" + name + "Type"].bind($$))),
22179
+ var shapeUpdate = shapeChart.selectAll("." + classes["chart" + name]).attr("class", chartClass).data(targets.filter($$["is" + name + "Type"].bind($$))),
21830
22180
  shapeEnter = shapeUpdate.enter().append("g").style("opacity", "0").attr("class", chartClass).append("g").attr("class", shapeClass);
21831
22181
  shapeUpdate.exit().remove(); // Area
21832
22182
 
@@ -21834,7 +22184,7 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
21834
22184
  }
21835
22185
  }); // -- Brush --//
21836
22186
 
21837
- main.selectAll("." + config_classes.brush + " rect").attr(config.axis_rotated ? "width" : "height", config.axis_rotated ? state.width2 : state.height2);
22187
+ main.selectAll("." + classes.brush + " rect").attr(config.axis_rotated ? "width" : "height", config.axis_rotated ? state.width2 : state.height2);
21838
22188
  }
21839
22189
  },
21840
22190
 
@@ -21916,7 +22266,7 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
21916
22266
  var $$ = this,
21917
22267
  subchart = $$.$el.subchart,
21918
22268
  $T = $$.$T,
21919
- subXAxis = transitions != null && transitions.axisSubX ? transitions.axisSubX : $T(subchart.main.select("." + config_classes.axisX), withTransition);
22269
+ subXAxis = transitions != null && transitions.axisSubX ? transitions.axisSubX : $T(subchart.main.select("." + classes.axisX), withTransition);
21920
22270
  subchart.main.attr("transform", $$.getTranslate("context"));
21921
22271
  subXAxis.attr("transform", $$.getTranslate("subX"));
21922
22272
  },
@@ -22236,7 +22586,7 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
22236
22586
  $$.unselectRect();
22237
22587
 
22238
22588
  if (!zoomRect) {
22239
- zoomRect = $$.$el.main.append("rect").attr("clip-path", state.clip.path).attr("class", config_classes.zoomBrush).attr("width", isRotated ? state.width : 0).attr("height", isRotated ? 0 : state.height);
22589
+ zoomRect = $$.$el.main.append("rect").attr("clip-path", state.clip.path).attr("class", $ZOOM.zoomBrush).attr("width", isRotated ? state.width : 0).attr("height", isRotated ? 0 : state.height);
22240
22590
  }
22241
22591
 
22242
22592
  start = getPointer(event, this)[prop.index];
@@ -22279,10 +22629,10 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
22279
22629
 
22280
22630
  if (resetButton && config.zoom_type === "drag") {
22281
22631
  if (!$el.zoomResetBtn) {
22282
- $el.zoomResetBtn = $$.$el.chart.append("div").classed(config_classes.button, !0).append("span").on("click", function () {
22632
+ $el.zoomResetBtn = $$.$el.chart.append("div").classed($COMMON.button, !0).append("span").on("click", function () {
22283
22633
  isFunction(resetButton.onclick) && resetButton.onclick.bind($$.api)(this);
22284
22634
  $$.api.unzoom();
22285
- }).classed(config_classes.buttonZoomReset, !0).text(resetButton.text || "Reset Zoom");
22635
+ }).classed($ZOOM.buttonZoomReset, !0).text(resetButton.text || "Reset Zoom");
22286
22636
  } else {
22287
22637
  $el.zoomResetBtn.style("display", null);
22288
22638
  }
@@ -22656,7 +23006,7 @@ var _defaults = {},
22656
23006
  * bb.version; // "1.0.0"
22657
23007
  * @memberof bb
22658
23008
  */
22659
- version: "3.2.1",
23009
+ version: "3.3.0",
22660
23010
 
22661
23011
  /**
22662
23012
  * Generate chart
@@ -22790,7 +23140,7 @@ var _defaults = {},
22790
23140
  };
22791
23141
  /**
22792
23142
  * @namespace bb
22793
- * @version 3.2.1
23143
+ * @version 3.3.0
22794
23144
  */
22795
23145
  ;// CONCATENATED MODULE: ./src/index.ts
22796
23146
  /**