@semcore/d3-chart 16.3.0 → 16.4.0-prerelease.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/lib/cjs/Area.js +11 -11
  3. package/lib/cjs/Axis.js +15 -15
  4. package/lib/cjs/Bar.js +16 -16
  5. package/lib/cjs/Bubble.js +59 -55
  6. package/lib/cjs/Bubble.js.map +1 -1
  7. package/lib/cjs/CompactHorizontalBar.js +25 -22
  8. package/lib/cjs/CompactHorizontalBar.js.map +1 -1
  9. package/lib/cjs/Donut.js +49 -45
  10. package/lib/cjs/Donut.js.map +1 -1
  11. package/lib/cjs/Dots.js +8 -8
  12. package/lib/cjs/HorizontalBar.js +16 -16
  13. package/lib/cjs/Hover.js +27 -10
  14. package/lib/cjs/Hover.js.map +1 -1
  15. package/lib/cjs/Line.js +9 -9
  16. package/lib/cjs/Plot.js +8 -6
  17. package/lib/cjs/Plot.js.map +1 -1
  18. package/lib/cjs/Radar.js +25 -24
  19. package/lib/cjs/Radar.js.map +1 -1
  20. package/lib/cjs/RadialTree.js +12 -12
  21. package/lib/cjs/Reference.js +12 -12
  22. package/lib/cjs/ScatterPlot.js +42 -40
  23. package/lib/cjs/ScatterPlot.js.map +1 -1
  24. package/lib/cjs/Tooltip.js +22 -20
  25. package/lib/cjs/Tooltip.js.map +1 -1
  26. package/lib/cjs/Venn.js +39 -27
  27. package/lib/cjs/Venn.js.map +1 -1
  28. package/lib/cjs/a11y/PlotA11yModule.js +2 -2
  29. package/lib/cjs/a11y/PlotA11yView.js +2 -2
  30. package/lib/cjs/component/Chart/AbstractChart.js +5 -3
  31. package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
  32. package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
  33. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  34. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +17 -17
  35. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
  36. package/lib/cjs/utils.js.map +1 -1
  37. package/lib/es6/Area.js +11 -11
  38. package/lib/es6/Axis.js +15 -15
  39. package/lib/es6/Bar.js +16 -16
  40. package/lib/es6/Bubble.js +59 -55
  41. package/lib/es6/Bubble.js.map +1 -1
  42. package/lib/es6/CompactHorizontalBar.js +25 -22
  43. package/lib/es6/CompactHorizontalBar.js.map +1 -1
  44. package/lib/es6/Donut.js +49 -45
  45. package/lib/es6/Donut.js.map +1 -1
  46. package/lib/es6/Dots.js +8 -8
  47. package/lib/es6/HorizontalBar.js +16 -16
  48. package/lib/es6/Hover.js +27 -10
  49. package/lib/es6/Hover.js.map +1 -1
  50. package/lib/es6/Line.js +9 -9
  51. package/lib/es6/Plot.js +8 -6
  52. package/lib/es6/Plot.js.map +1 -1
  53. package/lib/es6/Radar.js +25 -24
  54. package/lib/es6/Radar.js.map +1 -1
  55. package/lib/es6/RadialTree.js +12 -12
  56. package/lib/es6/Reference.js +12 -12
  57. package/lib/es6/ScatterPlot.js +42 -40
  58. package/lib/es6/ScatterPlot.js.map +1 -1
  59. package/lib/es6/Tooltip.js +22 -20
  60. package/lib/es6/Tooltip.js.map +1 -1
  61. package/lib/es6/Venn.js +39 -27
  62. package/lib/es6/Venn.js.map +1 -1
  63. package/lib/es6/a11y/PlotA11yModule.js +2 -2
  64. package/lib/es6/a11y/PlotA11yView.js +2 -2
  65. package/lib/es6/component/Chart/AbstractChart.js +5 -3
  66. package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
  67. package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
  68. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  69. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +17 -17
  70. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
  71. package/lib/es6/utils.js.map +1 -1
  72. package/lib/esm/Area.mjs +12 -12
  73. package/lib/esm/Axis.mjs +16 -16
  74. package/lib/esm/Bar.mjs +17 -17
  75. package/lib/esm/Bubble.mjs +26 -25
  76. package/lib/esm/CompactHorizontalBar.mjs +23 -23
  77. package/lib/esm/Donut.mjs +25 -24
  78. package/lib/esm/Dots.mjs +9 -9
  79. package/lib/esm/HorizontalBar.mjs +17 -17
  80. package/lib/esm/Hover.mjs +22 -11
  81. package/lib/esm/Line.mjs +10 -10
  82. package/lib/esm/Plot.mjs +9 -7
  83. package/lib/esm/Radar.mjs +25 -25
  84. package/lib/esm/RadialTree.mjs +13 -13
  85. package/lib/esm/Reference.mjs +13 -13
  86. package/lib/esm/ScatterPlot.mjs +17 -17
  87. package/lib/esm/Tooltip.mjs +17 -17
  88. package/lib/esm/Venn.mjs +30 -22
  89. package/lib/esm/a11y/PlotA11yModule.mjs +3 -3
  90. package/lib/esm/a11y/PlotA11yView.mjs +3 -3
  91. package/lib/esm/component/Chart/AbstractChart.mjs +4 -3
  92. package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +5 -5
  93. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +18 -18
  94. package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +7 -7
  95. package/lib/types/component/Chart/AbstractChart.type.d.ts +5 -0
  96. package/lib/types/utils.d.ts +4 -4
  97. package/package.json +10 -10
package/lib/esm/Bar.mjs CHANGED
@@ -17,26 +17,26 @@ var style = (
17
17
  /*__reshadow_css_start__*/
18
18
  (sstyled.insert(
19
19
  /*__inner_css_start__*/
20
- ".___SBar_1gb94_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_1gb94);transition-timing-function:ease-in-out}.___SBar_1gb94_gg_.__color_1gb94_gg_{fill:var(--color_1gb94)}.___SBar_1gb94_gg_.__pattern_1gb94_gg_.__color_1gb94_gg_{fill:var(--pattern_1gb94);stroke:var(--color_1gb94);stroke-width:1px}.___SBar_1gb94_gg_.__hide_1gb94_gg_{display:none}.___SBar_1gb94_gg_.__transparent_1gb94_gg_{opacity:.3}.___SBackground_1gb94_gg_.__onClick_1gb94_gg_,.___SBar_1gb94_gg_.__onClick_1gb94_gg_{cursor:pointer}.___SBackground_1gb94_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9)}.___SBarAnnotation_1gb94_gg_{display:flex;justify-content:space-between}.___SBarLabel_1gb94_gg_{color:var(--intergalactic-text-primary, #191b23);margin-right:auto}.___SBarLabel_1gb94_gg_,.___SBarPercent_1gb94_gg_,.___SBarValue_1gb94_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SBarPercent_1gb94_gg_{color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SBarValue_1gb94_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary, #191b23);text-align:right}.___SCompactHorizontalBarHoverRect_1gb94_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}",
20
+ ".___SBar_1u73j_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_1u73j);transition-timing-function:ease-in-out}.___SBar_1u73j_gg_.__color_1u73j_gg_{fill:var(--color_1u73j)}.___SBar_1u73j_gg_.__pattern_1u73j_gg_.__color_1u73j_gg_{fill:var(--pattern_1u73j);stroke:var(--color_1u73j);stroke-width:1px}.___SBar_1u73j_gg_.__hide_1u73j_gg_{display:none}.___SBar_1u73j_gg_.__transparent_1u73j_gg_{opacity:.3}.___SBackground_1u73j_gg_.__onClick_1u73j_gg_,.___SBar_1u73j_gg_.__onClick_1u73j_gg_{cursor:pointer}.___SBackground_1u73j_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9)}.___SBarAnnotation_1u73j_gg_{display:flex;justify-content:space-between}.___SBarLabel_1u73j_gg_{color:var(--intergalactic-text-primary, #191b23);margin-right:auto}.___SBarLabel_1u73j_gg_,.___SBarPercent_1u73j_gg_,.___SBarValue_1u73j_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SBarPercent_1u73j_gg_{color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SBarValue_1u73j_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary, #191b23);text-align:right}.___SCompactHorizontalBarHoverRect_1u73j_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}",
21
21
  /*__inner_css_end__*/
22
- "1gb94_gg_"
22
+ "1u73j_gg_"
23
23
  ), /*__reshadow_css_end__*/
24
24
  {
25
- "__SBar": "___SBar_1gb94_gg_",
26
- "--duration": "--duration_1gb94",
27
- "_color": "__color_1gb94_gg_",
28
- "--color": "--color_1gb94",
29
- "_pattern": "__pattern_1gb94_gg_",
30
- "--pattern": "--pattern_1gb94",
31
- "_hide": "__hide_1gb94_gg_",
32
- "_transparent": "__transparent_1gb94_gg_",
33
- "_onClick": "__onClick_1gb94_gg_",
34
- "__SBackground": "___SBackground_1gb94_gg_",
35
- "__SBarAnnotation": "___SBarAnnotation_1gb94_gg_",
36
- "__SBarLabel": "___SBarLabel_1gb94_gg_",
37
- "__SBarPercent": "___SBarPercent_1gb94_gg_",
38
- "__SBarValue": "___SBarValue_1gb94_gg_",
39
- "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1gb94_gg_"
25
+ "__SBar": "___SBar_1u73j_gg_",
26
+ "--duration": "--duration_1u73j",
27
+ "_color": "__color_1u73j_gg_",
28
+ "--color": "--color_1u73j",
29
+ "_pattern": "__pattern_1u73j_gg_",
30
+ "--pattern": "--pattern_1u73j",
31
+ "_hide": "__hide_1u73j_gg_",
32
+ "_transparent": "__transparent_1u73j_gg_",
33
+ "_onClick": "__onClick_1u73j_gg_",
34
+ "__SBackground": "___SBackground_1u73j_gg_",
35
+ "__SBarAnnotation": "___SBarAnnotation_1u73j_gg_",
36
+ "__SBarLabel": "___SBarLabel_1u73j_gg_",
37
+ "__SBarPercent": "___SBarPercent_1u73j_gg_",
38
+ "__SBarValue": "___SBarValue_1u73j_gg_",
39
+ "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1u73j_gg_"
40
40
  })
41
41
  );
42
42
  var MIN_HEIGHT = 2;
@@ -6,6 +6,7 @@ import _callSuper from "@babel/runtime/helpers/esm/callSuper";
6
6
  import _inherits from "@babel/runtime/helpers/esm/inherits";
7
7
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
8
  import { sstyled, assignProps, Component } from "@semcore/core";
9
+ import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
9
10
  import findComponent from "@semcore/core/lib/utils/findComponent";
10
11
  import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
11
12
  import { transition } from "d3-transition";
@@ -20,23 +21,23 @@ var style = (
20
21
  /*__reshadow_css_start__*/
21
22
  (sstyled.insert(
22
23
  /*__inner_css_start__*/
23
- ".___SBubble_1ucvn_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);stroke:var(--intergalactic-chart-grid-border, #ffffff);stroke-width:2px;transition-property:cx,cy;transition-duration:var(--duration_1ucvn);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SBubble_1ucvn_gg_:hover{opacity:.8}}g._visible_false_1ucvn_gg_{display:none}.___SBubble_1ucvn_gg_.__color_1ucvn_gg_{fill:var(--color_1ucvn)}.___SBubble_1ucvn_gg_.__pattern_1ucvn_gg_.__color_1ucvn_gg_{fill:var(--pattern_1ucvn);stroke:var(--color_1ucvn);stroke-width:1px}.___SBubble_1ucvn_gg_.__transparent_1ucvn_gg_{opacity:.3}.___SCenter_1ucvn_gg_{text-anchor:middle;font-size:calc(var(--intergalactic-fs-100, 12px) - 1px);stroke:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SCenter_1ucvn_gg_.__color_1ucvn_gg_{stroke:var(--color_1ucvn)}.___SCenter_1ucvn_gg_.__transparent_1ucvn_gg_{opacity:.3}.___SLabel_1ucvn_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SLabel_1ucvn_gg_._position_right_1ucvn_gg_{text-anchor:end}.___SLabel_1ucvn_gg_._position_left_1ucvn_gg_{text-anchor:start}.___SLabel_1ucvn_gg_.__color_1ucvn_gg_{fill:var(--color_1ucvn)}.___SLabel_1ucvn_gg_.__transparent_1ucvn_gg_{opacity:.3}",
24
+ ".___SBubble_emxoi_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);stroke:var(--intergalactic-chart-grid-border, #ffffff);stroke-width:2px;transition-property:cx,cy;transition-duration:var(--duration_emxoi);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SBubble_emxoi_gg_:hover{opacity:.8}}g._visible_false_emxoi_gg_{display:none}.___SBubble_emxoi_gg_.__color_emxoi_gg_{fill:var(--color_emxoi)}.___SBubble_emxoi_gg_.__pattern_emxoi_gg_.__color_emxoi_gg_{fill:var(--pattern_emxoi);stroke:var(--color_emxoi);stroke-width:1px}.___SBubble_emxoi_gg_.__transparent_emxoi_gg_{opacity:.3}.___SCenter_emxoi_gg_{text-anchor:middle;font-size:calc(var(--intergalactic-fs-100, 12px) - 1px);stroke:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SCenter_emxoi_gg_.__color_emxoi_gg_{stroke:var(--color_emxoi)}.___SCenter_emxoi_gg_.__transparent_emxoi_gg_{opacity:.3}.___SLabel_emxoi_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SLabel_emxoi_gg_._position_right_emxoi_gg_{text-anchor:end}.___SLabel_emxoi_gg_._position_left_emxoi_gg_{text-anchor:start}.___SLabel_emxoi_gg_.__color_emxoi_gg_{fill:var(--color_emxoi)}.___SLabel_emxoi_gg_.__transparent_emxoi_gg_{opacity:.3}",
24
25
  /*__inner_css_end__*/
25
- "1ucvn_gg_"
26
+ "emxoi_gg_"
26
27
  ), /*__reshadow_css_end__*/
27
28
  {
28
- "_visible_false": "_visible_false_1ucvn_gg_",
29
- "__SBubble": "___SBubble_1ucvn_gg_",
30
- "_color": "__color_1ucvn_gg_",
31
- "--color": "--color_1ucvn",
32
- "_pattern": "__pattern_1ucvn_gg_",
33
- "--pattern": "--pattern_1ucvn",
34
- "_transparent": "__transparent_1ucvn_gg_",
35
- "__SCenter": "___SCenter_1ucvn_gg_",
36
- "__SLabel": "___SLabel_1ucvn_gg_",
37
- "_position_right": "_position_right_1ucvn_gg_",
38
- "_position_left": "_position_left_1ucvn_gg_",
39
- "--duration": "--duration_1ucvn"
29
+ "_visible_false": "_visible_false_emxoi_gg_",
30
+ "__SBubble": "___SBubble_emxoi_gg_",
31
+ "_color": "__color_emxoi_gg_",
32
+ "--color": "--color_emxoi",
33
+ "_pattern": "__pattern_emxoi_gg_",
34
+ "--pattern": "--pattern_emxoi",
35
+ "_transparent": "__transparent_emxoi_gg_",
36
+ "__SCenter": "___SCenter_emxoi_gg_",
37
+ "__SLabel": "___SLabel_emxoi_gg_",
38
+ "_position_right": "_position_right_emxoi_gg_",
39
+ "_position_left": "_position_left_emxoi_gg_",
40
+ "--duration": "--duration_emxoi"
40
41
  })
41
42
  );
42
43
  var BubbleRoot = /* @__PURE__ */ (function(_Component) {
@@ -50,10 +51,10 @@ var BubbleRoot = /* @__PURE__ */ (function(_Component) {
50
51
  _defineProperty(_this, "bindHandlerTooltip", function(visible, props, tooltipProps) {
51
52
  return function(_ref4) {
52
53
  var clientX = _ref4.clientX, clientY = _ref4.clientY;
53
- var eventEmitter = _this.asProps.eventEmitter;
54
- eventEmitter.emit("setTooltipPosition", clientX, clientY);
55
- eventEmitter.emit("setTooltipRenderingProps", props, tooltipProps);
56
- eventEmitter.emit("setTooltipVisible", visible);
54
+ var _this$asProps = _this.asProps, eventEmitter = _this$asProps.eventEmitter, plotId = _this$asProps.plotId;
55
+ eventEmitter.emit("setTooltipPosition_".concat(plotId), clientX, clientY);
56
+ eventEmitter.emit("setTooltipRenderingProps_".concat(plotId), props, tooltipProps);
57
+ eventEmitter.emit("setTooltipVisible_".concat(plotId), visible);
57
58
  };
58
59
  });
59
60
  return _this;
@@ -78,7 +79,7 @@ var BubbleRoot = /* @__PURE__ */ (function(_Component) {
78
79
  }, {
79
80
  key: "animationCircle",
80
81
  value: function animationCircle() {
81
- var _this$asProps = this.asProps, duration = _this$asProps.duration, uid = _this$asProps.uid, data = _this$asProps.data, value = _this$asProps.value;
82
+ var _this$asProps2 = this.asProps, duration = _this$asProps2.duration, uid = _this$asProps2.uid, data = _this$asProps2.data, value = _this$asProps2.value;
82
83
  var z = getBubbleChartValueScale(data, value);
83
84
  var selectRect = transition().selection().selectAll("[id^=".concat(uid).concat(uid, "]")).attr("r", 0);
84
85
  var selectRectNode = selectRect.node();
@@ -92,7 +93,7 @@ var BubbleRoot = /* @__PURE__ */ (function(_Component) {
92
93
  }, {
93
94
  key: "componentDidUpdate",
94
95
  value: function componentDidUpdate(prevProps) {
95
- var _this$asProps2 = this.asProps, data = _this$asProps2.data, x = _this$asProps2.x, y = _this$asProps2.y, value = _this$asProps2.value;
96
+ var _this$asProps3 = this.asProps, data = _this$asProps3.data, x = _this$asProps3.x, y = _this$asProps3.y, value = _this$asProps3.value;
96
97
  var prevX = prevProps.x, prevY = prevProps.y, prevValue = prevProps.value;
97
98
  var prevData = prevProps.$rootProps.data;
98
99
  if (data !== prevData || x !== prevX || y !== prevY || value !== prevValue) {
@@ -117,7 +118,7 @@ var BubbleRoot = /* @__PURE__ */ (function(_Component) {
117
118
  }, {
118
119
  key: "getCircleProps",
119
120
  value: function getCircleProps() {
120
- var _this$asProps3 = this.asProps, color = _this$asProps3.color, scale = _this$asProps3.scale, x = _this$asProps3.x, y = _this$asProps3.y, offset = _this$asProps3.offset, styles = _this$asProps3.styles, uid = _this$asProps3.uid, duration = _this$asProps3.duration, value = _this$asProps3.value, label = _this$asProps3.label, markedCross = _this$asProps3.markedCross, size = _this$asProps3.size, data = _this$asProps3.data, transparent = _this$asProps3.transparent, resolveColor = _this$asProps3.resolveColor, patterns = _this$asProps3.patterns;
121
+ var _this$asProps4 = this.asProps, color = _this$asProps4.color, scale = _this$asProps4.scale, x = _this$asProps4.x, y = _this$asProps4.y, offset = _this$asProps4.offset, styles = _this$asProps4.styles, uid = _this$asProps4.uid, duration = _this$asProps4.duration, value = _this$asProps4.value, label = _this$asProps4.label, markedCross = _this$asProps4.markedCross, size = _this$asProps4.size, data = _this$asProps4.data, transparent = _this$asProps4.transparent, resolveColor = _this$asProps4.resolveColor, patterns = _this$asProps4.patterns;
121
122
  return {
122
123
  color,
123
124
  scale,
@@ -136,13 +137,13 @@ var BubbleRoot = /* @__PURE__ */ (function(_Component) {
136
137
  resolveColor,
137
138
  patterns,
138
139
  bindHandlerTooltip: this.bindHandlerTooltip,
139
- onClick: this.handlerOnClick.bind(this)
140
+ onClickCircleRoot: this.handlerOnClick.bind(this)
140
141
  };
141
142
  }
142
143
  }, {
143
144
  key: "render",
144
145
  value: function render() {
145
- var _this$asProps4 = this.asProps, data = _this$asProps4.data, uid = _this$asProps4.uid, scale = _this$asProps4.scale, x = _this$asProps4.x, y = _this$asProps4.y, value = _this$asProps4.value, Children = _this$asProps4.Children;
146
+ var _this$asProps5 = this.asProps, data = _this$asProps5.data, uid = _this$asProps5.uid, scale = _this$asProps5.scale, x = _this$asProps5.x, y = _this$asProps5.y, value = _this$asProps5.value, Children = _this$asProps5.Children;
146
147
  var _scale = _slicedToArray(scale, 2), xScale = _scale[0], yScale = _scale[1];
147
148
  var xSize = Math.abs(xScale.range()[0] - xScale.range()[1]);
148
149
  var ySize = Math.abs(yScale.range()[0] - yScale.range()[1]);
@@ -185,7 +186,7 @@ var BubbleTooltip = function BubbleTooltip2(props) {
185
186
  };
186
187
  function BubbleCircle(props) {
187
188
  var _ref3, _circleData$color;
188
- var color = props.color, scale = props.scale, x = props.x, y = props.y, offset = props.offset, styles = props.styles, uid = props.uid, duration = props.duration, value = props.value, label = props.label, markedCross = props.markedCross, size = props.size, data = props.data, transparent = props.transparent, resolveColor = props.resolveColor, patterns = props.patterns, index = props.index, bindHandlerTooltip = props.bindHandlerTooltip, Element = props.Element, _props$visible = props.visible, visible = _props$visible === void 0 ? true : _props$visible, onClick = props.onClick;
189
+ var color = props.color, scale = props.scale, x = props.x, y = props.y, offset = props.offset, styles = props.styles, uid = props.uid, duration = props.duration, value = props.value, label = props.label, markedCross = props.markedCross, size = props.size, data = props.data, transparent = props.transparent, resolveColor = props.resolveColor, patterns = props.patterns, index = props.index, bindHandlerTooltip = props.bindHandlerTooltip, Element = props.Element, _props$visible = props.visible, visible = _props$visible === void 0 ? true : _props$visible, onClick = props.onClick, onClickCircleRoot = props.onClickCircleRoot;
189
190
  var circleData = data[index];
190
191
  if (!circleData) return null;
191
192
  var _scale2 = _slicedToArray(scale, 2), xScale = _scale2[0], yScale = _scale2[1];
@@ -202,7 +203,7 @@ function BubbleCircle(props) {
202
203
  return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SvgElement, _ref3.cn("SvgElement", {
203
204
  "tag": "g",
204
205
  "key": "circle(#".concat(index, ")"),
205
- "onClickCapture": onClick(index),
206
+ "onClickCapture": callAllEventHandlers(onClickCircleRoot(index), onClick),
206
207
  "onMouseMove": bindHandlerTooltip(true, props, {
207
208
  xIndex: index,
208
209
  index,
@@ -23,26 +23,26 @@ var style = (
23
23
  /*__reshadow_css_start__*/
24
24
  (sstyled.insert(
25
25
  /*__inner_css_start__*/
26
- ".___SBar_1gb94_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_1gb94);transition-timing-function:ease-in-out}.___SBar_1gb94_gg_.__color_1gb94_gg_{fill:var(--color_1gb94)}.___SBar_1gb94_gg_.__pattern_1gb94_gg_.__color_1gb94_gg_{fill:var(--pattern_1gb94);stroke:var(--color_1gb94);stroke-width:1px}.___SBar_1gb94_gg_.__hide_1gb94_gg_{display:none}.___SBar_1gb94_gg_.__transparent_1gb94_gg_{opacity:.3}.___SBackground_1gb94_gg_.__onClick_1gb94_gg_,.___SBar_1gb94_gg_.__onClick_1gb94_gg_{cursor:pointer}.___SBackground_1gb94_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9)}.___SBarAnnotation_1gb94_gg_{display:flex;justify-content:space-between}.___SBarLabel_1gb94_gg_{color:var(--intergalactic-text-primary, #191b23);margin-right:auto}.___SBarLabel_1gb94_gg_,.___SBarPercent_1gb94_gg_,.___SBarValue_1gb94_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SBarPercent_1gb94_gg_{color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SBarValue_1gb94_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary, #191b23);text-align:right}.___SCompactHorizontalBarHoverRect_1gb94_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}",
26
+ ".___SBar_1u73j_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_1u73j);transition-timing-function:ease-in-out}.___SBar_1u73j_gg_.__color_1u73j_gg_{fill:var(--color_1u73j)}.___SBar_1u73j_gg_.__pattern_1u73j_gg_.__color_1u73j_gg_{fill:var(--pattern_1u73j);stroke:var(--color_1u73j);stroke-width:1px}.___SBar_1u73j_gg_.__hide_1u73j_gg_{display:none}.___SBar_1u73j_gg_.__transparent_1u73j_gg_{opacity:.3}.___SBackground_1u73j_gg_.__onClick_1u73j_gg_,.___SBar_1u73j_gg_.__onClick_1u73j_gg_{cursor:pointer}.___SBackground_1u73j_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9)}.___SBarAnnotation_1u73j_gg_{display:flex;justify-content:space-between}.___SBarLabel_1u73j_gg_{color:var(--intergalactic-text-primary, #191b23);margin-right:auto}.___SBarLabel_1u73j_gg_,.___SBarPercent_1u73j_gg_,.___SBarValue_1u73j_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SBarPercent_1u73j_gg_{color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SBarValue_1u73j_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary, #191b23);text-align:right}.___SCompactHorizontalBarHoverRect_1u73j_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}",
27
27
  /*__inner_css_end__*/
28
- "1gb94_gg_"
28
+ "1u73j_gg_"
29
29
  ), /*__reshadow_css_end__*/
30
30
  {
31
- "__SBar": "___SBar_1gb94_gg_",
32
- "--duration": "--duration_1gb94",
33
- "_color": "__color_1gb94_gg_",
34
- "--color": "--color_1gb94",
35
- "_pattern": "__pattern_1gb94_gg_",
36
- "--pattern": "--pattern_1gb94",
37
- "_hide": "__hide_1gb94_gg_",
38
- "_transparent": "__transparent_1gb94_gg_",
39
- "_onClick": "__onClick_1gb94_gg_",
40
- "__SBackground": "___SBackground_1gb94_gg_",
41
- "__SBarAnnotation": "___SBarAnnotation_1gb94_gg_",
42
- "__SBarLabel": "___SBarLabel_1gb94_gg_",
43
- "__SBarPercent": "___SBarPercent_1gb94_gg_",
44
- "__SBarValue": "___SBarValue_1gb94_gg_",
45
- "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1gb94_gg_"
31
+ "__SBar": "___SBar_1u73j_gg_",
32
+ "--duration": "--duration_1u73j",
33
+ "_color": "__color_1u73j_gg_",
34
+ "--color": "--color_1u73j",
35
+ "_pattern": "__pattern_1u73j_gg_",
36
+ "--pattern": "--pattern_1u73j",
37
+ "_hide": "__hide_1u73j_gg_",
38
+ "_transparent": "__transparent_1u73j_gg_",
39
+ "_onClick": "__onClick_1u73j_gg_",
40
+ "__SBackground": "___SBackground_1u73j_gg_",
41
+ "__SBarAnnotation": "___SBarAnnotation_1u73j_gg_",
42
+ "__SBarLabel": "___SBarLabel_1u73j_gg_",
43
+ "__SBarPercent": "___SBarPercent_1u73j_gg_",
44
+ "__SBarValue": "___SBarValue_1u73j_gg_",
45
+ "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1u73j_gg_"
46
46
  })
47
47
  );
48
48
  var MIN_WIDTH = 4;
@@ -400,28 +400,28 @@ var Hover = /* @__PURE__ */ (function(_Component2) {
400
400
  _defineProperty(_this3, "unsubscribeMouseMoveRoot", null);
401
401
  _defineProperty(_this3, "unsubscribeMouseLeaveRoot", null);
402
402
  _defineProperty(_this3, "handlerMouseMoveRoot", trottle(function(e) {
403
- var _this3$asProps = _this3.asProps, eventEmitter = _this3$asProps.eventEmitter, rootRef = _this3$asProps.rootRef, patterns = _this3$asProps.patterns, updateIndexToHover = _this3$asProps.updateIndexToHover;
403
+ var _this3$asProps = _this3.asProps, eventEmitter = _this3$asProps.eventEmitter, rootRef = _this3$asProps.rootRef, patterns = _this3$asProps.patterns, updateIndexToHover = _this3$asProps.updateIndexToHover, plotId = _this3$asProps.plotId;
404
404
  var point = eventToPoint(e, rootRef.current);
405
405
  var clientX = e.clientX, clientY = e.clientY;
406
406
  var index = _this3.getIndex(point);
407
407
  _this3.setState({
408
408
  index
409
409
  }, function() {
410
- eventEmitter.emit("setTooltipPosition", clientX, clientY);
411
- eventEmitter.emit("setTooltipRenderingProps", {}, {
410
+ eventEmitter.emit("setTooltipPosition_".concat(plotId), clientX, clientY);
411
+ eventEmitter.emit("setTooltipRenderingProps_".concat(plotId), {}, {
412
412
  index,
413
413
  patterns
414
414
  });
415
- eventEmitter.emit("setTooltipVisible", index !== null);
415
+ eventEmitter.emit("setTooltipVisible_".concat(plotId), index !== null);
416
416
  updateIndexToHover(index);
417
417
  });
418
418
  }));
419
419
  _defineProperty(_this3, "handlerMouseLeaveRoot", trottle(function() {
420
- var updateIndexToHover = _this3.asProps.updateIndexToHover;
420
+ var _this3$asProps2 = _this3.asProps, updateIndexToHover = _this3$asProps2.updateIndexToHover, plotId = _this3$asProps2.plotId;
421
421
  _this3.setState({
422
422
  index: null
423
423
  }, function() {
424
- _this3.asProps.eventEmitter.emit("setTooltipVisible", false);
424
+ _this3.asProps.eventEmitter.emit("setTooltipVisible_".concat(plotId), false);
425
425
  updateIndexToHover(null);
426
426
  });
427
427
  }));
package/lib/esm/Donut.mjs CHANGED
@@ -7,6 +7,7 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
7
7
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
8
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
9
9
  import { sstyled, assignProps, Component } from "@semcore/core";
10
+ import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
10
11
  import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
11
12
  import getOriginChildren from "@semcore/core/lib/utils/getOriginChildren";
12
13
  import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
@@ -18,25 +19,25 @@ import createElement from "./createElement.mjs";
18
19
  import { PatternFill } from "./Pattern.mjs";
19
20
  import Tooltip from "./Tooltip.mjs";
20
21
  import { getChartDefaultColorName } from "./utils.mjs";
21
- var _excluded = ["Element", "styles", "d3Arc", "data", "color", "$animationActivePie", "active", "d3ArcOut", "name", "dataKey", "dataHintsHandler", "transparent", "innerRadius", "outerRadius", "resolveColor", "halfsize", "uid", "patterns", "onClick"];
22
+ var _excluded = ["Element", "styles", "d3Arc", "data", "color", "$animationActivePie", "active", "d3ArcOut", "name", "dataKey", "dataHintsHandler", "transparent", "innerRadius", "outerRadius", "resolveColor", "halfsize", "uid", "patterns", "onClick", "onClickPieRoot"];
22
23
  /*!__reshadow-styles__:"./style/donut.shadow.css"*/
23
24
  var style = (
24
25
  /*__reshadow_css_start__*/
25
26
  (sstyled.insert(
26
27
  /*__inner_css_start__*/
27
- ".___SPie_1xjlm_gg_{stroke:var(--intergalactic-chart-grid-border, #ffffff);fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SPie_1xjlm_gg_.__color_1xjlm_gg_{fill:var(--color_1xjlm)}.___SPie_1xjlm_gg_.__pattern_1xjlm_gg_.__color_1xjlm_gg_{fill:var(--pattern_1xjlm);stroke:var(--color_1xjlm);stroke-width:1px}.___SPie_1xjlm_gg_.__transparent_1xjlm_gg_{opacity:.3}.___SEmptyData_1xjlm_gg_{fill:var(--intergalactic-chart-palette-order-null, #e0e1e9)}.___SEmptyData_1xjlm_gg_.__color_1xjlm_gg_{fill:var(--color_1xjlm)}.___SLabel_1xjlm_gg_{text-anchor:middle;vertical-anchor:middle;font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}",
28
+ ".___SPie_ndlco_gg_{stroke:var(--intergalactic-chart-grid-border, #ffffff);fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SPie_ndlco_gg_.__color_ndlco_gg_{fill:var(--color_ndlco)}.___SPie_ndlco_gg_.__pattern_ndlco_gg_.__color_ndlco_gg_{fill:var(--pattern_ndlco);stroke:var(--color_ndlco);stroke-width:1px}.___SPie_ndlco_gg_.__transparent_ndlco_gg_{opacity:.3}.___SEmptyData_ndlco_gg_{fill:var(--intergalactic-chart-palette-order-null, #e0e1e9)}.___SEmptyData_ndlco_gg_.__color_ndlco_gg_{fill:var(--color_ndlco)}.___SLabel_ndlco_gg_{text-anchor:middle;vertical-anchor:middle;font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}",
28
29
  /*__inner_css_end__*/
29
- "1xjlm_gg_"
30
+ "ndlco_gg_"
30
31
  ), /*__reshadow_css_end__*/
31
32
  {
32
- "__SPie": "___SPie_1xjlm_gg_",
33
- "_color": "__color_1xjlm_gg_",
34
- "--color": "--color_1xjlm",
35
- "_pattern": "__pattern_1xjlm_gg_",
36
- "--pattern": "--pattern_1xjlm",
37
- "_transparent": "__transparent_1xjlm_gg_",
38
- "__SEmptyData": "___SEmptyData_1xjlm_gg_",
39
- "__SLabel": "___SLabel_1xjlm_gg_"
33
+ "__SPie": "___SPie_ndlco_gg_",
34
+ "_color": "__color_ndlco_gg_",
35
+ "--color": "--color_ndlco",
36
+ "_pattern": "__pattern_ndlco_gg_",
37
+ "--pattern": "--pattern_ndlco",
38
+ "_transparent": "__transparent_ndlco_gg_",
39
+ "__SEmptyData": "___SEmptyData_ndlco_gg_",
40
+ "__SLabel": "___SLabel_ndlco_gg_"
40
41
  })
41
42
  );
42
43
  var DEFAULT_INSTANCE = Symbol("DEFAULT_INSTANCE");
@@ -99,15 +100,15 @@ var DonutRoot = /* @__PURE__ */ (function(_Component) {
99
100
  _defineProperty(_this, "bindHandlerTooltip", function(visible, props, tooltipProps) {
100
101
  return function(_ref9) {
101
102
  var clientX = _ref9.clientX, clientY = _ref9.clientY;
102
- var eventEmitter = _this.asProps.eventEmitter;
103
- eventEmitter.emit("setTooltipPosition", clientX, clientY);
104
- eventEmitter.emit("setTooltipRenderingProps", props, tooltipProps);
105
- eventEmitter.emit("setTooltipVisible", visible);
103
+ var _this$asProps = _this.asProps, eventEmitter = _this$asProps.eventEmitter, plotId = _this$asProps.plotId;
104
+ eventEmitter.emit("setTooltipPosition_".concat(plotId), clientX, clientY);
105
+ eventEmitter.emit("setTooltipRenderingProps_".concat(plotId), props, tooltipProps);
106
+ eventEmitter.emit("setTooltipVisible_".concat(plotId), visible);
106
107
  };
107
108
  });
108
109
  _defineProperty(_this, "animationActivePie", function(_ref0) {
109
110
  var data = _ref0.data, active = _ref0.active, selector = _ref0.selector, element = _ref0.element;
110
- var _this$asProps = _this.asProps, duration = _this$asProps.duration, innerRadius = _this$asProps.innerRadius, d3Arc = _this$asProps.d3Arc, paddingAngle = _this$asProps.paddingAngle;
111
+ var _this$asProps2 = _this.asProps, duration = _this$asProps2.duration, innerRadius = _this$asProps2.innerRadius, d3Arc = _this$asProps2.d3Arc, paddingAngle = _this$asProps2.paddingAngle;
111
112
  var outerRadius = d3Arc.outerRadius()();
112
113
  var outerRadiusStartEnd = active ? [+element.dataset["currentRadius"] || outerRadius, outerRadius + increaseFactor] : [+element.dataset["currentRadius"] || outerRadius, outerRadius];
113
114
  if (_this.canAnimatedHover && duration > 0) {
@@ -126,7 +127,7 @@ var DonutRoot = /* @__PURE__ */ (function(_Component) {
126
127
  _defineProperty(_this, "animationUpdatePie", function() {
127
128
  clearTimeout(_this.animationTimeout);
128
129
  _this.animationTimeout = setTimeout(function() {
129
- var _this$asProps2 = _this.asProps, duration = _this$asProps2.duration, d3Arc = _this$asProps2.d3Arc, halfsize = _this$asProps2.halfsize, d3ArcOut = _this$asProps2.d3ArcOut;
130
+ var _this$asProps3 = _this.asProps, duration = _this$asProps3.duration, d3Arc = _this$asProps3.d3Arc, halfsize = _this$asProps3.halfsize, d3ArcOut = _this$asProps3.d3ArcOut;
130
131
  _this.canAnimatedHover = false;
131
132
  if (duration > 0) {
132
133
  transitionAnglePie({
@@ -151,7 +152,7 @@ var DonutRoot = /* @__PURE__ */ (function(_Component) {
151
152
  return _createClass(DonutRoot2, [{
152
153
  key: "id",
153
154
  get: function get() {
154
- var _this$asProps3 = this.asProps, uid = _this$asProps3.uid, id = _this$asProps3.id;
155
+ var _this$asProps4 = this.asProps, uid = _this$asProps4.uid, id = _this$asProps4.id;
155
156
  return id || uid;
156
157
  }
157
158
  }, {
@@ -173,7 +174,7 @@ var DonutRoot = /* @__PURE__ */ (function(_Component) {
173
174
  }, {
174
175
  key: "getArcs",
175
176
  value: function getArcs() {
176
- var _this$asProps4 = this.asProps, Children = _this$asProps4.Children, data = _this$asProps4.data, d3Pie = _this$asProps4.d3Pie;
177
+ var _this$asProps5 = this.asProps, Children = _this$asProps5.Children, data = _this$asProps5.data, d3Pie = _this$asProps5.d3Pie;
177
178
  var pieData = Object.entries(data);
178
179
  if (d3Pie[DEFAULT_INSTANCE]) {
179
180
  var keys = React.Children.toArray(getOriginChildren(Children)).reduce(function(acc, child) {
@@ -216,7 +217,7 @@ var DonutRoot = /* @__PURE__ */ (function(_Component) {
216
217
  key: "getPieProps",
217
218
  value: function getPieProps(props, index) {
218
219
  var _this3 = this;
219
- var _this$asProps5 = this.asProps, d3Arc = _this$asProps5.d3Arc, d3ArcOut = _this$asProps5.d3ArcOut, innerRadius = _this$asProps5.innerRadius, outerRadius = _this$asProps5.outerRadius, halfsize = _this$asProps5.halfsize, resolveColor = _this$asProps5.resolveColor, uid = _this$asProps5.uid, patterns = _this$asProps5.patterns;
220
+ var _this$asProps6 = this.asProps, d3Arc = _this$asProps6.d3Arc, d3ArcOut = _this$asProps6.d3ArcOut, innerRadius = _this$asProps6.innerRadius, outerRadius = _this$asProps6.outerRadius, halfsize = _this$asProps6.halfsize, resolveColor = _this$asProps6.resolveColor, uid = _this$asProps6.uid, patterns = _this$asProps6.patterns;
220
221
  var active = props.active;
221
222
  var data = this.arcs.find(function(arc2) {
222
223
  return arc2.data[0] === props.dataKey;
@@ -267,7 +268,7 @@ var DonutRoot = /* @__PURE__ */ (function(_Component) {
267
268
  });
268
269
  }
269
270
  },
270
- onClick: this.handlerOnClick.bind(this)
271
+ onClickPieRoot: this.handlerOnClick(props.dataKey)
271
272
  };
272
273
  }
273
274
  }, {
@@ -294,7 +295,7 @@ var DonutRoot = /* @__PURE__ */ (function(_Component) {
294
295
  }, {
295
296
  key: "render",
296
297
  value: function render() {
297
- var _this$asProps6 = this.asProps, halfsize = _this$asProps6.halfsize, size = _this$asProps6.size;
298
+ var _this$asProps7 = this.asProps, halfsize = _this$asProps7.halfsize, size = _this$asProps7.size;
298
299
  this.asProps.dataHintsHandler.establishDataType("values-set");
299
300
  var _size2 = _slicedToArray(size, 2), width = _size2[0], height = _size2[1];
300
301
  var Element = this.Element;
@@ -342,7 +343,7 @@ _defineProperty(DonutRoot, "defaultProps", function(_ref18) {
342
343
  });
343
344
  function Pie(_ref15) {
344
345
  var _ref2;
345
- var SPie = _ref15.Element, styles = _ref15.styles, d3Arc = _ref15.d3Arc, data = _ref15.data, color = _ref15.color, $animationActivePie = _ref15.$animationActivePie, active = _ref15.active, d3ArcOut = _ref15.d3ArcOut, name = _ref15.name, dataKey = _ref15.dataKey, dataHintsHandler = _ref15.dataHintsHandler, transparent = _ref15.transparent, innerRadius = _ref15.innerRadius, outerRadius = _ref15.outerRadius, resolveColor = _ref15.resolveColor, halfsize = _ref15.halfsize, uid = _ref15.uid, patterns = _ref15.patterns, onClick = _ref15.onClick, other = _objectWithoutProperties(_ref15, _excluded);
346
+ var SPie = _ref15.Element, styles = _ref15.styles, d3Arc = _ref15.d3Arc, data = _ref15.data, color = _ref15.color, $animationActivePie = _ref15.$animationActivePie, active = _ref15.active, d3ArcOut = _ref15.d3ArcOut, name = _ref15.name, dataKey = _ref15.dataKey, dataHintsHandler = _ref15.dataHintsHandler, transparent = _ref15.transparent, innerRadius = _ref15.innerRadius, outerRadius = _ref15.outerRadius, resolveColor = _ref15.resolveColor, halfsize = _ref15.halfsize, uid = _ref15.uid, patterns = _ref15.patterns, onClick = _ref15.onClick, onClickPieRoot = _ref15.onClickPieRoot, other = _objectWithoutProperties(_ref15, _excluded);
346
347
  var _React$useState = React.useState(false), _React$useState2 = _slicedToArray(_React$useState, 2), isMount = _React$useState2[0], setIsMount = _React$useState2[1];
347
348
  var pieRef = React.useRef(null);
348
349
  React.useEffect(function() {
@@ -375,7 +376,7 @@ function Pie(_ref15) {
375
376
  "pattern": patterns ? "url(#".concat(uid, "-pattern)") : void 0,
376
377
  "d": active ? d3ArcOut(data) : d3Arc(data),
377
378
  "transparent": transparent,
378
- "onClick": onClick(dataKey)
379
+ "use:onClick": callAllEventHandlers(onClickPieRoot, onClick)
379
380
  }))), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref2.cn("PatternFill", {
380
381
  "id": "".concat(uid, "-pattern"),
381
382
  "patternKey": color,
package/lib/esm/Dots.mjs CHANGED
@@ -11,18 +11,18 @@ var style = (
11
11
  /*__reshadow_css_start__*/
12
12
  (sstyled.insert(
13
13
  /*__inner_css_start__*/
14
- ".___SDots_17fh8_gg_ .___SDot_17fh8_gg_{transition-duration:var(--duration_17fh8)}.___SDot_17fh8_gg_{stroke-width:1px;stroke:var(--intergalactic-chart-grid-border, #ffffff);fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:cx,cy,x,y;transition-timing-function:ease-in-out}.___SDot_17fh8_gg_.__hide_17fh8_gg_{display:none}.___SDot_17fh8_gg_.__color_17fh8_gg_{fill:var(--color_17fh8)}.___SDot_17fh8_gg_.__transparent_17fh8_gg_{opacity:.3}",
14
+ ".___SDots_153y5_gg_ .___SDot_153y5_gg_{transition-duration:var(--duration_153y5)}.___SDot_153y5_gg_{stroke-width:1px;stroke:var(--intergalactic-chart-grid-border, #ffffff);fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:cx,cy,x,y;transition-timing-function:ease-in-out}.___SDot_153y5_gg_.__hide_153y5_gg_{display:none}.___SDot_153y5_gg_.__color_153y5_gg_{fill:var(--color_153y5)}.___SDot_153y5_gg_.__transparent_153y5_gg_{opacity:.3}",
15
15
  /*__inner_css_end__*/
16
- "17fh8_gg_"
16
+ "153y5_gg_"
17
17
  ), /*__reshadow_css_end__*/
18
18
  {
19
- "__SDot": "___SDot_17fh8_gg_",
20
- "_hide": "__hide_17fh8_gg_",
21
- "_color": "__color_17fh8_gg_",
22
- "--color": "--color_17fh8",
23
- "_transparent": "__transparent_17fh8_gg_",
24
- "__SDots": "___SDots_17fh8_gg_",
25
- "--duration": "--duration_17fh8"
19
+ "__SDot": "___SDot_153y5_gg_",
20
+ "_hide": "__hide_153y5_gg_",
21
+ "_color": "__color_153y5_gg_",
22
+ "--color": "--color_153y5",
23
+ "_transparent": "__transparent_153y5_gg_",
24
+ "__SDots": "___SDots_153y5_gg_",
25
+ "--duration": "--duration_153y5"
26
26
  })
27
27
  );
28
28
  function Dots(props) {
@@ -16,26 +16,26 @@ var style = (
16
16
  /*__reshadow_css_start__*/
17
17
  (sstyled.insert(
18
18
  /*__inner_css_start__*/
19
- ".___SBar_1gb94_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_1gb94);transition-timing-function:ease-in-out}.___SBar_1gb94_gg_.__color_1gb94_gg_{fill:var(--color_1gb94)}.___SBar_1gb94_gg_.__pattern_1gb94_gg_.__color_1gb94_gg_{fill:var(--pattern_1gb94);stroke:var(--color_1gb94);stroke-width:1px}.___SBar_1gb94_gg_.__hide_1gb94_gg_{display:none}.___SBar_1gb94_gg_.__transparent_1gb94_gg_{opacity:.3}.___SBackground_1gb94_gg_.__onClick_1gb94_gg_,.___SBar_1gb94_gg_.__onClick_1gb94_gg_{cursor:pointer}.___SBackground_1gb94_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9)}.___SBarAnnotation_1gb94_gg_{display:flex;justify-content:space-between}.___SBarLabel_1gb94_gg_{color:var(--intergalactic-text-primary, #191b23);margin-right:auto}.___SBarLabel_1gb94_gg_,.___SBarPercent_1gb94_gg_,.___SBarValue_1gb94_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SBarPercent_1gb94_gg_{color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SBarValue_1gb94_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary, #191b23);text-align:right}.___SCompactHorizontalBarHoverRect_1gb94_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}",
19
+ ".___SBar_1u73j_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_1u73j);transition-timing-function:ease-in-out}.___SBar_1u73j_gg_.__color_1u73j_gg_{fill:var(--color_1u73j)}.___SBar_1u73j_gg_.__pattern_1u73j_gg_.__color_1u73j_gg_{fill:var(--pattern_1u73j);stroke:var(--color_1u73j);stroke-width:1px}.___SBar_1u73j_gg_.__hide_1u73j_gg_{display:none}.___SBar_1u73j_gg_.__transparent_1u73j_gg_{opacity:.3}.___SBackground_1u73j_gg_.__onClick_1u73j_gg_,.___SBar_1u73j_gg_.__onClick_1u73j_gg_{cursor:pointer}.___SBackground_1u73j_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9)}.___SBarAnnotation_1u73j_gg_{display:flex;justify-content:space-between}.___SBarLabel_1u73j_gg_{color:var(--intergalactic-text-primary, #191b23);margin-right:auto}.___SBarLabel_1u73j_gg_,.___SBarPercent_1u73j_gg_,.___SBarValue_1u73j_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SBarPercent_1u73j_gg_{color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SBarValue_1u73j_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary, #191b23);text-align:right}.___SCompactHorizontalBarHoverRect_1u73j_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}",
20
20
  /*__inner_css_end__*/
21
- "1gb94_gg_"
21
+ "1u73j_gg_"
22
22
  ), /*__reshadow_css_end__*/
23
23
  {
24
- "__SBar": "___SBar_1gb94_gg_",
25
- "--duration": "--duration_1gb94",
26
- "_color": "__color_1gb94_gg_",
27
- "--color": "--color_1gb94",
28
- "_pattern": "__pattern_1gb94_gg_",
29
- "--pattern": "--pattern_1gb94",
30
- "_hide": "__hide_1gb94_gg_",
31
- "_transparent": "__transparent_1gb94_gg_",
32
- "_onClick": "__onClick_1gb94_gg_",
33
- "__SBackground": "___SBackground_1gb94_gg_",
34
- "__SBarAnnotation": "___SBarAnnotation_1gb94_gg_",
35
- "__SBarLabel": "___SBarLabel_1gb94_gg_",
36
- "__SBarPercent": "___SBarPercent_1gb94_gg_",
37
- "__SBarValue": "___SBarValue_1gb94_gg_",
38
- "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1gb94_gg_"
24
+ "__SBar": "___SBar_1u73j_gg_",
25
+ "--duration": "--duration_1u73j",
26
+ "_color": "__color_1u73j_gg_",
27
+ "--color": "--color_1u73j",
28
+ "_pattern": "__pattern_1u73j_gg_",
29
+ "--pattern": "--pattern_1u73j",
30
+ "_hide": "__hide_1u73j_gg_",
31
+ "_transparent": "__transparent_1u73j_gg_",
32
+ "_onClick": "__onClick_1u73j_gg_",
33
+ "__SBackground": "___SBackground_1u73j_gg_",
34
+ "__SBarAnnotation": "___SBarAnnotation_1u73j_gg_",
35
+ "__SBarLabel": "___SBarLabel_1u73j_gg_",
36
+ "__SBarPercent": "___SBarPercent_1u73j_gg_",
37
+ "__SBarValue": "___SBarValue_1u73j_gg_",
38
+ "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1u73j_gg_"
39
39
  })
40
40
  );
41
41
  var MIN_WIDTH = 2;
package/lib/esm/Hover.mjs CHANGED
@@ -7,6 +7,7 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
7
7
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
8
  import { sstyled, assignProps, Component } from "@semcore/core";
9
9
  import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
10
+ import { hasParent } from "@semcore/core/lib/utils/hasParent";
10
11
  import trottle from "@semcore/core/lib/utils/rafTrottle";
11
12
  import React from "react";
12
13
  import createElement from "./createElement.mjs";
@@ -17,13 +18,13 @@ var style = (
17
18
  /*__reshadow_css_start__*/
18
19
  (sstyled.insert(
19
20
  /*__inner_css_start__*/
20
- ".___SHoverLine_1675o_gg_,.___SHoverLine_1675o_gg_:focus-visible{outline:0;stroke:var(--intergalactic-chart-grid-x-axis, #c4c7cf)}.___SHoverRect_1675o_gg_,.___SHoverRect_1675o_gg_:focus-visible{outline:0;fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}",
21
+ ".___SHoverLine_gc5pl_gg_,.___SHoverLine_gc5pl_gg_:focus-visible{outline:0;stroke:var(--intergalactic-chart-grid-x-axis, #c4c7cf)}.___SHoverRect_gc5pl_gg_,.___SHoverRect_gc5pl_gg_:focus-visible{outline:0;fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}",
21
22
  /*__inner_css_end__*/
22
- "1675o_gg_"
23
+ "gc5pl_gg_"
23
24
  ), /*__reshadow_css_end__*/
24
25
  {
25
- "__SHoverLine": "___SHoverLine_1675o_gg_",
26
- "__SHoverRect": "___SHoverRect_1675o_gg_"
26
+ "__SHoverLine": "___SHoverLine_gc5pl_gg_",
27
+ "__SHoverRect": "___SHoverRect_gc5pl_gg_"
27
28
  })
28
29
  );
29
30
  var Hover = /* @__PURE__ */ (function(_Component) {
@@ -39,8 +40,8 @@ var Hover = /* @__PURE__ */ (function(_Component) {
39
40
  yIndex: null
40
41
  });
41
42
  _defineProperty(_this, "virtualElement", canUseDOM() ? document.createElement("div") : {});
42
- _defineProperty(_this, "handlerMouseMoveRoot", trottle(function(e) {
43
- var _this$asProps = _this.asProps, eventEmitter = _this$asProps.eventEmitter, data = _this$asProps.data, scale = _this$asProps.scale, x = _this$asProps.x, y = _this$asProps.y, rootRef = _this$asProps.rootRef, patterns = _this$asProps.patterns;
43
+ _defineProperty(_this, "handlerMouseMoveRoot", trottle(function(e, currentTarget) {
44
+ var _this$asProps = _this.asProps, eventEmitter = _this$asProps.eventEmitter, data = _this$asProps.data, scale = _this$asProps.scale, x = _this$asProps.x, y = _this$asProps.y, rootRef = _this$asProps.rootRef, patterns = _this$asProps.patterns, plotId = _this$asProps.plotId;
44
45
  var clientX = e.clientX, clientY = e.clientY;
45
46
  var _scale = _slicedToArray(scale, 2), xScale = _scale[0], yScale = _scale[1];
46
47
  var _eventToPoint = eventToPoint(e, rootRef.current), _eventToPoint2 = _slicedToArray(_eventToPoint, 2), pX = _eventToPoint2[0], pY = _eventToPoint2[1];
@@ -53,10 +54,20 @@ var Hover = /* @__PURE__ */ (function(_Component) {
53
54
  yIndex,
54
55
  patterns
55
56
  };
57
+ var _rootRef$current$getB = rootRef.current.getBoundingClientRect(), xRect = _rootRef$current$getB.x, yRect = _rootRef$current$getB.y, height = _rootRef$current$getB.height;
58
+ var _currentTarget$getBou = currentTarget.getBoundingClientRect(), yOriginal = _currentTarget$getBou.y, heightOriginal = _currentTarget$getBou.height;
59
+ var isRootTooltip = hasParent(e.target, rootRef.current);
56
60
  _this.setState(state, function() {
57
- eventEmitter.emit("setTooltipPosition", clientX, clientY);
58
- eventEmitter.emit("setTooltipRenderingProps", {}, state);
59
- eventEmitter.emit("setTooltipVisible", xIndex !== null || yIndex !== null);
61
+ if (isRootTooltip) {
62
+ eventEmitter.emit("setTooltipPosition_".concat(plotId), clientX, clientY);
63
+ } else {
64
+ var diff = clientY - yOriginal;
65
+ var dimension = diff / heightOriginal * 100;
66
+ var heightValue = height / 100 * dimension;
67
+ eventEmitter.emit("setTooltipPosition_".concat(plotId), pX + xRect, yRect + heightValue);
68
+ }
69
+ eventEmitter.emit("setTooltipRenderingProps_".concat(plotId), {}, state);
70
+ eventEmitter.emit("setTooltipVisible_".concat(plotId), xIndex !== null || yIndex !== null);
60
71
  });
61
72
  }));
62
73
  _defineProperty(_this, "handlerMouseLeaveRoot", trottle(function() {
@@ -66,7 +77,7 @@ var Hover = /* @__PURE__ */ (function(_Component) {
66
77
  patterns: _this.asProps.patterns
67
78
  };
68
79
  _this.setState(state, function() {
69
- _this.asProps.eventEmitter.emit("setTooltipVisible", false);
80
+ _this.asProps.eventEmitter.emit("setTooltipVisible_".concat(_this.asProps.plotId), false);
70
81
  });
71
82
  }));
72
83
  return _this;
@@ -79,7 +90,7 @@ var Hover = /* @__PURE__ */ (function(_Component) {
79
90
  var eventEmitter = this.asProps.eventEmitter;
80
91
  this.unsubscribeMouseMoveRoot = eventEmitter.subscribe("onMouseMoveChart", function(e) {
81
92
  e.persist();
82
- _this2.handlerMouseMoveRoot(e);
93
+ _this2.handlerMouseMoveRoot(e, e.currentTarget);
83
94
  });
84
95
  this.unsubscribeMouseLeaveRoot = eventEmitter.subscribe("onMouseLeaveChart", this.handlerMouseLeaveRoot);
85
96
  }
package/lib/esm/Line.mjs CHANGED
@@ -19,19 +19,19 @@ var style = (
19
19
  /*__reshadow_css_start__*/
20
20
  (sstyled.insert(
21
21
  /*__inner_css_start__*/
22
- ".___SLine_ldybw_gg_{fill:transparent;stroke-width:3;stroke:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:d;transition-duration:var(--duration_ldybw);transition-timing-function:ease-in-out}.___SLine_ldybw_gg_.__color_ldybw_gg_{stroke:var(--color_ldybw)}.___SLine_ldybw_gg_.__hide_ldybw_gg_{display:none}.___SLine_ldybw_gg_.__transparent_ldybw_gg_{opacity:.3}.___SNull_ldybw_gg_{fill:transparent;stroke:var(--intergalactic-border-primary, #c4c7cf);stroke-dasharray:4}.___SNull_ldybw_gg_.__hide_ldybw_gg_{display:none}.___SLineArea_ldybw_gg_{transition-property:d;transition-duration:var(--duration_ldybw);transition-timing-function:ease-in-out;opacity:.3;fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SLineArea_ldybw_gg_.__color_ldybw_gg_{fill:var(--color_ldybw)}",
22
+ ".___SLine_jqqyf_gg_{fill:transparent;stroke-width:3;stroke:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:d;transition-duration:var(--duration_jqqyf);transition-timing-function:ease-in-out}.___SLine_jqqyf_gg_.__color_jqqyf_gg_{stroke:var(--color_jqqyf)}.___SLine_jqqyf_gg_.__hide_jqqyf_gg_{display:none}.___SLine_jqqyf_gg_.__transparent_jqqyf_gg_{opacity:.3}.___SNull_jqqyf_gg_{fill:transparent;stroke:var(--intergalactic-border-primary, #c4c7cf);stroke-dasharray:4}.___SNull_jqqyf_gg_.__hide_jqqyf_gg_{display:none}.___SLineArea_jqqyf_gg_{transition-property:d;transition-duration:var(--duration_jqqyf);transition-timing-function:ease-in-out;opacity:.3;fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SLineArea_jqqyf_gg_.__color_jqqyf_gg_{fill:var(--color_jqqyf)}",
23
23
  /*__inner_css_end__*/
24
- "ldybw_gg_"
24
+ "jqqyf_gg_"
25
25
  ), /*__reshadow_css_end__*/
26
26
  {
27
- "__SLine": "___SLine_ldybw_gg_",
28
- "--duration": "--duration_ldybw",
29
- "_color": "__color_ldybw_gg_",
30
- "--color": "--color_ldybw",
31
- "_hide": "__hide_ldybw_gg_",
32
- "_transparent": "__transparent_ldybw_gg_",
33
- "__SNull": "___SNull_ldybw_gg_",
34
- "__SLineArea": "___SLineArea_ldybw_gg_"
27
+ "__SLine": "___SLine_jqqyf_gg_",
28
+ "--duration": "--duration_jqqyf",
29
+ "_color": "__color_jqqyf_gg_",
30
+ "--color": "--color_jqqyf",
31
+ "_hide": "__hide_jqqyf_gg_",
32
+ "_transparent": "__transparent_jqqyf_gg_",
33
+ "__SNull": "___SNull_jqqyf_gg_",
34
+ "__SLineArea": "___SLineArea_jqqyf_gg_"
35
35
  })
36
36
  );
37
37
  var LineRoot = /* @__PURE__ */ (function(_Component) {