@semcore/d3-chart 2.13.4 → 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 +6 -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
@@ -1,93 +1,57 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports["default"] = void 0;
9
-
10
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
-
14
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
-
16
11
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
17
-
18
12
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
19
-
20
13
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
21
-
22
14
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
23
-
24
15
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
25
-
26
16
  var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
27
-
28
17
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
29
-
30
18
  var _core = require("@semcore/core");
31
-
32
19
  var _react = _interopRequireDefault(require("react"));
33
-
34
20
  var _d3Transition = require("d3-transition");
35
-
36
21
  var _uniqueID = _interopRequireDefault(require("@semcore/utils/lib/uniqueID"));
37
-
38
22
  var _color = require("@semcore/utils/lib/color");
39
-
40
23
  var _assignProps = _interopRequireDefault(require("@semcore/utils/lib/assignProps"));
41
-
42
24
  var _getOriginChildren = _interopRequireDefault(require("@semcore/utils/lib/getOriginChildren"));
43
-
44
25
  var _canUseDOM = _interopRequireDefault(require("@semcore/utils/lib/canUseDOM"));
45
-
46
26
  var _createElement = _interopRequireDefault(require("./createElement"));
47
-
48
27
  var _utils = require("./utils");
49
-
50
28
  var _excluded = ["data"];
51
-
52
29
  /*__reshadow-styles__:"./style/radial-tree.shadow.css"*/
53
- var style = (
54
- /*__reshadow_css_start__*/
55
- _core.sstyled.insert(
56
- /*__inner_css_start__*/
57
- ".___SRadian_oyqzm_gg_{cursor:pointer;fill:var(--intergalactic-chart-palette-order-9, #008ff8)}.___SLine_oyqzm_gg_{stroke:var(--intergalactic-chart-palette-order-9, #008ff8)}.___SLine_oyqzm_gg_.__color_oyqzm_gg_{stroke:var(--color_oyqzm)}.___SCap_oyqzm_gg_.__transparent_oyqzm_gg_,.___SIcon_oyqzm_gg_.__transparent_oyqzm_gg_,.___SLabel_oyqzm_gg_.__transparent_oyqzm_gg_,.___SLine_oyqzm_gg_.__transparent_oyqzm_gg_{opacity:.3}.___SCap_oyqzm_gg_{transition:r .1s}.___SLabel_oyqzm_gg_{fill:var(--color_oyqzm);cursor:var(--text-cursor_oyqzm)}@media (hover:hover){.___SRadian_oyqzm_gg_:hover .___SLabel_oyqzm_gg_{fill:var(--color-hovered_oyqzm)}}@media (prefers-reduced-motion){.___SLineCap_oyqzm_gg_{transition:none}}"
58
- /*__inner_css_end__*/
59
- , "oyqzm_gg_")
60
- /*__reshadow_css_end__*/
61
- , {
62
- "__SRadian": "___SRadian_oyqzm_gg_",
63
- "__SLine": "___SLine_oyqzm_gg_",
64
- "_color": "__color_oyqzm_gg_",
65
- "--color": "--color_oyqzm",
66
- "_transparent": "__transparent_oyqzm_gg_",
67
- "__SCap": "___SCap_oyqzm_gg_",
68
- "__SIcon": "___SIcon_oyqzm_gg_",
69
- "__SLabel": "___SLabel_oyqzm_gg_",
70
- "--text-cursor": "--text-cursor_oyqzm",
71
- "--color-hovered": "--color-hovered_oyqzm",
72
- "__SLineCap": "___SLineCap_oyqzm_gg_"
30
+ var style = ( /*__reshadow_css_start__*/_core.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__*/, {
31
+ "__SRadian": "___SRadian_10je7_gg_",
32
+ "__SLine": "___SLine_10je7_gg_",
33
+ "_color": "__color_10je7_gg_",
34
+ "--color": "--color_10je7",
35
+ "_transparent": "__transparent_10je7_gg_",
36
+ "__SCap": "___SCap_10je7_gg_",
37
+ "__SIcon": "___SIcon_10je7_gg_",
38
+ "__SLabel": "___SLabel_10je7_gg_",
39
+ "--text-cursor": "--text-cursor_10je7",
40
+ "--color-hovered": "--color-hovered_10je7",
41
+ "__SLineCap": "___SLineCap_10je7_gg_"
73
42
  });
74
43
  var baseAngle = -Math.PI / 2; // The top vertical line
75
-
76
44
  var RadialTreeBase = /*#__PURE__*/function (_Component) {
77
45
  (0, _inherits2["default"])(RadialTreeBase, _Component);
78
-
79
46
  var _super = (0, _createSuper2["default"])(RadialTreeBase);
80
-
81
47
  function RadialTreeBase(props) {
82
48
  var _this;
83
-
84
49
  (0, _classCallCheck2["default"])(this, RadialTreeBase);
85
50
  _this = _super.call(this, props);
86
51
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "Element", void 0);
87
52
  _this.handleRadianClick = _this.handleRadianClick.bind((0, _assertThisInitialized2["default"])(_this));
88
53
  return _this;
89
54
  }
90
-
91
55
  (0, _createClass2["default"])(RadialTreeBase, [{
92
56
  key: "uncontrolledProps",
93
57
  value: function uncontrolledProps() {
@@ -99,14 +63,13 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
99
63
  key: "runAppearAnimation",
100
64
  value: function runAppearAnimation() {
101
65
  var _window$matchMedia;
102
-
103
66
  var _this$asProps = this.asProps,
104
- duration = _this$asProps.duration,
105
- uid = _this$asProps.uid;
67
+ duration = _this$asProps.duration,
68
+ uid = _this$asProps.uid;
106
69
  if (!(0, _canUseDOM["default"])()) return;
107
70
  var preferReduceMotion = (_window$matchMedia = window.matchMedia('(prefers-reduced-motion: reduce)')) === null || _window$matchMedia === void 0 ? void 0 : _window$matchMedia.matches;
108
- /** using `!(>)` instead of `<=` to get true on NaN and non numbers stuff */
109
71
 
72
+ /** using `!(>)` instead of `<=` to get true on NaN and non numbers stuff */
110
73
  if (!(duration > 0)) return;
111
74
  if (preferReduceMotion) return;
112
75
  var circlesAnimation = (0, _d3Transition.transition)().selection().selectAll("[data-radial-animation=".concat(uid, "-cap-circle]")).interrupt();
@@ -117,11 +80,9 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
117
80
  var iconsNodes = iconsAnimation.nodes();
118
81
  var linesNodes = linesAnimation.nodes();
119
82
  var labelsNodes = linesAnimation.nodes();
120
-
121
83
  if (circlesNodes.length > 0) {
122
84
  var attrs = circlesNodes.map(function (node) {
123
85
  var _lineNode$x, _lineNode$x$baseVal, _lineNode$y, _lineNode$y$baseVal;
124
-
125
86
  var radianIndex = parseInt(node.dataset.radianIndex, 10);
126
87
  var lineNode = linesNodes[radianIndex];
127
88
  return {
@@ -137,27 +98,21 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
137
98
  });
138
99
  circlesAnimation.attr('opacity', 0).attr('cx', function (_, index) {
139
100
  var _attrs$index$from;
140
-
141
101
  return (_attrs$index$from = attrs[index].from) === null || _attrs$index$from === void 0 ? void 0 : _attrs$index$from.cx;
142
102
  }).attr('cy', function (_, index) {
143
103
  var _attrs$index$from2;
144
-
145
104
  return (_attrs$index$from2 = attrs[index].from) === null || _attrs$index$from2 === void 0 ? void 0 : _attrs$index$from2.cy;
146
105
  }).transition().duration(duration).attr('opacity', 1).attr('cx', function (_, index) {
147
106
  var _attrs$index$to;
148
-
149
107
  return (_attrs$index$to = attrs[index].to) === null || _attrs$index$to === void 0 ? void 0 : _attrs$index$to.cx;
150
108
  }).attr('cy', function (_, index) {
151
109
  var _attrs$index$to2;
152
-
153
110
  return (_attrs$index$to2 = attrs[index].to) === null || _attrs$index$to2 === void 0 ? void 0 : _attrs$index$to2.cy;
154
111
  });
155
112
  }
156
-
157
113
  if (iconsNodes.length > 0) {
158
114
  var _attrs = iconsNodes.map(function (node) {
159
115
  var _node$width, _node$width$baseVal, _node$height, _node$height$baseVal, _lineNode$x2, _lineNode$x2$baseVal, _lineNode$y2, _lineNode$y2$baseVal;
160
-
161
116
  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;
162
117
  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;
163
118
  var radianIndex = parseInt(node.dataset.radianIndex, 10);
@@ -173,30 +128,23 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
173
128
  }
174
129
  };
175
130
  });
176
-
177
131
  iconsAnimation.attr('opacity', 0).attr('x', function (_, index) {
178
132
  var _attrs$index$from3;
179
-
180
133
  return (_attrs$index$from3 = _attrs[index].from) === null || _attrs$index$from3 === void 0 ? void 0 : _attrs$index$from3.x;
181
134
  }).attr('y', function (_, index) {
182
135
  var _attrs$index$from4;
183
-
184
136
  return (_attrs$index$from4 = _attrs[index].from) === null || _attrs$index$from4 === void 0 ? void 0 : _attrs$index$from4.y;
185
137
  }).transition().duration(duration).attr('opacity', 1).attr('x', function (_, index) {
186
138
  var _attrs$index$to3;
187
-
188
139
  return (_attrs$index$to3 = _attrs[index].to) === null || _attrs$index$to3 === void 0 ? void 0 : _attrs$index$to3.x;
189
140
  }).attr('y', function (_, index) {
190
141
  var _attrs$index$to4;
191
-
192
142
  return (_attrs$index$to4 = _attrs[index].to) === null || _attrs$index$to4 === void 0 ? void 0 : _attrs$index$to4.y;
193
143
  });
194
144
  }
195
-
196
145
  if (linesNodes.length > 0) {
197
146
  var _attrs2 = linesNodes.map(function (node) {
198
147
  var _node$x, _node$x$baseVal, _node$y, _node$y$baseVal;
199
-
200
148
  return {
201
149
  from: {
202
150
  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,
@@ -208,26 +156,20 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
208
156
  }
209
157
  };
210
158
  });
211
-
212
159
  linesAnimation.attr('opacity', 0).attr('x2', function (_, index) {
213
160
  var _attrs2$index$from;
214
-
215
161
  return (_attrs2$index$from = _attrs2[index].from) === null || _attrs2$index$from === void 0 ? void 0 : _attrs2$index$from.x2;
216
162
  }).attr('y2', function (_, index) {
217
163
  var _attrs2$index$from2;
218
-
219
164
  return (_attrs2$index$from2 = _attrs2[index].from) === null || _attrs2$index$from2 === void 0 ? void 0 : _attrs2$index$from2.y2;
220
165
  }).transition().duration(duration).attr('opacity', 1).attr('x2', function (_, index) {
221
166
  var _attrs2$index$to;
222
-
223
167
  return (_attrs2$index$to = _attrs2[index].to) === null || _attrs2$index$to === void 0 ? void 0 : _attrs2$index$to.x2;
224
168
  }).attr('y2', function (_, index) {
225
169
  var _attrs2$index$to2;
226
-
227
170
  return (_attrs2$index$to2 = _attrs2[index].to) === null || _attrs2$index$to2 === void 0 ? void 0 : _attrs2$index$to2.y2;
228
171
  });
229
172
  }
230
-
231
173
  if (labelsNodes.length > 0) {
232
174
  labelsAnimation.attr('opacity', 0);
233
175
  labelsAnimation.transition().duration(duration).attr('opacity', 1);
@@ -249,10 +191,8 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
249
191
  key: "handleRadianClick",
250
192
  value: function handleRadianClick(key) {
251
193
  var _this2 = this;
252
-
253
194
  return function (event) {
254
195
  var newKey = key !== _this2.asProps.activeKey ? key : null;
255
-
256
196
  _this2.handlers.activeKey(newKey, event);
257
197
  };
258
198
  }
@@ -260,8 +200,8 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
260
200
  key: "computeTextWidth",
261
201
  value: function computeTextWidth() {
262
202
  var _this$asProps2 = this.asProps,
263
- data = _this$asProps2.data,
264
- textSize = _this$asProps2.textSize;
203
+ data = _this$asProps2.data,
204
+ textSize = _this$asProps2.textSize;
265
205
  var widths = data.map(function (_ref9) {
266
206
  var label = _ref9.label;
267
207
  return (0, _utils.measureText)(label, textSize);
@@ -272,17 +212,15 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
272
212
  key: "getTitleProps",
273
213
  value: function getTitleProps() {
274
214
  var _this$asProps3 = this.asProps,
275
- uid = _this$asProps3.uid,
276
- size = _this$asProps3.size,
277
- textSize = _this$asProps3.textSize;
278
-
215
+ uid = _this$asProps3.uid,
216
+ size = _this$asProps3.size,
217
+ textSize = _this$asProps3.textSize;
279
218
  var _size = (0, _slicedToArray2["default"])(size, 2),
280
- width = _size[0],
281
- height = _size[1];
282
-
219
+ width = _size[0],
220
+ height = _size[1];
283
221
  var center = [width / 2, height / 2];
284
222
  var x = center[0],
285
- y = center[1];
223
+ y = center[1];
286
224
  return (0, _defineProperty2["default"])({
287
225
  x: x,
288
226
  y: y,
@@ -293,8 +231,8 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
293
231
  key: "getRadianProps",
294
232
  value: function getRadianProps() {
295
233
  var _this$asProps4 = this.asProps,
296
- data = _this$asProps4.data,
297
- restRootProps = (0, _objectWithoutProperties2["default"])(_this$asProps4, _excluded);
234
+ data = _this$asProps4.data,
235
+ restRootProps = (0, _objectWithoutProperties2["default"])(_this$asProps4, _excluded);
298
236
  var textWidth = this.computeTextWidth();
299
237
  return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, restRootProps), {}, {
300
238
  radiansCount: data.length,
@@ -307,7 +245,6 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
307
245
  key: "render",
308
246
  value: function render() {
309
247
  var _ref;
310
-
311
248
  var SRadialTree = this.Element;
312
249
  var Children = this.asProps.Children;
313
250
  this.asProps.dataHintsHandler.establishDataType('values-set');
@@ -318,7 +255,6 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
318
255
  }]);
319
256
  return RadialTreeBase;
320
257
  }(_core.Component);
321
-
322
258
  (0, _defineProperty2["default"])(RadialTreeBase, "displayName", 'RadialTree');
323
259
  (0, _defineProperty2["default"])(RadialTreeBase, "style", style);
324
260
  (0, _defineProperty2["default"])(RadialTreeBase, "enhance", [(0, _uniqueID["default"])()]);
@@ -333,35 +269,28 @@ var RadialTreeBase = /*#__PURE__*/function (_Component) {
333
269
  textSize: 14,
334
270
  defaultActiveKey: null
335
271
  });
336
-
337
272
  var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
338
273
  (0, _inherits2["default"])(RadialTreeRadian, _Component2);
339
-
340
274
  var _super2 = (0, _createSuper2["default"])(RadialTreeRadian);
341
-
342
275
  function RadialTreeRadian(props) {
343
276
  var _this3;
344
-
345
277
  (0, _classCallCheck2["default"])(this, RadialTreeRadian);
346
278
  _this3 = _super2.call(this, props);
347
279
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this3), "Element", void 0);
348
280
  _this3.renderRadian = _this3.renderRadian.bind((0, _assertThisInitialized2["default"])(_this3));
349
281
  return _this3;
350
282
  }
351
-
352
283
  (0, _createClass2["default"])(RadialTreeRadian, [{
353
284
  key: "getInteractiveAreaProps",
354
285
  value: function getInteractiveAreaProps(_ref11, index) {
355
286
  var $rootProps = _ref11.$rootProps;
356
287
  var data = $rootProps.data[index];
357
-
358
288
  var _this$computeRadianPo = this.computeRadianPosition(data, index),
359
- xStart = _this$computeRadianPo.xStart,
360
- yStart = _this$computeRadianPo.yStart,
361
- xLabelCenter = _this$computeRadianPo.xLabelCenter,
362
- yLabelCenter = _this$computeRadianPo.yLabelCenter,
363
- capSize = _this$computeRadianPo.capSize;
364
-
289
+ xStart = _this$computeRadianPo.xStart,
290
+ yStart = _this$computeRadianPo.yStart,
291
+ xLabelCenter = _this$computeRadianPo.xLabelCenter,
292
+ yLabelCenter = _this$computeRadianPo.yLabelCenter,
293
+ capSize = _this$computeRadianPo.capSize;
365
294
  return {
366
295
  x1: xStart,
367
296
  y1: yStart,
@@ -374,19 +303,16 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
374
303
  key: "getLineProps",
375
304
  value: function getLineProps(_ref12, index) {
376
305
  var _data$color, _ref13;
377
-
378
306
  var $rootProps = _ref12.$rootProps;
379
307
  var data = $rootProps.data[index];
380
-
381
308
  var _this$computeRadianPo2 = this.computeRadianPosition(data, index),
382
- xStart = _this$computeRadianPo2.xStart,
383
- yStart = _this$computeRadianPo2.yStart,
384
- xEnd = _this$computeRadianPo2.xEnd,
385
- yEnd = _this$computeRadianPo2.yEnd;
386
-
309
+ xStart = _this$computeRadianPo2.xStart,
310
+ yStart = _this$computeRadianPo2.yStart,
311
+ xEnd = _this$computeRadianPo2.xEnd,
312
+ yEnd = _this$computeRadianPo2.yEnd;
387
313
  var _this$asProps5 = this.asProps,
388
- uid = _this$asProps5.uid,
389
- transparent = _this$asProps5.transparent;
314
+ uid = _this$asProps5.uid,
315
+ transparent = _this$asProps5.transparent;
390
316
  var color = (_data$color = data.color) !== null && _data$color !== void 0 ? _data$color : this.asProps.color;
391
317
  return _ref13 = {
392
318
  x1: xStart,
@@ -401,18 +327,15 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
401
327
  key: "getCapProps",
402
328
  value: function getCapProps(_ref14, index) {
403
329
  var _data$color2, _ref15;
404
-
405
330
  var $rootProps = _ref14.$rootProps;
406
331
  var data = $rootProps.data[index];
407
-
408
332
  var _this$computeRadianPo3 = this.computeRadianPosition(data, index),
409
- xEnd = _this$computeRadianPo3.xEnd,
410
- yEnd = _this$computeRadianPo3.yEnd,
411
- capSize = _this$computeRadianPo3.capSize;
412
-
333
+ xEnd = _this$computeRadianPo3.xEnd,
334
+ yEnd = _this$computeRadianPo3.yEnd,
335
+ capSize = _this$computeRadianPo3.capSize;
413
336
  var _this$asProps6 = this.asProps,
414
- uid = _this$asProps6.uid,
415
- transparent = _this$asProps6.transparent;
337
+ uid = _this$asProps6.uid,
338
+ transparent = _this$asProps6.transparent;
416
339
  var color = (_data$color2 = data.color) !== null && _data$color2 !== void 0 ? _data$color2 : this.asProps.color;
417
340
  return _ref15 = {
418
341
  x: xEnd,
@@ -423,15 +346,12 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
423
346
  key: "getIconProps",
424
347
  value: function getIconProps(_ref16, index) {
425
348
  var _data$iconColor, _data$iconSize, _data$icon, _ref17;
426
-
427
349
  var $rootProps = _ref16.$rootProps;
428
350
  var data = $rootProps.data[index];
429
-
430
351
  var _this$computeRadianPo4 = this.computeRadianPosition(data, index),
431
- xEnd = _this$computeRadianPo4.xEnd,
432
- yEnd = _this$computeRadianPo4.yEnd,
433
- isActive = _this$computeRadianPo4.isActive;
434
-
352
+ xEnd = _this$computeRadianPo4.xEnd,
353
+ yEnd = _this$computeRadianPo4.yEnd,
354
+ isActive = _this$computeRadianPo4.isActive;
435
355
  var uid = this.asProps.uid;
436
356
  var iconColor = (_data$iconColor = data.iconColor) !== null && _data$iconColor !== void 0 ? _data$iconColor : this.asProps.iconColor;
437
357
  var iconSize = (_data$iconSize = data.iconSize) !== null && _data$iconSize !== void 0 ? _data$iconSize : this.asProps.iconSize;
@@ -447,20 +367,17 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
447
367
  key: "getLabelProps",
448
368
  value: function getLabelProps(_ref18, index) {
449
369
  var _data$color3, _ref19;
450
-
451
370
  var $rootProps = _ref18.$rootProps;
452
371
  var data = $rootProps.data[index];
453
-
454
372
  var _this$computeRadianPo5 = this.computeRadianPosition(data, index),
455
- xLabelCenter = _this$computeRadianPo5.xLabelCenter,
456
- yLabelCenter = _this$computeRadianPo5.yLabelCenter,
457
- labelAngle = _this$computeRadianPo5.labelAngle,
458
- isHorizontal = _this$computeRadianPo5.isHorizontal;
459
-
373
+ xLabelCenter = _this$computeRadianPo5.xLabelCenter,
374
+ yLabelCenter = _this$computeRadianPo5.yLabelCenter,
375
+ labelAngle = _this$computeRadianPo5.labelAngle,
376
+ isHorizontal = _this$computeRadianPo5.isHorizontal;
460
377
  var _this$asProps7 = this.asProps,
461
- uid = _this$asProps7.uid,
462
- textSize = _this$asProps7.textSize,
463
- transparent = _this$asProps7.transparent;
378
+ uid = _this$asProps7.uid,
379
+ textSize = _this$asProps7.textSize,
380
+ transparent = _this$asProps7.transparent;
464
381
  var label = data.label;
465
382
  var color = (_data$color3 = data.color) !== null && _data$color3 !== void 0 ? _data$color3 : this.asProps.color;
466
383
  return _ref19 = {
@@ -473,27 +390,23 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
473
390
  key: "getRadianKey",
474
391
  value: function getRadianKey(data, index) {
475
392
  var _data$key;
476
-
477
393
  return (_data$key = data.key) !== null && _data$key !== void 0 ? _data$key : "radian-".concat(index);
478
394
  }
479
395
  }, {
480
396
  key: "computeRadianPosition",
481
397
  value: function computeRadianPosition(data, index) {
482
398
  var _data$capSize;
483
-
484
399
  var _this$asProps8 = this.asProps,
485
- centralMargin = _this$asProps8.centralMargin,
486
- labelMargin = _this$asProps8.labelMargin,
487
- angleOffset = _this$asProps8.angleOffset,
488
- activeKey = _this$asProps8.activeKey,
489
- size = _this$asProps8.size,
490
- radiansCount = _this$asProps8.radiansCount,
491
- textWidth = _this$asProps8.textWidth;
492
-
400
+ centralMargin = _this$asProps8.centralMargin,
401
+ labelMargin = _this$asProps8.labelMargin,
402
+ angleOffset = _this$asProps8.angleOffset,
403
+ activeKey = _this$asProps8.activeKey,
404
+ size = _this$asProps8.size,
405
+ radiansCount = _this$asProps8.radiansCount,
406
+ textWidth = _this$asProps8.textWidth;
493
407
  var _size2 = (0, _slicedToArray2["default"])(size, 2),
494
- width = _size2[0],
495
- height = _size2[1];
496
-
408
+ width = _size2[0],
409
+ height = _size2[1];
497
410
  var key = this.getRadianKey(data, index);
498
411
  var isActive = activeKey === key;
499
412
  var baseCapSize = (_data$capSize = data.capSize) !== null && _data$capSize !== void 0 ? _data$capSize : this.asProps.capSize;
@@ -506,16 +419,16 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
506
419
  var labelAngle = (angle - topAngle) % Math.PI + topAngle;
507
420
  var center = [width / 2, height / 2];
508
421
  var xCenter = center[0],
509
- yCenter = center[1];
422
+ yCenter = center[1];
510
423
  var start = [xCenter + Math.cos(angle) * centralMargin, yCenter + Math.sin(angle) * centralMargin];
511
424
  var end = [xCenter + Math.cos(angle) * (centralMargin + length), yCenter + Math.sin(angle) * (centralMargin + length)];
512
425
  var xStart = start[0],
513
- yStart = start[1];
426
+ yStart = start[1];
514
427
  var xEnd = end[0],
515
- yEnd = end[1];
428
+ yEnd = end[1];
516
429
  var labelCenter = [xCenter + Math.cos(angle) * (centralMargin + length + baseCapSize + textWidth / 2 + labelMargin), yCenter + Math.sin(angle) * (centralMargin + length + baseCapSize + textWidth / 2 + labelMargin)];
517
430
  var xLabelCenter = labelCenter[0],
518
- yLabelCenter = labelCenter[1];
431
+ yLabelCenter = labelCenter[1];
519
432
  return {
520
433
  xStart: xStart,
521
434
  yStart: yStart,
@@ -533,24 +446,22 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
533
446
  key: "renderRadian",
534
447
  value: function renderRadian(data, index) {
535
448
  var _ref2;
536
-
537
449
  var _this$asProps9 = this.asProps,
538
- styles = _this$asProps9.styles,
539
- Children = _this$asProps9.Children,
540
- onRadianClick = _this$asProps9.onRadianClick;
450
+ styles = _this$asProps9.styles,
451
+ Children = _this$asProps9.Children,
452
+ onRadianClick = _this$asProps9.onRadianClick;
541
453
  var key = this.getRadianKey(data, index);
542
454
  var SRadian = 'g';
543
455
  var children = (0, _getOriginChildren["default"])(Children);
544
-
545
456
  if (typeof children === 'function') {
546
457
  var _child = this.asProps.children;
547
458
  var mergedProps = (0, _assignProps["default"])(children(this.asProps), this.asProps);
548
459
  children = mergedProps.children;
549
460
  mergedProps.children = _child;
550
461
  }
462
+ this.asProps.dataHintsHandler.describeValueEntity("".concat(index, ".").concat(data.label), data.label);
551
463
 
552
- this.asProps.dataHintsHandler.describeValueEntity("".concat(index, ".").concat(data.label), data.label); // hidden from publicly typed export
553
-
464
+ // hidden from publicly typed export
554
465
  var InteractiveArea = RadialTree.Radian.InteractiveArea;
555
466
  return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SRadian, _ref2.cn("SRadian", {
556
467
  "aria-hidden": true,
@@ -562,8 +473,7 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
562
473
  key: "render",
563
474
  value: function render() {
564
475
  var _ref3,
565
- _this4 = this;
566
-
476
+ _this4 = this;
567
477
  var data = this.asProps.data;
568
478
  var SRadianList = 'g';
569
479
  return _ref3 = (0, _core.sstyled)(this.asProps.styles), /*#__PURE__*/_react["default"].createElement(SRadianList, _ref3.cn("SRadianList", {}), data.map(function (data, index) {
@@ -573,7 +483,6 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
573
483
  }]);
574
484
  return RadialTreeRadian;
575
485
  }(_core.Component);
576
-
577
486
  (0, _defineProperty2["default"])(RadialTreeRadian, "displayName", 'RadialTreeRadian');
578
487
  (0, _defineProperty2["default"])(RadialTreeRadian, "style", style);
579
488
  (0, _defineProperty2["default"])(RadialTreeRadian, "defaultProps", {
@@ -584,42 +493,36 @@ var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
584
493
  iconSize: 16,
585
494
  textSize: 14
586
495
  });
587
-
588
496
  var InteractiveArea = function InteractiveArea(_ref20) {
589
497
  var _ref4;
590
-
591
498
  var SInteractiveArea = _ref20.Element,
592
- styles = _ref20.styles;
499
+ styles = _ref20.styles;
593
500
  return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SInteractiveArea, _ref4.cn("SInteractiveArea", {
594
501
  "stroke": 'transparent',
595
502
  "render": 'line'
596
503
  }));
597
504
  };
598
-
599
505
  var Line = function Line(_ref21) {
600
506
  var _ref5;
601
-
602
507
  var SLine = _ref21.Element,
603
- styles = _ref21.styles,
604
- stroke = _ref21.stroke,
605
- transparent = _ref21.transparent;
508
+ styles = _ref21.styles,
509
+ stroke = _ref21.stroke,
510
+ transparent = _ref21.transparent;
606
511
  return _ref5 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SLine, _ref5.cn("SLine", {
607
512
  "render": 'line',
608
513
  "stroke": stroke,
609
514
  "transparent": transparent
610
515
  }));
611
516
  };
612
-
613
517
  var Cap = function Cap(_ref22) {
614
518
  var _ref6;
615
-
616
519
  var SCap = _ref22.Element,
617
- styles = _ref22.styles,
618
- x = _ref22.x,
619
- y = _ref22.y,
620
- radius = _ref22.radius,
621
- color = _ref22.color,
622
- transparent = _ref22.transparent;
520
+ styles = _ref22.styles,
521
+ x = _ref22.x,
522
+ y = _ref22.y,
523
+ radius = _ref22.radius,
524
+ color = _ref22.color,
525
+ transparent = _ref22.transparent;
623
526
  return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SCap, _ref6.cn("SCap", {
624
527
  "render": 'circle',
625
528
  "cx": x,
@@ -629,18 +532,16 @@ var Cap = function Cap(_ref22) {
629
532
  "transparent": transparent
630
533
  }));
631
534
  };
632
-
633
535
  var Icon = function Icon(_ref23) {
634
536
  var _ref7;
635
-
636
537
  var SIcon = _ref23.Element,
637
- styles = _ref23.styles,
638
- isActive = _ref23.isActive,
639
- tag = _ref23.tag,
640
- x = _ref23.x,
641
- y = _ref23.y,
642
- iconSize = _ref23.iconSize,
643
- transparent = _ref23.transparent;
538
+ styles = _ref23.styles,
539
+ isActive = _ref23.isActive,
540
+ tag = _ref23.tag,
541
+ x = _ref23.x,
542
+ y = _ref23.y,
543
+ iconSize = _ref23.iconSize,
544
+ transparent = _ref23.transparent;
644
545
  if (!(isActive && tag)) return null;
645
546
  var width = iconSize;
646
547
  var height = iconSize;
@@ -653,19 +554,18 @@ var Icon = function Icon(_ref23) {
653
554
  "transparent": transparent
654
555
  }));
655
556
  };
656
-
657
557
  var Label = function Label(_ref24) {
658
558
  var SLabel = _ref24.Element,
659
- Children = _ref24.Children,
660
- styles = _ref24.styles,
661
- label = _ref24.label,
662
- color = _ref24.color,
663
- isHorizontal = _ref24.isHorizontal,
664
- x = _ref24.x,
665
- y = _ref24.y,
666
- textSize = _ref24.textSize,
667
- angle = _ref24.angle,
668
- transparent = _ref24.transparent;
559
+ Children = _ref24.Children,
560
+ styles = _ref24.styles,
561
+ label = _ref24.label,
562
+ color = _ref24.color,
563
+ isHorizontal = _ref24.isHorizontal,
564
+ x = _ref24.x,
565
+ y = _ref24.y,
566
+ textSize = _ref24.textSize,
567
+ angle = _ref24.angle,
568
+ transparent = _ref24.transparent;
669
569
  var lines = String(label).split('\n');
670
570
  var linesCount = lines.length;
671
571
  var SLabelLine = 'tspan';
@@ -697,7 +597,6 @@ var Label = function Label(_ref24) {
697
597
  }, lineText);
698
598
  }), /*#__PURE__*/_react["default"].createElement(Children, null));
699
599
  };
700
-
701
600
  var Radian = (0, _createElement["default"])(RadialTreeRadian, {
702
601
  InteractiveArea: InteractiveArea,
703
602
  Line: Line,
@@ -705,24 +604,20 @@ var Radian = (0, _createElement["default"])(RadialTreeRadian, {
705
604
  Icon: Icon,
706
605
  Label: Label
707
606
  });
708
-
709
607
  var Title = function Title(_ref25) {
710
608
  var _ref8;
711
-
712
609
  var STitle = _ref25.Element,
713
- Children = _ref25.Children,
714
- children = _ref25.children,
715
- styles = _ref25.styles,
716
- textSize = _ref25.textSize,
717
- color = _ref25.color,
718
- x = _ref25.x,
719
- y = _ref25.y,
720
- dataHintsHandler = _ref25.dataHintsHandler;
721
-
610
+ Children = _ref25.Children,
611
+ children = _ref25.children,
612
+ styles = _ref25.styles,
613
+ textSize = _ref25.textSize,
614
+ color = _ref25.color,
615
+ x = _ref25.x,
616
+ y = _ref25.y,
617
+ dataHintsHandler = _ref25.dataHintsHandler;
722
618
  if (typeof children === 'string') {
723
619
  dataHintsHandler.setTitle('vertical', children);
724
620
  }
725
-
726
621
  return _ref8 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(STitle, _ref8.cn("STitle", {
727
622
  "aria-hidden": true,
728
623
  "render": 'text',
@@ -734,7 +629,6 @@ var Title = function Title(_ref25) {
734
629
  "y": y
735
630
  }), /*#__PURE__*/_react["default"].createElement(Children, _ref8.cn("Children", {})));
736
631
  };
737
-
738
632
  var RadialTree = (0, _createElement["default"])(RadialTreeBase, {
739
633
  Title: Title,
740
634
  Radian: Radian