billboard.js 3.2.1 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/billboard.css +2 -3
  2. package/dist/billboard.js +424 -114
  3. package/dist/billboard.min.css +2 -2
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +5415 -3250
  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 +19 -14
  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 +17 -12
  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 +19 -14
  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 +17 -12
  21. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  22. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +5056 -3201
  23. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +5082 -3222
  24. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +5081 -3221
  25. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +5075 -3215
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +5074 -3214
  27. package/dist/theme/datalab.css +2 -2
  28. package/dist/theme/datalab.min.css +2 -2
  29. package/dist/theme/graph.css +2 -2
  30. package/dist/theme/graph.min.css +2 -2
  31. package/dist/theme/insight.css +2 -2
  32. package/dist/theme/insight.min.css +2 -2
  33. package/dist-esm/billboard.js +737 -456
  34. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
  35. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  36. package/dist-esm/plugin/billboardjs-plugin-sparkline.d.ts +7 -0
  37. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +8 -8
  38. package/dist-esm/plugin/billboardjs-plugin-stanford.d.ts +7 -0
  39. package/dist-esm/plugin/billboardjs-plugin-stanford.js +15 -15
  40. package/dist-esm/plugin/billboardjs-plugin-tableview.d.ts +7 -0
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +6 -6
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
  43. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -4
  44. package/package.json +52 -52
  45. package/src/Chart/api/chart.ts +7 -1
  46. package/src/Chart/api/data.ts +3 -4
  47. package/src/ChartInternal/Axis/Axis.ts +15 -9
  48. package/src/ChartInternal/ChartInternal.ts +13 -2
  49. package/src/ChartInternal/data/IData.ts +9 -0
  50. package/src/ChartInternal/data/convert.ts +1 -1
  51. package/src/ChartInternal/data/data.ts +28 -11
  52. package/src/ChartInternal/interactions/interaction.ts +36 -4
  53. package/src/ChartInternal/internals/domain.ts +4 -2
  54. package/src/ChartInternal/internals/legend.ts +2 -1
  55. package/src/ChartInternal/internals/redraw.ts +2 -2
  56. package/src/ChartInternal/internals/scale.ts +3 -2
  57. package/src/ChartInternal/internals/size.ts +32 -1
  58. package/src/ChartInternal/internals/text.ts +2 -2
  59. package/src/ChartInternal/internals/tooltip.ts +4 -1
  60. package/src/ChartInternal/shape/arc.ts +3 -5
  61. package/src/ChartInternal/shape/bar.ts +89 -34
  62. package/src/ChartInternal/shape/radar.ts +2 -0
  63. package/src/ChartInternal/shape/shape.ts +72 -11
  64. package/src/Plugin/sparkline/index.ts +2 -2
  65. package/src/Plugin/tableview/index.ts +1 -1
  66. package/src/config/Options/axis/x.ts +27 -7
  67. package/src/config/Options/axis/y.ts +24 -3
  68. package/src/config/Options/axis/y2.ts +24 -3
  69. package/src/config/Options/common/main.ts +11 -1
  70. package/src/config/Options/data/data.ts +22 -0
  71. package/src/config/Options/shape/bar.ts +9 -2
  72. package/src/module/util.ts +19 -20
  73. package/src/scss/billboard.scss +1 -13
  74. package/src/scss/theme/datalab.scss +1 -7
  75. package/src/scss/theme/graph.scss +1 -2
  76. package/src/scss/theme/insight.scss +1 -2
  77. package/types/axis.d.ts +22 -8
  78. package/types/chart.d.ts +1 -1
  79. package/types/options.d.ts +40 -33
  80. package/types/plugin/tableview/index.d.ts +3 -3
  81. package/types/plugin/tableview/options.d.ts +1 -1
  82. package/types/types.d.ts +9 -6
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.1
8
+ * @version 3.3.0
9
9
  */
10
10
  (function webpackUniversalModuleDefinition(root, factory) {
11
11
  if(typeof exports === 'object' && typeof module === 'object')
@@ -432,9 +432,9 @@ var external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_ = __webp
432
432
  ;// CONCATENATED MODULE: ./src/module/util.ts
433
433
 
434
434
 
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; }
435
+ 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
436
 
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; }
437
+ 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
438
 
439
439
  /**
440
440
  * Copyright (c) 2017 ~ present NAVER Corp.
@@ -524,18 +524,19 @@ function hasValue(dict, value) {
524
524
  /**
525
525
  * Call function with arguments
526
526
  * @param {Function} fn Function to be called
527
- * @param {*} args Arguments
527
+ * @param {*} thisArg "this" value for fn
528
+ * @param {*} args Arguments for fn
528
529
  * @returns {boolean} true: fn is function, false: fn is not function
529
530
  * @private
530
531
  */
531
532
 
532
533
 
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];
534
+ function callFn(fn, thisArg) {
535
+ for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
536
+ args[_key - 2] = arguments[_key];
536
537
  }
537
538
 
538
- isFn && fn.call.apply(fn, args);
539
+ isFn && fn.call.apply(fn, [thisArg].concat(args));
539
540
  return isFn;
540
541
  }
541
542
  /**
@@ -691,9 +692,13 @@ function getPathBox(path) {
691
692
 
692
693
 
693
694
  function getPointer(event, element) {
694
- var touches = event && (event.touches || event.sourceEvent && event.sourceEvent.touches),
695
- pointer = event ? (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.pointer)(touches ? touches[0] : event, element) : [0, 0];
696
- return pointer;
695
+ var _ref,
696
+ touches = event && ((_ref = event.touches || event.sourceEvent && event.sourceEvent.touches) == null ? void 0 : _ref[0]),
697
+ pointer = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.pointer)(touches || event, element);
698
+
699
+ return pointer.map(function (v) {
700
+ return isNaN(v) ? 0 : v;
701
+ });
697
702
  }
698
703
  /**
699
704
  * Return brush selection array
@@ -1681,12 +1686,21 @@ var Store = /*#__PURE__*/function () {
1681
1686
  * @name padding
1682
1687
  * @memberof Options
1683
1688
  * @type {object}
1684
- * @property {object} [padding] padding object
1689
+ * @property {object|boolean} [padding=true] Set padding of chart, and accepts object or boolean type.
1690
+ * - `Object`: Specify each side's padding.
1691
+ * - `false`: Remove padding completely and make shape to fully occupy the container element.
1692
+ * - In this case, axes and subchart will be hidden.
1693
+ * - To adjust some padding from this state, use `axis.[x|y].padding` option.
1685
1694
  * @property {number} [padding.top] padding on the top of chart
1686
1695
  * @property {number} [padding.right] padding on the right of chart
1687
1696
  * @property {number} [padding.bottom] padding on the bottom of chart
1688
1697
  * @property {number} [padding.left] padding on the left of chart
1698
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#ChartOptions.Padding)
1689
1699
  * @example
1700
+ * // remove padding completely.
1701
+ * padding: false,
1702
+ *
1703
+ * // or specify padding value for each side
1690
1704
  * padding: {
1691
1705
  * top: 20,
1692
1706
  * right: 20,
@@ -1694,6 +1708,7 @@ var Store = /*#__PURE__*/function () {
1694
1708
  * left: 20
1695
1709
  * }
1696
1710
  */
1711
+ padding: !0,
1697
1712
  padding_left: undefined,
1698
1713
  padding_right: undefined,
1699
1714
  padding_top: undefined,
@@ -2552,6 +2567,18 @@ var Store = /*#__PURE__*/function () {
2552
2567
  * ]
2553
2568
  * }
2554
2569
  *
2570
+ * // for 'bar' type, data can contain:
2571
+ * // - an array of [start, end] data following the order
2572
+ * data: {
2573
+ * rows: [
2574
+ * ["data1", "data2"],
2575
+ * [[100, 150], 120],
2576
+ * [[200, 300], 55],
2577
+ * [[-400, 500], 60]
2578
+ * ],
2579
+ * type: "bar"
2580
+ * }
2581
+ *
2555
2582
  * // for 'range' types('area-line-range' or 'area-spline-range'), data should contain:
2556
2583
  * // - an array of [high, mid, low] data following the order
2557
2584
  * // - or an object with 'high', 'mid' and 'low' key value
@@ -2628,6 +2655,16 @@ var Store = /*#__PURE__*/function () {
2628
2655
  * ]
2629
2656
  * }
2630
2657
  *
2658
+ * // for 'bar' type, data can contain:
2659
+ * // - an array of [start, end] data following the order
2660
+ * data: {
2661
+ * columns: [
2662
+ * ["data1", -100, 50, [100, 200], [200, 300]],
2663
+ * ["data2", -200, 300, [-100, 100], [-50, -30]],
2664
+ * ],
2665
+ * type: "bar"
2666
+ * }
2667
+ *
2631
2668
  * // for 'range' types('area-line-range' or 'area-spline-range'), data should contain:
2632
2669
  * // - an array of [high, mid, low] data following the order
2633
2670
  * // - or an object with 'high', 'mid' and 'low' key value
@@ -3244,9 +3281,9 @@ var Store = /*#__PURE__*/function () {
3244
3281
  ;// CONCATENATED MODULE: ./src/config/Options/Options.ts
3245
3282
 
3246
3283
 
3247
- 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; }
3284
+ 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; }
3248
3285
 
3249
- 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; }
3286
+ 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; }
3250
3287
 
3251
3288
  /**
3252
3289
  * Copyright (c) 2017 ~ present NAVER Corp.
@@ -3987,7 +4024,7 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
3987
4024
 
3988
4025
  if (filterNull) {
3989
4026
  value = value.filter(function (v) {
3990
- return isValue(v.value);
4027
+ return v && "value" in v && isValue(v.value);
3991
4028
  });
3992
4029
  }
3993
4030
 
@@ -4421,6 +4458,7 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
4421
4458
 
4422
4459
  /**
4423
4460
  * Sort targets data
4461
+ * Note: For stacked bar, will sort from the total sum of data series, not for each stacked bar
4424
4462
  * @param {Array} targetsValue Target value
4425
4463
  * @returns {Array}
4426
4464
  * @private
@@ -4457,8 +4495,8 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
4457
4495
  };
4458
4496
 
4459
4497
  fn = function (t1, t2) {
4460
- var t1Sum = t1.values.reduce(reducer, 0),
4461
- t2Sum = t2.values.reduce(reducer, 0);
4498
+ var t1Sum = "values" in t1 ? t1.values.reduce(reducer, 0) : t1.value,
4499
+ t2Sum = "values" in t2 ? t2.values.reduce(reducer, 0) : t2.value;
4462
4500
  return isArc ? orderAsc ? t1Sum - t2Sum : t2Sum - t1Sum : orderAsc ? t2Sum - t1Sum : t1Sum - t2Sum;
4463
4501
  };
4464
4502
  } else if (isFunction(order)) {
@@ -4572,19 +4610,20 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
4572
4610
  }),
4573
4611
  minDist = config.point_sensitivity,
4574
4612
  closest;
4575
- // find mouseovering bar
4613
+ // find mouseovering bar/candlestick
4614
+ // https://github.com/naver/billboard.js/issues/2434
4576
4615
  data.filter(function (v) {
4577
- return $$.isBarType(v.id);
4616
+ return $$.isBarType(v.id) || $$.isCandlestickType(v.id);
4578
4617
  }).forEach(function (v) {
4579
- var shape = main.select("." + config_classes.bars + $$.getTargetSelectorSuffix(v.id) + " ." + config_classes.bar + "-" + v.index).node();
4618
+ var selector = $$.isBarType(v.id) ? "." + config_classes.chartBar + "." + config_classes.target + $$.getTargetSelectorSuffix(v.id) + " ." + config_classes.bar + "-" + v.index : "." + config_classes.chartCandlestick + "." + config_classes.target + $$.getTargetSelectorSuffix(v.id) + " ." + config_classes.candlestick + "-" + v.index + " path";
4580
4619
 
4581
- if (!closest && $$.isWithinBar(shape)) {
4620
+ if (!closest && $$.isWithinBar(main.select(selector).node())) {
4582
4621
  closest = v;
4583
4622
  }
4584
- }); // find closest point from non-bar
4623
+ }); // find closest point from non-bar/candlestick
4585
4624
 
4586
4625
  data.filter(function (v) {
4587
- return !$$.isBarType(v.id);
4626
+ return !$$.isBarType(v.id) && !$$.isCandlestickType(v.id);
4588
4627
  }).forEach(function (v) {
4589
4628
  var d = $$.dist(v, pos);
4590
4629
 
@@ -4817,6 +4856,20 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
4817
4856
  return $$.isBubbleType(d) && (isObject(d.value) && ("z" in d.value || "y" in d.value) || isArray(d.value) && d.value.length === 2);
4818
4857
  },
4819
4858
 
4859
+ /**
4860
+ * Determine if bar has ranged data
4861
+ * @param {Array} d data value
4862
+ * @returns {boolean}
4863
+ * @private
4864
+ */
4865
+ isBarRangeType: function isBarRangeType(d) {
4866
+ var $$ = this,
4867
+ value = d.value;
4868
+ return $$.isBarType(d) && isArray(value) && value.length === 2 && value.every(function (v) {
4869
+ return isNumber(v);
4870
+ });
4871
+ },
4872
+
4820
4873
  /**
4821
4874
  * Get data object by id
4822
4875
  * @param {string} id data id
@@ -5194,14 +5247,40 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5194
5247
  * @private
5195
5248
  */
5196
5249
  unbindZoomEvent: function unbindZoomEvent() {
5197
- var _zoomResetBtn,
5250
+ var _eventRect,
5251
+ _zoomResetBtn,
5198
5252
  $$ = this,
5199
5253
  _$$$$el2 = $$.$el,
5200
5254
  eventRect = _$$$$el2.eventRect,
5201
5255
  zoomResetBtn = _$$$$el2.zoomResetBtn;
5202
5256
 
5203
- eventRect.on(".zoom", null).on(".drag", null);
5204
- (_zoomResetBtn = zoomResetBtn) == null ? void 0 : _zoomResetBtn.style("display", "none");
5257
+ (_eventRect = eventRect) == null ? void 0 : _eventRect.on(".zoom wheel.zoom .drag", null);
5258
+ (_zoomResetBtn = zoomResetBtn) == null ? void 0 : _zoomResetBtn.on("click", null).style("display", "none");
5259
+ },
5260
+
5261
+ /**
5262
+ * Unbind all attached events
5263
+ * @private
5264
+ */
5265
+ unbindAllEvents: function unbindAllEvents() {
5266
+ var _region,
5267
+ _brush,
5268
+ _arcs,
5269
+ _legend,
5270
+ $$ = this,
5271
+ _$$$$el3 = $$.$el,
5272
+ arcs = _$$$$el3.arcs,
5273
+ eventRect = _$$$$el3.eventRect,
5274
+ legend = _$$$$el3.legend,
5275
+ region = _$$$$el3.region,
5276
+ svg = _$$$$el3.svg,
5277
+ brush = $$.brush;
5278
+
5279
+ // detach all possible event types
5280
+ [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) {
5281
+ 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);
5282
+ });
5283
+ $$.unbindZoomEvent == null ? void 0 : $$.unbindZoomEvent();
5205
5284
  }
5206
5285
  });
5207
5286
  ;// CONCATENATED MODULE: ./src/ChartInternal/internals/class.ts
@@ -5695,9 +5774,10 @@ var colorizePattern = function (pattern, color, id) {
5695
5774
  ["bottom", "top"].forEach(function (v, i) {
5696
5775
  padding[v] += $$.convertPixelToScale("y", lengths[i], domainLength);
5697
5776
  });
5698
- } // if padding is set, the domain will be updated relative the current domain value
5699
- // ex) $$.height=300, padding.top=150, domainLength=4 --> domain=6
5777
+ }
5700
5778
 
5779
+ padding = $$.getResettedPadding(padding); // if padding is set, the domain will be updated relative the current domain value
5780
+ // ex) $$.height=300, padding.top=150, domainLength=4 --> domain=6
5701
5781
 
5702
5782
  var p = config[pfx + "_padding"];
5703
5783
 
@@ -5761,7 +5841,7 @@ var colorizePattern = function (pattern, color, id) {
5761
5841
  var maxDataCount = $$.getMaxDataCount();
5762
5842
  defaultValue = maxDataCount > 1 ? diff / (maxDataCount - 1) / 2 : .5;
5763
5843
  } else {
5764
- defaultValue = diff * .01;
5844
+ defaultValue = $$.getResettedPadding(diff * .01);
5765
5845
  }
5766
5846
 
5767
5847
  var _ref = isNumber(padding) ? {
@@ -6589,8 +6669,9 @@ function getFormat($$, typeValue, v) {
6589
6669
  return browser_doc.createElementNS(external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.namespaces.svg, "hasValidPointType" in $$ && $$.hasValidPointType(point) ? point : "use");
6590
6670
  }).attr("class", config_classes.legendItemPoint).style("fill", getColor).style("pointer-events", "none").attr("href", function (data, idx, selection) {
6591
6671
  var node = selection[idx],
6592
- nodeName = node.nodeName.toLowerCase();
6593
- return nodeName === "use" ? "#" + state.datetimeId + "-point-" + data : undefined;
6672
+ nodeName = node.nodeName.toLowerCase(),
6673
+ id = $$.getTargetSelectorSuffix(data);
6674
+ return nodeName === "use" ? "#" + state.datetimeId + "-point" + id : undefined;
6594
6675
  });
6595
6676
  } else {
6596
6677
  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);
@@ -6693,8 +6774,9 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
6693
6774
  main = $el.main;
6694
6775
  state.redrawing = !0;
6695
6776
  var targetsToShow = $$.filterTargetsToShow($$.data.targets),
6696
- initializing = options.initializing,
6697
- flow = options.flow,
6777
+ _options = options,
6778
+ flow = _options.flow,
6779
+ initializing = _options.initializing,
6698
6780
  wth = $$.getWithOption(options),
6699
6781
  duration = wth.Transition ? config.transition_duration : 0,
6700
6782
  durationForExit = wth.TransitionForExit ? duration : 0,
@@ -6900,6 +6982,7 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
6900
6982
  redrawWithoutRescale: function redrawWithoutRescale() {
6901
6983
  this.redraw({
6902
6984
  withY: !1,
6985
+ withLegend: !0,
6903
6986
  withSubchart: !1,
6904
6987
  withEventRect: !1,
6905
6988
  withTransitionForAxis: !1
@@ -7070,15 +7153,16 @@ function getScale(type, min, max) {
7070
7153
  if (hasAxis) {
7071
7154
  var _scale$x,
7072
7155
  isRotated = config.axis_rotated,
7156
+ resettedPadding = $$.getResettedPadding(1),
7073
7157
  min = {
7074
- x: isRotated ? 1 : 0,
7158
+ x: isRotated ? resettedPadding : 0,
7075
7159
  y: isRotated ? 0 : height,
7076
7160
  subX: isRotated ? 1 : 0,
7077
7161
  subY: isRotated ? 0 : height2
7078
7162
  },
7079
7163
  max = {
7080
7164
  x: isRotated ? height : width,
7081
- y: isRotated ? width : 1,
7165
+ y: isRotated ? width : resettedPadding,
7082
7166
  subX: isRotated ? height : width,
7083
7167
  subY: isRotated ? width2 : 1
7084
7168
  },
@@ -7211,6 +7295,20 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7211
7295
 
7212
7296
  return shape;
7213
7297
  },
7298
+
7299
+ /**
7300
+ * Get shape's indices according it's position
7301
+ *
7302
+ * From the below example, indices will be:
7303
+ * ==> {data1: 0, data2: 0, data3: 1, data4: 1, __max__: 1}
7304
+ *
7305
+ * data1 data3 data1 data3
7306
+ * data2 data4 data2 data4
7307
+ * -------------------------
7308
+ * 0 1
7309
+ * @param {Function} typeFilter Chart type filter function
7310
+ * @returns {object} Indices object with its position
7311
+ */
7214
7312
  getShapeIndices: function getShapeIndices(typeFilter) {
7215
7313
  var $$ = this,
7216
7314
  config = $$.config,
@@ -7256,12 +7354,30 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7256
7354
  /**
7257
7355
  * Get indices value based on data ID value
7258
7356
  * @param {object} indices Indices object
7259
- * @param {string} id Data id value
7357
+ * @param {object} d Data row
7358
+ * @param {string} caller Caller function name (Used only for 'sparkline' plugin)
7260
7359
  * @returns {object} Indices object
7261
7360
  * @private
7262
7361
  */
7263
- getIndices: function getIndices(indices, id) {
7264
- var xs = this.config.data_xs;
7362
+ getIndices: function getIndices(indices, d) {
7363
+ // eslint-disable-line
7364
+ var $$ = this,
7365
+ _$$$config = $$.config,
7366
+ xs = _$$$config.data_xs,
7367
+ removeNull = _$$$config.bar_indices_removeNull,
7368
+ id = d.id,
7369
+ index = d.index;
7370
+
7371
+ if ($$.isBarType(id) && removeNull) {
7372
+ var ind = {}; // redefine bar indices order
7373
+
7374
+ $$.getAllValuesOnIndex(index, !0).forEach(function (v, i) {
7375
+ ind[v.id] = i;
7376
+ ind.__max__ = i;
7377
+ });
7378
+ return ind;
7379
+ }
7380
+
7265
7381
  return notEmpty(xs) ? indices[xs[id]] : indices;
7266
7382
  },
7267
7383
 
@@ -7291,7 +7407,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7291
7407
  halfWidth = isObjectType(offset) && (offset._$total.length ? offset._$total.reduce(sum) / 2 : 0);
7292
7408
 
7293
7409
  return function (d) {
7294
- var ind = $$.getIndices(indices, d.id, "getShapeX"),
7410
+ var ind = $$.getIndices(indices, d, "getShapeX"),
7295
7411
  index = d.id in ind ? ind[d.id] : 0,
7296
7412
  targetsNum = (ind.__max__ || 0) + 1,
7297
7413
  x = 0;
@@ -7334,6 +7450,9 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7334
7450
  value = $$.getRatio("index", d, !0);
7335
7451
  } else if ($$.isBubbleZType(d)) {
7336
7452
  value = $$.getBubbleZData(d.value, "y");
7453
+ } else if ($$.isBarRangeType(d)) {
7454
+ // TODO use range.getEnd() like method
7455
+ value = value[1];
7337
7456
  }
7338
7457
 
7339
7458
  return $$.getYScaleById(d.id, isSub)(value);
@@ -7406,9 +7525,15 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7406
7525
  var id = d.id,
7407
7526
  value = d.value,
7408
7527
  x = d.x,
7409
- ind = $$.getIndices(indices, id),
7410
- scale = $$.getYScaleById(id, isSub),
7411
- y0 = scale($$.getShapeYMin(id)),
7528
+ ind = $$.getIndices(indices, d),
7529
+ scale = $$.getYScaleById(id, isSub);
7530
+
7531
+ if ($$.isBarRangeType(d)) {
7532
+ // TODO use range.getStart()
7533
+ return scale(value[0]);
7534
+ }
7535
+
7536
+ var y0 = scale($$.getShapeYMin(id)),
7412
7537
  dataXAsNumber = +x,
7413
7538
  offset = y0;
7414
7539
  shapeOffsetTargets.filter(function (t) {
@@ -7417,7 +7542,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7417
7542
  var tid = t.id,
7418
7543
  rowValueMapByXValue = t.rowValueMapByXValue,
7419
7544
  rowValues = t.rowValues,
7420
- tvalues = t.values;
7545
+ tvalues = t.values; // for same stacked group (ind[tid] === ind[id])
7421
7546
 
7422
7547
  if (ind[tid] === ind[id] && indexMapByTargetId[tid] < indexMapByTargetId[id]) {
7423
7548
  var _row,
@@ -7547,6 +7672,22 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7547
7672
  type = config.spline_interpolation_type,
7548
7673
  interpolation = $$.isInterpolationType(type) ? type : "cardinal";
7549
7674
  return $$.isSplineType(d) ? interpolation : $$.isStepType(d) ? config.line_step_type : "linear";
7675
+ },
7676
+ isWithinBar: function isWithinBar(that) {
7677
+ var mouse = getPointer(this.state.event, that),
7678
+ list = getRectSegList(that),
7679
+ _list = list,
7680
+ seg0 = _list[0],
7681
+ seg1 = _list[1],
7682
+ x = Math.min(seg0.x, seg1.x),
7683
+ y = Math.min(seg0.y, seg1.y),
7684
+ offset = this.config.bar_sensitivity,
7685
+ _that$getBBox = that.getBBox(),
7686
+ width = _that$getBBox.width,
7687
+ height = _that$getBBox.height,
7688
+ isWithin = x - offset < mouse[0] && mouse[0] < x + width + offset && y - offset < mouse[1] && mouse[1] < y + height + offset;
7689
+
7690
+ return isWithin;
7550
7691
  }
7551
7692
  });
7552
7693
  ;// CONCATENATED MODULE: ./src/ChartInternal/internals/size.ts
@@ -7763,6 +7904,31 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7763
7904
  }
7764
7905
  },
7765
7906
 
7907
+ /**
7908
+ * Get resetted padding values when 'padding=false' option is set
7909
+ * https://github.com/naver/billboard.js/issues/2367
7910
+ * @param {number|object} v Padding values to be resetted
7911
+ * @returns {number|object} Padding value
7912
+ * @private
7913
+ */
7914
+ getResettedPadding: function getResettedPadding(v) {
7915
+ var $$ = this,
7916
+ config = $$.config,
7917
+ isNum = isNumber(v),
7918
+ p = isNum ? 0 : {};
7919
+
7920
+ if (config.padding === !1) {
7921
+ isNum || Object.keys(v).forEach(function (key) {
7922
+ // when data.lables=true, do not reset top padding
7923
+ p[key] = !isEmpty(config.data_labels) && config.data_labels !== !1 && key === "top" ? v[key] : 0;
7924
+ });
7925
+ } else {
7926
+ p = v;
7927
+ }
7928
+
7929
+ return p;
7930
+ },
7931
+
7766
7932
  /**
7767
7933
  * Update size values
7768
7934
  * @param {boolean} isInit If is called at initialization
@@ -7801,7 +7967,8 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
7801
7967
  right: hasArc ? 0 : $$.getCurrentPaddingRight(!0),
7802
7968
  bottom: xAxisHeight + subchartHeight + legendHeightForBottom + $$.getCurrentPaddingBottom(),
7803
7969
  left: hasArc ? 0 : $$.getCurrentPaddingLeft()
7804
- }; // for subchart
7970
+ };
7971
+ state.margin = $$.getResettedPadding(state.margin); // for subchart
7805
7972
 
7806
7973
  state.margin2 = isRotated ? {
7807
7974
  top: state.margin.top,
@@ -8140,9 +8307,11 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
8140
8307
  isRotated = config.axis_rotated,
8141
8308
  xPos = points[0][0];
8142
8309
 
8143
- if ($$.hasType("candlestick")) {
8310
+ if ($$.isCandlestickType(d)) {
8144
8311
  if (isRotated) {
8145
- xPos = $$.getCandlestickData(d)._isUp ? points[2][2] + 4 : points[2][1] - 4;
8312
+ var _$$$getCandlestickDat;
8313
+
8314
+ xPos = (_$$$getCandlestickDat = $$.getCandlestickData(d)) != null && _$$$getCandlestickDat._isUp ? points[2][2] + 4 : points[2][1] - 4;
8146
8315
  } else {
8147
8316
  xPos += (points[1][0] - xPos) / 2;
8148
8317
  }
@@ -8450,7 +8619,7 @@ function getTextPos(pos, width) {
8450
8619
  $el.tooltip = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(config.tooltip_contents.bindto);
8451
8620
 
8452
8621
  if ($el.tooltip.empty()) {
8453
- $el.tooltip = $el.chart.style("position", "relative").append("div").attr("class", config_classes.tooltipContainer).style("position", "absolute").style("pointer-events", "none").style("display", "none");
8622
+ $el.tooltip = $el.chart.append("div").attr("class", config_classes.tooltipContainer).style("position", "absolute").style("pointer-events", "none").style("display", "none");
8454
8623
  }
8455
8624
 
8456
8625
  $$.bindTooltipResizePos();
@@ -8634,6 +8803,11 @@ function getTextPos(pos, width) {
8634
8803
  volume = _map3[4];
8635
8804
 
8636
8805
  value = "<b>Open:</b> " + open + " <b>High:</b> " + _high + " <b>Low:</b> " + _low + " <b>Close:</b> " + close + (volume ? " <b>Volume:</b> " + volume : "");
8806
+ } else if ($$.isBarRangeType(row)) {
8807
+ var _row$value = row.value,
8808
+ start = _row$value[0],
8809
+ end = _row$value[1];
8810
+ value = valueFormat(start) + " ~ " + valueFormat(end);
8637
8811
  }
8638
8812
 
8639
8813
  if (value !== undefined) {
@@ -9400,7 +9574,15 @@ var ChartInternal = /*#__PURE__*/function () {
9400
9574
  $el = $$.$el;
9401
9575
  checkModuleImport($$);
9402
9576
  state.hasAxis = !$$.hasArcType();
9403
- state.hasRadar = !state.hasAxis && $$.hasType("radar");
9577
+ state.hasRadar = !state.hasAxis && $$.hasType("radar"); // when 'padding=false' is set, disable axes and subchart. Because they are useless.
9578
+
9579
+ if (config.padding === !1) {
9580
+ config.axis_x_show = !1;
9581
+ config.axis_y_show = !1;
9582
+ config.axis_y2_show = !1;
9583
+ config.subchart_show = !1;
9584
+ }
9585
+
9404
9586
  $$.initParams();
9405
9587
  var bindto = {
9406
9588
  element: config.bindto,
@@ -9419,7 +9601,7 @@ var ChartInternal = /*#__PURE__*/function () {
9419
9601
  $el.chart = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(browser_doc.body.appendChild(browser_doc.createElement("div")));
9420
9602
  }
9421
9603
 
9422
- $el.chart.html("").classed(bindto.classname, !0);
9604
+ $el.chart.html("").classed(bindto.classname, !0).style("position", "relative");
9423
9605
  $$.initToRender();
9424
9606
  }
9425
9607
  /**
@@ -9496,7 +9678,8 @@ var ChartInternal = /*#__PURE__*/function () {
9496
9678
  state.isLegendInset = config.legend_position === "inset";
9497
9679
  state.isLegendTop = config.legend_inset_anchor === "top-left" || config.legend_inset_anchor === "top-right";
9498
9680
  state.isLegendLeft = config.legend_inset_anchor === "top-left" || config.legend_inset_anchor === "bottom-left";
9499
- state.rotatedPaddingRight = isRotated && !config.axis_x_show ? 0 : 30;
9681
+ state.rotatedPadding.top = $$.getResettedPadding(state.rotatedPadding.top);
9682
+ state.rotatedPadding.right = isRotated && !config.axis_x_show ? 0 : 30;
9500
9683
  state.inputType = convertInputType(config.interaction_inputType_mouse, config.interaction_inputType_touch);
9501
9684
  };
9502
9685
 
@@ -10076,12 +10259,14 @@ function loadConfig(config) {
10076
10259
 
10077
10260
  if (notEmpty($$)) {
10078
10261
  $$.callPluginHook("$willDestroy");
10079
- $$.charts.splice($$.charts.indexOf(this), 1); // clear timers && pending transition
10262
+ $$.charts.splice($$.charts.indexOf(this), 1); // detach events
10263
+
10264
+ $$.unbindAllEvents(); // clear timers && pending transition
10080
10265
 
10081
10266
  svg.select("*").interrupt();
10082
10267
  $$.resizeFunction.clear();
10083
10268
  win.removeEventListener("resize", $$.resizeFunction);
10084
- chart.classed("bb", !1).html(""); // releasing own references
10269
+ chart.classed("bb", !1).style("position", null).selectChildren().remove(); // releasing own references
10085
10270
 
10086
10271
  Object.keys(this).forEach(function (key) {
10087
10272
  key === "internal" && Object.keys($$).forEach(function (k) {
@@ -13395,7 +13580,7 @@ var Axis_Axis = /*#__PURE__*/function () {
13395
13580
  }
13396
13581
 
13397
13582
  isYAxis || this.updateXAxisTickValues(targetsToShow, axis);
13398
- var dummy = chart.append("svg").style("visibility", "hidden").style("position", "fixed").style("top", "0px").style("left", "0px");
13583
+ var dummy = chart.append("svg").style("visibility", "hidden").style("position", "fixed").style("top", "0").style("left", "0");
13399
13584
  axis.create(dummy);
13400
13585
  dummy.selectAll("text").each(function (d, i) {
13401
13586
  var currentTextWidth = this.getBoundingClientRect().width;
@@ -13691,13 +13876,15 @@ var Axis_Axis = /*#__PURE__*/function () {
13691
13876
  ["subX", "x", "y", "y2"].forEach(function (type) {
13692
13877
  var axis = $el.axis[type],
13693
13878
  id = type === "subX" ? "x" : type,
13694
- toCull = config["axis_" + id + "_tick_culling"]; // subchart x axis should be aligned with x axis culling
13879
+ cullingOptionPrefix = "axis_" + id + "_tick_culling",
13880
+ toCull = config[cullingOptionPrefix]; // subchart x axis should be aligned with x axis culling
13695
13881
 
13696
13882
  if (axis && toCull) {
13697
- var tickText = axis.selectAll(".tick text"),
13698
- tickValues = sortValue(tickText.data()),
13883
+ var tickNodes = axis.selectAll(".tick"),
13884
+ tickValues = sortValue(tickNodes.data()),
13699
13885
  tickSize = tickValues.length,
13700
- cullingMax = config["axis_" + id + "_tick_culling_max"],
13886
+ cullingMax = config[cullingOptionPrefix + "_max"],
13887
+ lines = config[cullingOptionPrefix + "_lines"],
13701
13888
  intervalForCulling;
13702
13889
 
13703
13890
  if (tickSize) {
@@ -13708,11 +13895,13 @@ var Axis_Axis = /*#__PURE__*/function () {
13708
13895
  }
13709
13896
  }
13710
13897
 
13711
- tickText.each(function (d) {
13712
- this.style.display = tickValues.indexOf(d) % intervalForCulling ? "none" : null;
13898
+ tickNodes.each(function (d) {
13899
+ if (tickValues.indexOf(d) % intervalForCulling) {
13900
+ (lines ? this.querySelector("text") : this).style.display = "none";
13901
+ }
13713
13902
  });
13714
13903
  } else {
13715
- tickText.style("display", null);
13904
+ tickNodes.style("display", null);
13716
13905
  } // set/unset x_axis_tick_clippath
13717
13906
 
13718
13907
 
@@ -15523,15 +15712,16 @@ function smoothLines(el, type) {
15523
15712
  axis_x_tick_format: undefined,
15524
15713
 
15525
15714
  /**
15526
- * Setting for culling ticks.<br><br>
15527
- * 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>
15528
- * We can change the number of ticks to be shown by axis.x.tick.culling.max.
15715
+ * Setting for culling ticks.
15716
+ * - `true`: the ticks will be culled, then only limited tick text will be shown.<br>
15717
+ * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.x.tick.culling.lines=false`.
15718
+ * - `false`: all of ticks will be shown.<br><br>
15719
+ * The number of ticks to be shown can be chaned by `axis.x.tick.culling.max`.
15529
15720
  * @name axis․x․tick․culling
15530
15721
  * @memberof Options
15531
15722
  * @type {boolean}
15532
15723
  * @default
15533
- * - true for indexed axis and timeseries axis
15534
- * - false for category axis
15724
+ * `true` for indexed axis and timeseries axis, `false` for category axis
15535
15725
  * @example
15536
15726
  * axis: {
15537
15727
  * x: {
@@ -15562,6 +15752,25 @@ function smoothLines(el, type) {
15562
15752
  */
15563
15753
  axis_x_tick_culling_max: 10,
15564
15754
 
15755
+ /**
15756
+ * Control visibility of tick lines within culling option, along with tick text.
15757
+ * @name axis․x․tick․culling․lines
15758
+ * @memberof Options
15759
+ * @type {boolean}
15760
+ * @default true
15761
+ * @example
15762
+ * axis: {
15763
+ * x: {
15764
+ * tick: {
15765
+ * culling: {
15766
+ * lines: false,
15767
+ * }
15768
+ * }
15769
+ * }
15770
+ * }
15771
+ */
15772
+ axis_x_tick_culling_lines: !0,
15773
+
15565
15774
  /**
15566
15775
  * The number of x axis ticks to show.<br><br>
15567
15776
  * 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).
@@ -15645,8 +15854,8 @@ function smoothLines(el, type) {
15645
15854
 
15646
15855
  /**
15647
15856
  * Fit x axis ticks.
15648
- * - **true**: ticks will be positioned nicely to have same intervals.
15649
- * - **false**: ticks will be positioned according to x value of the data points.
15857
+ * - **true**: ticks will be shown according to x value of the data points.
15858
+ * - **false**: ticks will be shown as to have same intervals.
15650
15859
  * @name axis․x․tick․fit
15651
15860
  * @memberof Options
15652
15861
  * @type {boolean}
@@ -16235,9 +16444,11 @@ function smoothLines(el, type) {
16235
16444
  axis_y_tick_format: undefined,
16236
16445
 
16237
16446
  /**
16238
- * Setting for culling ticks.<br><br>
16239
- * 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>
16240
- * We can change the number of ticks to be shown by axis.y.tick.culling.max.
16447
+ * Setting for culling ticks.
16448
+ * - `true`: the ticks will be culled, then only limited tick text will be shown.<br>
16449
+ * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.y.tick.culling.lines=false`.
16450
+ * - `false`: all of ticks will be shown.<br><br>
16451
+ * The number of ticks to be shown can be chaned by `axis.y.tick.culling.max`.
16241
16452
  * @name axis․y․tick․culling
16242
16453
  * @memberof Options
16243
16454
  * @type {boolean}
@@ -16272,6 +16483,25 @@ function smoothLines(el, type) {
16272
16483
  */
16273
16484
  axis_y_tick_culling_max: 5,
16274
16485
 
16486
+ /**
16487
+ * Control visibility of tick lines within culling option, along with tick text.
16488
+ * @name axis․y․tick․culling․lines
16489
+ * @memberof Options
16490
+ * @type {boolean}
16491
+ * @default true
16492
+ * @example
16493
+ * axis: {
16494
+ * y: {
16495
+ * tick: {
16496
+ * culling: {
16497
+ * lines: false,
16498
+ * }
16499
+ * }
16500
+ * }
16501
+ * }
16502
+ */
16503
+ axis_y_tick_culling_lines: !0,
16504
+
16275
16505
  /**
16276
16506
  * Show y axis outer tick.
16277
16507
  * @name axis․y․tick․outer
@@ -16715,9 +16945,11 @@ function smoothLines(el, type) {
16715
16945
  axis_y2_tick_format: undefined,
16716
16946
 
16717
16947
  /**
16718
- * Setting for culling ticks.<br><br>
16719
- * 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>
16720
- * We can change the number of ticks to be shown by axis.y.tick.culling.max.
16948
+ * Setting for culling ticks.
16949
+ * - `true`: the ticks will be culled, then only limited tick text will be shown.<br>
16950
+ * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.y2.tick.culling.lines=false`.
16951
+ * - `false`: all of ticks will be shown.<br><br>
16952
+ * The number of ticks to be shown can be chaned by `axis.y2.tick.culling.max`.
16721
16953
  * @name axis․y2․tick․culling
16722
16954
  * @memberof Options
16723
16955
  * @type {boolean}
@@ -16752,6 +16984,25 @@ function smoothLines(el, type) {
16752
16984
  */
16753
16985
  axis_y2_tick_culling_max: 5,
16754
16986
 
16987
+ /**
16988
+ * Control visibility of tick lines within culling option, along with tick text.
16989
+ * @name axis․y2․tick․culling․lines
16990
+ * @memberof Options
16991
+ * @type {boolean}
16992
+ * @default true
16993
+ * @example
16994
+ * axis: {
16995
+ * y2: {
16996
+ * tick: {
16997
+ * culling: {
16998
+ * lines: false,
16999
+ * }
17000
+ * }
17001
+ * }
17002
+ * }
17003
+ */
17004
+ axis_y2_tick_culling_lines: !0,
17005
+
16755
17006
  /**
16756
17007
  * Show or hide y2 axis outer tick.
16757
17008
  * @name axis․y2․tick․outer
@@ -16995,9 +17246,9 @@ function smoothLines(el, type) {
16995
17246
  ;// CONCATENATED MODULE: ./src/config/Options/axis/axis.ts
16996
17247
 
16997
17248
 
16998
- 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; }
17249
+ 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; }
16999
17250
 
17000
- 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; }
17251
+ 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; }
17001
17252
 
17002
17253
  /**
17003
17254
  * Copyright (c) 2017 ~ present NAVER Corp.
@@ -17569,11 +17820,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
17569
17820
 
17570
17821
  if (title) {
17571
17822
  var text = $$.$el.arcs.append("text").attr("class", config_classes[hasGauge ? "chartArcsGaugeTitle" : "chartArcsTitle"]).style("text-anchor", "middle");
17572
-
17573
- if (hasGauge) {
17574
- text.attr("dy", "-0.3em").style("font-size", "27px");
17575
- }
17576
-
17823
+ hasGauge && text.attr("dy", "-0.3em");
17577
17824
  setTextValue(text, title, hasGauge ? undefined : [-.6, 1.35], !0);
17578
17825
  }
17579
17826
  },
@@ -17797,6 +18044,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
17797
18044
  return;
17798
18045
  }
17799
18046
 
18047
+ state.event = event;
17800
18048
  var eventArc = getEventArc(event),
17801
18049
  datum = eventArc.datum(),
17802
18050
  updated = (_datum = datum) != null && _datum.data && datum.data.id ? $$.updateAngle(datum) : null,
@@ -18034,9 +18282,16 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
18034
18282
 
18035
18283
  /* harmony default export */ var bar = ({
18036
18284
  initBar: function initBar() {
18037
- var $el = this.$el;
18285
+ var $el = this.$el,
18286
+ config = this.config,
18287
+ clip = this.state.clip;
18038
18288
  $el.bar = $el.main.select("." + config_classes.chart) // should positioned at the beginning of the shape node to not overlap others
18039
- .insert("g", ":first-child").attr("class", config_classes.chartBars);
18289
+ .insert("g", ":first-child").attr("class", config_classes.chartBars); // set clip-path attribute when condition meet
18290
+ // https://github.com/naver/billboard.js/issues/2421
18291
+
18292
+ if (config.clipPath === !1 && (config.bar_radius || config.bar_radius_ratio)) {
18293
+ $el.bar.attr("clip-path", clip.pathXAxis.replace(/#[^)]*/, "#" + clip.id));
18294
+ }
18040
18295
  },
18041
18296
  updateTargetsForBar: function updateTargetsForBar(targets) {
18042
18297
  var $$ = this,
@@ -18053,8 +18308,8 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
18053
18308
 
18054
18309
  var mainBarUpdate = $$.$el.main.select("." + config_classes.chartBars).selectAll("." + config_classes.chartBar).data( // remove
18055
18310
  targets.filter(function (v) {
18056
- return !v.values.every(function (d) {
18057
- return !isNumber(d.value);
18311
+ return v.values.some(function (d) {
18312
+ return isNumber(d.value) || $$.isBarRangeType(d);
18058
18313
  });
18059
18314
  })).attr("class", function (d) {
18060
18315
  return classChartBar(d) + classFocus(d);
@@ -18092,7 +18347,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
18092
18347
 
18093
18348
  /**
18094
18349
  * Redraw function
18095
- * @param {Function} drawFn Retuned functino from .generateDrawCandlestick()
18350
+ * @param {Function} drawFn Retuned function from .getDrawShape() => .generateDrawBar()
18096
18351
  * @param {boolean} withTransition With or without transition
18097
18352
  * @param {boolean} isSub Subchart draw
18098
18353
  * @returns {Array}
@@ -18107,15 +18362,35 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
18107
18362
  bar = _ref.bar;
18108
18363
 
18109
18364
  return [$$.$T(bar, withTransition, getRandom()).attr("d", function (d) {
18110
- return isNumber(d.value) && drawFn(d);
18365
+ return (isNumber(d.value) || $$.isBarRangeType(d)) && drawFn(d);
18111
18366
  }).style("fill", this.color).style("opacity", null)];
18112
18367
  },
18368
+
18369
+ /**
18370
+ * Generate draw function
18371
+ * @param {object} barIndices data order within x axis.
18372
+ * barIndices ==> {data1: 0, data2: 0, data3: 1, data4: 1, __max__: 1}
18373
+ *
18374
+ * When gropus given as:
18375
+ * groups: [
18376
+ * ["data1", "data2"],
18377
+ * ["data3", "data4"]
18378
+ * ],
18379
+ *
18380
+ * Will be rendered as:
18381
+ * data1 data3 data1 data3
18382
+ * data2 data4 data2 data4
18383
+ * -------------------------
18384
+ * 0 1
18385
+ * @param {boolean} isSub If is for subchart
18386
+ * @returns {Function}
18387
+ * @private
18388
+ */
18113
18389
  generateDrawBar: function generateDrawBar(barIndices, isSub) {
18114
18390
  var $$ = this,
18115
18391
  config = $$.config,
18116
18392
  getPoints = $$.generateGetBarPoints(barIndices, isSub),
18117
18393
  isRotated = config.axis_rotated,
18118
- isGrouped = config.data_groups.length,
18119
18394
  barRadius = config.bar_radius,
18120
18395
  barRadiusRatio = config.bar_radius_ratio,
18121
18396
  getRadius = isNumber(barRadius) && barRadius > 0 ? function () {
@@ -18130,9 +18405,12 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
18130
18405
  indexY = +!indexX,
18131
18406
  isNegative = d.value < 0,
18132
18407
  pathRadius = ["", ""],
18133
- radius = 0; // switch points if axis is rotated, not applicable for sub chart
18408
+ radius = 0,
18409
+ isGrouped = $$.isGrouped(d.id),
18410
+ hasRadius = d.value !== 0 && getRadius,
18411
+ isRadiusData = hasRadius && isGrouped ? $$.isStackingRadiusData(d) : !1; // switch points if axis is rotated, not applicable for sub chart
18134
18412
 
18135
- if (getRadius && !isGrouped) {
18413
+ if (hasRadius && (!isGrouped || isRadiusData)) {
18136
18414
  var index = isRotated ? indexY : indexX,
18137
18415
  barW = points[2][index] - points[0][index];
18138
18416
  radius = getRadius(barW);
@@ -18148,6 +18426,43 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
18148
18426
  return "M" + points[0][indexX] + "," + points[0][indexY] + path + "z";
18149
18427
  };
18150
18428
  },
18429
+
18430
+ /**
18431
+ * Determine if given stacking bar data is radius type
18432
+ * @param {Object} d Data row
18433
+ * @returns {boolean}
18434
+ */
18435
+ isStackingRadiusData: function isStackingRadiusData(d) {
18436
+ var $$ = this,
18437
+ config = $$.config,
18438
+ data = $$.data,
18439
+ id = d.id,
18440
+ index = d.index,
18441
+ value = d.value,
18442
+ keys = config.data_groups.find(function (v) {
18443
+ return v.indexOf(id) > -1;
18444
+ }),
18445
+ sortedList = $$.orderTargets($$.filterTargetsToShow(data.targets.filter($$.isBarType, $$))).filter(function (v) {
18446
+ return keys.indexOf(v.id) > -1;
18447
+ }),
18448
+ sortedIds = sortedList.map(function (v) {
18449
+ return v.values.filter(function (v2) {
18450
+ return v2.index === index && (value > 0 ? v2.value > 0 : v2.value < 0);
18451
+ })[0];
18452
+ }).filter(Boolean).map(function (v) {
18453
+ return v.id;
18454
+ });
18455
+ // If the given id stays in the last position, then radius should be applied.
18456
+ return value !== 0 && sortedIds.indexOf(id) === sortedIds.length - 1;
18457
+ },
18458
+
18459
+ /**
18460
+ * Generate bar coordinate points data
18461
+ * @param {object} barIndices Data order within x axis.
18462
+ * @param {boolean} isSub If is for subchart
18463
+ * @returns {Array} Array of coordinate points
18464
+ * @private
18465
+ */
18151
18466
  generateGetBarPoints: function generateGetBarPoints(barIndices, isSub) {
18152
18467
  var $$ = this,
18153
18468
  config = $$.config,
@@ -18170,35 +18485,22 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
18170
18485
  posY = y0;
18171
18486
  }
18172
18487
 
18173
- posY -= y0 - offset;
18488
+ if (!$$.isBarRangeType(d)) {
18489
+ posY -= y0 - offset;
18490
+ }
18491
+
18174
18492
  var startPosX = posX + width; // 4 points that make a bar
18175
18493
 
18176
18494
  return [[posX, offset], [posX, posY], [startPosX, posY], [startPosX, offset]];
18177
18495
  };
18178
- },
18179
- isWithinBar: function isWithinBar(that) {
18180
- var mouse = getPointer(this.state.event, that),
18181
- list = getRectSegList(that),
18182
- _list = list,
18183
- seg0 = _list[0],
18184
- seg1 = _list[1],
18185
- x = Math.min(seg0.x, seg1.x),
18186
- y = Math.min(seg0.y, seg1.y),
18187
- offset = this.config.bar_sensitivity,
18188
- _that$getBBox = that.getBBox(),
18189
- width = _that$getBBox.width,
18190
- height = _that$getBBox.height,
18191
- isWithin = x - offset < mouse[0] && mouse[0] < x + width + offset && y - offset < mouse[1] && mouse[1] < y + height + offset;
18192
-
18193
- return isWithin;
18194
18496
  }
18195
18497
  });
18196
18498
  ;// CONCATENATED MODULE: ./src/ChartInternal/shape/candlestick.ts
18197
18499
 
18198
18500
 
18199
- 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; }
18501
+ 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; }
18200
18502
 
18201
- 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; }
18503
+ 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; }
18202
18504
 
18203
18505
  /**
18204
18506
  * Copyright (c) 2017 ~ present NAVER Corp.
@@ -19707,6 +20009,7 @@ var cacheKey = KEY.radarPoints;
19707
20009
  return d && Object.keys(d).length === 1 ? d.index : undefined;
19708
20010
  },
19709
20011
  hide = function (event) {
20012
+ state.event = event;
19710
20013
  var index = getIndex(event),
19711
20014
  noIndex = isUndefined(index);
19712
20015
 
@@ -19958,10 +20261,10 @@ var cacheKey = KEY.radarPoints;
19958
20261
  * @memberof Options
19959
20262
  * @type {object}
19960
20263
  * @property {object} bar Bar object
20264
+ * @property {number} [bar.indices.removeNull=false] Remove nullish data on bar indices positions.
19961
20265
  * @property {number} [bar.label.threshold=0] Set threshold ratio to show/hide labels.
19962
20266
  * @property {number} [bar.padding=0] The padding pixel value between each bar.
19963
20267
  * @property {number} [bar.radius] Set the radius of bar edge in pixel.
19964
- * - **NOTE:** Works only for non-stacked bar
19965
20268
  * @property {number} [bar.radius.ratio] Set the radius ratio of bar edge in relative the bar's width.
19966
20269
  * @property {number} [bar.sensitivity=2] The senstivity offset value for interaction boundary.
19967
20270
  * @property {number} [bar.width] Change the width of bar chart.
@@ -19974,15 +20277,21 @@ var cacheKey = KEY.radarPoints;
19974
20277
  * @property {number} [bar.width.dataname.ratio=0.6] Change the width of bar chart by ratio.
19975
20278
  * @property {number} [bar.width.dataname.max] The maximum width value for ratio.
19976
20279
  * @property {boolean} [bar.zerobased=true] Set if min or max value will be 0 on bar chart.
20280
+ * @see [Demo: bar indices](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarIndices)
19977
20281
  * @see [Demo: bar padding](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarPadding)
19978
20282
  * @see [Demo: bar radius](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarRadius)
19979
20283
  * @see [Demo: bar width](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarWidth)
19980
20284
  * @see [Demo: bar width variant](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarWidthVariant)
19981
20285
  * @example
19982
20286
  * bar: {
20287
+ * // remove nullish data on bar indices postions
20288
+ * indices: {
20289
+ * removeNull: true
20290
+ * },
20291
+ *
19983
20292
  * padding: 1,
19984
20293
  *
19985
- * // the 'radius' option can be used only for non-stacking bars
20294
+ * // bar radius
19986
20295
  * radius: 10,
19987
20296
  * // or
19988
20297
  * radius: {
@@ -20019,6 +20328,7 @@ var cacheKey = KEY.radarPoints;
20019
20328
  * }
20020
20329
  */
20021
20330
  bar_label_threshold: 0,
20331
+ bar_indices_removeNull: !1,
20022
20332
  bar_padding: 0,
20023
20333
  bar_radius: undefined,
20024
20334
  bar_radius_ratio: undefined,
@@ -21422,9 +21732,9 @@ extend(zoom, {
21422
21732
  ;// CONCATENATED MODULE: ./src/ChartInternal/internals/selection.ts
21423
21733
 
21424
21734
 
21425
- 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; }
21735
+ 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; }
21426
21736
 
21427
- 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; }
21737
+ 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; }
21428
21738
 
21429
21739
  /**
21430
21740
  * Copyright (c) 2017 ~ present NAVER Corp.
@@ -22646,7 +22956,7 @@ var _defaults = {},
22646
22956
  * bb.version; // "1.0.0"
22647
22957
  * @memberof bb
22648
22958
  */
22649
- version: "3.2.0",
22959
+ version: "3.2.2",
22650
22960
 
22651
22961
  /**
22652
22962
  * Generate chart
@@ -22780,7 +23090,7 @@ var _defaults = {},
22780
23090
  };
22781
23091
  /**
22782
23092
  * @namespace bb
22783
- * @version 3.2.0
23093
+ * @version 3.2.2
22784
23094
  */
22785
23095
  ;// CONCATENATED MODULE: ./src/index.ts
22786
23096
  /**