billboard.js 3.9.1 → 3.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +372 -248
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +1262 -422
  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 +892 -176
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +893 -177
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +894 -178
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +894 -178
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +894 -178
  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 +189 -92
  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 +20 -20
  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 +34 -6
  45. package/src/ChartInternal/shape/line.ts +0 -1
  46. package/src/ChartInternal/shape/radar.ts +5 -14
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.3
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
  /**
@@ -9630,75 +9589,76 @@ function title_getTextPos(pos, width) {
9630
9589
  len = d.length;
9631
9590
  var text, row, param, value, i;
9632
9591
  var _loop = function () {
9633
- var _this3 = this;
9634
- row = d[i];
9635
- if (!row || !(getRowValue(row) || getRowValue(row) === 0)) {
9636
- return "continue";
9637
- }
9638
- if (isUndefined(text)) {
9639
- var title = (state.hasAxis || state.hasRadar) && sanitise(titleFormat ? titleFormat(row.x) : row.x);
9640
- text = tplProcess(tpl[0], {
9641
- CLASS_TOOLTIP: $TOOLTIP.tooltip,
9642
- TITLE: isValue(title) ? tplStr ? title : "<tr><th colspan=\"2\">" + title + "</th></tr>" : ""
9643
- });
9644
- }
9645
- if (!row.ratio && $el.arcs) {
9646
- param = ["arc", $$.$el.arcs.select("path." + $ARC.arc + "-" + row.id).data()[0]];
9647
- row.ratio = $$.getRatio.apply($$, param);
9648
- }
9649
- param = [row.ratio, row.id, row.index, d];
9650
- value = sanitise(valueFormat.apply(void 0, [getRowValue(row)].concat(param)));
9651
- if ($$.isAreaRangeType(row)) {
9652
- var _map2 = ["high", "low"].map(function (v) {
9653
- _newArrowCheck(this, _this3);
9654
- return sanitise(valueFormat.apply(void 0, [$$.getRangedData(row, v)].concat(param)));
9655
- }.bind(this)),
9656
- high = _map2[0],
9657
- low = _map2[1];
9658
- value = "<b>Mid:</b> " + value + " <b>High:</b> " + high + " <b>Low:</b> " + low;
9659
- } else if ($$.isCandlestickType(row)) {
9660
- var _map3 = ["open", "high", "low", "close", "volume"].map(function (v) {
9661
- _newArrowCheck(this, _this3);
9662
- return sanitise(valueFormat.apply(void 0, [$$.getRangedData(row, v, "candlestick")].concat(param)));
9663
- }.bind(this)),
9664
- open = _map3[0],
9665
- _high = _map3[1],
9666
- _low = _map3[2],
9667
- close = _map3[3],
9668
- volume = _map3[4];
9669
- value = "<b>Open:</b> " + open + " <b>High:</b> " + _high + " <b>Low:</b> " + _low + " <b>Close:</b> " + close + (volume ? " <b>Volume:</b> " + volume : "");
9670
- } else if ($$.isBarRangeType(row)) {
9671
- var _row$value = row.value,
9672
- start = _row$value[0],
9673
- end = _row$value[1];
9674
- value = valueFormat(start) + " ~ " + valueFormat(end);
9675
- }
9676
- if (value !== undefined) {
9677
- // Skip elements when their name is set to null
9678
- if (row.name === null) {
9679
- return "continue";
9592
+ var _this3 = this;
9593
+ row = d[i];
9594
+ if (!row || !(getRowValue(row) || getRowValue(row) === 0)) {
9595
+ return 0; // continue
9680
9596
  }
9681
- var name = sanitise(nameFormat.apply(void 0, [row.name].concat(param))),
9682
- _color = getBgColor(row),
9683
- contentValue = {
9684
- CLASS_TOOLTIP_NAME: $TOOLTIP.tooltipName + $$.getTargetSelectorSuffix(row.id),
9685
- COLOR: tplStr || !$$.patterns ? _color : "<svg><rect style=\"fill:" + _color + "\" width=\"10\" height=\"10\"></rect></svg>",
9686
- NAME: name,
9687
- VALUE: value
9688
- };
9689
- if (tplStr && isObject(contents.text)) {
9690
- var index = targetIds.indexOf(row.id);
9691
- Object.keys(contents.text).forEach(function (key) {
9692
- _newArrowCheck(this, _this3);
9693
- contentValue[key] = contents.text[key][index];
9694
- }.bind(this));
9597
+ if (isUndefined(text)) {
9598
+ var title = (state.hasAxis || state.hasRadar) && sanitise(titleFormat ? titleFormat(row.x) : row.x);
9599
+ text = tplProcess(tpl[0], {
9600
+ CLASS_TOOLTIP: $TOOLTIP.tooltip,
9601
+ TITLE: isValue(title) ? tplStr ? title : "<tr><th colspan=\"2\">" + title + "</th></tr>" : ""
9602
+ });
9695
9603
  }
9696
- text += tplProcess(tpl[1], contentValue);
9697
- }
9698
- };
9604
+ if (!row.ratio && $el.arcs) {
9605
+ param = ["arc", $$.$el.arcs.select("path." + $ARC.arc + "-" + row.id).data()[0]];
9606
+ row.ratio = $$.getRatio.apply($$, param);
9607
+ }
9608
+ param = [row.ratio, row.id, row.index, d];
9609
+ value = sanitise(valueFormat.apply(void 0, [getRowValue(row)].concat(param)));
9610
+ if ($$.isAreaRangeType(row)) {
9611
+ var _map2 = ["high", "low"].map(function (v) {
9612
+ _newArrowCheck(this, _this3);
9613
+ return sanitise(valueFormat.apply(void 0, [$$.getRangedData(row, v)].concat(param)));
9614
+ }.bind(this)),
9615
+ high = _map2[0],
9616
+ low = _map2[1];
9617
+ value = "<b>Mid:</b> " + value + " <b>High:</b> " + high + " <b>Low:</b> " + low;
9618
+ } else if ($$.isCandlestickType(row)) {
9619
+ var _map3 = ["open", "high", "low", "close", "volume"].map(function (v) {
9620
+ _newArrowCheck(this, _this3);
9621
+ return sanitise(valueFormat.apply(void 0, [$$.getRangedData(row, v, "candlestick")].concat(param)));
9622
+ }.bind(this)),
9623
+ open = _map3[0],
9624
+ _high = _map3[1],
9625
+ _low = _map3[2],
9626
+ close = _map3[3],
9627
+ volume = _map3[4];
9628
+ value = "<b>Open:</b> " + open + " <b>High:</b> " + _high + " <b>Low:</b> " + _low + " <b>Close:</b> " + close + (volume ? " <b>Volume:</b> " + volume : "");
9629
+ } else if ($$.isBarRangeType(row)) {
9630
+ var _row$value = row.value,
9631
+ start = _row$value[0],
9632
+ end = _row$value[1];
9633
+ value = valueFormat(start) + " ~ " + valueFormat(end);
9634
+ }
9635
+ if (value !== undefined) {
9636
+ // Skip elements when their name is set to null
9637
+ if (row.name === null) {
9638
+ return 0; // continue
9639
+ }
9640
+ var name = sanitise(nameFormat.apply(void 0, [row.name].concat(param))),
9641
+ _color = getBgColor(row),
9642
+ contentValue = {
9643
+ CLASS_TOOLTIP_NAME: $TOOLTIP.tooltipName + $$.getTargetSelectorSuffix(row.id),
9644
+ COLOR: tplStr || !$$.patterns ? _color : "<svg><rect style=\"fill:" + _color + "\" width=\"10\" height=\"10\"></rect></svg>",
9645
+ NAME: name,
9646
+ VALUE: value
9647
+ };
9648
+ if (tplStr && isObject(contents.text)) {
9649
+ var index = targetIds.indexOf(row.id);
9650
+ Object.keys(contents.text).forEach(function (key) {
9651
+ _newArrowCheck(this, _this3);
9652
+ contentValue[key] = contents.text[key][index];
9653
+ }.bind(this));
9654
+ }
9655
+ text += tplProcess(tpl[1], contentValue);
9656
+ }
9657
+ },
9658
+ _ret;
9699
9659
  for (i = 0; i < len; i++) {
9700
- var _ret = _loop();
9701
- if (_ret === "continue") continue;
9660
+ _ret = _loop();
9661
+ if (_ret === 0) continue;
9702
9662
  }
9703
9663
  return text + "</table>";
9704
9664
  },
@@ -9731,7 +9691,7 @@ function title_getTextPos(pos, width) {
9731
9691
  if (!bindto && datum) {
9732
9692
  var _config$tooltip_posit,
9733
9693
  _config$tooltip_posit2,
9734
- _getPointer = getPointer(state.event, eventTarget != null ? eventTarget : eventRect.node()),
9694
+ _getPointer = getPointer(state.event, eventTarget != null ? eventTarget : eventRect == null ? void 0 : eventRect.node()),
9735
9695
  x = _getPointer[0],
9736
9696
  y = _getPointer[1],
9737
9697
  currPos = {
@@ -9961,6 +9921,63 @@ function title_getTextPos(pos, width) {
9961
9921
  }
9962
9922
  }.bind(this));
9963
9923
  }
9924
+ },
9925
+ /**
9926
+ * Update tooltip content on redraw
9927
+ * - In a situation where tooltip is displayed and data load happens, it should reflect loaded data to tooltip
9928
+ * @param {d3Selection} context Event rect element
9929
+ * @param {number} index Data index
9930
+ * @private
9931
+ */
9932
+ updateTooltipOnRedraw: function updateTooltipOnRedraw(context, index) {
9933
+ var _this9 = this,
9934
+ $$ = this,
9935
+ config = $$.config,
9936
+ _$$$$el2 = $$.$el,
9937
+ eventRect = _$$$$el2.eventRect,
9938
+ svg = _$$$$el2.svg,
9939
+ tooltip = _$$$$el2.tooltip,
9940
+ _$$$state2 = $$.state,
9941
+ event = _$$$state2.event,
9942
+ hasAxis = _$$$state2.hasAxis,
9943
+ hasRadar = _$$$state2.hasRadar,
9944
+ hasTreemap = _$$$state2.hasTreemap;
9945
+ // Update tooltip, when tooltip is in shown state
9946
+ if ((tooltip == null ? void 0 : tooltip.style("display")) === "block" && event) {
9947
+ var _ref,
9948
+ rect = context != null ? context : (_ref = hasRadar ? svg : eventRect) == null ? void 0 : _ref.node();
9949
+ // for Axis based & Radar
9950
+ if (hasAxis || hasRadar) {
9951
+ if ($$.isMultipleX()) {
9952
+ $$.selectRectForMultipleXs(rect, !1);
9953
+ } else {
9954
+ var idx = index != null ? index : $$.getDataIndexFromEvent(event);
9955
+ if (index === -1) {
9956
+ $$.api.tooltip.hide();
9957
+ } else {
9958
+ $$.selectRectForSingle(rect, idx);
9959
+ $$.setExpand(idx, null, !0);
9960
+ }
9961
+ }
9962
+
9963
+ // for Arc & Treemap
9964
+ } else {
9965
+ var clientX = event.clientX,
9966
+ clientY = event.clientY;
9967
+ setTimeout(function () {
9968
+ _newArrowCheck(this, _this9);
9969
+ var target = browser_doc.elementFromPoint(clientX, clientY);
9970
+ var data = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(target).datum();
9971
+ if (data) {
9972
+ var d = $$.hasArcType() ? $$.convertToArcData($$.updateAngle(data)) : data == null ? void 0 : data.data;
9973
+ hasTreemap && (target = svg.node());
9974
+ d && $$.showTooltip([d], target);
9975
+ } else {
9976
+ $$.api.tooltip.hide();
9977
+ }
9978
+ }.bind(this), config.transition_duration);
9979
+ }
9980
+ }
9964
9981
  }
9965
9982
  });
9966
9983
  ;// CONCATENATED MODULE: ./src/ChartInternal/internals/transform.ts
@@ -12186,7 +12203,6 @@ var legend_legend = {
12186
12203
  }.bind(this));
12187
12204
  }.bind(this));
12188
12205
  } else {
12189
- $$.api.tooltip.hide();
12190
12206
  $$.loadFromArgs(args);
12191
12207
  }
12192
12208
  },
@@ -12219,6 +12235,8 @@ var legend_legend = {
12219
12235
  var _this3 = this,
12220
12236
  $$ = this.internal,
12221
12237
  args = argsValue || {};
12238
+ // hide possible tooltip display when data is completely unloaded
12239
+ isEmpty(args) && this.tooltip.hide();
12222
12240
  if (isArray(args)) {
12223
12241
  args = {
12224
12242
  ids: args
@@ -12436,6 +12454,10 @@ var tooltip_tooltip = {
12436
12454
  * }
12437
12455
  * });
12438
12456
  *
12457
+ * // for Arc types, specify 'id' or 'index'
12458
+ * chart.tooltip.show({ data: { id: "data2" }});
12459
+ * chart.tooltip.show({ data: { index: 2 }});
12460
+ *
12439
12461
  * // when data.xs is used
12440
12462
  * chart.tooltip.show({
12441
12463
  * data: {
@@ -12472,18 +12494,20 @@ var tooltip_tooltip = {
12472
12494
 
12473
12495
  // determine focus data
12474
12496
  if (args.data) {
12475
- var data = args.data,
12476
- y = $$.getYScaleById(data.id)(data.value);
12497
+ var _$$$getYScaleById,
12498
+ data = args.data,
12499
+ y = (_$$$getYScaleById = $$.getYScaleById(data.id)) == null ? void 0 : _$$$getYScaleById(data.value);
12477
12500
  if (hasTreemap && data.id) {
12478
12501
  eventReceiver.rect = $el.main.select("" + $$.selectorTarget(data.id, undefined, "rect"));
12479
12502
  } else if ($$.isMultipleX()) {
12480
12503
  // if multiple xs, target point will be determined by mouse
12481
12504
  mouse = [$$.xx(data), y];
12482
12505
  } else {
12506
+ var _data$index, _$$$getArcElementById;
12483
12507
  if (!config.tooltip_grouped) {
12484
12508
  mouse = [0, y];
12485
12509
  }
12486
- index = isValue(data.index) ? data.index : $$.getIndexByX(data.x);
12510
+ 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
12511
  }
12488
12512
  } else if (isDefined(args.x)) {
12489
12513
  index = $$.getIndexByX(args.x);
@@ -15124,7 +15148,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15124
15148
  eventRectUpdate.call($$.getDraggableSelection());
15125
15149
  $el.eventRect = eventRectUpdate;
15126
15150
  if ($$.state.inputType === "touch" && !$el.svg.on("touchstart.eventRect") && !$$.hasArcType()) {
15127
- $$.bindTouchOnEventRect(isMultipleX);
15151
+ $$.bindTouchOnEventRect();
15128
15152
  }
15129
15153
 
15130
15154
  // when initilazed with empty data and data loaded later, need to update eventRect
@@ -15148,7 +15172,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15148
15172
  }
15149
15173
  $$.updateEventRectData();
15150
15174
  },
15151
- bindTouchOnEventRect: function bindTouchOnEventRect(isMultipleX) {
15175
+ bindTouchOnEventRect: function bindTouchOnEventRect() {
15152
15176
  var _this2 = this,
15153
15177
  $$ = this,
15154
15178
  config = $$.config,
@@ -15158,12 +15182,12 @@ var Axis_Axis = /*#__PURE__*/function () {
15158
15182
  svg = _$$$$el.svg,
15159
15183
  selectRect = function (context) {
15160
15184
  _newArrowCheck(this, _this2);
15161
- if (isMultipleX) {
15185
+ if ($$.isMultipleX()) {
15162
15186
  $$.selectRectForMultipleXs(context);
15163
15187
  } else {
15164
15188
  var index = $$.getDataIndexFromEvent(state.event);
15165
15189
  $$.callOverOutForTouch(index);
15166
- index === -1 ? $$.unselectRect() : $$.selectRectForSingle(context, eventRect, index);
15190
+ index === -1 ? $$.unselectRect() : $$.selectRectForSingle(context, index);
15167
15191
  }
15168
15192
  }.bind(this),
15169
15193
  unselectRect = function () {
@@ -15368,9 +15392,72 @@ var Axis_Axis = /*#__PURE__*/function () {
15368
15392
  };
15369
15393
  }.bind(this));
15370
15394
  },
15371
- selectRectForMultipleXs: function selectRectForMultipleXs(context) {
15395
+ /**
15396
+ * Seletct rect for single x value
15397
+ * @param {d3Selection} context Event rect element
15398
+ * @param {number} index x Axis index
15399
+ * @private
15400
+ */
15401
+ selectRectForSingle: function selectRectForSingle(context, index) {
15372
15402
  var _this6 = this,
15373
15403
  $$ = this,
15404
+ config = $$.config,
15405
+ _$$$$el2 = $$.$el,
15406
+ main = _$$$$el2.main,
15407
+ circle = _$$$$el2.circle,
15408
+ isSelectionEnabled = config.data_selection_enabled,
15409
+ isSelectionGrouped = config.data_selection_grouped,
15410
+ isSelectable = config.data_selection_isselectable,
15411
+ isTooltipGrouped = config.tooltip_grouped,
15412
+ selectedData = $$.getAllValuesOnIndex(index);
15413
+ if (isTooltipGrouped) {
15414
+ $$.showTooltip(selectedData, context);
15415
+ $$.showGridFocus == null ? void 0 : $$.showGridFocus(selectedData);
15416
+ if (!isSelectionEnabled || isSelectionGrouped) {
15417
+ return;
15418
+ }
15419
+ }
15420
+
15421
+ // remove possible previous focused state
15422
+ circle || main.selectAll("." + $COMMON.EXPANDED + ":not(." + $SHAPE.shape + "-" + index + ")").classed($COMMON.EXPANDED, !1);
15423
+ var shapeAtIndex = main.selectAll("." + $SHAPE.shape + "-" + index).classed($COMMON.EXPANDED, !0).style("cursor", isSelectable ? "pointer" : null).filter(function (d) {
15424
+ return $$.isWithinShape(this, d);
15425
+ });
15426
+ if (shapeAtIndex.empty() && !isTooltipGrouped) {
15427
+ $$.hideGridFocus == null ? void 0 : $$.hideGridFocus();
15428
+ $$.hideTooltip();
15429
+ isSelectionGrouped || $$.setExpand(index);
15430
+ }
15431
+ shapeAtIndex.call(function (selected) {
15432
+ var _this7 = this;
15433
+ _newArrowCheck(this, _this6);
15434
+ var d = selected.data();
15435
+ if (isSelectionEnabled && (isSelectionGrouped || isSelectable != null && isSelectable.bind($$.api)(d))) {
15436
+ context.style.cursor = "pointer";
15437
+ }
15438
+ if (!isTooltipGrouped) {
15439
+ $$.showTooltip(d, context);
15440
+ $$.showGridFocus == null ? void 0 : $$.showGridFocus(d);
15441
+ $$.unexpandCircles == null ? void 0 : $$.unexpandCircles();
15442
+ selected.each(function (d) {
15443
+ _newArrowCheck(this, _this7);
15444
+ return $$.setExpand(index, d.id);
15445
+ }.bind(this));
15446
+ }
15447
+ }.bind(this));
15448
+ },
15449
+ /**
15450
+ * Select rect for multiple x values
15451
+ * @param {d3Selection} context Event rect element
15452
+ * @param {boolean} [triggerEvent=true] Whether trigger event or not
15453
+ * @private
15454
+ */
15455
+ selectRectForMultipleXs: function selectRectForMultipleXs(context, triggerEvent) {
15456
+ var _this8 = this;
15457
+ if (triggerEvent === void 0) {
15458
+ triggerEvent = !0;
15459
+ }
15460
+ var $$ = this,
15374
15461
  config = $$.config,
15375
15462
  state = $$.state,
15376
15463
  targetsToShow = $$.filterTargetsToShow($$.data.targets);
@@ -15380,7 +15467,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15380
15467
  }
15381
15468
  var mouse = getPointer(state.event, context),
15382
15469
  closest = $$.findClosestFromTargets(targetsToShow, mouse);
15383
- if (state.mouseover && (!closest || closest.id !== state.mouseover.id)) {
15470
+ if (triggerEvent && state.mouseover && (!closest || closest.id !== state.mouseover.id)) {
15384
15471
  config.data_onout.call($$.api, state.mouseover);
15385
15472
  state.mouseover = undefined;
15386
15473
  }
@@ -15390,7 +15477,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15390
15477
  }
15391
15478
  var sameXData = $$.isBubbleType(closest) || $$.isScatterType(closest) || !config.tooltip_grouped ? [closest] : $$.filterByX(targetsToShow, closest.x),
15392
15479
  selectedData = sameXData.map(function (d) {
15393
- _newArrowCheck(this, _this6);
15480
+ _newArrowCheck(this, _this8);
15394
15481
  return $$.addName(d);
15395
15482
  }.bind(this)); // show tooltip when cursor is close to some point
15396
15483
  $$.showTooltip(selectedData, context);
@@ -15405,7 +15492,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15405
15492
  // Show cursor as pointer if point is close to mouse position
15406
15493
  if ($$.isBarType(closest.id) || dist < $$.getPointSensitivity(closest)) {
15407
15494
  $$.$el.svg.select("." + $EVENT.eventRect).style("cursor", "pointer");
15408
- if (!state.mouseover) {
15495
+ if (triggerEvent && !state.mouseover) {
15409
15496
  config.data_onover.call($$.api, closest);
15410
15497
  state.mouseover = closest;
15411
15498
  }
@@ -15418,9 +15505,9 @@ var Axis_Axis = /*#__PURE__*/function () {
15418
15505
  unselectRect: function unselectRect() {
15419
15506
  var $$ = this,
15420
15507
  config = $$.config,
15421
- _$$$$el2 = $$.$el,
15422
- circle = _$$$$el2.circle,
15423
- tooltip = _$$$$el2.tooltip;
15508
+ _$$$$el3 = $$.$el,
15509
+ circle = _$$$$el3.circle,
15510
+ tooltip = _$$$$el3.tooltip;
15424
15511
  $$.$el.svg.select("." + $EVENT.eventRect).style("cursor", null);
15425
15512
  $$.hideGridFocus();
15426
15513
  if (tooltip) {
@@ -15438,7 +15525,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15438
15525
  * @private
15439
15526
  */
15440
15527
  generateEventRectsForSingleX: function generateEventRectsForSingleX(eventRectEnter) {
15441
- var _this7 = this,
15528
+ var _this9 = this,
15442
15529
  $$ = this,
15443
15530
  config = $$.config,
15444
15531
  state = $$.state,
@@ -15452,12 +15539,12 @@ var Axis_Axis = /*#__PURE__*/function () {
15452
15539
  });
15453
15540
  if (state.inputType === "mouse") {
15454
15541
  var getData = function (event) {
15455
- _newArrowCheck(this, _this7);
15542
+ _newArrowCheck(this, _this9);
15456
15543
  var index = event ? $$.getDataIndexFromEvent(event) : eventReceiver.currentIdx;
15457
15544
  return index > -1 ? eventReceiver.data[index] : null;
15458
15545
  }.bind(this);
15459
15546
  rect.on("mouseover", function (event) {
15460
- _newArrowCheck(this, _this7);
15547
+ _newArrowCheck(this, _this9);
15461
15548
  state.event = event;
15462
15549
  $$.updateEventRect();
15463
15550
  }.bind(this)).on("mousemove", function (event) {
@@ -15491,13 +15578,13 @@ var Axis_Axis = /*#__PURE__*/function () {
15491
15578
  $$.setOverOut(!1, eventReceiver.currentIdx);
15492
15579
  eventReceiver.currentIdx = index;
15493
15580
  }
15494
- index === -1 ? $$.unselectRect() : $$.selectRectForSingle(this, rect, index);
15581
+ index === -1 ? $$.unselectRect() : $$.selectRectForSingle(this, index);
15495
15582
 
15496
15583
  // As of individual data point(or <path>) element can't bind mouseover/out event
15497
15584
  // to determine current interacting element, so use 'mousemove' event instead.
15498
15585
  $$.setOverOut(index !== -1, index);
15499
15586
  }).on("mouseout", function (event) {
15500
- _newArrowCheck(this, _this7);
15587
+ _newArrowCheck(this, _this9);
15501
15588
  state.event = event;
15502
15589
 
15503
15590
  // chart is destroyed
@@ -15537,7 +15624,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15537
15624
  * @private
15538
15625
  */
15539
15626
  generateEventRectsForMultipleXs: function generateEventRectsForMultipleXs(eventRectEnter) {
15540
- var _this8 = this,
15627
+ var _this10 = this,
15541
15628
  $$ = this,
15542
15629
  state = $$.state;
15543
15630
  eventRectEnter.on("click", function (event) {
@@ -15549,7 +15636,7 @@ var Axis_Axis = /*#__PURE__*/function () {
15549
15636
  state.event = event;
15550
15637
  $$.selectRectForMultipleXs(this);
15551
15638
  }).on("mouseout", function (event) {
15552
- _newArrowCheck(this, _this8);
15639
+ _newArrowCheck(this, _this10);
15553
15640
  state.event = event;
15554
15641
 
15555
15642
  // chart is destroyed
@@ -18532,6 +18619,9 @@ var options = [data_axis, axis_axis, common_grid];
18532
18619
  var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate_root_d3_ = __webpack_require__(12);
18533
18620
  ;// CONCATENATED MODULE: ./src/ChartInternal/shape/arc.ts
18534
18621
 
18622
+
18623
+ function arc_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; }
18624
+ function arc_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? arc_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : arc_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18535
18625
  /**
18536
18626
  * Copyright (c) 2017 ~ present NAVER Corp.
18537
18627
  * billboard.js project is licensed under the MIT license
@@ -18631,17 +18721,43 @@ function getRadiusFn(expandRate) {
18631
18721
  */
18632
18722
  function getAttrTweenFn(fn) {
18633
18723
  return function (d) {
18634
- var interpolate = (0,external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate_root_d3_.interpolate)(this._current, d);
18724
+ var _this2 = this,
18725
+ getAngleKeyValue = function (_ref) {
18726
+ var _ref$startAngle = _ref.startAngle,
18727
+ startAngle = _ref$startAngle === void 0 ? 0 : _ref$startAngle,
18728
+ _ref$endAngle = _ref.endAngle,
18729
+ endAngle = _ref$endAngle === void 0 ? 0 : _ref$endAngle,
18730
+ _ref$padAngle = _ref.padAngle,
18731
+ padAngle = _ref$padAngle === void 0 ? 0 : _ref$padAngle;
18732
+ _newArrowCheck(this, _this2);
18733
+ return {
18734
+ startAngle: startAngle,
18735
+ endAngle: endAngle,
18736
+ padAngle: padAngle
18737
+ };
18738
+ }.bind(this),
18739
+ interpolate = (0,external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate_root_d3_.interpolate)(getAngleKeyValue(this._current), getAngleKeyValue(d));
18740
+ // d3.interpolate interpolates id value, if id is given as color string(ex. gold, silver, etc)
18741
+ // to avoid unexpected behavior, interpolate only angle values
18742
+ // https://github.com/naver/billboard.js/issues/3321
18743
+
18635
18744
  this._current = d;
18636
18745
  return function (t) {
18637
- var interpolated = interpolate(t);
18638
- return fn(interpolated);
18746
+ var interpolated = interpolate(t),
18747
+ data = d.data,
18748
+ index = d.index,
18749
+ value = d.value;
18750
+ return fn(arc_objectSpread(arc_objectSpread({}, interpolated), {}, {
18751
+ data: data,
18752
+ index: index,
18753
+ value: value
18754
+ }));
18639
18755
  };
18640
18756
  };
18641
18757
  }
18642
18758
  /* harmony default export */ var arc = ({
18643
18759
  initPie: function initPie() {
18644
- var _this2 = this,
18760
+ var _this3 = this,
18645
18761
  $$ = this,
18646
18762
  config = $$.config,
18647
18763
  dataType = config.data_type,
@@ -18649,10 +18765,10 @@ function getAttrTweenFn(fn) {
18649
18765
  startingAngle = config[dataType + "_startingAngle"] || 0,
18650
18766
  padAngle = (padding ? padding * .01 : config[dataType + "_padAngle"]) || 0;
18651
18767
  $$.pie = (0,external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_.pie)().startAngle(startingAngle).endAngle(startingAngle + 2 * Math.PI).padAngle(padAngle).value(function (d) {
18652
- var _this3 = this;
18653
- _newArrowCheck(this, _this2);
18768
+ var _this4 = this;
18769
+ _newArrowCheck(this, _this3);
18654
18770
  return d.values.reduce(function (a, b) {
18655
- _newArrowCheck(this, _this3);
18771
+ _newArrowCheck(this, _this4);
18656
18772
  return a + b.value;
18657
18773
  }.bind(this), 0);
18658
18774
  }.bind(this)).sort($$.getSortCompareFn.bind($$)(!0));
@@ -18736,7 +18852,7 @@ function getAttrTweenFn(fn) {
18736
18852
  return startAngle;
18737
18853
  },
18738
18854
  updateAngle: function updateAngle(dValue) {
18739
- var _this4 = this,
18855
+ var _this5 = this,
18740
18856
  $$ = this,
18741
18857
  config = $$.config,
18742
18858
  state = $$.state,
@@ -18757,7 +18873,7 @@ function getAttrTweenFn(fn) {
18757
18873
  }
18758
18874
  pie($$.filterTargetsToShow()).forEach(function (t, i) {
18759
18875
  var _d$data;
18760
- _newArrowCheck(this, _this4);
18876
+ _newArrowCheck(this, _this5);
18761
18877
  if (!found && t.data.id === ((_d$data = d.data) == null ? void 0 : _d$data.id)) {
18762
18878
  found = !0;
18763
18879
  d = t;
@@ -18808,7 +18924,7 @@ function getAttrTweenFn(fn) {
18808
18924
  * @private
18809
18925
  */
18810
18926
  getSvgArcExpanded: function getSvgArcExpanded(rate) {
18811
- var _this5 = this;
18927
+ var _this6 = this;
18812
18928
  if (rate === void 0) {
18813
18929
  rate = 1;
18814
18930
  }
@@ -18819,7 +18935,7 @@ function getAttrTweenFn(fn) {
18819
18935
  corner = _getRadiusFn$call2.corner,
18820
18936
  arc = (0,external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_.arc)().innerRadius(inner).outerRadius(outer);
18821
18937
  return function (d) {
18822
- _newArrowCheck(this, _this5);
18938
+ _newArrowCheck(this, _this6);
18823
18939
  var updated = $$.updateAngle(d),
18824
18940
  outerR = outer(updated);
18825
18941
  var cornerR = 0;
@@ -18839,7 +18955,7 @@ function getAttrTweenFn(fn) {
18839
18955
  * @private
18840
18956
  */
18841
18957
  transformForArcLabel: function transformForArcLabel(d) {
18842
- var _this6 = this,
18958
+ var _this7 = this,
18843
18959
  $$ = this,
18844
18960
  config = $$.config,
18845
18961
  radiusExpanded = $$.state.radiusExpanded,
@@ -18860,14 +18976,14 @@ function getAttrTweenFn(fn) {
18860
18976
  }
18861
18977
  var c = this.svgArc.centroid(updated),
18862
18978
  _c$map = c.map(function (v) {
18863
- _newArrowCheck(this, _this6);
18979
+ _newArrowCheck(this, _this7);
18864
18980
  return isNaN(v) ? 0 : v;
18865
18981
  }.bind(this)),
18866
18982
  x = _c$map[0],
18867
18983
  y = _c$map[1],
18868
18984
  h = Math.sqrt(x * x + y * y);
18869
18985
  var ratio = (_filter$map = ["donut", "pie", "polar"].filter($$.hasType.bind($$)).map(function (v) {
18870
- _newArrowCheck(this, _this6);
18986
+ _newArrowCheck(this, _this7);
18871
18987
  return config[v + "_label_ratio"];
18872
18988
  }.bind(this))) == null ? void 0 : _filter$map[0];
18873
18989
  if (ratio) {
@@ -18909,14 +19025,14 @@ function getAttrTweenFn(fn) {
18909
19025
  }
18910
19026
  },
18911
19027
  expandArc: function expandArc(targetIds) {
18912
- var _this7 = this,
19028
+ var _this8 = this,
18913
19029
  $$ = this,
18914
19030
  transiting = $$.state.transiting,
18915
19031
  $el = $$.$el;
18916
19032
  // MEMO: avoid to cancel transition
18917
19033
  if (transiting) {
18918
19034
  var interval = setInterval(function () {
18919
- _newArrowCheck(this, _this7);
19035
+ _newArrowCheck(this, _this8);
18920
19036
  if (!transiting) {
18921
19037
  clearInterval(interval);
18922
19038
  $el.legend.selectAll("." + $FOCUS.legendItemFocused).size() > 0 && $$.expandArc(targetIds);
@@ -18935,7 +19051,7 @@ function getAttrTweenFn(fn) {
18935
19051
  });
18936
19052
  },
18937
19053
  unexpandArc: function unexpandArc(targetIds) {
18938
- var _this8 = this,
19054
+ var _this9 = this,
18939
19055
  $$ = this,
18940
19056
  transiting = $$.state.transiting,
18941
19057
  svg = $$.$el.svg;
@@ -18944,7 +19060,7 @@ function getAttrTweenFn(fn) {
18944
19060
  }
18945
19061
  var newTargetIds = $$.mapToTargetIds(targetIds);
18946
19062
  svg.selectAll($$.selectorTargets(newTargetIds, "." + $ARC.chartArc)).selectAll("path").transition().duration(function (d) {
18947
- _newArrowCheck(this, _this8);
19063
+ _newArrowCheck(this, _this9);
18948
19064
  return $$.getExpandConfig(d.data.id, "duration");
18949
19065
  }.bind(this)).attrTween("d", getAttrTweenFn($$.svgArc.bind($$)));
18950
19066
  svg.selectAll("" + $ARC.arc).style("opacity", null);
@@ -18978,30 +19094,30 @@ function getAttrTweenFn(fn) {
18978
19094
  return $$.isDonutType(id) && config.donut_expand || $$.isGaugeType(id) && config.gauge_expand || $$.isPieType(id) && config.pie_expand;
18979
19095
  },
18980
19096
  shouldShowArcLabel: function shouldShowArcLabel() {
18981
- var _this9 = this,
19097
+ var _this10 = this,
18982
19098
  $$ = this,
18983
19099
  config = $$.config;
18984
19100
  return ["donut", "gauge", "pie", "polar"].some(function (v) {
18985
- _newArrowCheck(this, _this9);
19101
+ _newArrowCheck(this, _this10);
18986
19102
  return $$.hasType(v) && config[v + "_label_show"];
18987
19103
  }.bind(this));
18988
19104
  },
18989
19105
  getArcLabelFormat: function getArcLabelFormat() {
18990
- var _this10 = this,
19106
+ var _this11 = this,
18991
19107
  $$ = this,
18992
19108
  config = $$.config,
18993
19109
  format = function (v) {
18994
- _newArrowCheck(this, _this10);
19110
+ _newArrowCheck(this, _this11);
18995
19111
  return v;
18996
19112
  }.bind(this);
18997
19113
  ["donut", "gauge", "pie", "polar"].filter($$.hasType.bind($$)).forEach(function (v) {
18998
- _newArrowCheck(this, _this10);
19114
+ _newArrowCheck(this, _this11);
18999
19115
  format = config[v + "_label_format"];
19000
19116
  }.bind(this));
19001
19117
  return isFunction(format) ? format.bind($$.api) : format;
19002
19118
  },
19003
19119
  updateTargetsForArc: function updateTargetsForArc(targets) {
19004
- var _this11 = this,
19120
+ var _this12 = this,
19005
19121
  $$ = this,
19006
19122
  $el = $$.$el,
19007
19123
  hasGauge = $$.hasType("gauge"),
@@ -19010,7 +19126,7 @@ function getAttrTweenFn(fn) {
19010
19126
  classFocus = $$.classFocus.bind($$),
19011
19127
  chartArcs = $el.main.select("." + $ARC.chartArcs),
19012
19128
  mainPieUpdate = chartArcs.selectAll("." + $ARC.chartArc).data($$.pie(targets)).attr("class", function (d) {
19013
- _newArrowCheck(this, _this11);
19129
+ _newArrowCheck(this, _this12);
19014
19130
  return classChartArc(d) + classFocus(d.data);
19015
19131
  }.bind(this)),
19016
19132
  mainPieEnter = mainPieUpdate.enter().append("g").attr("class", classChartArc).call(this.setCssRule(!1, "." + $ARC.chartArcs + " text", ["pointer-events:none", "text-anchor:middle"]));
@@ -19077,7 +19193,7 @@ function getAttrTweenFn(fn) {
19077
19193
  return !1;
19078
19194
  },
19079
19195
  redrawArc: function redrawArc(duration, durationForExit, withTransform) {
19080
- var _this12 = this,
19196
+ var _this13 = this,
19081
19197
  $$ = this,
19082
19198
  config = $$.config,
19083
19199
  state = $$.state,
@@ -19087,10 +19203,10 @@ function getAttrTweenFn(fn) {
19087
19203
  mainArc = main.selectAll("." + $ARC.arcs).selectAll("." + $ARC.arc).data($$.arcData.bind($$));
19088
19204
  mainArc.exit().transition().duration(durationForExit).style("opacity", "0").remove();
19089
19205
  mainArc = mainArc.enter().append("path").attr("class", $$.getClass("arc", !0)).style("fill", function (d) {
19090
- _newArrowCheck(this, _this12);
19206
+ _newArrowCheck(this, _this13);
19091
19207
  return $$.color(d.data);
19092
19208
  }.bind(this)).style("cursor", function (d) {
19093
- _newArrowCheck(this, _this12);
19209
+ _newArrowCheck(this, _this13);
19094
19210
  return isSelectable != null && isSelectable.bind != null && isSelectable.bind($$.api)(d) ? "pointer" : null;
19095
19211
  }.bind(this)).style("opacity", "0").each(function (d) {
19096
19212
  if ($$.isGaugeType(d.data)) {
@@ -19104,19 +19220,19 @@ function getAttrTweenFn(fn) {
19104
19220
  $$.hasMultiArcGauge() && $$.redrawMultiArcGauge();
19105
19221
  }
19106
19222
  mainArc.attr("transform", function (d) {
19107
- _newArrowCheck(this, _this12);
19223
+ _newArrowCheck(this, _this13);
19108
19224
  return !$$.isGaugeType(d.data) && withTransform ? "scale(0)" : "";
19109
19225
  }.bind(this)).style("opacity", function (d) {
19110
19226
  return d === this._current ? "0" : null;
19111
19227
  }).each(function () {
19112
- _newArrowCheck(this, _this12);
19228
+ _newArrowCheck(this, _this13);
19113
19229
  state.transiting = !0;
19114
19230
  }.bind(this)).transition().duration(duration).attrTween("d", function (d) {
19115
- var _this13 = this,
19231
+ var _this14 = this,
19116
19232
  updated = $$.updateAngle(d);
19117
19233
  if (!updated) {
19118
19234
  return function () {
19119
- _newArrowCheck(this, _this13);
19235
+ _newArrowCheck(this, _this14);
19120
19236
  return "M 0 0";
19121
19237
  }.bind(this);
19122
19238
  }
@@ -19135,7 +19251,7 @@ function getAttrTweenFn(fn) {
19135
19251
  return $$.getArc(interpolated, !0);
19136
19252
  };
19137
19253
  }).attr("transform", withTransform ? "scale(1)" : "").style("fill", function (d) {
19138
- _newArrowCheck(this, _this12);
19254
+ _newArrowCheck(this, _this13);
19139
19255
  var color;
19140
19256
  if ($$.levelColor) {
19141
19257
  color = $$.levelColor(d.data.values[0].value);
@@ -19151,7 +19267,7 @@ function getAttrTweenFn(fn) {
19151
19267
  .style("opacity", null).call(endall, function () {
19152
19268
  if ($$.levelColor) {
19153
19269
  var path = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
19154
- d = path.datum();
19270
+ d = path.datum(this._current);
19155
19271
  $$.updateLegendItemColor(d.data.id, path.style("fill"));
19156
19272
  }
19157
19273
  state.transiting = !1;
@@ -19170,7 +19286,7 @@ function getAttrTweenFn(fn) {
19170
19286
  * @private
19171
19287
  */
19172
19288
  redrawNeedle: function redrawNeedle() {
19173
- var _this14 = this,
19289
+ var _this15 = this,
19174
19290
  $$ = this,
19175
19291
  $el = $$.$el,
19176
19292
  config = $$.config,
@@ -19190,7 +19306,7 @@ function getAttrTweenFn(fn) {
19190
19306
  bottomRy = config.arc_needle_bottom_ry,
19191
19307
  needleAngle = $$.getNeedleAngle(),
19192
19308
  updateNeedleValue = function () {
19193
- _newArrowCheck(this, _this14);
19309
+ _newArrowCheck(this, _this15);
19194
19310
  var title = $$.getArcTitleWithNeedleValue();
19195
19311
  title && $$.setArcTitle(title);
19196
19312
  }.bind(this); // needle options
@@ -19206,14 +19322,14 @@ function getAttrTweenFn(fn) {
19206
19322
  * @private
19207
19323
  */
19208
19324
  $el.needle.updateHelper = function (v, updateConfig) {
19209
- var _this15 = this;
19325
+ var _this16 = this;
19210
19326
  if (updateConfig === void 0) {
19211
19327
  updateConfig = !1;
19212
19328
  }
19213
- _newArrowCheck(this, _this14);
19329
+ _newArrowCheck(this, _this15);
19214
19330
  if ($el.needle.style("display") !== "none") {
19215
19331
  $$.$T($el.needle).style("transform", "rotate(" + $$.getNeedleAngle(v) + "deg)").call(endall, function () {
19216
- _newArrowCheck(this, _this15);
19332
+ _newArrowCheck(this, _this16);
19217
19333
  updateConfig && (config.arc_needle_value = v);
19218
19334
  updateNeedleValue();
19219
19335
  }.bind(this));
@@ -19259,7 +19375,7 @@ function getAttrTweenFn(fn) {
19259
19375
  return (startingAngle + radian) * (180 / Math.PI);
19260
19376
  },
19261
19377
  redrawBackgroundArcs: function redrawBackgroundArcs() {
19262
- var _this16 = this,
19378
+ var _this17 = this,
19263
19379
  $$ = this,
19264
19380
  config = $$.config,
19265
19381
  state = $$.state,
@@ -19273,11 +19389,11 @@ function getAttrTweenFn(fn) {
19273
19389
  var index = 0;
19274
19390
  backgroundArc = backgroundArc.selectAll("path." + $ARC.chartArcsBackground).data($$.data.targets);
19275
19391
  backgroundArc.enter().append("path").attr("class", function (d, i) {
19276
- _newArrowCheck(this, _this16);
19392
+ _newArrowCheck(this, _this17);
19277
19393
  return $ARC.chartArcsBackground + " " + $ARC.chartArcsBackground + "-" + i;
19278
- }.bind(this)).merge(backgroundArc).style("fill", config.gauge_background || null).attr("d", function (_ref2) {
19279
- var id = _ref2.id;
19280
- _newArrowCheck(this, _this16);
19394
+ }.bind(this)).merge(backgroundArc).style("fill", config.gauge_background || null).attr("d", function (_ref3) {
19395
+ var id = _ref3.id;
19396
+ _newArrowCheck(this, _this17);
19281
19397
  if (showEmptyTextLabel || state.hiddenTargetIds.indexOf(id) >= 0) {
19282
19398
  return "M 0 0";
19283
19399
  }
@@ -19294,7 +19410,7 @@ function getAttrTweenFn(fn) {
19294
19410
  backgroundArc.exit().remove();
19295
19411
  } else {
19296
19412
  backgroundArc.attr("d", showEmptyTextLabel ? "M 0 0" : function () {
19297
- _newArrowCheck(this, _this16);
19413
+ _newArrowCheck(this, _this17);
19298
19414
  var d = {
19299
19415
  data: [{
19300
19416
  value: config.gauge_max
@@ -19307,7 +19423,7 @@ function getAttrTweenFn(fn) {
19307
19423
  }
19308
19424
  },
19309
19425
  bindArcEvent: function bindArcEvent(arc) {
19310
- var _this17 = this,
19426
+ var _this18 = this,
19311
19427
  $$ = this,
19312
19428
  config = $$.config,
19313
19429
  state = $$.state,
@@ -19355,7 +19471,7 @@ function getAttrTweenFn(fn) {
19355
19471
  selectArc(this, arcData, id);
19356
19472
  $$.setOverOut(!0, arcData);
19357
19473
  }).on("mouseout", function (event, d) {
19358
- _newArrowCheck(this, _this17);
19474
+ _newArrowCheck(this, _this18);
19359
19475
  if (state.transiting) {
19360
19476
  // skip while transiting
19361
19477
  return;
@@ -19376,7 +19492,7 @@ function getAttrTweenFn(fn) {
19376
19492
  // touch events
19377
19493
  if (isTouch && $$.hasArcType() && !$$.radars) {
19378
19494
  var getEventArc = function (event) {
19379
- _newArrowCheck(this, _this17);
19495
+ _newArrowCheck(this, _this18);
19380
19496
  var touch = event.changedTouches[0],
19381
19497
  eventArc = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(browser_doc.elementFromPoint(touch.clientX, touch.clientY));
19382
19498
  return eventArc;
@@ -19399,7 +19515,7 @@ function getAttrTweenFn(fn) {
19399
19515
  }
19400
19516
  },
19401
19517
  redrawArcText: function redrawArcText(duration) {
19402
- var _this18 = this,
19518
+ var _this19 = this,
19403
19519
  $$ = this,
19404
19520
  config = $$.config,
19405
19521
  state = $$.state,
@@ -19412,13 +19528,13 @@ function getAttrTweenFn(fn) {
19412
19528
  // for gauge type, update text when has no title & multi data
19413
19529
  if (!(hasGauge && $$.data.targets.length === 1 && config.gauge_title)) {
19414
19530
  text = main.selectAll("." + $ARC.chartArc).select("text").style("opacity", "0").attr("class", function (d) {
19415
- _newArrowCheck(this, _this18);
19531
+ _newArrowCheck(this, _this19);
19416
19532
  return $$.isGaugeType(d.data) ? $GAUGE.gaugeValue : null;
19417
19533
  }.bind(this)).call($$.textForArcLabel.bind($$)).attr("transform", $$.transformForArcLabel.bind($$)).style("font-size", function (d) {
19418
- _newArrowCheck(this, _this18);
19534
+ _newArrowCheck(this, _this19);
19419
19535
  return $$.isGaugeType(d.data) && $$.data.targets.length === 1 && !hasMultiArcGauge ? Math.round(state.radius / 5) + "px" : null;
19420
19536
  }.bind(this)).transition().duration(duration).style("opacity", function (d) {
19421
- _newArrowCheck(this, _this18);
19537
+ _newArrowCheck(this, _this19);
19422
19538
  return $$.isTargetToShow(d.data.id) && $$.isArcType(d.data) ? null : "0";
19423
19539
  }.bind(this));
19424
19540
  hasMultiArcGauge && text.attr("dy", "-.1em");
@@ -19436,6 +19552,26 @@ function getAttrTweenFn(fn) {
19436
19552
  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
19553
  }
19438
19554
  }
19555
+ },
19556
+ /**
19557
+ * Get Arc element by id or index
19558
+ * @param {string|number} value id or index of Arc
19559
+ * @returns {d3Selection} Arc path element
19560
+ * @private
19561
+ */
19562
+ getArcElementByIdOrIndex: function getArcElementByIdOrIndex(value) {
19563
+ var _this20 = this,
19564
+ $$ = this,
19565
+ arcs = $$.$el.arcs,
19566
+ filterFn = isNumber(value) ? function (d) {
19567
+ _newArrowCheck(this, _this20);
19568
+ return d.index === value;
19569
+ }.bind(this) : function (d) {
19570
+ _newArrowCheck(this, _this20);
19571
+ return d.data.id === value;
19572
+ }.bind(this),
19573
+ _arcs;
19574
+ return (_arcs = arcs) == null ? void 0 : _arcs.selectAll("." + $COMMON.target + " path").filter(filterFn);
19439
19575
  }
19440
19576
  });
19441
19577
  ;// CONCATENATED MODULE: ./src/ChartInternal/shape/area.ts
@@ -20334,10 +20470,7 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
20334
20470
  $root.line = line.enter().append("path").attr("class", function (d) {
20335
20471
  _newArrowCheck(this, _this2);
20336
20472
  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);
20473
+ }.bind(this)).style("stroke", $$.color).merge(line).style("opacity", $$.initialOpacity.bind($$)).attr("transform", null);
20341
20474
  },
20342
20475
  /**
20343
20476
  * Redraw function
@@ -21493,21 +21626,12 @@ var cacheKey = KEY.radarPoints;
21493
21626
  transiting = _state.transiting;
21494
21627
  if (config.interaction_enabled) {
21495
21628
  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
21629
  hide = function (event) {
21508
21630
  _newArrowCheck(this, _this9);
21509
21631
  state.event = event;
21510
- var index = getIndex(event),
21632
+
21633
+ // const index = getIndex(event);
21634
+ var index = $$.getDataIndexFromEvent(event),
21511
21635
  noIndex = isUndefined(index);
21512
21636
  if (isMouse || noIndex) {
21513
21637
  $$.hideTooltip();
@@ -21526,8 +21650,8 @@ var cacheKey = KEY.radarPoints;
21526
21650
  return;
21527
21651
  }
21528
21652
  state.event = event;
21529
- var index = getIndex(event);
21530
- $$.selectRectForSingle(svg.node(), null, index);
21653
+ var index = $$.getDataIndexFromEvent(event);
21654
+ $$.selectRectForSingle(svg.node(), index);
21531
21655
  isMouse ? $$.setOverOut(!0, index) : $$.callOverOutForTouch(index);
21532
21656
  }.bind(this)).on("mouseout", isMouse ? hide : null);
21533
21657
  if (!isMouse) {
@@ -25101,7 +25225,7 @@ var _defaults = {};
25101
25225
 
25102
25226
  /**
25103
25227
  * @namespace bb
25104
- * @version 3.9.1
25228
+ * @version 3.9.3
25105
25229
  */
25106
25230
  var bb = {
25107
25231
  /**
@@ -25111,7 +25235,7 @@ var bb = {
25111
25235
  * bb.version; // "1.0.0"
25112
25236
  * @memberof bb
25113
25237
  */
25114
- version: "3.9.1",
25238
+ version: "3.9.3",
25115
25239
  /**
25116
25240
  * Generate chart
25117
25241
  * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when: