billboard.js 3.9.1 → 3.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +225 -131
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +1109 -294
  6. package/dist/billboard.pkgd.min.js +2 -2
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +886 -165
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +887 -166
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +888 -167
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +888 -167
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +888 -167
  22. package/dist/theme/dark.css +1 -1
  23. package/dist/theme/dark.min.css +1 -1
  24. package/dist/theme/datalab.css +1 -1
  25. package/dist/theme/datalab.min.css +1 -1
  26. package/dist/theme/graph.css +1 -1
  27. package/dist/theme/graph.min.css +1 -1
  28. package/dist/theme/insight.css +1 -1
  29. package/dist/theme/insight.min.css +1 -1
  30. package/dist-esm/billboard.js +175 -86
  31. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  32. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  33. package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
  34. package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
  35. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  36. package/package.json +17 -17
  37. package/src/Chart/api/load.ts +4 -2
  38. package/src/Chart/api/tooltip.ts +11 -3
  39. package/src/ChartInternal/data/data.ts +29 -12
  40. package/src/ChartInternal/interactions/eventrect.ts +75 -8
  41. package/src/ChartInternal/interactions/interaction.ts +2 -57
  42. package/src/ChartInternal/internals/redraw.ts +2 -0
  43. package/src/ChartInternal/internals/tooltip.ts +58 -2
  44. package/src/ChartInternal/shape/arc.ts +20 -2
  45. package/src/ChartInternal/shape/line.ts +0 -1
  46. package/src/ChartInternal/shape/radar.ts +5 -14
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.9.1
8
+ * @version 3.9.2
9
9
  */
10
10
  /*-- Chart --*/
11
11
  .bb svg {
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.9.1
8
+ * @version 3.9.2
9
9
  */
10
10
  (function webpackUniversalModuleDefinition(root, factory) {
11
11
  if(typeof exports === 'object' && typeof module === 'object')
@@ -4399,6 +4399,7 @@ function getDataKeyForJson(keysParam, config) {
4399
4399
 
4400
4400
 
4401
4401
 
4402
+
4402
4403
  /* harmony default export */ var data_data = ({
4403
4404
  isX: function isX(key) {
4404
4405
  var $$ = this,
@@ -5049,16 +5050,26 @@ function getDataKeyForJson(keysParam, config) {
5049
5050
  var $$ = this,
5050
5051
  config = $$.config,
5051
5052
  _$$$state = $$.state,
5053
+ hasRadar = _$$$state.hasRadar,
5052
5054
  inputType = _$$$state.inputType,
5053
5055
  _$$$state$eventReceiv = _$$$state.eventReceiver,
5054
5056
  coords = _$$$state$eventReceiv.coords,
5055
- rect = _$$$state$eventReceiv.rect,
5056
- isRotated = config.axis_rotated,
5057
- e = inputType === "touch" && event.changedTouches ? event.changedTouches[0] : event,
5058
- index = findIndex(coords, isRotated ? e.clientY - rect.top : e.clientX - rect.left, 0, coords.length - 1, isRotated);
5059
-
5060
- // get data based on the mouse coords
5057
+ rect = _$$$state$eventReceiv.rect;
5058
+ var index;
5059
+ if (hasRadar) {
5060
+ var target = event.target;
5061
5061
 
5062
+ // in case of multilined axis text
5063
+ if (/tspan/i.test(target.tagName)) {
5064
+ target = target.parentNode;
5065
+ }
5066
+ var d = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(target).datum();
5067
+ index = d && Object.keys(d).length === 1 ? d.index : undefined;
5068
+ } else {
5069
+ var isRotated = config.axis_rotated,
5070
+ e = inputType === "touch" && event.changedTouches ? event.changedTouches[0] : event; // get data based on the mouse coords
5071
+ index = findIndex(coords, isRotated ? e.clientY - rect.top : e.clientX - rect.left, 0, coords.length - 1, isRotated);
5072
+ }
5062
5073
  return index;
5063
5074
  },
5064
5075
  getDataLabelLength: function getDataLabelLength(min, max, key) {
@@ -5589,54 +5600,6 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5589
5600
 
5590
5601
 
5591
5602
  /* harmony default export */ var interactions_interaction = ({
5592
- selectRectForSingle: function selectRectForSingle(context, eventRect, index) {
5593
- var _this = this,
5594
- $$ = this,
5595
- config = $$.config,
5596
- _$$$$el = $$.$el,
5597
- main = _$$$$el.main,
5598
- circle = _$$$$el.circle,
5599
- isSelectionEnabled = config.data_selection_enabled,
5600
- isSelectionGrouped = config.data_selection_grouped,
5601
- isSelectable = config.data_selection_isselectable,
5602
- isTooltipGrouped = config.tooltip_grouped,
5603
- selectedData = $$.getAllValuesOnIndex(index);
5604
- if (isTooltipGrouped) {
5605
- $$.showTooltip(selectedData, context);
5606
- $$.showGridFocus == null ? void 0 : $$.showGridFocus(selectedData);
5607
- if (!isSelectionEnabled || isSelectionGrouped) {
5608
- return;
5609
- }
5610
- }
5611
-
5612
- // remove possible previous focused state
5613
- circle || main.selectAll("." + $COMMON.EXPANDED + ":not(." + $SHAPE.shape + "-" + index + ")").classed($COMMON.EXPANDED, !1);
5614
- var shapeAtIndex = main.selectAll("." + $SHAPE.shape + "-" + index).classed($COMMON.EXPANDED, !0).style("cursor", isSelectable ? "pointer" : null).filter(function (d) {
5615
- return $$.isWithinShape(this, d);
5616
- });
5617
- if (shapeAtIndex.empty() && !isTooltipGrouped) {
5618
- $$.hideGridFocus == null ? void 0 : $$.hideGridFocus();
5619
- $$.hideTooltip();
5620
- isSelectionGrouped || $$.setExpand(index);
5621
- }
5622
- shapeAtIndex.call(function (selected) {
5623
- var _this2 = this;
5624
- _newArrowCheck(this, _this);
5625
- var d = selected.data();
5626
- if (isSelectionEnabled && (isSelectionGrouped || isSelectable != null && isSelectable.bind($$.api)(d))) {
5627
- eventRect.style("cursor", "pointer");
5628
- }
5629
- if (!isTooltipGrouped) {
5630
- $$.showTooltip(d, context);
5631
- $$.showGridFocus == null ? void 0 : $$.showGridFocus(d);
5632
- $$.unexpandCircles == null ? void 0 : $$.unexpandCircles();
5633
- selected.each(function (d) {
5634
- _newArrowCheck(this, _this2);
5635
- return $$.setExpand(index, d.id);
5636
- }.bind(this));
5637
- }
5638
- }.bind(this));
5639
- },
5640
5603
  /**
5641
5604
  * Expand data shape/point
5642
5605
  * @param {number} index Index number
@@ -5662,16 +5625,16 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5662
5625
  * @private
5663
5626
  */
5664
5627
  expandBarTypeShapes: function expandBarTypeShapes(expand, i, id, reset) {
5665
- var _this3 = this;
5628
+ var _this = this;
5666
5629
  if (expand === void 0) {
5667
5630
  expand = !0;
5668
5631
  }
5669
5632
  var $$ = this;
5670
5633
  ["bar", "candlestick"].filter(function (v) {
5671
- _newArrowCheck(this, _this3);
5634
+ _newArrowCheck(this, _this);
5672
5635
  return $$.$el[v];
5673
5636
  }.bind(this)).forEach(function (v) {
5674
- _newArrowCheck(this, _this3);
5637
+ _newArrowCheck(this, _this);
5675
5638
  reset && $$.$el[v].classed($COMMON.EXPANDED, !1);
5676
5639
  $$.getShapeByIndex(v, i, id).classed($COMMON.EXPANDED, expand);
5677
5640
  }.bind(this));
@@ -5683,7 +5646,7 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5683
5646
  * @private
5684
5647
  */
5685
5648
  setOverOut: function setOverOut(isOver, d) {
5686
- var _this5 = this,
5649
+ var _this3 = this,
5687
5650
  $$ = this,
5688
5651
  config = $$.config,
5689
5652
  _$$$state = $$.state,
@@ -5704,16 +5667,16 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5704
5667
  return $$.isWithinShape(this, d);
5705
5668
  }),
5706
5669
  shape = shapesAtIndex.filter(function () {
5707
- var _this4 = this;
5670
+ var _this2 = this;
5708
5671
  return last.every(function (v) {
5709
- _newArrowCheck(this, _this4);
5672
+ _newArrowCheck(this, _this2);
5710
5673
  return v !== this;
5711
5674
  }.bind(this));
5712
5675
  }); // select based on the index
5713
5676
  // filter if has new selection
5714
5677
  // call onout callback
5715
5678
  if (!isOver || shapesAtIndex.empty() || last.length === shape.size() && shape.nodes().every(function (v, i) {
5716
- _newArrowCheck(this, _this5);
5679
+ _newArrowCheck(this, _this3);
5717
5680
  return v !== last[i];
5718
5681
  }.bind(this))) {
5719
5682
  while (last.length) {
@@ -5760,7 +5723,7 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5760
5723
  * @private
5761
5724
  */
5762
5725
  getDraggableSelection: function getDraggableSelection() {
5763
- var _this6 = this,
5726
+ var _this4 = this,
5764
5727
  $$ = this,
5765
5728
  config = $$.config,
5766
5729
  state = $$.state;
@@ -5771,11 +5734,11 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5771
5734
  state.event = event;
5772
5735
  $$.dragstart(getPointer(event, this));
5773
5736
  }).on("end", function (event) {
5774
- _newArrowCheck(this, _this6);
5737
+ _newArrowCheck(this, _this4);
5775
5738
  state.event = event;
5776
5739
  $$.dragend();
5777
5740
  }.bind(this)) : function () {
5778
- _newArrowCheck(this, _this6);
5741
+ _newArrowCheck(this, _this4);
5779
5742
  }.bind(this);
5780
5743
  },
5781
5744
  /**
@@ -5787,7 +5750,6 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5787
5750
  */
5788
5751
  dispatchEvent: function dispatchEvent(type, index, mouse) {
5789
5752
  var _ref,
5790
- _this7 = this,
5791
5753
  $$ = this,
5792
5754
  config = $$.config,
5793
5755
  _$$$state2 = $$.state,
@@ -5795,15 +5757,11 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5795
5757
  hasAxis = _$$$state2.hasAxis,
5796
5758
  hasRadar = _$$$state2.hasRadar,
5797
5759
  hasTreemap = _$$$state2.hasTreemap,
5798
- _$$$$el2 = $$.$el,
5799
- eventRect = _$$$$el2.eventRect,
5800
- arcs = _$$$$el2.arcs,
5801
- radar = _$$$$el2.radar,
5802
- treemap = _$$$$el2.treemap,
5803
- element = (_ref = hasTreemap && eventReceiver.rect || hasRadar && radar.axes.select("." + $AXIS.axis + "-" + index + " text") || eventRect || (arcs == null ? void 0 : arcs.selectAll("." + $COMMON.target + " path").filter(function (d, i) {
5804
- _newArrowCheck(this, _this7);
5805
- return i === index;
5806
- }.bind(this)))) == null ? void 0 : _ref.node();
5760
+ _$$$$el = $$.$el,
5761
+ eventRect = _$$$$el.eventRect,
5762
+ radar = _$$$$el.radar,
5763
+ treemap = _$$$$el.treemap,
5764
+ element = (_ref = hasTreemap && eventReceiver.rect || hasRadar && radar.axes.select("." + $AXIS.axis + "-" + index + " text") || eventRect || ($$.getArcElementByIdOrIndex == null ? void 0 : $$.getArcElementByIdOrIndex(index))) == null ? void 0 : _ref.node();
5807
5765
  if (element) {
5808
5766
  var isMultipleX = $$.isMultipleX();
5809
5767
  var _element$getBoundingC = element.getBoundingClientRect(),
@@ -5835,9 +5793,9 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5835
5793
  */
5836
5794
  unbindZoomEvent: function unbindZoomEvent() {
5837
5795
  var $$ = this,
5838
- _$$$$el3 = $$.$el,
5839
- eventRect = _$$$$el3.eventRect,
5840
- zoomResetBtn = _$$$$el3.zoomResetBtn;
5796
+ _$$$$el2 = $$.$el,
5797
+ eventRect = _$$$$el2.eventRect,
5798
+ zoomResetBtn = _$$$$el2.zoomResetBtn;
5841
5799
  eventRect == null ? void 0 : eventRect.on(".zoom wheel.zoom .drag", null);
5842
5800
  zoomResetBtn == null ? void 0 : zoomResetBtn.on("click", null).style("display", "none");
5843
5801
  },
@@ -5846,19 +5804,19 @@ var external_commonjs_d3_drag_commonjs2_d3_drag_amd_d3_drag_root_d3_ = __webpack
5846
5804
  * @private
5847
5805
  */
5848
5806
  unbindAllEvents: function unbindAllEvents() {
5849
- var _this8 = this,
5807
+ var _this5 = this,
5850
5808
  $$ = this,
5851
- _$$$$el4 = $$.$el,
5852
- arcs = _$$$$el4.arcs,
5853
- eventRect = _$$$$el4.eventRect,
5854
- legend = _$$$$el4.legend,
5855
- region = _$$$$el4.region,
5856
- svg = _$$$$el4.svg,
5857
- treemap = _$$$$el4.treemap,
5809
+ _$$$$el3 = $$.$el,
5810
+ arcs = _$$$$el3.arcs,
5811
+ eventRect = _$$$$el3.eventRect,
5812
+ legend = _$$$$el3.legend,
5813
+ region = _$$$$el3.region,
5814
+ svg = _$$$$el3.svg,
5815
+ treemap = _$$$$el3.treemap,
5858
5816
  brush = $$.brush;
5859
5817
  // detach all possible event types
5860
5818
  [svg, eventRect, region == null ? void 0 : region.list, brush == null ? void 0 : brush.getSelection(), arcs == null ? void 0 : arcs.selectAll("path"), legend == null ? void 0 : legend.selectAll("g"), treemap].forEach(function (v) {
5861
- _newArrowCheck(this, _this8);
5819
+ _newArrowCheck(this, _this5);
5862
5820
  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);
5863
5821
  }.bind(this));
5864
5822
  $$.unbindZoomEvent == null ? void 0 : $$.unbindZoomEvent();
@@ -7573,6 +7531,7 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
7573
7531
  $$.redrawTitle == null ? void 0 : $$.redrawTitle();
7574
7532
  initializing && $$.updateTypesElements();
7575
7533
  $$.generateRedrawList(targetsToShow, flow, duration, wth.Subchart);
7534
+ $$.updateTooltipOnRedraw();
7576
7535
  $$.callPluginHook("$redraw", options, duration);
7577
7536
  },
7578
7537
  /**
@@ -9731,7 +9690,7 @@ function title_getTextPos(pos, width) {
9731
9690
  if (!bindto && datum) {
9732
9691
  var _config$tooltip_posit,
9733
9692
  _config$tooltip_posit2,
9734
- _getPointer = getPointer(state.event, eventTarget != null ? eventTarget : eventRect.node()),
9693
+ _getPointer = getPointer(state.event, eventTarget != null ? eventTarget : eventRect == null ? void 0 : eventRect.node()),
9735
9694
  x = _getPointer[0],
9736
9695
  y = _getPointer[1],
9737
9696
  currPos = {
@@ -9961,6 +9920,63 @@ function title_getTextPos(pos, width) {
9961
9920
  }
9962
9921
  }.bind(this));
9963
9922
  }
9923
+ },
9924
+ /**
9925
+ * Update tooltip content on redraw
9926
+ * - In a situation where tooltip is displayed and data load happens, it should reflect loaded data to tooltip
9927
+ * @param {d3Selection} context Event rect element
9928
+ * @param {number} index Data index
9929
+ * @private
9930
+ */
9931
+ updateTooltipOnRedraw: function updateTooltipOnRedraw(context, index) {
9932
+ var _this9 = this,
9933
+ $$ = this,
9934
+ config = $$.config,
9935
+ _$$$$el2 = $$.$el,
9936
+ eventRect = _$$$$el2.eventRect,
9937
+ svg = _$$$$el2.svg,
9938
+ tooltip = _$$$$el2.tooltip,
9939
+ _$$$state2 = $$.state,
9940
+ event = _$$$state2.event,
9941
+ hasAxis = _$$$state2.hasAxis,
9942
+ hasRadar = _$$$state2.hasRadar,
9943
+ hasTreemap = _$$$state2.hasTreemap;
9944
+ // Update tooltip, when tooltip is in shown state
9945
+ if ((tooltip == null ? void 0 : tooltip.style("display")) === "block" && event) {
9946
+ var _ref,
9947
+ rect = context != null ? context : (_ref = hasRadar ? svg : eventRect) == null ? void 0 : _ref.node();
9948
+ // for Axis based & Radar
9949
+ if (hasAxis || hasRadar) {
9950
+ if ($$.isMultipleX()) {
9951
+ $$.selectRectForMultipleXs(rect, !1);
9952
+ } else {
9953
+ var idx = index != null ? index : $$.getDataIndexFromEvent(event);
9954
+ if (index === -1) {
9955
+ $$.api.tooltip.hide();
9956
+ } else {
9957
+ $$.selectRectForSingle(rect, idx);
9958
+ $$.setExpand(idx, null, !0);
9959
+ }
9960
+ }
9961
+
9962
+ // for Arc & Treemap
9963
+ } else {
9964
+ var clientX = event.clientX,
9965
+ clientY = event.clientY;
9966
+ setTimeout(function () {
9967
+ _newArrowCheck(this, _this9);
9968
+ var target = browser_doc.elementFromPoint(clientX, clientY);
9969
+ var data = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(target).datum();
9970
+ if (data) {
9971
+ var d = $$.hasArcType() ? $$.convertToArcData($$.updateAngle(data)) : data == null ? void 0 : data.data;
9972
+ hasTreemap && (target = svg.node());
9973
+ d && $$.showTooltip([d], target);
9974
+ } else {
9975
+ $$.api.tooltip.hide();
9976
+ }
9977
+ }.bind(this), config.transition_duration);
9978
+ }
9979
+ }
9964
9980
  }
9965
9981
  });
9966
9982
  ;// CONCATENATED MODULE: ./src/ChartInternal/internals/transform.ts
@@ -12186,7 +12202,6 @@ var legend_legend = {
12186
12202
  }.bind(this));
12187
12203
  }.bind(this));
12188
12204
  } else {
12189
- $$.api.tooltip.hide();
12190
12205
  $$.loadFromArgs(args);
12191
12206
  }
12192
12207
  },
@@ -12219,6 +12234,8 @@ var legend_legend = {
12219
12234
  var _this3 = this,
12220
12235
  $$ = this.internal,
12221
12236
  args = argsValue || {};
12237
+ // hide possible tooltip display when data is completely unloaded
12238
+ isEmpty(args) && this.tooltip.hide();
12222
12239
  if (isArray(args)) {
12223
12240
  args = {
12224
12241
  ids: args
@@ -12436,6 +12453,10 @@ var tooltip_tooltip = {
12436
12453
  * }
12437
12454
  * });
12438
12455
  *
12456
+ * // for Arc types, specify 'id' or 'index'
12457
+ * chart.tooltip.show({ data: { id: "data2" }});
12458
+ * chart.tooltip.show({ data: { index: 2 }});
12459
+ *
12439
12460
  * // when data.xs is used
12440
12461
  * chart.tooltip.show({
12441
12462
  * data: {
@@ -12472,18 +12493,20 @@ var tooltip_tooltip = {
12472
12493
 
12473
12494
  // determine focus data
12474
12495
  if (args.data) {
12475
- var data = args.data,
12476
- y = $$.getYScaleById(data.id)(data.value);
12496
+ var _$$$getYScaleById,
12497
+ data = args.data,
12498
+ y = (_$$$getYScaleById = $$.getYScaleById(data.id)) == null ? void 0 : _$$$getYScaleById(data.value);
12477
12499
  if (hasTreemap && data.id) {
12478
12500
  eventReceiver.rect = $el.main.select("" + $$.selectorTarget(data.id, undefined, "rect"));
12479
12501
  } else if ($$.isMultipleX()) {
12480
12502
  // if multiple xs, target point will be determined by mouse
12481
12503
  mouse = [$$.xx(data), y];
12482
12504
  } else {
12505
+ var _data$index, _$$$getArcElementById;
12483
12506
  if (!config.tooltip_grouped) {
12484
12507
  mouse = [0, y];
12485
12508
  }
12486
- index = isValue(data.index) ? data.index : $$.getIndexByX(data.x);
12509
+ index = (_data$index = data.index) != null ? _data$index : $$.hasArcType() && data.id ? (_$$$getArcElementById = $$.getArcElementByIdOrIndex(data.id)) == null ? void 0 : _$$$getArcElementById.datum().index : $$.getIndexByX(data.x);
12487
12510
  }
12488
12511
  } else if (isDefined(args.x)) {
12489
12512
  index = $$.getIndexByX(args.x);
@@ -15124,7 +15147,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15124
15147
  eventRectUpdate.call($$.getDraggableSelection());
15125
15148
  $el.eventRect = eventRectUpdate;
15126
15149
  if ($$.state.inputType === "touch" && !$el.svg.on("touchstart.eventRect") && !$$.hasArcType()) {
15127
- $$.bindTouchOnEventRect(isMultipleX);
15150
+ $$.bindTouchOnEventRect();
15128
15151
  }
15129
15152
 
15130
15153
  // when initilazed with empty data and data loaded later, need to update eventRect
@@ -15148,7 +15171,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15148
15171
  }
15149
15172
  $$.updateEventRectData();
15150
15173
  },
15151
- bindTouchOnEventRect: function bindTouchOnEventRect(isMultipleX) {
15174
+ bindTouchOnEventRect: function bindTouchOnEventRect() {
15152
15175
  var _this2 = this,
15153
15176
  $$ = this,
15154
15177
  config = $$.config,
@@ -15158,12 +15181,12 @@ var Axis_Axis = /*#__PURE__*/function () {
15158
15181
  svg = _$$$$el.svg,
15159
15182
  selectRect = function (context) {
15160
15183
  _newArrowCheck(this, _this2);
15161
- if (isMultipleX) {
15184
+ if ($$.isMultipleX()) {
15162
15185
  $$.selectRectForMultipleXs(context);
15163
15186
  } else {
15164
15187
  var index = $$.getDataIndexFromEvent(state.event);
15165
15188
  $$.callOverOutForTouch(index);
15166
- index === -1 ? $$.unselectRect() : $$.selectRectForSingle(context, eventRect, index);
15189
+ index === -1 ? $$.unselectRect() : $$.selectRectForSingle(context, index);
15167
15190
  }
15168
15191
  }.bind(this),
15169
15192
  unselectRect = function () {
@@ -15368,9 +15391,72 @@ var Axis_Axis = /*#__PURE__*/function () {
15368
15391
  };
15369
15392
  }.bind(this));
15370
15393
  },
15371
- selectRectForMultipleXs: function selectRectForMultipleXs(context) {
15394
+ /**
15395
+ * Seletct rect for single x value
15396
+ * @param {d3Selection} context Event rect element
15397
+ * @param {number} index x Axis index
15398
+ * @private
15399
+ */
15400
+ selectRectForSingle: function selectRectForSingle(context, index) {
15372
15401
  var _this6 = this,
15373
15402
  $$ = this,
15403
+ config = $$.config,
15404
+ _$$$$el2 = $$.$el,
15405
+ main = _$$$$el2.main,
15406
+ circle = _$$$$el2.circle,
15407
+ isSelectionEnabled = config.data_selection_enabled,
15408
+ isSelectionGrouped = config.data_selection_grouped,
15409
+ isSelectable = config.data_selection_isselectable,
15410
+ isTooltipGrouped = config.tooltip_grouped,
15411
+ selectedData = $$.getAllValuesOnIndex(index);
15412
+ if (isTooltipGrouped) {
15413
+ $$.showTooltip(selectedData, context);
15414
+ $$.showGridFocus == null ? void 0 : $$.showGridFocus(selectedData);
15415
+ if (!isSelectionEnabled || isSelectionGrouped) {
15416
+ return;
15417
+ }
15418
+ }
15419
+
15420
+ // remove possible previous focused state
15421
+ circle || main.selectAll("." + $COMMON.EXPANDED + ":not(." + $SHAPE.shape + "-" + index + ")").classed($COMMON.EXPANDED, !1);
15422
+ var shapeAtIndex = main.selectAll("." + $SHAPE.shape + "-" + index).classed($COMMON.EXPANDED, !0).style("cursor", isSelectable ? "pointer" : null).filter(function (d) {
15423
+ return $$.isWithinShape(this, d);
15424
+ });
15425
+ if (shapeAtIndex.empty() && !isTooltipGrouped) {
15426
+ $$.hideGridFocus == null ? void 0 : $$.hideGridFocus();
15427
+ $$.hideTooltip();
15428
+ isSelectionGrouped || $$.setExpand(index);
15429
+ }
15430
+ shapeAtIndex.call(function (selected) {
15431
+ var _this7 = this;
15432
+ _newArrowCheck(this, _this6);
15433
+ var d = selected.data();
15434
+ if (isSelectionEnabled && (isSelectionGrouped || isSelectable != null && isSelectable.bind($$.api)(d))) {
15435
+ context.style.cursor = "pointer";
15436
+ }
15437
+ if (!isTooltipGrouped) {
15438
+ $$.showTooltip(d, context);
15439
+ $$.showGridFocus == null ? void 0 : $$.showGridFocus(d);
15440
+ $$.unexpandCircles == null ? void 0 : $$.unexpandCircles();
15441
+ selected.each(function (d) {
15442
+ _newArrowCheck(this, _this7);
15443
+ return $$.setExpand(index, d.id);
15444
+ }.bind(this));
15445
+ }
15446
+ }.bind(this));
15447
+ },
15448
+ /**
15449
+ * Select rect for multiple x values
15450
+ * @param {d3Selection} context Event rect element
15451
+ * @param {boolean} [triggerEvent=true] Whether trigger event or not
15452
+ * @private
15453
+ */
15454
+ selectRectForMultipleXs: function selectRectForMultipleXs(context, triggerEvent) {
15455
+ var _this8 = this;
15456
+ if (triggerEvent === void 0) {
15457
+ triggerEvent = !0;
15458
+ }
15459
+ var $$ = this,
15374
15460
  config = $$.config,
15375
15461
  state = $$.state,
15376
15462
  targetsToShow = $$.filterTargetsToShow($$.data.targets);
@@ -15380,7 +15466,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15380
15466
  }
15381
15467
  var mouse = getPointer(state.event, context),
15382
15468
  closest = $$.findClosestFromTargets(targetsToShow, mouse);
15383
- if (state.mouseover && (!closest || closest.id !== state.mouseover.id)) {
15469
+ if (triggerEvent && state.mouseover && (!closest || closest.id !== state.mouseover.id)) {
15384
15470
  config.data_onout.call($$.api, state.mouseover);
15385
15471
  state.mouseover = undefined;
15386
15472
  }
@@ -15390,7 +15476,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15390
15476
  }
15391
15477
  var sameXData = $$.isBubbleType(closest) || $$.isScatterType(closest) || !config.tooltip_grouped ? [closest] : $$.filterByX(targetsToShow, closest.x),
15392
15478
  selectedData = sameXData.map(function (d) {
15393
- _newArrowCheck(this, _this6);
15479
+ _newArrowCheck(this, _this8);
15394
15480
  return $$.addName(d);
15395
15481
  }.bind(this)); // show tooltip when cursor is close to some point
15396
15482
  $$.showTooltip(selectedData, context);
@@ -15405,7 +15491,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15405
15491
  // Show cursor as pointer if point is close to mouse position
15406
15492
  if ($$.isBarType(closest.id) || dist < $$.getPointSensitivity(closest)) {
15407
15493
  $$.$el.svg.select("." + $EVENT.eventRect).style("cursor", "pointer");
15408
- if (!state.mouseover) {
15494
+ if (triggerEvent && !state.mouseover) {
15409
15495
  config.data_onover.call($$.api, closest);
15410
15496
  state.mouseover = closest;
15411
15497
  }
@@ -15418,9 +15504,9 @@ var Axis_Axis = /*#__PURE__*/function () {
15418
15504
  unselectRect: function unselectRect() {
15419
15505
  var $$ = this,
15420
15506
  config = $$.config,
15421
- _$$$$el2 = $$.$el,
15422
- circle = _$$$$el2.circle,
15423
- tooltip = _$$$$el2.tooltip;
15507
+ _$$$$el3 = $$.$el,
15508
+ circle = _$$$$el3.circle,
15509
+ tooltip = _$$$$el3.tooltip;
15424
15510
  $$.$el.svg.select("." + $EVENT.eventRect).style("cursor", null);
15425
15511
  $$.hideGridFocus();
15426
15512
  if (tooltip) {
@@ -15438,7 +15524,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15438
15524
  * @private
15439
15525
  */
15440
15526
  generateEventRectsForSingleX: function generateEventRectsForSingleX(eventRectEnter) {
15441
- var _this7 = this,
15527
+ var _this9 = this,
15442
15528
  $$ = this,
15443
15529
  config = $$.config,
15444
15530
  state = $$.state,
@@ -15452,12 +15538,12 @@ var Axis_Axis = /*#__PURE__*/function () {
15452
15538
  });
15453
15539
  if (state.inputType === "mouse") {
15454
15540
  var getData = function (event) {
15455
- _newArrowCheck(this, _this7);
15541
+ _newArrowCheck(this, _this9);
15456
15542
  var index = event ? $$.getDataIndexFromEvent(event) : eventReceiver.currentIdx;
15457
15543
  return index > -1 ? eventReceiver.data[index] : null;
15458
15544
  }.bind(this);
15459
15545
  rect.on("mouseover", function (event) {
15460
- _newArrowCheck(this, _this7);
15546
+ _newArrowCheck(this, _this9);
15461
15547
  state.event = event;
15462
15548
  $$.updateEventRect();
15463
15549
  }.bind(this)).on("mousemove", function (event) {
@@ -15491,13 +15577,13 @@ var Axis_Axis = /*#__PURE__*/function () {
15491
15577
  $$.setOverOut(!1, eventReceiver.currentIdx);
15492
15578
  eventReceiver.currentIdx = index;
15493
15579
  }
15494
- index === -1 ? $$.unselectRect() : $$.selectRectForSingle(this, rect, index);
15580
+ index === -1 ? $$.unselectRect() : $$.selectRectForSingle(this, index);
15495
15581
 
15496
15582
  // As of individual data point(or <path>) element can't bind mouseover/out event
15497
15583
  // to determine current interacting element, so use 'mousemove' event instead.
15498
15584
  $$.setOverOut(index !== -1, index);
15499
15585
  }).on("mouseout", function (event) {
15500
- _newArrowCheck(this, _this7);
15586
+ _newArrowCheck(this, _this9);
15501
15587
  state.event = event;
15502
15588
 
15503
15589
  // chart is destroyed
@@ -15537,7 +15623,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15537
15623
  * @private
15538
15624
  */
15539
15625
  generateEventRectsForMultipleXs: function generateEventRectsForMultipleXs(eventRectEnter) {
15540
- var _this8 = this,
15626
+ var _this10 = this,
15541
15627
  $$ = this,
15542
15628
  state = $$.state;
15543
15629
  eventRectEnter.on("click", function (event) {
@@ -15549,7 +15635,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15549
15635
  state.event = event;
15550
15636
  $$.selectRectForMultipleXs(this);
15551
15637
  }).on("mouseout", function (event) {
15552
- _newArrowCheck(this, _this8);
15638
+ _newArrowCheck(this, _this10);
15553
15639
  state.event = event;
15554
15640
 
15555
15641
  // chart is destroyed
@@ -19151,7 +19237,7 @@ function getAttrTweenFn(fn) {
19151
19237
  .style("opacity", null).call(endall, function () {
19152
19238
  if ($$.levelColor) {
19153
19239
  var path = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
19154
- d = path.datum();
19240
+ d = path.datum(this._current);
19155
19241
  $$.updateLegendItemColor(d.data.id, path.style("fill"));
19156
19242
  }
19157
19243
  state.transiting = !1;
@@ -19436,6 +19522,26 @@ function getAttrTweenFn(fn) {
19436
19522
  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));
19437
19523
  }
19438
19524
  }
19525
+ },
19526
+ /**
19527
+ * Get Arc element by id or index
19528
+ * @param {string|number} value id or index of Arc
19529
+ * @returns {d3Selection} Arc path element
19530
+ * @private
19531
+ */
19532
+ getArcElementByIdOrIndex: function getArcElementByIdOrIndex(value) {
19533
+ var _this19 = this,
19534
+ $$ = this,
19535
+ arcs = $$.$el.arcs,
19536
+ filterFn = isNumber(value) ? function (d) {
19537
+ _newArrowCheck(this, _this19);
19538
+ return d.index === value;
19539
+ }.bind(this) : function (d) {
19540
+ _newArrowCheck(this, _this19);
19541
+ return d.data.id === value;
19542
+ }.bind(this),
19543
+ _arcs;
19544
+ return (_arcs = arcs) == null ? void 0 : _arcs.selectAll("." + $COMMON.target + " path").filter(filterFn);
19439
19545
  }
19440
19546
  });
19441
19547
  ;// CONCATENATED MODULE: ./src/ChartInternal/shape/area.ts
@@ -20334,10 +20440,7 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
20334
20440
  $root.line = line.enter().append("path").attr("class", function (d) {
20335
20441
  _newArrowCheck(this, _this2);
20336
20442
  return $$.getClass("line", !0)(d) + " " + (extraLineClasses(d) || "");
20337
- }.bind(this)).style("stroke", $$.color).merge(line).style("opacity", $$.initialOpacity.bind($$)).style("shape-rendering", function (d) {
20338
- _newArrowCheck(this, _this2);
20339
- return $$.isStepType(d) ? "crispEdges" : "";
20340
- }.bind(this)).attr("transform", null);
20443
+ }.bind(this)).style("stroke", $$.color).merge(line).style("opacity", $$.initialOpacity.bind($$)).attr("transform", null);
20341
20444
  },
20342
20445
  /**
20343
20446
  * Redraw function
@@ -21493,21 +21596,12 @@ var cacheKey = KEY.radarPoints;
21493
21596
  transiting = _state.transiting;
21494
21597
  if (config.interaction_enabled) {
21495
21598
  var isMouse = inputType === "mouse",
21496
- getIndex = function (event) {
21497
- _newArrowCheck(this, _this9);
21498
- var target = event.target;
21499
-
21500
- // in case of multilined axis text
21501
- if (/tspan/i.test(target.tagName)) {
21502
- target = target.parentNode;
21503
- }
21504
- var d = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(target).datum();
21505
- return d && Object.keys(d).length === 1 ? d.index : undefined;
21506
- }.bind(this),
21507
21599
  hide = function (event) {
21508
21600
  _newArrowCheck(this, _this9);
21509
21601
  state.event = event;
21510
- var index = getIndex(event),
21602
+
21603
+ // const index = getIndex(event);
21604
+ var index = $$.getDataIndexFromEvent(event),
21511
21605
  noIndex = isUndefined(index);
21512
21606
  if (isMouse || noIndex) {
21513
21607
  $$.hideTooltip();
@@ -21526,8 +21620,8 @@ var cacheKey = KEY.radarPoints;
21526
21620
  return;
21527
21621
  }
21528
21622
  state.event = event;
21529
- var index = getIndex(event);
21530
- $$.selectRectForSingle(svg.node(), null, index);
21623
+ var index = $$.getDataIndexFromEvent(event);
21624
+ $$.selectRectForSingle(svg.node(), index);
21531
21625
  isMouse ? $$.setOverOut(!0, index) : $$.callOverOutForTouch(index);
21532
21626
  }.bind(this)).on("mouseout", isMouse ? hide : null);
21533
21627
  if (!isMouse) {
@@ -25101,7 +25195,7 @@ var _defaults = {};
25101
25195
 
25102
25196
  /**
25103
25197
  * @namespace bb
25104
- * @version 3.9.1
25198
+ * @version 3.9.2
25105
25199
  */
25106
25200
  var bb = {
25107
25201
  /**
@@ -25111,7 +25205,7 @@ var bb = {
25111
25205
  * bb.version; // "1.0.0"
25112
25206
  * @memberof bb
25113
25207
  */
25114
- version: "3.9.1",
25208
+ version: "3.9.2",
25115
25209
  /**
25116
25210
  * Generate chart
25117
25211
  * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when: