@semcore/d3-chart 2.13.3 → 2.13.5

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 (152) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/lib/cjs/Area.js +59 -97
  3. package/lib/cjs/Area.js.map +1 -1
  4. package/lib/cjs/Axis.js +76 -143
  5. package/lib/cjs/Axis.js.map +1 -1
  6. package/lib/cjs/Bar.js +49 -96
  7. package/lib/cjs/Bar.js.map +1 -1
  8. package/lib/cjs/Bubble.js +39 -81
  9. package/lib/cjs/Bubble.js.map +1 -1
  10. package/lib/cjs/ClipPath.js +9 -35
  11. package/lib/cjs/ClipPath.js.map +1 -1
  12. package/lib/cjs/Donut.js +77 -152
  13. package/lib/cjs/Donut.js.map +1 -1
  14. package/lib/cjs/Dots.js +29 -57
  15. package/lib/cjs/Dots.js.map +1 -1
  16. package/lib/cjs/GroupBar.js +5 -26
  17. package/lib/cjs/GroupBar.js.map +1 -1
  18. package/lib/cjs/HorizontalBar.js +43 -84
  19. package/lib/cjs/HorizontalBar.js.map +1 -1
  20. package/lib/cjs/Hover.js +33 -88
  21. package/lib/cjs/Hover.js.map +1 -1
  22. package/lib/cjs/Line.js +42 -78
  23. package/lib/cjs/Line.js.map +1 -1
  24. package/lib/cjs/Plot.js +27 -73
  25. package/lib/cjs/Plot.js.map +1 -1
  26. package/lib/cjs/Radar.js +152 -277
  27. package/lib/cjs/Radar.js.map +1 -1
  28. package/lib/cjs/RadialTree.js +105 -211
  29. package/lib/cjs/RadialTree.js.map +1 -1
  30. package/lib/cjs/ReferenceLine.js +45 -87
  31. package/lib/cjs/ReferenceLine.js.map +1 -1
  32. package/lib/cjs/ResponsiveContainer.js +9 -38
  33. package/lib/cjs/ResponsiveContainer.js.map +1 -1
  34. package/lib/cjs/ScatterPlot.js +34 -74
  35. package/lib/cjs/ScatterPlot.js.map +1 -1
  36. package/lib/cjs/StackBar.js +9 -38
  37. package/lib/cjs/StackBar.js.map +1 -1
  38. package/lib/cjs/StackedArea.js +5 -29
  39. package/lib/cjs/StackedArea.js.map +1 -1
  40. package/lib/cjs/Tooltip.js +27 -76
  41. package/lib/cjs/Tooltip.js.map +1 -1
  42. package/lib/cjs/Venn.js +32 -75
  43. package/lib/cjs/Venn.js.map +1 -1
  44. package/lib/cjs/a11y/PlotA11yModule.js +18 -71
  45. package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
  46. package/lib/cjs/a11y/PlotA11yView.js +19 -83
  47. package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
  48. package/lib/cjs/a11y/bezier.js +0 -7
  49. package/lib/cjs/a11y/bezier.js.map +1 -1
  50. package/lib/cjs/a11y/focus.js +2 -11
  51. package/lib/cjs/a11y/focus.js.map +1 -1
  52. package/lib/cjs/a11y/hints.js +0 -13
  53. package/lib/cjs/a11y/hints.js.map +1 -1
  54. package/lib/cjs/a11y/insights.js +21 -132
  55. package/lib/cjs/a11y/insights.js.map +1 -1
  56. package/lib/cjs/a11y/intl.js +0 -6
  57. package/lib/cjs/a11y/intl.js.map +1 -1
  58. package/lib/cjs/a11y/locale.js +4 -22
  59. package/lib/cjs/a11y/locale.js.map +1 -1
  60. package/lib/cjs/a11y/serialize.js +23 -83
  61. package/lib/cjs/a11y/serialize.js.map +1 -1
  62. package/lib/cjs/a11y/summarize.js +0 -4
  63. package/lib/cjs/a11y/summarize.js.map +1 -1
  64. package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js +0 -13
  65. package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
  66. package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js +0 -13
  67. package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
  68. package/lib/cjs/color.js +0 -3
  69. package/lib/cjs/color.js.map +1 -1
  70. package/lib/cjs/createElement.js +18 -47
  71. package/lib/cjs/createElement.js.map +1 -1
  72. package/lib/cjs/index.js +0 -23
  73. package/lib/cjs/index.js.map +1 -1
  74. package/lib/cjs/types/Plot.d.js.map +1 -1
  75. package/lib/cjs/types/index.d.js +0 -39
  76. package/lib/cjs/types/index.d.js.map +1 -1
  77. package/lib/cjs/utils.js +7 -59
  78. package/lib/cjs/utils.js.map +1 -1
  79. package/lib/es6/Area.js +59 -86
  80. package/lib/es6/Area.js.map +1 -1
  81. package/lib/es6/Axis.js +76 -135
  82. package/lib/es6/Axis.js.map +1 -1
  83. package/lib/es6/Bar.js +49 -86
  84. package/lib/es6/Bar.js.map +1 -1
  85. package/lib/es6/Bubble.js +39 -70
  86. package/lib/es6/Bubble.js.map +1 -1
  87. package/lib/es6/ClipPath.js +9 -23
  88. package/lib/es6/ClipPath.js.map +1 -1
  89. package/lib/es6/Donut.js +77 -141
  90. package/lib/es6/Donut.js.map +1 -1
  91. package/lib/es6/Dots.js +29 -46
  92. package/lib/es6/Dots.js.map +1 -1
  93. package/lib/es6/GroupBar.js +5 -15
  94. package/lib/es6/GroupBar.js.map +1 -1
  95. package/lib/es6/HorizontalBar.js +43 -75
  96. package/lib/es6/HorizontalBar.js.map +1 -1
  97. package/lib/es6/Hover.js +33 -85
  98. package/lib/es6/Hover.js.map +1 -1
  99. package/lib/es6/Line.js +42 -67
  100. package/lib/es6/Line.js.map +1 -1
  101. package/lib/es6/Plot.js +27 -66
  102. package/lib/es6/Plot.js.map +1 -1
  103. package/lib/es6/Radar.js +152 -281
  104. package/lib/es6/Radar.js.map +1 -1
  105. package/lib/es6/RadialTree.js +105 -203
  106. package/lib/es6/RadialTree.js.map +1 -1
  107. package/lib/es6/ReferenceLine.js +45 -79
  108. package/lib/es6/ReferenceLine.js.map +1 -1
  109. package/lib/es6/ResponsiveContainer.js +9 -28
  110. package/lib/es6/ResponsiveContainer.js.map +1 -1
  111. package/lib/es6/ScatterPlot.js +34 -65
  112. package/lib/es6/ScatterPlot.js.map +1 -1
  113. package/lib/es6/StackBar.js +9 -26
  114. package/lib/es6/StackBar.js.map +1 -1
  115. package/lib/es6/StackedArea.js +5 -18
  116. package/lib/es6/StackedArea.js.map +1 -1
  117. package/lib/es6/Tooltip.js +27 -63
  118. package/lib/es6/Tooltip.js.map +1 -1
  119. package/lib/es6/Venn.js +32 -64
  120. package/lib/es6/Venn.js.map +1 -1
  121. package/lib/es6/a11y/PlotA11yModule.js +18 -52
  122. package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
  123. package/lib/es6/a11y/PlotA11yView.js +19 -53
  124. package/lib/es6/a11y/PlotA11yView.js.map +1 -1
  125. package/lib/es6/a11y/bezier.js +0 -5
  126. package/lib/es6/a11y/bezier.js.map +1 -1
  127. package/lib/es6/a11y/focus.js +2 -9
  128. package/lib/es6/a11y/focus.js.map +1 -1
  129. package/lib/es6/a11y/hints.js +0 -3
  130. package/lib/es6/a11y/hints.js.map +1 -1
  131. package/lib/es6/a11y/insights.js +21 -133
  132. package/lib/es6/a11y/insights.js.map +1 -1
  133. package/lib/es6/a11y/intl.js +0 -1
  134. package/lib/es6/a11y/intl.js.map +1 -1
  135. package/lib/es6/a11y/locale.js +4 -18
  136. package/lib/es6/a11y/locale.js.map +1 -1
  137. package/lib/es6/a11y/serialize.js +23 -74
  138. package/lib/es6/a11y/serialize.js.map +1 -1
  139. package/lib/es6/a11y/summarize.js.map +1 -1
  140. package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
  141. package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
  142. package/lib/es6/color.js +0 -1
  143. package/lib/es6/color.js.map +1 -1
  144. package/lib/es6/createElement.js +18 -34
  145. package/lib/es6/createElement.js.map +1 -1
  146. package/lib/es6/index.js.map +1 -1
  147. package/lib/es6/types/Plot.d.js.map +1 -1
  148. package/lib/es6/types/index.d.js +5 -3
  149. package/lib/es6/types/index.d.js.map +1 -1
  150. package/lib/es6/utils.js +7 -28
  151. package/lib/es6/utils.js.map +1 -1
  152. package/package.json +1 -1
@@ -20,49 +20,32 @@ import getOriginChildren from '@semcore/utils/lib/getOriginChildren';
20
20
  import canUseDOM from '@semcore/utils/lib/canUseDOM';
21
21
  import createElement from './createElement';
22
22
  import { measureText } from './utils';
23
-
24
23
  /*__reshadow-styles__:"./style/radial-tree.shadow.css"*/
25
- var style = (
26
- /*__reshadow_css_start__*/
27
- _sstyled.insert(
28
- /*__inner_css_start__*/
29
- ".___SRadian_s7r6s_gg_{cursor:pointer;fill:var(--intergalactic-chart-palette-order-9, #008ff8)}.___SLine_s7r6s_gg_{stroke:var(--intergalactic-chart-palette-order-9, #008ff8)}.___SLine_s7r6s_gg_.__color_s7r6s_gg_{stroke:var(--color_s7r6s)}.___SCap_s7r6s_gg_.__transparent_s7r6s_gg_,.___SIcon_s7r6s_gg_.__transparent_s7r6s_gg_,.___SLabel_s7r6s_gg_.__transparent_s7r6s_gg_,.___SLine_s7r6s_gg_.__transparent_s7r6s_gg_{opacity:.3}.___SCap_s7r6s_gg_{transition:r .1s}.___SLabel_s7r6s_gg_{fill:var(--color_s7r6s);cursor:var(--text-cursor_s7r6s)}@media (hover:hover){.___SRadian_s7r6s_gg_:hover .___SLabel_s7r6s_gg_{fill:var(--color-hovered_s7r6s)}}@media (prefers-reduced-motion){.___SLineCap_s7r6s_gg_{transition:none}}"
30
- /*__inner_css_end__*/
31
- , "s7r6s_gg_")
32
- /*__reshadow_css_end__*/
33
- , {
34
- "__SRadian": "___SRadian_s7r6s_gg_",
35
- "__SLine": "___SLine_s7r6s_gg_",
36
- "_color": "__color_s7r6s_gg_",
37
- "--color": "--color_s7r6s",
38
- "_transparent": "__transparent_s7r6s_gg_",
39
- "__SCap": "___SCap_s7r6s_gg_",
40
- "__SIcon": "___SIcon_s7r6s_gg_",
41
- "__SLabel": "___SLabel_s7r6s_gg_",
42
- "--text-cursor": "--text-cursor_s7r6s",
43
- "--color-hovered": "--color-hovered_s7r6s",
44
- "__SLineCap": "___SLineCap_s7r6s_gg_"
24
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SRadian_10je7_gg_{cursor:pointer;fill:var(--intergalactic-chart-palette-order-9, #008ff8)}.___SLine_10je7_gg_{stroke:var(--intergalactic-chart-palette-order-9, #008ff8)}.___SLine_10je7_gg_.__color_10je7_gg_{stroke:var(--color_10je7)}.___SCap_10je7_gg_.__transparent_10je7_gg_,.___SIcon_10je7_gg_.__transparent_10je7_gg_,.___SLabel_10je7_gg_.__transparent_10je7_gg_,.___SLine_10je7_gg_.__transparent_10je7_gg_{opacity:.3}.___SCap_10je7_gg_{transition:r .1s}.___SLabel_10je7_gg_{fill:var(--color_10je7);cursor:var(--text-cursor_10je7)}@media (hover:hover){.___SRadian_10je7_gg_:hover .___SLabel_10je7_gg_{fill:var(--color-hovered_10je7)}}@media (prefers-reduced-motion){.___SLineCap_10je7_gg_{transition:none}}" /*__inner_css_end__*/, "10je7_gg_") /*__reshadow_css_end__*/, {
25
+ "__SRadian": "___SRadian_10je7_gg_",
26
+ "__SLine": "___SLine_10je7_gg_",
27
+ "_color": "__color_10je7_gg_",
28
+ "--color": "--color_10je7",
29
+ "_transparent": "__transparent_10je7_gg_",
30
+ "__SCap": "___SCap_10je7_gg_",
31
+ "__SIcon": "___SIcon_10je7_gg_",
32
+ "__SLabel": "___SLabel_10je7_gg_",
33
+ "--text-cursor": "--text-cursor_10je7",
34
+ "--color-hovered": "--color-hovered_10je7",
35
+ "__SLineCap": "___SLineCap_10je7_gg_"
45
36
  });
46
37
  var baseAngle = -Math.PI / 2; // The top vertical line
47
-
48
38
  var RadialTreeBase = /*#__PURE__*/function (_Component) {
49
39
  _inherits(RadialTreeBase, _Component);
50
-
51
40
  var _super = _createSuper(RadialTreeBase);
52
-
53
41
  function RadialTreeBase(props) {
54
42
  var _this;
55
-
56
43
  _classCallCheck(this, RadialTreeBase);
57
-
58
44
  _this = _super.call(this, props);
59
-
60
45
  _defineProperty(_assertThisInitialized(_this), "Element", void 0);
61
-
62
46
  _this.handleRadianClick = _this.handleRadianClick.bind(_assertThisInitialized(_this));
63
47
  return _this;
64
48
  }
65
-
66
49
  _createClass(RadialTreeBase, [{
67
50
  key: "uncontrolledProps",
68
51
  value: function uncontrolledProps() {
@@ -74,14 +57,13 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
74
57
  key: "runAppearAnimation",
75
58
  value: function runAppearAnimation() {
76
59
  var _window$matchMedia;
77
-
78
60
  var _this$asProps = this.asProps,
79
- duration = _this$asProps.duration,
80
- uid = _this$asProps.uid;
61
+ duration = _this$asProps.duration,
62
+ uid = _this$asProps.uid;
81
63
  if (!canUseDOM()) return;
82
64
  var preferReduceMotion = (_window$matchMedia = window.matchMedia('(prefers-reduced-motion: reduce)')) === null || _window$matchMedia === void 0 ? void 0 : _window$matchMedia.matches;
83
- /** using `!(>)` instead of `<=` to get true on NaN and non numbers stuff */
84
65
 
66
+ /** using `!(>)` instead of `<=` to get true on NaN and non numbers stuff */
85
67
  if (!(duration > 0)) return;
86
68
  if (preferReduceMotion) return;
87
69
  var circlesAnimation = transition().selection().selectAll("[data-radial-animation=".concat(uid, "-cap-circle]")).interrupt();
@@ -92,11 +74,9 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
92
74
  var iconsNodes = iconsAnimation.nodes();
93
75
  var linesNodes = linesAnimation.nodes();
94
76
  var labelsNodes = linesAnimation.nodes();
95
-
96
77
  if (circlesNodes.length > 0) {
97
78
  var attrs = circlesNodes.map(function (node) {
98
79
  var _lineNode$x, _lineNode$x$baseVal, _lineNode$y, _lineNode$y$baseVal;
99
-
100
80
  var radianIndex = parseInt(node.dataset.radianIndex, 10);
101
81
  var lineNode = linesNodes[radianIndex];
102
82
  return {
@@ -112,27 +92,21 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
112
92
  });
113
93
  circlesAnimation.attr('opacity', 0).attr('cx', function (_, index) {
114
94
  var _attrs$index$from;
115
-
116
95
  return (_attrs$index$from = attrs[index].from) === null || _attrs$index$from === void 0 ? void 0 : _attrs$index$from.cx;
117
96
  }).attr('cy', function (_, index) {
118
97
  var _attrs$index$from2;
119
-
120
98
  return (_attrs$index$from2 = attrs[index].from) === null || _attrs$index$from2 === void 0 ? void 0 : _attrs$index$from2.cy;
121
99
  }).transition().duration(duration).attr('opacity', 1).attr('cx', function (_, index) {
122
100
  var _attrs$index$to;
123
-
124
101
  return (_attrs$index$to = attrs[index].to) === null || _attrs$index$to === void 0 ? void 0 : _attrs$index$to.cx;
125
102
  }).attr('cy', function (_, index) {
126
103
  var _attrs$index$to2;
127
-
128
104
  return (_attrs$index$to2 = attrs[index].to) === null || _attrs$index$to2 === void 0 ? void 0 : _attrs$index$to2.cy;
129
105
  });
130
106
  }
131
-
132
107
  if (iconsNodes.length > 0) {
133
108
  var _attrs = iconsNodes.map(function (node) {
134
109
  var _node$width, _node$width$baseVal, _node$height, _node$height$baseVal, _lineNode$x2, _lineNode$x2$baseVal, _lineNode$y2, _lineNode$y2$baseVal;
135
-
136
110
  var width = (_node$width = node.width) === null || _node$width === void 0 ? void 0 : (_node$width$baseVal = _node$width.baseVal) === null || _node$width$baseVal === void 0 ? void 0 : _node$width$baseVal.value;
137
111
  var height = (_node$height = node.height) === null || _node$height === void 0 ? void 0 : (_node$height$baseVal = _node$height.baseVal) === null || _node$height$baseVal === void 0 ? void 0 : _node$height$baseVal.value;
138
112
  var radianIndex = parseInt(node.dataset.radianIndex, 10);
@@ -148,30 +122,23 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
148
122
  }
149
123
  };
150
124
  });
151
-
152
125
  iconsAnimation.attr('opacity', 0).attr('x', function (_, index) {
153
126
  var _attrs$index$from3;
154
-
155
127
  return (_attrs$index$from3 = _attrs[index].from) === null || _attrs$index$from3 === void 0 ? void 0 : _attrs$index$from3.x;
156
128
  }).attr('y', function (_, index) {
157
129
  var _attrs$index$from4;
158
-
159
130
  return (_attrs$index$from4 = _attrs[index].from) === null || _attrs$index$from4 === void 0 ? void 0 : _attrs$index$from4.y;
160
131
  }).transition().duration(duration).attr('opacity', 1).attr('x', function (_, index) {
161
132
  var _attrs$index$to3;
162
-
163
133
  return (_attrs$index$to3 = _attrs[index].to) === null || _attrs$index$to3 === void 0 ? void 0 : _attrs$index$to3.x;
164
134
  }).attr('y', function (_, index) {
165
135
  var _attrs$index$to4;
166
-
167
136
  return (_attrs$index$to4 = _attrs[index].to) === null || _attrs$index$to4 === void 0 ? void 0 : _attrs$index$to4.y;
168
137
  });
169
138
  }
170
-
171
139
  if (linesNodes.length > 0) {
172
140
  var _attrs2 = linesNodes.map(function (node) {
173
141
  var _node$x, _node$x$baseVal, _node$y, _node$y$baseVal;
174
-
175
142
  return {
176
143
  from: {
177
144
  x2: (_node$x = node.x1) === null || _node$x === void 0 ? void 0 : (_node$x$baseVal = _node$x.baseVal) === null || _node$x$baseVal === void 0 ? void 0 : _node$x$baseVal.value,
@@ -183,26 +150,20 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
183
150
  }
184
151
  };
185
152
  });
186
-
187
153
  linesAnimation.attr('opacity', 0).attr('x2', function (_, index) {
188
154
  var _attrs2$index$from;
189
-
190
155
  return (_attrs2$index$from = _attrs2[index].from) === null || _attrs2$index$from === void 0 ? void 0 : _attrs2$index$from.x2;
191
156
  }).attr('y2', function (_, index) {
192
157
  var _attrs2$index$from2;
193
-
194
158
  return (_attrs2$index$from2 = _attrs2[index].from) === null || _attrs2$index$from2 === void 0 ? void 0 : _attrs2$index$from2.y2;
195
159
  }).transition().duration(duration).attr('opacity', 1).attr('x2', function (_, index) {
196
160
  var _attrs2$index$to;
197
-
198
161
  return (_attrs2$index$to = _attrs2[index].to) === null || _attrs2$index$to === void 0 ? void 0 : _attrs2$index$to.x2;
199
162
  }).attr('y2', function (_, index) {
200
163
  var _attrs2$index$to2;
201
-
202
164
  return (_attrs2$index$to2 = _attrs2[index].to) === null || _attrs2$index$to2 === void 0 ? void 0 : _attrs2$index$to2.y2;
203
165
  });
204
166
  }
205
-
206
167
  if (labelsNodes.length > 0) {
207
168
  labelsAnimation.attr('opacity', 0);
208
169
  labelsAnimation.transition().duration(duration).attr('opacity', 1);
@@ -224,10 +185,8 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
224
185
  key: "handleRadianClick",
225
186
  value: function handleRadianClick(key) {
226
187
  var _this2 = this;
227
-
228
188
  return function (event) {
229
189
  var newKey = key !== _this2.asProps.activeKey ? key : null;
230
-
231
190
  _this2.handlers.activeKey(newKey, event);
232
191
  };
233
192
  }
@@ -235,8 +194,8 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
235
194
  key: "computeTextWidth",
236
195
  value: function computeTextWidth() {
237
196
  var _this$asProps2 = this.asProps,
238
- data = _this$asProps2.data,
239
- textSize = _this$asProps2.textSize;
197
+ data = _this$asProps2.data,
198
+ textSize = _this$asProps2.textSize;
240
199
  var widths = data.map(function (_ref9) {
241
200
  var label = _ref9.label;
242
201
  return measureText(label, textSize);
@@ -247,17 +206,15 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
247
206
  key: "getTitleProps",
248
207
  value: function getTitleProps() {
249
208
  var _this$asProps3 = this.asProps,
250
- uid = _this$asProps3.uid,
251
- size = _this$asProps3.size,
252
- textSize = _this$asProps3.textSize;
253
-
209
+ uid = _this$asProps3.uid,
210
+ size = _this$asProps3.size,
211
+ textSize = _this$asProps3.textSize;
254
212
  var _size = _slicedToArray(size, 2),
255
- width = _size[0],
256
- height = _size[1];
257
-
213
+ width = _size[0],
214
+ height = _size[1];
258
215
  var center = [width / 2, height / 2];
259
216
  var x = center[0],
260
- y = center[1];
217
+ y = center[1];
261
218
  return _defineProperty({
262
219
  x: x,
263
220
  y: y,
@@ -268,9 +225,8 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
268
225
  key: "getRadianProps",
269
226
  value: function getRadianProps() {
270
227
  var _this$asProps4 = this.asProps,
271
- data = _this$asProps4.data,
272
- restRootProps = _objectWithoutProperties(_this$asProps4, _excluded);
273
-
228
+ data = _this$asProps4.data,
229
+ restRootProps = _objectWithoutProperties(_this$asProps4, _excluded);
274
230
  var textWidth = this.computeTextWidth();
275
231
  return _objectSpread(_objectSpread({}, restRootProps), {}, {
276
232
  radiansCount: data.length,
@@ -283,7 +239,6 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
283
239
  key: "render",
284
240
  value: function render() {
285
241
  var _ref;
286
-
287
242
  var SRadialTree = this.Element;
288
243
  var Children = this.asProps.Children;
289
244
  this.asProps.dataHintsHandler.establishDataType('values-set');
@@ -292,16 +247,11 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
292
247
  }), /*#__PURE__*/React.createElement(Children, _ref.cn("Children", {})));
293
248
  }
294
249
  }]);
295
-
296
250
  return RadialTreeBase;
297
251
  }(Component);
298
-
299
252
  _defineProperty(RadialTreeBase, "displayName", 'RadialTree');
300
-
301
253
  _defineProperty(RadialTreeBase, "style", style);
302
-
303
254
  _defineProperty(RadialTreeBase, "enhance", [uniqueIDEnhancement()]);
304
-
305
255
  _defineProperty(RadialTreeBase, "defaultProps", {
306
256
  angleOffset: 0,
307
257
  duration: 300,
@@ -313,38 +263,28 @@ _defineProperty(RadialTreeBase, "defaultProps", {
313
263
  textSize: 14,
314
264
  defaultActiveKey: null
315
265
  });
316
-
317
266
  var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
318
267
  _inherits(RadialTreeRadian, _Component2);
319
-
320
268
  var _super2 = _createSuper(RadialTreeRadian);
321
-
322
269
  function RadialTreeRadian(props) {
323
270
  var _this3;
324
-
325
271
  _classCallCheck(this, RadialTreeRadian);
326
-
327
272
  _this3 = _super2.call(this, props);
328
-
329
273
  _defineProperty(_assertThisInitialized(_this3), "Element", void 0);
330
-
331
274
  _this3.renderRadian = _this3.renderRadian.bind(_assertThisInitialized(_this3));
332
275
  return _this3;
333
276
  }
334
-
335
277
  _createClass(RadialTreeRadian, [{
336
278
  key: "getInteractiveAreaProps",
337
279
  value: function getInteractiveAreaProps(_ref11, index) {
338
280
  var $rootProps = _ref11.$rootProps;
339
281
  var data = $rootProps.data[index];
340
-
341
282
  var _this$computeRadianPo = this.computeRadianPosition(data, index),
342
- xStart = _this$computeRadianPo.xStart,
343
- yStart = _this$computeRadianPo.yStart,
344
- xLabelCenter = _this$computeRadianPo.xLabelCenter,
345
- yLabelCenter = _this$computeRadianPo.yLabelCenter,
346
- capSize = _this$computeRadianPo.capSize;
347
-
283
+ xStart = _this$computeRadianPo.xStart,
284
+ yStart = _this$computeRadianPo.yStart,
285
+ xLabelCenter = _this$computeRadianPo.xLabelCenter,
286
+ yLabelCenter = _this$computeRadianPo.yLabelCenter,
287
+ capSize = _this$computeRadianPo.capSize;
348
288
  return {
349
289
  x1: xStart,
350
290
  y1: yStart,
@@ -357,19 +297,16 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
357
297
  key: "getLineProps",
358
298
  value: function getLineProps(_ref12, index) {
359
299
  var _data$color, _ref13;
360
-
361
300
  var $rootProps = _ref12.$rootProps;
362
301
  var data = $rootProps.data[index];
363
-
364
302
  var _this$computeRadianPo2 = this.computeRadianPosition(data, index),
365
- xStart = _this$computeRadianPo2.xStart,
366
- yStart = _this$computeRadianPo2.yStart,
367
- xEnd = _this$computeRadianPo2.xEnd,
368
- yEnd = _this$computeRadianPo2.yEnd;
369
-
303
+ xStart = _this$computeRadianPo2.xStart,
304
+ yStart = _this$computeRadianPo2.yStart,
305
+ xEnd = _this$computeRadianPo2.xEnd,
306
+ yEnd = _this$computeRadianPo2.yEnd;
370
307
  var _this$asProps5 = this.asProps,
371
- uid = _this$asProps5.uid,
372
- transparent = _this$asProps5.transparent;
308
+ uid = _this$asProps5.uid,
309
+ transparent = _this$asProps5.transparent;
373
310
  var color = (_data$color = data.color) !== null && _data$color !== void 0 ? _data$color : this.asProps.color;
374
311
  return _ref13 = {
375
312
  x1: xStart,
@@ -384,18 +321,15 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
384
321
  key: "getCapProps",
385
322
  value: function getCapProps(_ref14, index) {
386
323
  var _data$color2, _ref15;
387
-
388
324
  var $rootProps = _ref14.$rootProps;
389
325
  var data = $rootProps.data[index];
390
-
391
326
  var _this$computeRadianPo3 = this.computeRadianPosition(data, index),
392
- xEnd = _this$computeRadianPo3.xEnd,
393
- yEnd = _this$computeRadianPo3.yEnd,
394
- capSize = _this$computeRadianPo3.capSize;
395
-
327
+ xEnd = _this$computeRadianPo3.xEnd,
328
+ yEnd = _this$computeRadianPo3.yEnd,
329
+ capSize = _this$computeRadianPo3.capSize;
396
330
  var _this$asProps6 = this.asProps,
397
- uid = _this$asProps6.uid,
398
- transparent = _this$asProps6.transparent;
331
+ uid = _this$asProps6.uid,
332
+ transparent = _this$asProps6.transparent;
399
333
  var color = (_data$color2 = data.color) !== null && _data$color2 !== void 0 ? _data$color2 : this.asProps.color;
400
334
  return _ref15 = {
401
335
  x: xEnd,
@@ -406,15 +340,12 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
406
340
  key: "getIconProps",
407
341
  value: function getIconProps(_ref16, index) {
408
342
  var _data$iconColor, _data$iconSize, _data$icon, _ref17;
409
-
410
343
  var $rootProps = _ref16.$rootProps;
411
344
  var data = $rootProps.data[index];
412
-
413
345
  var _this$computeRadianPo4 = this.computeRadianPosition(data, index),
414
- xEnd = _this$computeRadianPo4.xEnd,
415
- yEnd = _this$computeRadianPo4.yEnd,
416
- isActive = _this$computeRadianPo4.isActive;
417
-
346
+ xEnd = _this$computeRadianPo4.xEnd,
347
+ yEnd = _this$computeRadianPo4.yEnd,
348
+ isActive = _this$computeRadianPo4.isActive;
418
349
  var uid = this.asProps.uid;
419
350
  var iconColor = (_data$iconColor = data.iconColor) !== null && _data$iconColor !== void 0 ? _data$iconColor : this.asProps.iconColor;
420
351
  var iconSize = (_data$iconSize = data.iconSize) !== null && _data$iconSize !== void 0 ? _data$iconSize : this.asProps.iconSize;
@@ -430,20 +361,17 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
430
361
  key: "getLabelProps",
431
362
  value: function getLabelProps(_ref18, index) {
432
363
  var _data$color3, _ref19;
433
-
434
364
  var $rootProps = _ref18.$rootProps;
435
365
  var data = $rootProps.data[index];
436
-
437
366
  var _this$computeRadianPo5 = this.computeRadianPosition(data, index),
438
- xLabelCenter = _this$computeRadianPo5.xLabelCenter,
439
- yLabelCenter = _this$computeRadianPo5.yLabelCenter,
440
- labelAngle = _this$computeRadianPo5.labelAngle,
441
- isHorizontal = _this$computeRadianPo5.isHorizontal;
442
-
367
+ xLabelCenter = _this$computeRadianPo5.xLabelCenter,
368
+ yLabelCenter = _this$computeRadianPo5.yLabelCenter,
369
+ labelAngle = _this$computeRadianPo5.labelAngle,
370
+ isHorizontal = _this$computeRadianPo5.isHorizontal;
443
371
  var _this$asProps7 = this.asProps,
444
- uid = _this$asProps7.uid,
445
- textSize = _this$asProps7.textSize,
446
- transparent = _this$asProps7.transparent;
372
+ uid = _this$asProps7.uid,
373
+ textSize = _this$asProps7.textSize,
374
+ transparent = _this$asProps7.transparent;
447
375
  var label = data.label;
448
376
  var color = (_data$color3 = data.color) !== null && _data$color3 !== void 0 ? _data$color3 : this.asProps.color;
449
377
  return _ref19 = {
@@ -456,27 +384,23 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
456
384
  key: "getRadianKey",
457
385
  value: function getRadianKey(data, index) {
458
386
  var _data$key;
459
-
460
387
  return (_data$key = data.key) !== null && _data$key !== void 0 ? _data$key : "radian-".concat(index);
461
388
  }
462
389
  }, {
463
390
  key: "computeRadianPosition",
464
391
  value: function computeRadianPosition(data, index) {
465
392
  var _data$capSize;
466
-
467
393
  var _this$asProps8 = this.asProps,
468
- centralMargin = _this$asProps8.centralMargin,
469
- labelMargin = _this$asProps8.labelMargin,
470
- angleOffset = _this$asProps8.angleOffset,
471
- activeKey = _this$asProps8.activeKey,
472
- size = _this$asProps8.size,
473
- radiansCount = _this$asProps8.radiansCount,
474
- textWidth = _this$asProps8.textWidth;
475
-
394
+ centralMargin = _this$asProps8.centralMargin,
395
+ labelMargin = _this$asProps8.labelMargin,
396
+ angleOffset = _this$asProps8.angleOffset,
397
+ activeKey = _this$asProps8.activeKey,
398
+ size = _this$asProps8.size,
399
+ radiansCount = _this$asProps8.radiansCount,
400
+ textWidth = _this$asProps8.textWidth;
476
401
  var _size2 = _slicedToArray(size, 2),
477
- width = _size2[0],
478
- height = _size2[1];
479
-
402
+ width = _size2[0],
403
+ height = _size2[1];
480
404
  var key = this.getRadianKey(data, index);
481
405
  var isActive = activeKey === key;
482
406
  var baseCapSize = (_data$capSize = data.capSize) !== null && _data$capSize !== void 0 ? _data$capSize : this.asProps.capSize;
@@ -489,16 +413,16 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
489
413
  var labelAngle = (angle - topAngle) % Math.PI + topAngle;
490
414
  var center = [width / 2, height / 2];
491
415
  var xCenter = center[0],
492
- yCenter = center[1];
416
+ yCenter = center[1];
493
417
  var start = [xCenter + Math.cos(angle) * centralMargin, yCenter + Math.sin(angle) * centralMargin];
494
418
  var end = [xCenter + Math.cos(angle) * (centralMargin + length), yCenter + Math.sin(angle) * (centralMargin + length)];
495
419
  var xStart = start[0],
496
- yStart = start[1];
420
+ yStart = start[1];
497
421
  var xEnd = end[0],
498
- yEnd = end[1];
422
+ yEnd = end[1];
499
423
  var labelCenter = [xCenter + Math.cos(angle) * (centralMargin + length + baseCapSize + textWidth / 2 + labelMargin), yCenter + Math.sin(angle) * (centralMargin + length + baseCapSize + textWidth / 2 + labelMargin)];
500
424
  var xLabelCenter = labelCenter[0],
501
- yLabelCenter = labelCenter[1];
425
+ yLabelCenter = labelCenter[1];
502
426
  return {
503
427
  xStart: xStart,
504
428
  yStart: yStart,
@@ -516,24 +440,22 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
516
440
  key: "renderRadian",
517
441
  value: function renderRadian(data, index) {
518
442
  var _ref2;
519
-
520
443
  var _this$asProps9 = this.asProps,
521
- styles = _this$asProps9.styles,
522
- Children = _this$asProps9.Children,
523
- onRadianClick = _this$asProps9.onRadianClick;
444
+ styles = _this$asProps9.styles,
445
+ Children = _this$asProps9.Children,
446
+ onRadianClick = _this$asProps9.onRadianClick;
524
447
  var key = this.getRadianKey(data, index);
525
448
  var SRadian = 'g';
526
449
  var children = getOriginChildren(Children);
527
-
528
450
  if (typeof children === 'function') {
529
451
  var _child = this.asProps.children;
530
452
  var mergedProps = assignProps(children(this.asProps), this.asProps);
531
453
  children = mergedProps.children;
532
454
  mergedProps.children = _child;
533
455
  }
456
+ this.asProps.dataHintsHandler.describeValueEntity("".concat(index, ".").concat(data.label), data.label);
534
457
 
535
- this.asProps.dataHintsHandler.describeValueEntity("".concat(index, ".").concat(data.label), data.label); // hidden from publicly typed export
536
-
458
+ // hidden from publicly typed export
537
459
  var InteractiveArea = RadialTree.Radian.InteractiveArea;
538
460
  return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(SRadian, _ref2.cn("SRadian", {
539
461
  "aria-hidden": true,
@@ -545,8 +467,7 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
545
467
  key: "render",
546
468
  value: function render() {
547
469
  var _ref3,
548
- _this4 = this;
549
-
470
+ _this4 = this;
550
471
  var data = this.asProps.data;
551
472
  var SRadianList = 'g';
552
473
  return _ref3 = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SRadianList, _ref3.cn("SRadianList", {}), data.map(function (data, index) {
@@ -554,14 +475,10 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
554
475
  }));
555
476
  }
556
477
  }]);
557
-
558
478
  return RadialTreeRadian;
559
479
  }(Component);
560
-
561
480
  _defineProperty(RadialTreeRadian, "displayName", 'RadialTreeRadian');
562
-
563
481
  _defineProperty(RadialTreeRadian, "style", style);
564
-
565
482
  _defineProperty(RadialTreeRadian, "defaultProps", {
566
483
  centralMargin: 50,
567
484
  labelMargin: 2,
@@ -570,42 +487,36 @@ _defineProperty(RadialTreeRadian, "defaultProps", {
570
487
  iconSize: 16,
571
488
  textSize: 14
572
489
  });
573
-
574
490
  var InteractiveArea = function InteractiveArea(_ref20) {
575
491
  var _ref4;
576
-
577
492
  var SInteractiveArea = _ref20.Element,
578
- styles = _ref20.styles;
493
+ styles = _ref20.styles;
579
494
  return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SInteractiveArea, _ref4.cn("SInteractiveArea", {
580
495
  "stroke": 'transparent',
581
496
  "render": 'line'
582
497
  }));
583
498
  };
584
-
585
499
  var Line = function Line(_ref21) {
586
500
  var _ref5;
587
-
588
501
  var SLine = _ref21.Element,
589
- styles = _ref21.styles,
590
- stroke = _ref21.stroke,
591
- transparent = _ref21.transparent;
502
+ styles = _ref21.styles,
503
+ stroke = _ref21.stroke,
504
+ transparent = _ref21.transparent;
592
505
  return _ref5 = sstyled(styles), /*#__PURE__*/React.createElement(SLine, _ref5.cn("SLine", {
593
506
  "render": 'line',
594
507
  "stroke": stroke,
595
508
  "transparent": transparent
596
509
  }));
597
510
  };
598
-
599
511
  var Cap = function Cap(_ref22) {
600
512
  var _ref6;
601
-
602
513
  var SCap = _ref22.Element,
603
- styles = _ref22.styles,
604
- x = _ref22.x,
605
- y = _ref22.y,
606
- radius = _ref22.radius,
607
- color = _ref22.color,
608
- transparent = _ref22.transparent;
514
+ styles = _ref22.styles,
515
+ x = _ref22.x,
516
+ y = _ref22.y,
517
+ radius = _ref22.radius,
518
+ color = _ref22.color,
519
+ transparent = _ref22.transparent;
609
520
  return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SCap, _ref6.cn("SCap", {
610
521
  "render": 'circle',
611
522
  "cx": x,
@@ -615,18 +526,16 @@ var Cap = function Cap(_ref22) {
615
526
  "transparent": transparent
616
527
  }));
617
528
  };
618
-
619
529
  var Icon = function Icon(_ref23) {
620
530
  var _ref7;
621
-
622
531
  var SIcon = _ref23.Element,
623
- styles = _ref23.styles,
624
- isActive = _ref23.isActive,
625
- tag = _ref23.tag,
626
- x = _ref23.x,
627
- y = _ref23.y,
628
- iconSize = _ref23.iconSize,
629
- transparent = _ref23.transparent;
532
+ styles = _ref23.styles,
533
+ isActive = _ref23.isActive,
534
+ tag = _ref23.tag,
535
+ x = _ref23.x,
536
+ y = _ref23.y,
537
+ iconSize = _ref23.iconSize,
538
+ transparent = _ref23.transparent;
630
539
  if (!(isActive && tag)) return null;
631
540
  var width = iconSize;
632
541
  var height = iconSize;
@@ -639,19 +548,18 @@ var Icon = function Icon(_ref23) {
639
548
  "transparent": transparent
640
549
  }));
641
550
  };
642
-
643
551
  var Label = function Label(_ref24) {
644
552
  var SLabel = _ref24.Element,
645
- Children = _ref24.Children,
646
- styles = _ref24.styles,
647
- label = _ref24.label,
648
- color = _ref24.color,
649
- isHorizontal = _ref24.isHorizontal,
650
- x = _ref24.x,
651
- y = _ref24.y,
652
- textSize = _ref24.textSize,
653
- angle = _ref24.angle,
654
- transparent = _ref24.transparent;
553
+ Children = _ref24.Children,
554
+ styles = _ref24.styles,
555
+ label = _ref24.label,
556
+ color = _ref24.color,
557
+ isHorizontal = _ref24.isHorizontal,
558
+ x = _ref24.x,
559
+ y = _ref24.y,
560
+ textSize = _ref24.textSize,
561
+ angle = _ref24.angle,
562
+ transparent = _ref24.transparent;
655
563
  var lines = String(label).split('\n');
656
564
  var linesCount = lines.length;
657
565
  var SLabelLine = 'tspan';
@@ -683,7 +591,6 @@ var Label = function Label(_ref24) {
683
591
  }, lineText);
684
592
  }), /*#__PURE__*/React.createElement(Children, null));
685
593
  };
686
-
687
594
  var Radian = createElement(RadialTreeRadian, {
688
595
  InteractiveArea: InteractiveArea,
689
596
  Line: Line,
@@ -691,24 +598,20 @@ var Radian = createElement(RadialTreeRadian, {
691
598
  Icon: Icon,
692
599
  Label: Label
693
600
  });
694
-
695
601
  var Title = function Title(_ref25) {
696
602
  var _ref8;
697
-
698
603
  var STitle = _ref25.Element,
699
- Children = _ref25.Children,
700
- children = _ref25.children,
701
- styles = _ref25.styles,
702
- textSize = _ref25.textSize,
703
- color = _ref25.color,
704
- x = _ref25.x,
705
- y = _ref25.y,
706
- dataHintsHandler = _ref25.dataHintsHandler;
707
-
604
+ Children = _ref25.Children,
605
+ children = _ref25.children,
606
+ styles = _ref25.styles,
607
+ textSize = _ref25.textSize,
608
+ color = _ref25.color,
609
+ x = _ref25.x,
610
+ y = _ref25.y,
611
+ dataHintsHandler = _ref25.dataHintsHandler;
708
612
  if (typeof children === 'string') {
709
613
  dataHintsHandler.setTitle('vertical', children);
710
614
  }
711
-
712
615
  return _ref8 = sstyled(styles), /*#__PURE__*/React.createElement(STitle, _ref8.cn("STitle", {
713
616
  "aria-hidden": true,
714
617
  "render": 'text',
@@ -720,7 +623,6 @@ var Title = function Title(_ref25) {
720
623
  "y": y
721
624
  }), /*#__PURE__*/React.createElement(Children, _ref8.cn("Children", {})));
722
625
  };
723
-
724
626
  var RadialTree = createElement(RadialTreeBase, {
725
627
  Title: Title,
726
628
  Radian: Radian