@semcore/d3-chart 16.0.0-prerelease.9 → 16.0.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 (214) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/lib/cjs/Area.js +4 -2
  3. package/lib/cjs/Area.js.map +1 -1
  4. package/lib/cjs/Axis.js +4 -2
  5. package/lib/cjs/Axis.js.map +1 -1
  6. package/lib/cjs/Bar.js +4 -2
  7. package/lib/cjs/Bar.js.map +1 -1
  8. package/lib/cjs/Bubble.js +4 -2
  9. package/lib/cjs/Bubble.js.map +1 -1
  10. package/lib/cjs/CompactHorizontalBar.js +4 -2
  11. package/lib/cjs/CompactHorizontalBar.js.map +1 -1
  12. package/lib/cjs/Donut.js +4 -2
  13. package/lib/cjs/Donut.js.map +1 -1
  14. package/lib/cjs/Dots.js +4 -2
  15. package/lib/cjs/Dots.js.map +1 -1
  16. package/lib/cjs/HorizontalBar.js +4 -2
  17. package/lib/cjs/HorizontalBar.js.map +1 -1
  18. package/lib/cjs/Hover.js +4 -2
  19. package/lib/cjs/Hover.js.map +1 -1
  20. package/lib/cjs/Line.js +4 -2
  21. package/lib/cjs/Line.js.map +1 -1
  22. package/lib/cjs/Plot.js +4 -2
  23. package/lib/cjs/Plot.js.map +1 -1
  24. package/lib/cjs/Radar.js +4 -2
  25. package/lib/cjs/Radar.js.map +1 -1
  26. package/lib/cjs/RadialTree.js +4 -2
  27. package/lib/cjs/RadialTree.js.map +1 -1
  28. package/lib/cjs/Reference.js +4 -2
  29. package/lib/cjs/Reference.js.map +1 -1
  30. package/lib/cjs/ScatterPlot.js +4 -2
  31. package/lib/cjs/ScatterPlot.js.map +1 -1
  32. package/lib/cjs/Tooltip.js +4 -2
  33. package/lib/cjs/Tooltip.js.map +1 -1
  34. package/lib/cjs/Venn.js +4 -2
  35. package/lib/cjs/Venn.js.map +1 -1
  36. package/lib/cjs/a11y/PlotA11yModule.js +4 -2
  37. package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
  38. package/lib/cjs/a11y/PlotA11yView.js +4 -2
  39. package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
  40. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -2
  41. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  42. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +4 -2
  43. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  44. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +4 -2
  45. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  46. package/lib/es6/Area.js +4 -2
  47. package/lib/es6/Area.js.map +1 -1
  48. package/lib/es6/Axis.js +4 -2
  49. package/lib/es6/Axis.js.map +1 -1
  50. package/lib/es6/Bar.js +4 -2
  51. package/lib/es6/Bar.js.map +1 -1
  52. package/lib/es6/Bubble.js +4 -2
  53. package/lib/es6/Bubble.js.map +1 -1
  54. package/lib/es6/CompactHorizontalBar.js +4 -2
  55. package/lib/es6/CompactHorizontalBar.js.map +1 -1
  56. package/lib/es6/Donut.js +4 -2
  57. package/lib/es6/Donut.js.map +1 -1
  58. package/lib/es6/Dots.js +4 -2
  59. package/lib/es6/Dots.js.map +1 -1
  60. package/lib/es6/HorizontalBar.js +4 -2
  61. package/lib/es6/HorizontalBar.js.map +1 -1
  62. package/lib/es6/Hover.js +4 -2
  63. package/lib/es6/Hover.js.map +1 -1
  64. package/lib/es6/Line.js +4 -2
  65. package/lib/es6/Line.js.map +1 -1
  66. package/lib/es6/Plot.js +4 -2
  67. package/lib/es6/Plot.js.map +1 -1
  68. package/lib/es6/Radar.js +4 -2
  69. package/lib/es6/Radar.js.map +1 -1
  70. package/lib/es6/RadialTree.js +4 -2
  71. package/lib/es6/RadialTree.js.map +1 -1
  72. package/lib/es6/Reference.js +4 -2
  73. package/lib/es6/Reference.js.map +1 -1
  74. package/lib/es6/ScatterPlot.js +4 -2
  75. package/lib/es6/ScatterPlot.js.map +1 -1
  76. package/lib/es6/Tooltip.js +4 -2
  77. package/lib/es6/Tooltip.js.map +1 -1
  78. package/lib/es6/Venn.js +4 -2
  79. package/lib/es6/Venn.js.map +1 -1
  80. package/lib/es6/a11y/PlotA11yModule.js +4 -2
  81. package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
  82. package/lib/es6/a11y/PlotA11yView.js +4 -2
  83. package/lib/es6/a11y/PlotA11yView.js.map +1 -1
  84. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -2
  85. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  86. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +4 -2
  87. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  88. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +4 -2
  89. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  90. package/lib/esm/AnimatedClipPath.mjs +54 -0
  91. package/lib/esm/Area.mjs +188 -0
  92. package/lib/esm/Axis.mjs +405 -0
  93. package/lib/esm/Bar.mjs +200 -0
  94. package/lib/esm/Bubble.mjs +215 -0
  95. package/lib/esm/CompactHorizontalBar.mjs +517 -0
  96. package/lib/esm/Donut.mjs +414 -0
  97. package/lib/esm/Dots.mjs +119 -0
  98. package/lib/esm/GroupBar.mjs +94 -0
  99. package/lib/esm/HorizontalBar.mjs +180 -0
  100. package/lib/esm/Hover.mjs +216 -0
  101. package/lib/esm/Line.mjs +198 -0
  102. package/lib/esm/Pattern.mjs +520 -0
  103. package/lib/esm/Plot.mjs +136 -0
  104. package/lib/esm/Radar.mjs +705 -0
  105. package/lib/esm/RadialTree.mjs +564 -0
  106. package/lib/esm/Reference.mjs +242 -0
  107. package/lib/esm/ResponsiveContainer.mjs +99 -0
  108. package/lib/esm/ScatterPlot.mjs +193 -0
  109. package/lib/esm/StackBar.mjs +177 -0
  110. package/lib/esm/StackedArea.mjs +84 -0
  111. package/lib/esm/Tooltip.mjs +254 -0
  112. package/lib/esm/Venn.mjs +233 -0
  113. package/lib/esm/a11y/DataAccessibilityTable.mjs +100 -0
  114. package/lib/esm/a11y/PlotA11yModule.mjs +116 -0
  115. package/lib/esm/a11y/PlotA11yView.mjs +145 -0
  116. package/lib/esm/a11y/bezier.mjs +32 -0
  117. package/lib/esm/a11y/focus.mjs +44 -0
  118. package/lib/esm/a11y/hints.mjs +122 -0
  119. package/lib/esm/a11y/insights.mjs +700 -0
  120. package/lib/esm/a11y/intl.mjs +17 -0
  121. package/lib/esm/a11y/locale.mjs +39 -0
  122. package/lib/esm/a11y/serialize.mjs +363 -0
  123. package/lib/esm/a11y/summarize.mjs +14 -0
  124. package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +33 -0
  125. package/lib/esm/a11y/translations/module/de.json.mjs +14 -0
  126. package/lib/esm/a11y/translations/module/en.json.mjs +14 -0
  127. package/lib/esm/a11y/translations/module/es.json.mjs +14 -0
  128. package/lib/esm/a11y/translations/module/fr.json.mjs +14 -0
  129. package/lib/esm/a11y/translations/module/it.json.mjs +14 -0
  130. package/lib/esm/a11y/translations/module/ja.json.mjs +14 -0
  131. package/lib/esm/a11y/translations/module/ko.json.mjs +14 -0
  132. package/lib/esm/a11y/translations/module/nl.json.mjs +14 -0
  133. package/lib/esm/a11y/translations/module/pl.json.mjs +14 -0
  134. package/lib/esm/a11y/translations/module/pt.json.mjs +14 -0
  135. package/lib/esm/a11y/translations/module/sv.json.mjs +14 -0
  136. package/lib/esm/a11y/translations/module/tr.json.mjs +14 -0
  137. package/lib/esm/a11y/translations/module/vi.json.mjs +14 -0
  138. package/lib/esm/a11y/translations/module/zh.json.mjs +14 -0
  139. package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +33 -0
  140. package/lib/esm/a11y/translations/view/de.json.mjs +48 -0
  141. package/lib/esm/a11y/translations/view/en.json.mjs +48 -0
  142. package/lib/esm/a11y/translations/view/es.json.mjs +48 -0
  143. package/lib/esm/a11y/translations/view/fr.json.mjs +48 -0
  144. package/lib/esm/a11y/translations/view/it.json.mjs +48 -0
  145. package/lib/esm/a11y/translations/view/ja.json.mjs +48 -0
  146. package/lib/esm/a11y/translations/view/ko.json.mjs +48 -0
  147. package/lib/esm/a11y/translations/view/nl.json.mjs +48 -0
  148. package/lib/esm/a11y/translations/view/pl.json.mjs +48 -0
  149. package/lib/esm/a11y/translations/view/pt.json.mjs +48 -0
  150. package/lib/esm/a11y/translations/view/sv.json.mjs +48 -0
  151. package/lib/esm/a11y/translations/view/tr.json.mjs +48 -0
  152. package/lib/esm/a11y/translations/view/vi.json.mjs +48 -0
  153. package/lib/esm/a11y/translations/view/zh.json.mjs +48 -0
  154. package/lib/esm/color.mjs +127 -0
  155. package/lib/esm/component/Chart/AbstractChart.mjs +408 -0
  156. package/lib/esm/component/Chart/AreaChart.mjs +145 -0
  157. package/lib/esm/component/Chart/BarChart.mjs +240 -0
  158. package/lib/esm/component/Chart/BubbleChart.mjs +135 -0
  159. package/lib/esm/component/Chart/CigaretteChart.mjs +294 -0
  160. package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +113 -0
  161. package/lib/esm/component/Chart/DonutChart.mjs +113 -0
  162. package/lib/esm/component/Chart/HistogramChart.mjs +166 -0
  163. package/lib/esm/component/Chart/LineChart.mjs +131 -0
  164. package/lib/esm/component/Chart/RadarChart.mjs +115 -0
  165. package/lib/esm/component/Chart/ScatterPlotChart.mjs +144 -0
  166. package/lib/esm/component/Chart/VennChart.mjs +141 -0
  167. package/lib/esm/component/Chart/index.mjs +27 -0
  168. package/lib/esm/component/ChartLegend/BaseLegend.mjs +91 -0
  169. package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +85 -0
  170. package/lib/esm/component/ChartLegend/LegendFlex/legend-flex.shadow.css +12 -0
  171. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +239 -0
  172. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +4 -0
  173. package/lib/esm/component/ChartLegend/LegendItem/legend-item.shadow.css +129 -0
  174. package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +89 -0
  175. package/lib/esm/component/ChartLegend/LegendTable/legend-table.shadow.css +19 -0
  176. package/lib/esm/component/ChartLegend/index.mjs +5 -0
  177. package/lib/esm/component/Cigarette/Cigarette.mjs +139 -0
  178. package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +141 -0
  179. package/lib/esm/createElement.mjs +104 -0
  180. package/lib/esm/index.mjs +70 -0
  181. package/lib/esm/style/area.shadow.css +50 -0
  182. package/lib/esm/style/axis.shadow.css +88 -0
  183. package/lib/esm/style/bar.shadow.css +66 -0
  184. package/lib/esm/style/bubble.shadow.css +64 -0
  185. package/lib/esm/style/donut.shadow.css +36 -0
  186. package/lib/esm/style/dot.shadow.css +27 -0
  187. package/lib/esm/style/hover.shadow.css +9 -0
  188. package/lib/esm/style/line.shadow.css +43 -0
  189. package/lib/esm/style/plot.shadow.css +19 -0
  190. package/lib/esm/style/plotA11yModule.shadow.css +12 -0
  191. package/lib/esm/style/plotA11yView.shadow.css +39 -0
  192. package/lib/esm/style/radar.shadow.css +80 -0
  193. package/lib/esm/style/radial-tree.shadow.css +54 -0
  194. package/lib/esm/style/reference.shadow.css +43 -0
  195. package/lib/esm/style/scatterplot.shadow.css +41 -0
  196. package/lib/esm/style/tooltip.shadow.css +42 -0
  197. package/lib/esm/style/venn.shadow.css +48 -0
  198. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +31 -0
  199. package/lib/esm/translations/en.json.mjs +12 -0
  200. package/lib/esm/translations/es.json.mjs +11 -0
  201. package/lib/esm/translations/fr.json.mjs +11 -0
  202. package/lib/esm/translations/it.json.mjs +11 -0
  203. package/lib/esm/translations/ja.json.mjs +11 -0
  204. package/lib/esm/translations/ko.json.mjs +11 -0
  205. package/lib/esm/translations/nl.json.mjs +11 -0
  206. package/lib/esm/translations/pl.json.mjs +11 -0
  207. package/lib/esm/translations/pt.json.mjs +11 -0
  208. package/lib/esm/translations/sv.json.mjs +11 -0
  209. package/lib/esm/translations/tr.json.mjs +11 -0
  210. package/lib/esm/translations/vi.json.mjs +11 -0
  211. package/lib/esm/translations/zh.json.mjs +11 -0
  212. package/lib/esm/utils.mjs +266 -0
  213. package/package.json +9 -9
  214. package/vite.config.ts +2 -0
@@ -0,0 +1,414 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
5
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
6
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
7
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
8
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
10
+ import { sstyled, Component, assignProps } from "@semcore/core";
11
+ import React from "react";
12
+ import { arc, pie } from "d3-shape";
13
+ import { interpolate } from "d3-interpolate";
14
+ import { transition } from "d3-transition";
15
+ import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
16
+ import getOriginChildren from "@semcore/core/lib/utils/getOriginChildren";
17
+ import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
18
+ import createElement from "./createElement.mjs";
19
+ import { getChartDefaultColorName } from "./utils.mjs";
20
+ import Tooltip from "./Tooltip.mjs";
21
+ import { PatternFill } from "./Pattern.mjs";
22
+ var _excluded = ["Element", "styles", "d3Arc", "data", "color", "$animationActivePie", "active", "d3ArcOut", "name", "dataKey", "dataHintsHandler", "transparent", "innerRadius", "outerRadius", "resolveColor", "halfsize", "uid", "patterns"];
23
+ /*!__reshadow-styles__:"./style/donut.shadow.css"*/
24
+ var style = (
25
+ /*__reshadow_css_start__*/
26
+ (sstyled.insert(
27
+ /*__inner_css_start__*/
28
+ ".___SPie_1h0hc_gg_{stroke:var(--intergalactic-chart-grid-border, #ffffff);fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SPie_1h0hc_gg_.__color_1h0hc_gg_{fill:var(--color_1h0hc)}.___SPie_1h0hc_gg_.__pattern_1h0hc_gg_.__color_1h0hc_gg_{fill:var(--pattern_1h0hc);stroke:var(--color_1h0hc);stroke-width:1px}.___SPie_1h0hc_gg_.__transparent_1h0hc_gg_{opacity:.3}.___SEmptyData_1h0hc_gg_{fill:var(--intergalactic-chart-palette-order-null, #e0e1e9)}.___SEmptyData_1h0hc_gg_.__color_1h0hc_gg_{fill:var(--color_1h0hc)}.___SLabel_1h0hc_gg_{text-anchor:middle;vertical-anchor:middle;font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}",
29
+ /*__inner_css_end__*/
30
+ "1h0hc_gg_"
31
+ ), /*__reshadow_css_end__*/
32
+ {
33
+ "__SPie": "___SPie_1h0hc_gg_",
34
+ "_color": "__color_1h0hc_gg_",
35
+ "--color": "--color_1h0hc",
36
+ "_pattern": "__pattern_1h0hc_gg_",
37
+ "--pattern": "--pattern_1h0hc",
38
+ "_transparent": "__transparent_1h0hc_gg_",
39
+ "__SEmptyData": "___SEmptyData_1h0hc_gg_",
40
+ "__SLabel": "___SLabel_1h0hc_gg_"
41
+ })
42
+ );
43
+ var DEFAULT_INSTANCE = Symbol("DEFAULT_INSTANCE");
44
+ function transitionAnglePie(_ref6) {
45
+ var selector = _ref6.selector, duration = _ref6.duration, halfsize = _ref6.halfsize, d3Arc = _ref6.d3Arc, d3ArcOut = _ref6.d3ArcOut, arcs = _ref6.arcs, activeIndexPie = _ref6.activeIndexPie;
46
+ return transition().selection().selectAll(selector).interrupt().transition().duration(duration).attrTween("d", function(_, ind) {
47
+ if (!arcs[ind]) return function() {
48
+ return "";
49
+ };
50
+ var d = Object.assign({}, arcs[ind]);
51
+ var self = this;
52
+ var initAngle = halfsize ? -Math.PI / 2 : 0;
53
+ var prevStartAngle = initAngle;
54
+ var prevEndAngle = initAngle;
55
+ if (self.arc) {
56
+ prevStartAngle = self.arc.startAngle;
57
+ prevEndAngle = self.arc.endAngle;
58
+ }
59
+ var iStartAngle = interpolate(prevStartAngle, d.startAngle);
60
+ var iEndAngle = interpolate(prevEndAngle, d.endAngle);
61
+ return function(t) {
62
+ d.startAngle = iStartAngle(t);
63
+ d.endAngle = iEndAngle(t);
64
+ self.arc = d;
65
+ return ind === activeIndexPie ? d3ArcOut(self.arc) : d3Arc(self.arc);
66
+ };
67
+ });
68
+ }
69
+ function transitionRadiusPie(_ref7) {
70
+ var data = _ref7.data, selector = _ref7.selector, element = _ref7.element, duration = _ref7.duration, innerRadius = _ref7.innerRadius, outerRadiusStartEnd = _ref7.outerRadiusStartEnd, paddingAngle = _ref7.paddingAngle;
71
+ return transition().selection().select(selector).interrupt().transition().duration(duration).attrTween("d", function() {
72
+ var _outerRadiusStartEnd = _slicedToArray(outerRadiusStartEnd, 2), start = _outerRadiusStartEnd[0], end = _outerRadiusStartEnd[1];
73
+ var iOuterRadius = interpolate(start, end);
74
+ return function(t) {
75
+ var outerRadiusPX = iOuterRadius(t);
76
+ element.dataset["currentRadius"] = outerRadiusPX;
77
+ var d3ArcOut = arc().innerRadius(innerRadius).outerRadius(outerRadiusPX).padAngle(paddingAngle);
78
+ return d3ArcOut(data);
79
+ };
80
+ });
81
+ }
82
+ var increaseFactor = 8;
83
+ function getOuterRadius(_ref8) {
84
+ var size = _ref8.size, halfsize = _ref8.halfsize;
85
+ var _size = _slicedToArray(size, 2), width = _size[0], height = _size[1];
86
+ var minORmax = halfsize ? Math.max : Math.min;
87
+ return minORmax(width - increaseFactor * 2, height - increaseFactor * 2) / 2;
88
+ }
89
+ var DonutRoot = /* @__PURE__ */ function(_Component) {
90
+ _inherits(DonutRoot2, _Component);
91
+ var _super = _createSuper(DonutRoot2);
92
+ function DonutRoot2() {
93
+ var _this;
94
+ _classCallCheck(this, DonutRoot2);
95
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
96
+ args[_key] = arguments[_key];
97
+ }
98
+ _this = _super.call.apply(_super, [this].concat(args));
99
+ _defineProperty(_assertThisInitialized(_this), "virtualElement", canUseDOM() ? document.createElement("div") : {});
100
+ _defineProperty(_assertThisInitialized(_this), "activeIndexPie", void 0);
101
+ _defineProperty(_assertThisInitialized(_this), "canAnimatedHover", false);
102
+ _defineProperty(_assertThisInitialized(_this), "bindHandlerTooltip", function(visible, props, tooltipProps) {
103
+ return function(_ref9) {
104
+ var clientX = _ref9.clientX, clientY = _ref9.clientY;
105
+ var eventEmitter = _this.asProps.eventEmitter;
106
+ eventEmitter.emit("setTooltipPosition", clientX, clientY);
107
+ eventEmitter.emit("setTooltipRenderingProps", props, tooltipProps);
108
+ eventEmitter.emit("setTooltipVisible", visible);
109
+ };
110
+ });
111
+ _defineProperty(_assertThisInitialized(_this), "animationActivePie", function(_ref10) {
112
+ var data = _ref10.data, active = _ref10.active, selector = _ref10.selector, element = _ref10.element;
113
+ var _this$asProps = _this.asProps, duration = _this$asProps.duration, innerRadius = _this$asProps.innerRadius, d3Arc = _this$asProps.d3Arc, paddingAngle = _this$asProps.paddingAngle;
114
+ var outerRadius = d3Arc.outerRadius()();
115
+ var outerRadiusStartEnd = active ? [+element.dataset["currentRadius"] || outerRadius, outerRadius + increaseFactor] : [+element.dataset["currentRadius"] || outerRadius, outerRadius];
116
+ if (_this.canAnimatedHover && duration > 0) {
117
+ transitionRadiusPie({
118
+ data,
119
+ selector: "#".concat(_this.id, " ").concat(selector),
120
+ element,
121
+ duration: duration === 0 ? 0 : 300,
122
+ innerRadius,
123
+ outerRadiusStartEnd,
124
+ paddingAngle
125
+ });
126
+ }
127
+ });
128
+ _defineProperty(_assertThisInitialized(_this), "animationTimeout", null);
129
+ _defineProperty(_assertThisInitialized(_this), "animationUpdatePie", function() {
130
+ clearTimeout(_this.animationTimeout);
131
+ _this.animationTimeout = setTimeout(function() {
132
+ var _this$asProps2 = _this.asProps, duration = _this$asProps2.duration, d3Arc = _this$asProps2.d3Arc, halfsize = _this$asProps2.halfsize, d3ArcOut = _this$asProps2.d3ArcOut;
133
+ _this.canAnimatedHover = false;
134
+ if (duration > 0) {
135
+ transitionAnglePie({
136
+ selector: "#".concat(_this.id, ' [data-ui-name="Donut.Pie"]'),
137
+ duration,
138
+ arcs: _this.arcs,
139
+ halfsize,
140
+ d3Arc,
141
+ d3ArcOut,
142
+ activeIndexPie: _this.activeIndexPie
143
+ }).on("end", function() {
144
+ _this.canAnimatedHover = true;
145
+ });
146
+ } else {
147
+ _this.canAnimatedHover = true;
148
+ }
149
+ }, 0);
150
+ });
151
+ return _this;
152
+ }
153
+ _createClass(DonutRoot2, [{
154
+ key: "id",
155
+ get: function get() {
156
+ var _this$asProps3 = this.asProps, uid = _this$asProps3.uid, id = _this$asProps3.id;
157
+ return id || uid;
158
+ }
159
+ }, {
160
+ key: "generateGetBoundingClientRect",
161
+ value: function generateGetBoundingClientRect() {
162
+ var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
163
+ var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
164
+ return function() {
165
+ return {
166
+ width: 0,
167
+ height: 0,
168
+ top: y,
169
+ right: x,
170
+ bottom: y,
171
+ left: x
172
+ };
173
+ };
174
+ }
175
+ }, {
176
+ key: "getArcs",
177
+ value: function getArcs() {
178
+ var _this$asProps4 = this.asProps, Children = _this$asProps4.Children, data = _this$asProps4.data, d3Pie = _this$asProps4.d3Pie;
179
+ var pieData = Object.entries(data);
180
+ if (d3Pie[DEFAULT_INSTANCE]) {
181
+ var keys = React.Children.toArray(getOriginChildren(Children)).reduce(function(acc, child) {
182
+ if (/* @__PURE__ */ React.isValidElement(child) && child.type === Donut.Pie) {
183
+ acc.push(child.props.dataKey);
184
+ }
185
+ return acc;
186
+ }, []);
187
+ pieData = Object.entries(data).filter(function(_ref11) {
188
+ var _ref12 = _slicedToArray(_ref11, 2), key = _ref12[0], value = _ref12[1];
189
+ return keys.includes(key) && value > 0;
190
+ }).sort(function(_ref13, _ref14) {
191
+ var _ref15 = _slicedToArray(_ref13, 1), a = _ref15[0];
192
+ var _ref16 = _slicedToArray(_ref14, 1), b = _ref16[0];
193
+ return keys.indexOf(a) > keys.indexOf(b) ? 1 : -1;
194
+ });
195
+ }
196
+ var minValue = pieData.reduce(function(acc, cur) {
197
+ if (cur[1]) acc += cur[1];
198
+ return acc;
199
+ }, 0) / 100;
200
+ pieData = pieData.map(function(d) {
201
+ if (d[1] && d[1] < minValue) d[1] = minValue;
202
+ return d;
203
+ });
204
+ return d3Pie(pieData);
205
+ }
206
+ }, {
207
+ key: "getPieProps",
208
+ value: function getPieProps(props, index) {
209
+ var _this2 = this;
210
+ 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;
211
+ var active = props.active;
212
+ var data = this.arcs.find(function(arc2) {
213
+ return arc2.data[0] === props.dataKey;
214
+ });
215
+ if (active) {
216
+ this.activeIndexPie = index;
217
+ }
218
+ var tooltipProps = {
219
+ dataKey: props.dataKey,
220
+ name: props.name,
221
+ resolveColor,
222
+ color: props.color || getChartDefaultColorName(index),
223
+ active: props.active,
224
+ transparent: props.transparent,
225
+ patterns
226
+ };
227
+ return {
228
+ data,
229
+ d3Arc,
230
+ d3ArcOut,
231
+ innerRadius,
232
+ outerRadius,
233
+ uid: "".concat(uid, "-").concat(index),
234
+ patterns,
235
+ halfsize,
236
+ color: props.color || getChartDefaultColorName(index),
237
+ resolveColor,
238
+ $animationActivePie: this.animationActivePie,
239
+ onMouseMove: this.bindHandlerTooltip(true, props, tooltipProps),
240
+ onMouseLeave: this.bindHandlerTooltip(false, props, tooltipProps),
241
+ onMouseOver: function onMouseOver(e) {
242
+ if (!active) {
243
+ _this2.animationActivePie({
244
+ active: true,
245
+ data,
246
+ selector: '[d="'.concat(e.target.getAttribute("d"), '"]'),
247
+ element: e.target
248
+ });
249
+ }
250
+ },
251
+ onMouseOut: function onMouseOut(e) {
252
+ if (!active) {
253
+ _this2.animationActivePie({
254
+ active: false,
255
+ data,
256
+ selector: '[d="'.concat(e.target.getAttribute("d"), '"]'),
257
+ element: e.target
258
+ });
259
+ }
260
+ }
261
+ };
262
+ }
263
+ }, {
264
+ key: "getEmptyDataProps",
265
+ value: function getEmptyDataProps() {
266
+ var d3Arc = this.asProps.d3Arc;
267
+ return {
268
+ d3Arc
269
+ };
270
+ }
271
+ }, {
272
+ key: "componentDidUpdate",
273
+ value: function componentDidUpdate(prevProps) {
274
+ var data = this.asProps.data;
275
+ if (prevProps.$rootProps.data !== data) {
276
+ this.animationUpdatePie();
277
+ }
278
+ }
279
+ }, {
280
+ key: "componentDidMount",
281
+ value: function componentDidMount() {
282
+ this.animationUpdatePie();
283
+ }
284
+ }, {
285
+ key: "render",
286
+ value: function render() {
287
+ var _this$asProps6 = this.asProps, halfsize = _this$asProps6.halfsize, size = _this$asProps6.size;
288
+ this.asProps.dataHintsHandler.establishDataType("values-set");
289
+ var _size2 = _slicedToArray(size, 2), width = _size2[0], height = _size2[1];
290
+ var Element = this.Element;
291
+ var k = halfsize ? 1 : 2;
292
+ this.arcs = this.getArcs();
293
+ return /* @__PURE__ */ React.createElement(Element, {
294
+ "aria-hidden": true,
295
+ id: this.id,
296
+ render: "g",
297
+ childrenPosition: "inside",
298
+ transform: "translate(".concat(width / 2, ",").concat(height / k, ")")
299
+ });
300
+ }
301
+ }]);
302
+ return DonutRoot2;
303
+ }(Component);
304
+ _defineProperty(DonutRoot, "displayName", "Donut");
305
+ _defineProperty(DonutRoot, "style", style);
306
+ _defineProperty(DonutRoot, "enhance", [uniqueIDEnhancement()]);
307
+ _defineProperty(DonutRoot, "defaultProps", function(_ref20) {
308
+ var _ref20$innerRadius = _ref20.innerRadius, innerRadius = _ref20$innerRadius === void 0 ? 0 : _ref20$innerRadius, _ref20$paddingAngle = _ref20.paddingAngle, paddingAngle = _ref20$paddingAngle === void 0 ? 0 : _ref20$paddingAngle, outerRadius = _ref20.outerRadius, _ref20$halfsize = _ref20.halfsize, halfsize = _ref20$halfsize === void 0 ? false : _ref20$halfsize, size = _ref20.$rootProps.size;
309
+ var d3Arc = arc().outerRadius(outerRadius || getOuterRadius({
310
+ size,
311
+ halfsize,
312
+ outerRadius
313
+ })).innerRadius(innerRadius).padAngle(paddingAngle);
314
+ var d3ArcOut = arc().outerRadius((outerRadius || getOuterRadius({
315
+ size,
316
+ halfsize
317
+ })) + increaseFactor).innerRadius(innerRadius).padAngle(paddingAngle);
318
+ var d3Pie = pie().sort(null).value(function(_ref21) {
319
+ var _ref22 = _slicedToArray(_ref21, 2), value = _ref22[1];
320
+ return value;
321
+ });
322
+ d3Pie[DEFAULT_INSTANCE] = true;
323
+ if (halfsize) {
324
+ d3Pie = d3Pie.startAngle(-Math.PI / 2).endAngle(Math.PI / 2);
325
+ }
326
+ return {
327
+ d3Pie,
328
+ d3Arc,
329
+ d3ArcOut,
330
+ duration: 500,
331
+ paddingAngle
332
+ };
333
+ });
334
+ function Pie(_ref17) {
335
+ var _ref2;
336
+ var SPie = _ref17.Element, styles = _ref17.styles, d3Arc = _ref17.d3Arc, data = _ref17.data, color = _ref17.color, $animationActivePie = _ref17.$animationActivePie, active = _ref17.active, d3ArcOut = _ref17.d3ArcOut, name = _ref17.name, dataKey = _ref17.dataKey, dataHintsHandler = _ref17.dataHintsHandler, transparent = _ref17.transparent, innerRadius = _ref17.innerRadius, outerRadius = _ref17.outerRadius, resolveColor = _ref17.resolveColor, halfsize = _ref17.halfsize, uid = _ref17.uid, patterns = _ref17.patterns, other = _objectWithoutProperties(_ref17, _excluded);
337
+ var _React$useState = React.useState(false), _React$useState2 = _slicedToArray(_React$useState, 2), isMount = _React$useState2[0], setIsMount = _React$useState2[1];
338
+ var pieRef = React.useRef(null);
339
+ React.useEffect(function() {
340
+ if (!pieRef.current) return;
341
+ pieRef.current.dataset["currentRadius"] = (active ? d3ArcOut : d3Arc).outerRadius()();
342
+ if (!isMount) {
343
+ setIsMount(true);
344
+ return;
345
+ }
346
+ if (active !== void 0 && active !== null) {
347
+ $animationActivePie({
348
+ active,
349
+ data,
350
+ selector: '[name="'.concat(other.name, '"]'),
351
+ element: pieRef.current
352
+ });
353
+ }
354
+ }, [active, Boolean(data)]);
355
+ React.useEffect(function() {
356
+ if (!pieRef.current) return;
357
+ pieRef.current.dataset["currentRadius"] = (active ? d3ArcOut : d3Arc).outerRadius()();
358
+ }, [active, innerRadius, outerRadius, halfsize, Boolean(data)]);
359
+ if (!data) return null;
360
+ dataHintsHandler.establishDataType("values-set");
361
+ dataHintsHandler.describeValueEntity(dataKey, name);
362
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, (_ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SPie, _ref2.cn("SPie", {
363
+ "render": "path",
364
+ "ref": pieRef,
365
+ "color": resolveColor(color),
366
+ "pattern": patterns ? "url(#".concat(uid, "-pattern)") : void 0,
367
+ "d": active ? d3ArcOut(data) : d3Arc(data),
368
+ "transparent": transparent
369
+ }))), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref2.cn("PatternFill", {
370
+ "id": "".concat(uid, "-pattern"),
371
+ "patternKey": color,
372
+ "color": resolveColor(color),
373
+ "patterns": patterns
374
+ })));
375
+ }
376
+ function EmptyData(_ref18) {
377
+ var _ref3;
378
+ var SEmptyData = _ref18.Element, styles = _ref18.styles, d3Arc = _ref18.d3Arc, color = _ref18.color, resolveColor = _ref18.resolveColor;
379
+ return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SEmptyData, _ref3.cn("SEmptyData", {
380
+ "render": "path",
381
+ "color": resolveColor(color),
382
+ "d": d3Arc({
383
+ endAngle: Math.PI * 2,
384
+ startAngle: 0
385
+ })
386
+ }));
387
+ }
388
+ function Label(_ref19) {
389
+ var _ref4;
390
+ var SLabel = _ref19.Element, styles = _ref19.styles, Children = _ref19.Children, children = _ref19.children, label = _ref19.label, dataHintsHandler = _ref19.dataHintsHandler, _ref19$x = _ref19.x, x = _ref19$x === void 0 ? 0 : _ref19$x, _ref19$y = _ref19.y, y = _ref19$y === void 0 ? 0 : _ref19$y;
391
+ dataHintsHandler.setTitle("vertical", label || children);
392
+ return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SLabel, _ref4.cn("SLabel", {
393
+ "render": "text",
394
+ "x": x,
395
+ "y": y,
396
+ "aria-hidden": true
397
+ }), /* @__PURE__ */ React.createElement(Children, _ref4.cn("Children", {})));
398
+ }
399
+ var DonutTooltip = function DonutTooltip2(props) {
400
+ var _ref = arguments[0], _ref5;
401
+ var SDonutTooltip = Tooltip;
402
+ return _ref5 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SDonutTooltip, _ref5.cn("SDonutTooltip", _objectSpread({}, assignProps({
403
+ "excludeAnchorProps": true
404
+ }, _ref))));
405
+ };
406
+ var Donut = createElement(DonutRoot, {
407
+ Pie,
408
+ Label,
409
+ EmptyData,
410
+ Tooltip: [DonutTooltip, Tooltip._______childrenComponents]
411
+ });
412
+ export {
413
+ Donut as default
414
+ };
@@ -0,0 +1,119 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import { sstyled } from "@semcore/core";
3
+ import { bisector } from "d3-array";
4
+ import React from "react";
5
+ import trottle from "@semcore/core/lib/utils/rafTrottle";
6
+ import createElement from "./createElement.mjs";
7
+ import { interpolateValue, eventToPoint, invert, getChartDefaultColorName } from "./utils.mjs";
8
+ import { getPatternSymbolSize, PatternSymbol } from "./Pattern.mjs";
9
+ /*!__reshadow-styles__:"./style/dot.shadow.css"*/
10
+ var style = (
11
+ /*__reshadow_css_start__*/
12
+ (sstyled.insert(
13
+ /*__inner_css_start__*/
14
+ ".___SDots_1sgcw_gg_ .___SDot_1sgcw_gg_{transition-duration:var(--duration_1sgcw)}.___SDot_1sgcw_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_1sgcw_gg_.__hide_1sgcw_gg_{display:none}.___SDot_1sgcw_gg_.__color_1sgcw_gg_{fill:var(--color_1sgcw)}.___SDot_1sgcw_gg_.__transparent_1sgcw_gg_{opacity:.3}",
15
+ /*__inner_css_end__*/
16
+ "1sgcw_gg_"
17
+ ), /*__reshadow_css_end__*/
18
+ {
19
+ "__SDot": "___SDot_1sgcw_gg_",
20
+ "_hide": "__hide_1sgcw_gg_",
21
+ "_color": "__color_1sgcw_gg_",
22
+ "--color": "--color_1sgcw",
23
+ "_transparent": "__transparent_1sgcw_gg_",
24
+ "__SDots": "___SDots_1sgcw_gg_",
25
+ "--duration": "--duration_1sgcw"
26
+ })
27
+ );
28
+ function Dots(props) {
29
+ var _ref3;
30
+ var SDot = props.Element, styles = props.styles, color = props.color, d3 = props.d3, x = props.x, y = props.y, eventEmitter = props.eventEmitter, display = props.display, hide = props.hide, rootRef = props.rootRef, scale = props.scale, _props$duration = props.duration, duration = _props$duration === void 0 ? 500 : _props$duration, transparent = props.transparent, _props$radius = props.radius, radiusBase = _props$radius === void 0 ? 4 : _props$radius, resolveColor = props.resolveColor, patterns = props.patterns;
31
+ var bisect = bisector(function(d) {
32
+ return d[x];
33
+ }).center;
34
+ var _React$useState = React.useState(null), _React$useState2 = _slicedToArray(_React$useState, 2), activeIndex = _React$useState2[0], setActiveIndex = _React$useState2[1];
35
+ var data = React.useMemo(function() {
36
+ return props.data.filter(function(item) {
37
+ return item[y] !== interpolateValue;
38
+ });
39
+ }, [props.data]);
40
+ var handlerMouseMoveRoot = React.useCallback(trottle(function(e) {
41
+ var _scale = _slicedToArray(scale, 1), xScale = _scale[0];
42
+ var _eventToPoint = eventToPoint(e, rootRef.current), _eventToPoint2 = _slicedToArray(_eventToPoint, 1), pX = _eventToPoint2[0];
43
+ var vX = invert(xScale, pX);
44
+ setActiveIndex(bisect(data, vX));
45
+ }), [scale, data]);
46
+ var handlerMouseLeaveRoot = React.useCallback(trottle(function() {
47
+ setActiveIndex(null);
48
+ }), []);
49
+ React.useEffect(function() {
50
+ var unsubscribeMouseMoveRoot = eventEmitter.subscribe("onMouseMoveChart", function(e) {
51
+ e.persist();
52
+ handlerMouseMoveRoot(e);
53
+ });
54
+ var unsubscribeMouseLeaveRoot = eventEmitter.subscribe("onMouseLeaveChart", handlerMouseLeaveRoot);
55
+ return function() {
56
+ unsubscribeMouseMoveRoot();
57
+ unsubscribeMouseLeaveRoot();
58
+ };
59
+ }, [eventEmitter, scale, data, x, y]);
60
+ var dots = data.reduce(function(acc, d, i) {
61
+ var isPrev = d3.defined()(data[i - 1] || {});
62
+ var isNext = d3.defined()(data[i + 1] || {});
63
+ var active = i === activeIndex;
64
+ var visible = typeof display === "function" ? display(i, i === activeIndex, !isPrev && !isNext) : display || i === activeIndex || !isPrev && !isNext;
65
+ var radius = radiusBase * (active ? 5 / 4 : 1);
66
+ if (!d3.defined()(d)) return acc;
67
+ if (!visible) return acc;
68
+ var patternKey = color || getChartDefaultColorName(0);
69
+ var _getPatternSymbolSize = getPatternSymbolSize({
70
+ patternKey,
71
+ patterns
72
+ }), _getPatternSymbolSize2 = _slicedToArray(_getPatternSymbolSize, 2), width = _getPatternSymbolSize2[0], height = _getPatternSymbolSize2[1];
73
+ if (!patterns) {
74
+ var _ref;
75
+ acc.push((_ref = sstyled(styles), /* @__PURE__ */ React.createElement(SDot, _ref.cn("SDot", {
76
+ "render": "circle",
77
+ "color": resolveColor(color),
78
+ "patternKey": patternKey,
79
+ "patterns": patterns,
80
+ "key": "".concat(i),
81
+ "value": d,
82
+ "visible": visible,
83
+ "active": active,
84
+ "hide": hide,
85
+ "transparent": transparent,
86
+ "cx": d3.x()(d),
87
+ "cy": d3.y()(d),
88
+ "r": radius
89
+ }))));
90
+ } else {
91
+ var _ref2;
92
+ acc.push((_ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SDot, _ref2.cn("SDot", {
93
+ "render": PatternSymbol,
94
+ "color": resolveColor(color),
95
+ "patternKey": patternKey,
96
+ "patterns": patterns,
97
+ "key": "".concat(i),
98
+ "value": d,
99
+ "visible": visible,
100
+ "active": active,
101
+ "hide": hide,
102
+ "transparent": transparent,
103
+ "x": d3.x()(d) - width / 2,
104
+ "y": d3.y()(d) - height / 2,
105
+ "radius": radius
106
+ }))));
107
+ }
108
+ return acc;
109
+ }, []);
110
+ var SDots = "g";
111
+ return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SDots, _ref3.cn("SDots", {
112
+ "duration": "".concat(duration, "ms")
113
+ }), dots);
114
+ }
115
+ Dots.style = style;
116
+ const Dots$1 = createElement(Dots);
117
+ export {
118
+ Dots$1 as default
119
+ };
@@ -0,0 +1,94 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
4
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
+ import React from "react";
7
+ import { Component } from "@semcore/core";
8
+ import getOriginChildren from "@semcore/core/lib/utils/getOriginChildren";
9
+ import createElement from "./createElement.mjs";
10
+ import Bar from "./Bar.mjs";
11
+ import HorizontalBar from "./HorizontalBar.mjs";
12
+ import { scaleBand } from "d3-scale";
13
+ import { scaleToBand, getChartDefaultColorName } from "./utils.mjs";
14
+ var GroupBarRoot = /* @__PURE__ */ function(_Component) {
15
+ _inherits(GroupBarRoot2, _Component);
16
+ var _super = _createSuper(GroupBarRoot2);
17
+ function GroupBarRoot2() {
18
+ _classCallCheck(this, GroupBarRoot2);
19
+ return _super.apply(this, arguments);
20
+ }
21
+ _createClass(GroupBarRoot2, [{
22
+ key: "getScaleGroup",
23
+ value: function getScaleGroup() {
24
+ var _this$asProps = this.asProps, Children = _this$asProps.Children, scale = _this$asProps.scale, scaleGroup = _this$asProps.scaleGroup, x = _this$asProps.x;
25
+ var xyScale = x ? scale[0] : scale[1];
26
+ if (scaleGroup) return scaleGroup;
27
+ var domain = React.Children.toArray(getOriginChildren(Children)).reduce(function(acc, child) {
28
+ if (/* @__PURE__ */ React.isValidElement(child) && child.type === GroupBar.Bar && !child.props.hide) {
29
+ acc.push(child.props.y);
30
+ }
31
+ if (/* @__PURE__ */ React.isValidElement(child) && child.type === GroupBar.HorizontalBar && !child.props.hide) {
32
+ acc.push(child.props.x);
33
+ }
34
+ return acc;
35
+ }, []);
36
+ return scaleBand().range([0, scaleToBand(xyScale).bandwidth()]).domain(domain).paddingInner(0.1).paddingOuter(0.1);
37
+ }
38
+ }, {
39
+ key: "getBarProps",
40
+ value: function getBarProps(_ref, index) {
41
+ var y = _ref.y;
42
+ var _this$asProps2 = this.asProps, x = _this$asProps2.x, _this$asProps2$maxBar = _this$asProps2.maxBarSize, maxBarSize = _this$asProps2$maxBar === void 0 ? Infinity : _this$asProps2$maxBar, patterns = _this$asProps2.patterns;
43
+ var bandWidth = this.scaleGroup.bandwidth();
44
+ var width = Math.min(bandWidth, maxBarSize);
45
+ var offsetX = this.scaleGroup(y) + bandWidth / 2 - width / 2;
46
+ return {
47
+ offset: [offsetX, 0],
48
+ width,
49
+ color: getChartDefaultColorName(index),
50
+ x,
51
+ groupKey: x,
52
+ patterns
53
+ };
54
+ }
55
+ }, {
56
+ key: "getHorizontalBarProps",
57
+ value: function getHorizontalBarProps(_ref2, index) {
58
+ var x = _ref2.x;
59
+ var _this$asProps3 = this.asProps, y = _this$asProps3.y, _this$asProps3$maxBar = _this$asProps3.maxBarSize, maxBarSize = _this$asProps3$maxBar === void 0 ? Infinity : _this$asProps3$maxBar;
60
+ var bandWidth = this.scaleGroup.bandwidth();
61
+ var height = Math.min(bandWidth, maxBarSize);
62
+ var offsetY = this.scaleGroup(x) + bandWidth / 2 - height / 2;
63
+ return {
64
+ offset: [0, offsetY],
65
+ height,
66
+ color: getChartDefaultColorName(index),
67
+ y,
68
+ groupKey: y
69
+ };
70
+ }
71
+ }, {
72
+ key: "render",
73
+ value: function render() {
74
+ var Element = this.Element;
75
+ this.scaleGroup = this.getScaleGroup();
76
+ this.asProps.dataHintsHandler.establishDataType("grouped-values");
77
+ return /* @__PURE__ */ React.createElement(Element, {
78
+ "aria-hidden": true,
79
+ render: "g",
80
+ childrenPosition: "inside",
81
+ scaleGroup: this.scaleGroup
82
+ });
83
+ }
84
+ }]);
85
+ return GroupBarRoot2;
86
+ }(Component);
87
+ _defineProperty(GroupBarRoot, "displayName", "GroupBar");
88
+ var GroupBar = createElement(GroupBarRoot, {
89
+ Bar,
90
+ HorizontalBar
91
+ });
92
+ export {
93
+ GroupBar as default
94
+ };