@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
package/lib/es6/Radar.js CHANGED
@@ -17,69 +17,53 @@ import { polygonContains } from 'd3-polygon';
17
17
  import { line, lineRadial, curveLinearClosed, arc } from 'd3-shape';
18
18
  import createElement from './createElement';
19
19
  import { CONSTANT, eventToPoint, measureText } from './utils';
20
-
21
20
  /*__reshadow-styles__:"./style/radar.shadow.css"*/
22
- var style = (
23
- /*__reshadow_css_start__*/
24
- _sstyled.insert(
25
- /*__inner_css_start__*/
26
- ".___SAxisLine_1iddb_gg_,.___SAxisTick_1iddb_gg_,.___SAxis_1iddb_gg_{stroke:var(--intergalactic-chart-grid-line, #e0e1e9);stroke-width:1;fill:transparent}.___SAxisLine_1iddb_gg_,.___SAxisTick_1iddb_gg_{stroke-dasharray:2}.___SAxisLine_1iddb_gg_.__active_1iddb_gg_{stroke:var(--intergalactic-chart-grid-y-accent-hover-line, #a9abb6)}.___SAxisLabel_1iddb_gg_{text-anchor:middle;dominant-baseline:central;font-size:12px}.___SAxisLabel_1iddb_gg_.__xDirection_1iddb_gg_{text-anchor:var(--xDirection_1iddb)}.___SAxisLabel_1iddb_gg_.__yDirection_1iddb_gg_{dominant-baseline:var(--yDirection_1iddb)}.___SPolygonDot_1iddb_gg_,.___SPolygon_1iddb_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SPolygon_1iddb_gg_{opacity:.2}.___SPolygon_1iddb_gg_.__color_1iddb_gg_{fill:var(--color_1iddb)}.___SPolygonDot_1iddb_gg_{stroke-width:2px;stroke:var(--intergalactic-chart-grid-border, #ffffff);r:6px}.___SPolygonDot_1iddb_gg_.__transparent_1iddb_gg_{opacity:.3}.___SPolygonDot_1iddb_gg_.__color_1iddb_gg_{fill:var(--color_1iddb)}.___SPolygonLine_1iddb_gg_{stroke:var(--intergalactic-chart-palette-order-1, #2bb3ff);stroke-width:3;fill:transparent}.___SPolygonLine_1iddb_gg_.__transparent_1iddb_gg_{opacity:.3}.___SPolygonLine_1iddb_gg_.__color_1iddb_gg_{stroke:var(--color_1iddb)}.___SPieRect_1iddb_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}"
27
- /*__inner_css_end__*/
28
- , "1iddb_gg_")
29
- /*__reshadow_css_end__*/
30
- , {
31
- "__SAxis": "___SAxis_1iddb_gg_",
32
- "__SAxisLine": "___SAxisLine_1iddb_gg_",
33
- "__SAxisTick": "___SAxisTick_1iddb_gg_",
34
- "_active": "__active_1iddb_gg_",
35
- "__SAxisLabel": "___SAxisLabel_1iddb_gg_",
36
- "_xDirection": "__xDirection_1iddb_gg_",
37
- "--xDirection": "--xDirection_1iddb",
38
- "_yDirection": "__yDirection_1iddb_gg_",
39
- "--yDirection": "--yDirection_1iddb",
40
- "__SPolygon": "___SPolygon_1iddb_gg_",
41
- "_color": "__color_1iddb_gg_",
42
- "--color": "--color_1iddb",
43
- "__SPolygonDot": "___SPolygonDot_1iddb_gg_",
44
- "_transparent": "__transparent_1iddb_gg_",
45
- "__SPolygonLine": "___SPolygonLine_1iddb_gg_",
46
- "__SPieRect": "___SPieRect_1iddb_gg_"
21
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SAxisLine_1oec7_gg_,.___SAxisTick_1oec7_gg_,.___SAxis_1oec7_gg_{stroke:var(--intergalactic-chart-grid-line, #e0e1e9);stroke-width:1;fill:transparent}.___SAxisLine_1oec7_gg_,.___SAxisTick_1oec7_gg_{stroke-dasharray:2}.___SAxisLine_1oec7_gg_.__active_1oec7_gg_{stroke:var(--intergalactic-chart-grid-y-accent-hover-line, #a9abb6)}.___SAxisLabel_1oec7_gg_{text-anchor:middle;dominant-baseline:central;font-size:12px}.___SAxisLabel_1oec7_gg_.__xDirection_1oec7_gg_{text-anchor:var(--xDirection_1oec7)}.___SAxisLabel_1oec7_gg_.__yDirection_1oec7_gg_{dominant-baseline:var(--yDirection_1oec7)}.___SPolygonDot_1oec7_gg_,.___SPolygon_1oec7_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SPolygon_1oec7_gg_{opacity:.2}.___SPolygon_1oec7_gg_.__color_1oec7_gg_{fill:var(--color_1oec7)}.___SPolygonDot_1oec7_gg_{stroke-width:2px;stroke:var(--intergalactic-chart-grid-border, #ffffff);r:6px}.___SPolygonDot_1oec7_gg_.__transparent_1oec7_gg_{opacity:.3}.___SPolygonDot_1oec7_gg_.__color_1oec7_gg_{fill:var(--color_1oec7)}.___SPolygonLine_1oec7_gg_{stroke:var(--intergalactic-chart-palette-order-1, #2bb3ff);stroke-width:3;fill:transparent}.___SPolygonLine_1oec7_gg_.__transparent_1oec7_gg_{opacity:.3}.___SPolygonLine_1oec7_gg_.__color_1oec7_gg_{stroke:var(--color_1oec7)}.___SPieRect_1oec7_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}" /*__inner_css_end__*/, "1oec7_gg_") /*__reshadow_css_end__*/, {
22
+ "__SAxis": "___SAxis_1oec7_gg_",
23
+ "__SAxisLine": "___SAxisLine_1oec7_gg_",
24
+ "__SAxisTick": "___SAxisTick_1oec7_gg_",
25
+ "_active": "__active_1oec7_gg_",
26
+ "__SAxisLabel": "___SAxisLabel_1oec7_gg_",
27
+ "_xDirection": "__xDirection_1oec7_gg_",
28
+ "--xDirection": "--xDirection_1oec7",
29
+ "_yDirection": "__yDirection_1oec7_gg_",
30
+ "--yDirection": "--yDirection_1oec7",
31
+ "__SPolygon": "___SPolygon_1oec7_gg_",
32
+ "_color": "__color_1oec7_gg_",
33
+ "--color": "--color_1oec7",
34
+ "__SPolygonDot": "___SPolygonDot_1oec7_gg_",
35
+ "_transparent": "__transparent_1oec7_gg_",
36
+ "__SPolygonLine": "___SPolygonLine_1oec7_gg_",
37
+ "__SPieRect": "___SPieRect_1oec7_gg_"
47
38
  });
48
-
49
39
  var clampAngle = function clampAngle(angle) {
50
40
  angle = angle % (2 * Math.PI);
51
41
  if (angle < 0) angle += 2 * Math.PI;
52
42
  return angle;
53
43
  };
54
-
55
44
  function getBoxAxesValue(i, range, axes, total, angleOffset) {
56
45
  var func = axes === 'y' ? Math.sin : Math.cos;
57
46
  var angle = clampAngle((total - i) * 2 * Math.PI / total + angleOffset);
58
47
  return range * (1 - func(angle)) - range;
59
48
  }
60
-
61
49
  function getRadianPosition(i, range, total, angleOffset) {
62
50
  return [getBoxAxesValue(i, range, 'y', total, angleOffset), getBoxAxesValue(i, range, 'x', total, angleOffset)];
63
51
  }
64
-
65
52
  var getLabelXPlacement = function getLabelXPlacement(i, total, angleOffset) {
66
53
  var angle = clampAngle(i / total * (Math.PI * 2) - angleOffset);
67
54
  if (angle >= Math.PI + Math.PI * (8 / 9) || angle <= Math.PI * (1 / 9)) return 'middle';
68
55
  if (angle >= Math.PI * (8 / 9) && angle <= Math.PI + Math.PI * (1 / 9)) return 'middle';
69
56
  return angle < Math.PI ? 'start' : 'end';
70
57
  };
71
-
72
58
  var getLabelYPlacement = function getLabelYPlacement(i, total, angleOffset) {
73
59
  var angle = clampAngle(i / total * (Math.PI * 2) - angleOffset);
74
60
  if (angle >= Math.PI + Math.PI * (8 / 9) || angle <= Math.PI * (1 / 9)) return 'alphabetic';
75
61
  if (angle >= Math.PI * (8 / 9) && angle <= Math.PI + Math.PI * (1 / 9)) return 'mathematical';
76
62
  return 'middle';
77
63
  };
78
-
79
64
  function getLabelPlacement(i, total, angleOffset) {
80
65
  return [getLabelXPlacement(i, total, angleOffset), getLabelYPlacement(i, total, angleOffset)];
81
66
  }
82
-
83
67
  function computeTextWidth(texts, textSize) {
84
68
  var defaultWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 50;
85
69
  var defaultHeight = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 20;
@@ -87,42 +71,33 @@ function computeTextWidth(texts, textSize) {
87
71
  if (typeof text === 'string') {
88
72
  return measureText(text, textSize);
89
73
  }
90
-
91
74
  if ( /*#__PURE__*/React.isValidElement(text)) {
92
75
  var _text$props, _text$props2;
93
-
94
76
  // @ts-ignore
95
77
  return Math.max(((_text$props = text.props) === null || _text$props === void 0 ? void 0 : _text$props.width) || defaultWidth, ((_text$props2 = text.props) === null || _text$props2 === void 0 ? void 0 : _text$props2.height) || defaultHeight);
96
78
  }
97
-
98
79
  return defaultWidth;
99
80
  });
100
81
  return Math.max.apply(Math, _toConsumableArray(widths));
101
82
  }
102
-
103
83
  function getTicks(tickSize, radius) {
104
84
  var ticks = 0;
105
-
106
85
  while (Math.trunc(radius / (tickSize / 2)) > ticks) {
107
86
  ticks += 1;
108
87
  }
109
-
110
88
  return _toConsumableArray(Array(ticks).keys()).reduce(function (ticks, t, i, total) {
111
89
  if (i) ticks.push(i / total.length);
112
90
  return ticks;
113
91
  }, []);
114
92
  }
115
-
116
93
  function pieContains(_ref10, _ref11) {
117
94
  var _ref12 = _slicedToArray(_ref10, 3),
118
- startAngle = _ref12[0],
119
- endAngle = _ref12[1],
120
- radius = _ref12[2];
121
-
95
+ startAngle = _ref12[0],
96
+ endAngle = _ref12[1],
97
+ radius = _ref12[2];
122
98
  var _ref13 = _slicedToArray(_ref11, 2),
123
- x = _ref13[0],
124
- y = _ref13[1];
125
-
99
+ x = _ref13[0],
100
+ y = _ref13[1];
126
101
  var distance = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
127
102
  if (distance > radius) return false;
128
103
  startAngle = clampAngle(startAngle);
@@ -136,62 +111,46 @@ function pieContains(_ref10, _ref11) {
136
111
  if (nextAngle > startAngle && nextAngle < endAngle) return true;
137
112
  return false;
138
113
  }
139
-
140
114
  export function getLabelOffsetPosition(xDirection, yDirection, width, height) {
141
115
  var xOffset = 0;
142
116
  var yOffset = 0;
143
-
144
117
  switch ("".concat(xDirection, "-").concat(yDirection)) {
145
118
  case 'middle-alphabetic':
146
119
  yOffset = height / 2;
147
120
  break;
148
-
149
121
  case 'start-middle':
150
122
  xOffset = -width / 2;
151
123
  break;
152
-
153
124
  case 'middle-mathematical':
154
125
  yOffset = -height / 2;
155
126
  break;
156
-
157
127
  case 'end-middle':
158
128
  xOffset = width / 2;
159
129
  break;
160
130
  }
161
-
162
131
  return [xOffset + width / 2, yOffset + height / 2];
163
132
  }
164
133
  var MINIMUM_OFFSET = 5;
165
-
166
134
  var RadarRoot = /*#__PURE__*/function (_Component) {
167
135
  _inherits(RadarRoot, _Component);
168
-
169
136
  var _super = _createSuper(RadarRoot);
170
-
171
137
  function RadarRoot() {
172
138
  var _this;
173
-
174
139
  _classCallCheck(this, RadarRoot);
175
-
176
140
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
177
141
  args[_key] = arguments[_key];
178
142
  }
179
-
180
143
  _this = _super.call.apply(_super, [this].concat(args));
181
-
182
144
  _defineProperty(_assertThisInitialized(_this), "computeOffset", 0);
183
-
184
145
  _defineProperty(_assertThisInitialized(_this), "categoriesKey", null);
185
-
186
146
  return _this;
187
147
  }
188
-
189
148
  _createClass(RadarRoot, [{
190
149
  key: "id",
191
150
  get: function get() {
192
151
  var _this$asProps = this.asProps,
193
- id = _this$asProps.id,
194
- uid = _this$asProps.uid;
152
+ id = _this$asProps.id,
153
+ uid = _this$asProps.uid;
195
154
  return id || uid;
196
155
  }
197
156
  }, {
@@ -221,9 +180,9 @@ var RadarRoot = /*#__PURE__*/function (_Component) {
221
180
  value: function getPolygonProps(_ref14) {
222
181
  var dataKey = _ref14.dataKey;
223
182
  var _this$asProps2 = this.asProps,
224
- data = _this$asProps2.data,
225
- scale = _this$asProps2.scale,
226
- angleOffset = _this$asProps2.angleOffset;
183
+ data = _this$asProps2.data,
184
+ scale = _this$asProps2.scale,
185
+ angleOffset = _this$asProps2.angleOffset;
227
186
  return {
228
187
  offset: this.offset,
229
188
  data: data[dataKey] || [],
@@ -245,19 +204,16 @@ var RadarRoot = /*#__PURE__*/function (_Component) {
245
204
  key: "render",
246
205
  value: function render() {
247
206
  var _ref;
248
-
249
207
  var SRadar = this.Element;
250
208
  var _this$asProps3 = this.asProps,
251
- Children = _this$asProps3.Children,
252
- style = _this$asProps3.style,
253
- size = _this$asProps3.size,
254
- data = _this$asProps3.data,
255
- offset = _this$asProps3.offset;
256
-
209
+ Children = _this$asProps3.Children,
210
+ style = _this$asProps3.style,
211
+ size = _this$asProps3.size,
212
+ data = _this$asProps3.data,
213
+ offset = _this$asProps3.offset;
257
214
  var _size = _slicedToArray(size, 2),
258
- width = _size[0],
259
- height = _size[1];
260
-
215
+ width = _size[0],
216
+ height = _size[1];
261
217
  this.asProps.dataHintsHandler.establishDataType('indexed-groups');
262
218
  var dataKey;
263
219
  React.Children.toArray(getOriginChildren(Children)).forEach(function (child) {
@@ -265,16 +221,13 @@ var RadarRoot = /*#__PURE__*/function (_Component) {
265
221
  dataKey = child.props.dataKey;
266
222
  }
267
223
  });
268
-
269
224
  if (dataKey) {
270
225
  if (offset === undefined) {
271
226
  // +5 because font might not be loaded and just in case)
272
227
  this.computeOffset = computeTextWidth(data[dataKey], this.textSize) + MINIMUM_OFFSET;
273
228
  }
274
-
275
229
  this.categoriesKey = dataKey;
276
230
  }
277
-
278
231
  return _ref = sstyled(style), /*#__PURE__*/React.createElement(SRadar, _ref.cn("SRadar", {
279
232
  "aria-hidden": true,
280
233
  "id": this.id,
@@ -284,43 +237,33 @@ var RadarRoot = /*#__PURE__*/function (_Component) {
284
237
  }));
285
238
  }
286
239
  }]);
287
-
288
240
  return RadarRoot;
289
241
  }(Component);
290
-
291
242
  _defineProperty(RadarRoot, "displayName", 'Line');
292
-
293
243
  _defineProperty(RadarRoot, "style", style);
294
-
295
244
  _defineProperty(RadarRoot, "enhance", [uniqueIDEnhancement()]);
296
-
297
245
  _defineProperty(RadarRoot, "defaultProps", {
298
246
  type: 'polygon',
299
247
  angleOffset: 0
300
248
  });
301
-
302
249
  var PolygonRoot = /*#__PURE__*/function (_Component2) {
303
250
  _inherits(PolygonRoot, _Component2);
304
-
305
251
  var _super2 = _createSuper(PolygonRoot);
306
-
307
252
  function PolygonRoot() {
308
253
  _classCallCheck(this, PolygonRoot);
309
-
310
254
  return _super2.apply(this, arguments);
311
255
  }
312
-
313
256
  _createClass(PolygonRoot, [{
314
257
  key: "getDotsProps",
315
258
  value: function getDotsProps() {
316
259
  var _this$asProps4 = this.asProps,
317
- data = _this$asProps4.data,
318
- scale = _this$asProps4.scale,
319
- color = _this$asProps4.color,
320
- transparent = _this$asProps4.transparent,
321
- dataKey = _this$asProps4.dataKey,
322
- dataHintsHandler = _this$asProps4.dataHintsHandler,
323
- angleOffset = _this$asProps4.angleOffset;
260
+ data = _this$asProps4.data,
261
+ scale = _this$asProps4.scale,
262
+ color = _this$asProps4.color,
263
+ transparent = _this$asProps4.transparent,
264
+ dataKey = _this$asProps4.dataKey,
265
+ dataHintsHandler = _this$asProps4.dataHintsHandler,
266
+ angleOffset = _this$asProps4.angleOffset;
324
267
  return {
325
268
  data: data,
326
269
  scale: scale,
@@ -335,10 +278,10 @@ var PolygonRoot = /*#__PURE__*/function (_Component2) {
335
278
  key: "getLineProps",
336
279
  value: function getLineProps() {
337
280
  var _this$asProps5 = this.asProps,
338
- d3 = _this$asProps5.d3,
339
- data = _this$asProps5.data,
340
- color = _this$asProps5.color,
341
- transparent = _this$asProps5.transparent;
281
+ d3 = _this$asProps5.d3,
282
+ data = _this$asProps5.data,
283
+ color = _this$asProps5.color,
284
+ transparent = _this$asProps5.transparent;
342
285
  return {
343
286
  data: data,
344
287
  color: color,
@@ -350,14 +293,13 @@ var PolygonRoot = /*#__PURE__*/function (_Component2) {
350
293
  key: "render",
351
294
  value: function render() {
352
295
  var _ref2;
353
-
354
296
  var _this$asProps6 = this.asProps,
355
- SPolygon = _this$asProps6.Element,
356
- styles = _this$asProps6.styles,
357
- d3 = _this$asProps6.d3,
358
- data = _this$asProps6.data,
359
- color = _this$asProps6.color,
360
- fill = _this$asProps6.fill;
297
+ SPolygon = _this$asProps6.Element,
298
+ styles = _this$asProps6.styles,
299
+ d3 = _this$asProps6.d3,
300
+ data = _this$asProps6.data,
301
+ color = _this$asProps6.color,
302
+ fill = _this$asProps6.fill;
361
303
  return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(SPolygon, _ref2.cn("SPolygon", {
362
304
  "render": "path",
363
305
  "d": d3(data),
@@ -365,21 +307,17 @@ var PolygonRoot = /*#__PURE__*/function (_Component2) {
365
307
  }));
366
308
  }
367
309
  }]);
368
-
369
310
  return PolygonRoot;
370
311
  }(Component);
371
-
372
312
  _defineProperty(PolygonRoot, "displayName", 'Polygon');
373
-
374
313
  _defineProperty(PolygonRoot, "style", style);
375
-
376
314
  _defineProperty(PolygonRoot, "defaultProps", function (_ref18) {
377
315
  var scale = _ref18.scale,
378
- _ref18$curve = _ref18.curve,
379
- curve = _ref18$curve === void 0 ? curveLinearClosed : _ref18$curve,
380
- size = _ref18.size,
381
- offset = _ref18.offset,
382
- angleOffset = _ref18.angleOffset;
316
+ _ref18$curve = _ref18.curve,
317
+ curve = _ref18$curve === void 0 ? curveLinearClosed : _ref18$curve,
318
+ size = _ref18.size,
319
+ offset = _ref18.offset,
320
+ angleOffset = _ref18.angleOffset;
383
321
  scale.range([0, Math.min(size[0], size[1]) / 2 - offset]);
384
322
  return {
385
323
  d3: lineRadial().curve(curve).radius(function (d) {
@@ -389,16 +327,14 @@ _defineProperty(PolygonRoot, "defaultProps", function (_ref18) {
389
327
  })
390
328
  };
391
329
  });
392
-
393
330
  function PolygonLine(props) {
394
331
  var _ref3;
395
-
396
332
  var SPolygonLine = props.Element,
397
- styles = props.styles,
398
- d3 = props.d3,
399
- color = props.color,
400
- data = props.data,
401
- transparent = props.transparent;
333
+ styles = props.styles,
334
+ d3 = props.d3,
335
+ color = props.color,
336
+ data = props.data,
337
+ transparent = props.transparent;
402
338
  return _ref3 = sstyled(styles), /*#__PURE__*/React.createElement(SPolygonLine, _ref3.cn("SPolygonLine", {
403
339
  "render": "path",
404
340
  "d": d3(data),
@@ -406,28 +342,24 @@ function PolygonLine(props) {
406
342
  "transparent": transparent
407
343
  }));
408
344
  }
409
-
410
345
  function PolygonDots(props) {
411
346
  var SPolygonDot = props.Element,
412
- styles = props.styles,
413
- color = props.color,
414
- data = props.data,
415
- scale = props.scale,
416
- transparent = props.transparent,
417
- categoryKey = props.categoryKey,
418
- angleOffset = props.angleOffset;
347
+ styles = props.styles,
348
+ color = props.color,
349
+ data = props.data,
350
+ scale = props.scale,
351
+ transparent = props.transparent,
352
+ categoryKey = props.categoryKey,
353
+ angleOffset = props.angleOffset;
419
354
  return data.map(function (value, i) {
420
355
  var _ref4;
421
-
422
356
  if (value === null || value === undefined) return;
423
357
  var radius = scale(value);
424
358
  props.dataHintsHandler.describeGroupedValues(categoryKey, "".concat(categoryKey, ".").concat(i));
425
-
426
359
  var _getRadianPosition = getRadianPosition(i, radius, data.length, angleOffset),
427
- _getRadianPosition2 = _slicedToArray(_getRadianPosition, 2),
428
- cx = _getRadianPosition2[0],
429
- cy = _getRadianPosition2[1];
430
-
360
+ _getRadianPosition2 = _slicedToArray(_getRadianPosition, 2),
361
+ cx = _getRadianPosition2[0],
362
+ cy = _getRadianPosition2[1];
431
363
  return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SPolygonDot, _ref4.cn("SPolygonDot", {
432
364
  "key": i,
433
365
  "render": "circle",
@@ -438,40 +370,28 @@ function PolygonDots(props) {
438
370
  }));
439
371
  });
440
372
  }
441
-
442
373
  var AxisRoot = /*#__PURE__*/function (_Component3) {
443
374
  _inherits(AxisRoot, _Component3);
444
-
445
375
  var _super3 = _createSuper(AxisRoot);
446
-
447
376
  function AxisRoot() {
448
377
  var _this2;
449
-
450
378
  _classCallCheck(this, AxisRoot);
451
-
452
379
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
453
380
  args[_key2] = arguments[_key2];
454
381
  }
455
-
456
382
  _this2 = _super3.call.apply(_super3, [this].concat(args));
457
-
458
383
  _defineProperty(_assertThisInitialized(_this2), "unsubscribeTooltipVisible", null);
459
-
460
384
  _defineProperty(_assertThisInitialized(_this2), "state", {
461
385
  activeLineIndex: null
462
386
  });
463
-
464
387
  _defineProperty(_assertThisInitialized(_this2), "handlerTooltipVisible", function (visible, _ref15) {
465
388
  var index = _ref15.index;
466
-
467
389
  _this2.setState({
468
390
  activeLineIndex: index
469
391
  });
470
392
  });
471
-
472
393
  return _this2;
473
394
  }
474
-
475
395
  _createClass(AxisRoot, [{
476
396
  key: "createLineRadial",
477
397
  value: function createLineRadial(radius, total) {
@@ -485,13 +405,13 @@ var AxisRoot = /*#__PURE__*/function (_Component3) {
485
405
  key: "getTicksProps",
486
406
  value: function getTicksProps(_ref16) {
487
407
  var _ref16$tickSize = _ref16.tickSize,
488
- tickSize = _ref16$tickSize === void 0 ? 100 : _ref16$tickSize;
408
+ tickSize = _ref16$tickSize === void 0 ? 100 : _ref16$tickSize;
489
409
  var _this$asProps7 = this.asProps,
490
- data = _this$asProps7.data,
491
- offset = _this$asProps7.offset,
492
- categories = _this$asProps7.categories,
493
- size = _this$asProps7.size,
494
- type = _this$asProps7.type;
410
+ data = _this$asProps7.data,
411
+ offset = _this$asProps7.offset,
412
+ categories = _this$asProps7.categories,
413
+ size = _this$asProps7.size,
414
+ type = _this$asProps7.type;
495
415
  var radius = Math.min(size[0], size[1]) / 2 - offset;
496
416
  return {
497
417
  type: type,
@@ -506,12 +426,12 @@ var AxisRoot = /*#__PURE__*/function (_Component3) {
506
426
  key: "getLabelsProps",
507
427
  value: function getLabelsProps(_ref17) {
508
428
  var _ref17$labelOffset = _ref17.labelOffset,
509
- labelOffset = _ref17$labelOffset === void 0 ? 10 : _ref17$labelOffset;
429
+ labelOffset = _ref17$labelOffset === void 0 ? 10 : _ref17$labelOffset;
510
430
  var _this$asProps8 = this.asProps,
511
- offset = _this$asProps8.offset,
512
- categories = _this$asProps8.categories,
513
- textSize = _this$asProps8.textSize,
514
- angleOffset = _this$asProps8.angleOffset;
431
+ offset = _this$asProps8.offset,
432
+ categories = _this$asProps8.categories,
433
+ textSize = _this$asProps8.textSize,
434
+ angleOffset = _this$asProps8.angleOffset;
515
435
  return {
516
436
  categories: categories,
517
437
  textSize: textSize,
@@ -536,15 +456,14 @@ var AxisRoot = /*#__PURE__*/function (_Component3) {
536
456
  key: "render",
537
457
  value: function render() {
538
458
  var _ref5;
539
-
540
459
  var _this$asProps9 = this.asProps,
541
- SAxis = _this$asProps9.Element,
542
- styles = _this$asProps9.styles,
543
- categories = _this$asProps9.categories,
544
- size = _this$asProps9.size,
545
- offset = _this$asProps9.offset,
546
- type = _this$asProps9.type,
547
- angleOffset = _this$asProps9.angleOffset;
460
+ SAxis = _this$asProps9.Element,
461
+ styles = _this$asProps9.styles,
462
+ categories = _this$asProps9.categories,
463
+ size = _this$asProps9.size,
464
+ offset = _this$asProps9.offset,
465
+ type = _this$asProps9.type,
466
+ angleOffset = _this$asProps9.angleOffset;
548
467
  var activeLineIndex = this.state.activeLineIndex;
549
468
  var radius = Math.min(size[0], size[1]) / 2 - offset;
550
469
  var total = categories.length;
@@ -558,15 +477,13 @@ var AxisRoot = /*#__PURE__*/function (_Component3) {
558
477
  "d": this.createLineRadial(radius, total)(categories)
559
478
  })), categories.map(function (category, i) {
560
479
  var _getRadianPosition3 = getRadianPosition(i, radius, total, angleOffset),
561
- _getRadianPosition4 = _slicedToArray(_getRadianPosition3, 2),
562
- x = _getRadianPosition4[0],
563
- y = _getRadianPosition4[1];
564
-
480
+ _getRadianPosition4 = _slicedToArray(_getRadianPosition3, 2),
481
+ x = _getRadianPosition4[0],
482
+ y = _getRadianPosition4[1];
565
483
  var _sstyled$cn = sstyled(styles).cn('SAxisLine', {
566
- active: activeLineIndex === i
567
- }),
568
- className = _sstyled$cn.className;
569
-
484
+ active: activeLineIndex === i
485
+ }),
486
+ className = _sstyled$cn.className;
570
487
  return /*#__PURE__*/React.createElement("line", {
571
488
  key: i,
572
489
  x1: 0,
@@ -578,36 +495,30 @@ var AxisRoot = /*#__PURE__*/function (_Component3) {
578
495
  }));
579
496
  }
580
497
  }]);
581
-
582
498
  return AxisRoot;
583
499
  }(Component);
584
-
585
500
  _defineProperty(AxisRoot, "displayName", 'Polygon');
586
-
587
501
  _defineProperty(AxisRoot, "style", style);
588
-
589
502
  _defineProperty(AxisRoot, "defaultProps", function (_ref19) {
590
503
  var data = _ref19.data,
591
- dataKey = _ref19.dataKey;
504
+ dataKey = _ref19.dataKey;
592
505
  var categories = data[dataKey];
593
506
  return {
594
507
  categories: categories
595
508
  };
596
509
  });
597
-
598
510
  function AxisTicks(props) {
599
511
  var SAxisTick = props.Element,
600
- styles = props.styles,
601
- size = props.size,
602
- ticks = props.ticks,
603
- d3 = props.d3,
604
- categories = props.categories,
605
- offset = props.offset,
606
- type = props.type;
512
+ styles = props.styles,
513
+ size = props.size,
514
+ ticks = props.ticks,
515
+ d3 = props.d3,
516
+ categories = props.categories,
517
+ offset = props.offset,
518
+ type = props.type;
607
519
  var radius = Math.min(size[0], size[1]) / 2 - offset;
608
520
  return ticks.map(function (tick, i) {
609
521
  var _ref6;
610
-
611
522
  d3.radius(function () {
612
523
  return radius * tick;
613
524
  });
@@ -624,30 +535,26 @@ function AxisTicks(props) {
624
535
  }));
625
536
  });
626
537
  }
627
-
628
538
  function AxisLabels(props) {
629
539
  var SAxisLabel = props.Element,
630
- styles = props.styles,
631
- textSize = props.textSize,
632
- size = props.size,
633
- offset = props.offset,
634
- categories = props.categories,
635
- angleOffset = props.angleOffset;
540
+ styles = props.styles,
541
+ textSize = props.textSize,
542
+ size = props.size,
543
+ offset = props.offset,
544
+ categories = props.categories,
545
+ angleOffset = props.angleOffset;
636
546
  var radius = Math.min(size[0], size[1]) / 2 - offset;
637
547
  return categories.map(function (category, i) {
638
548
  var _getRadianPosition5 = getRadianPosition(i, radius, categories.length, angleOffset),
639
- _getRadianPosition6 = _slicedToArray(_getRadianPosition5, 2),
640
- x = _getRadianPosition6[0],
641
- y = _getRadianPosition6[1];
642
-
549
+ _getRadianPosition6 = _slicedToArray(_getRadianPosition5, 2),
550
+ x = _getRadianPosition6[0],
551
+ y = _getRadianPosition6[1];
643
552
  var _getLabelPlacement = getLabelPlacement(i, categories.length, angleOffset),
644
- _getLabelPlacement2 = _slicedToArray(_getLabelPlacement, 2),
645
- xDirection = _getLabelPlacement2[0],
646
- yDirection = _getLabelPlacement2[1];
647
-
553
+ _getLabelPlacement2 = _slicedToArray(_getLabelPlacement, 2),
554
+ xDirection = _getLabelPlacement2[0],
555
+ yDirection = _getLabelPlacement2[1];
648
556
  if (typeof category === 'string') {
649
557
  var _ref7;
650
-
651
558
  props.dataHintsHandler.labelKey('value', i, category);
652
559
  var lines = category.split('\n');
653
560
  return _ref7 = sstyled(styles), /*#__PURE__*/React.createElement(SAxisLabel, _ref7.cn("SAxisLabel", {
@@ -666,19 +573,16 @@ function AxisLabels(props) {
666
573
  }, lineText);
667
574
  }));
668
575
  }
669
-
670
576
  if ( /*#__PURE__*/React.isValidElement(category)) {
671
577
  var _category$props = category === null || category === void 0 ? void 0 : category.props,
672
- _category$props$width = _category$props.width,
673
- width = _category$props$width === void 0 ? 0 : _category$props$width,
674
- _category$props$heigh = _category$props.height,
675
- height = _category$props$heigh === void 0 ? 0 : _category$props$heigh;
676
-
578
+ _category$props$width = _category$props.width,
579
+ width = _category$props$width === void 0 ? 0 : _category$props$width,
580
+ _category$props$heigh = _category$props.height,
581
+ height = _category$props$heigh === void 0 ? 0 : _category$props$heigh;
677
582
  var _getLabelOffsetPositi = getLabelOffsetPosition(xDirection, yDirection, width, height),
678
- _getLabelOffsetPositi2 = _slicedToArray(_getLabelOffsetPositi, 2),
679
- xOffset = _getLabelOffsetPositi2[0],
680
- yOffset = _getLabelOffsetPositi2[1];
681
-
583
+ _getLabelOffsetPositi2 = _slicedToArray(_getLabelOffsetPositi, 2),
584
+ xOffset = _getLabelOffsetPositi2[0],
585
+ yOffset = _getLabelOffsetPositi2[1];
682
586
  return /*#__PURE__*/cloneElement(category, {
683
587
  key: i,
684
588
  x: x - xOffset,
@@ -687,50 +591,37 @@ function AxisLabels(props) {
687
591
  }
688
592
  });
689
593
  }
690
-
691
594
  var Hover = /*#__PURE__*/function (_Component4) {
692
595
  _inherits(Hover, _Component4);
693
-
694
596
  var _super4 = _createSuper(Hover);
695
-
696
597
  function Hover() {
697
598
  var _this3;
698
-
699
599
  _classCallCheck(this, Hover);
700
-
701
600
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
702
601
  args[_key3] = arguments[_key3];
703
602
  }
704
-
705
603
  _this3 = _super4.call.apply(_super4, [this].concat(args));
706
-
707
604
  _defineProperty(_assertThisInitialized(_this3), "state", {
708
605
  index: null
709
606
  });
710
-
711
607
  _defineProperty(_assertThisInitialized(_this3), "virtualElement", canUseDOM() ? document.createElement('div') : {});
712
-
713
608
  _defineProperty(_assertThisInitialized(_this3), "unsubscribeMouseMoveRoot", null);
714
-
715
609
  _defineProperty(_assertThisInitialized(_this3), "unsubscribeMouseLeaveRoot", null);
716
-
717
610
  _defineProperty(_assertThisInitialized(_this3), "handlerMouseMoveRoot", trottle(function (e) {
718
611
  var _this3$asProps = _this3.asProps,
719
- eventEmitter = _this3$asProps.eventEmitter,
720
- size = _this3$asProps.size,
721
- rootRef = _this3$asProps.rootRef;
612
+ eventEmitter = _this3$asProps.eventEmitter,
613
+ size = _this3$asProps.size,
614
+ rootRef = _this3$asProps.rootRef;
722
615
  var point = eventToPoint(e, rootRef.current);
723
616
  var diam = Math.min(size[0], size[1]);
724
617
  var centerX = point[0] - diam / 2;
725
618
  var centerY = point[1] - diam / 2;
726
619
  var clientX = e.clientX,
727
- clientY = e.clientY; // @ts-ignore
728
-
620
+ clientY = e.clientY;
621
+ // @ts-ignore
729
622
  _this3.virtualElement.getBoundingClientRect = _this3.generateGetBoundingClientRect(clientX, clientY);
730
623
  _this3.virtualElement[CONSTANT.VIRTUAL_ELEMENT] = true;
731
-
732
624
  var index = _this3.getIndex([centerX, centerY]);
733
-
734
625
  _this3.setState({
735
626
  index: index
736
627
  }, function () {
@@ -739,7 +630,6 @@ var Hover = /*#__PURE__*/function (_Component4) {
739
630
  }, _this3.virtualElement);
740
631
  });
741
632
  }));
742
-
743
633
  _defineProperty(_assertThisInitialized(_this3), "handlerMouseLeaveRoot", trottle(function () {
744
634
  _this3.setState({
745
635
  index: null
@@ -749,10 +639,8 @@ var Hover = /*#__PURE__*/function (_Component4) {
749
639
  });
750
640
  });
751
641
  }));
752
-
753
642
  return _this3;
754
643
  }
755
-
756
644
  _createClass(Hover, [{
757
645
  key: "generateGetBoundingClientRect",
758
646
  value: function generateGetBoundingClientRect() {
@@ -773,41 +661,37 @@ var Hover = /*#__PURE__*/function (_Component4) {
773
661
  key: "getPolygon",
774
662
  value: function getPolygon(index) {
775
663
  var _this$asProps10 = this.asProps,
776
- categories = _this$asProps10.categories,
777
- size = _this$asProps10.size,
778
- offset = _this$asProps10.offset,
779
- angleOffset = _this$asProps10.angleOffset;
664
+ categories = _this$asProps10.categories,
665
+ size = _this$asProps10.size,
666
+ offset = _this$asProps10.offset,
667
+ angleOffset = _this$asProps10.angleOffset;
780
668
  var total = categories.length;
781
669
  var diam = Math.min(size[0], size[1]);
782
670
  var radius = diam / 2 - offset;
783
671
  var prevIndex = (index - 1 + total) % total;
784
672
  var nextIndex = (index + 1 + total) % total;
785
-
786
673
  var _getRadianPosition7 = getRadianPosition(prevIndex, radius, total, angleOffset),
787
- _getRadianPosition8 = _slicedToArray(_getRadianPosition7, 2),
788
- prevX1 = _getRadianPosition8[0],
789
- prevY1 = _getRadianPosition8[1];
790
-
674
+ _getRadianPosition8 = _slicedToArray(_getRadianPosition7, 2),
675
+ prevX1 = _getRadianPosition8[0],
676
+ prevY1 = _getRadianPosition8[1];
791
677
  var _getRadianPosition9 = getRadianPosition(index, radius, total, angleOffset),
792
- _getRadianPosition10 = _slicedToArray(_getRadianPosition9, 2),
793
- x = _getRadianPosition10[0],
794
- y = _getRadianPosition10[1];
795
-
678
+ _getRadianPosition10 = _slicedToArray(_getRadianPosition9, 2),
679
+ x = _getRadianPosition10[0],
680
+ y = _getRadianPosition10[1];
796
681
  var _getRadianPosition11 = getRadianPosition(nextIndex, radius, total, angleOffset),
797
- _getRadianPosition12 = _slicedToArray(_getRadianPosition11, 2),
798
- nextX1 = _getRadianPosition12[0],
799
- nextY1 = _getRadianPosition12[1];
800
-
682
+ _getRadianPosition12 = _slicedToArray(_getRadianPosition11, 2),
683
+ nextX1 = _getRadianPosition12[0],
684
+ nextY1 = _getRadianPosition12[1];
801
685
  return [[0, 0], [(prevX1 + x) / 2, (prevY1 + y) / 2], [x, y], [(nextX1 + x) / 2, (nextY1 + y) / 2]];
802
686
  }
803
687
  }, {
804
688
  key: "getPie",
805
689
  value: function getPie(index) {
806
690
  var _this$asProps11 = this.asProps,
807
- categories = _this$asProps11.categories,
808
- size = _this$asProps11.size,
809
- offset = _this$asProps11.offset,
810
- angleOffset = _this$asProps11.angleOffset;
691
+ categories = _this$asProps11.categories,
692
+ size = _this$asProps11.size,
693
+ offset = _this$asProps11.offset,
694
+ angleOffset = _this$asProps11.angleOffset;
811
695
  var angle = Math.PI * 2 / categories.length;
812
696
  var radius = Math.min(size[0], size[1]) / 2 - offset;
813
697
  return [index * angle - angle / 2 - angleOffset, (index + 1) * angle - angle / 2 - angleOffset, radius];
@@ -816,12 +700,10 @@ var Hover = /*#__PURE__*/function (_Component4) {
816
700
  key: "getIndex",
817
701
  value: function getIndex(point) {
818
702
  var _this4 = this;
819
-
820
703
  var _this$asProps12 = this.asProps,
821
- categories = _this$asProps12.categories,
822
- type = _this$asProps12.type;
704
+ categories = _this$asProps12.categories,
705
+ type = _this$asProps12.type;
823
706
  var index;
824
-
825
707
  if (type === 'circle') {
826
708
  index = categories.findIndex(function (c, i) {
827
709
  return pieContains(_this4.getPie(i), point);
@@ -831,18 +713,15 @@ var Hover = /*#__PURE__*/function (_Component4) {
831
713
  return polygonContains(_this4.getPolygon(i), point);
832
714
  });
833
715
  }
834
-
835
716
  return index === -1 ? null : index;
836
717
  }
837
718
  }, {
838
719
  key: "componentDidMount",
839
720
  value: function componentDidMount() {
840
721
  var _this5 = this;
841
-
842
722
  var eventEmitter = this.asProps.eventEmitter;
843
723
  this.unsubscribeMouseMoveRoot = eventEmitter.subscribe('onMouseMoveRoot', function (e) {
844
724
  e.persist();
845
-
846
725
  _this5.handlerMouseMoveRoot(e);
847
726
  });
848
727
  this.unsubscribeMouseLeaveRoot = eventEmitter.subscribe('onMouseLeaveRoot', this.handlerMouseLeaveRoot);
@@ -853,7 +732,6 @@ var Hover = /*#__PURE__*/function (_Component4) {
853
732
  if (this.unsubscribeMouseMoveRoot) {
854
733
  this.unsubscribeMouseMoveRoot();
855
734
  }
856
-
857
735
  if (this.unsubscribeMouseLeaveRoot) {
858
736
  this.unsubscribeMouseLeaveRoot();
859
737
  }
@@ -862,21 +740,18 @@ var Hover = /*#__PURE__*/function (_Component4) {
862
740
  key: "render",
863
741
  value: function render() {
864
742
  var _this$asProps13 = this.asProps,
865
- styles = _this$asProps13.styles,
866
- type = _this$asProps13.type;
743
+ styles = _this$asProps13.styles,
744
+ type = _this$asProps13.type;
867
745
  var index = this.state.index;
868
746
  var SPieRect = this.Element;
869
-
870
747
  if (index !== null) {
871
748
  if (type === 'circle') {
872
749
  var _ref8;
873
-
874
750
  var _this$getPie = this.getPie(index),
875
- _this$getPie2 = _slicedToArray(_this$getPie, 3),
876
- startAngle = _this$getPie2[0],
877
- endAngle = _this$getPie2[1],
878
- radius = _this$getPie2[2];
879
-
751
+ _this$getPie2 = _slicedToArray(_this$getPie, 3),
752
+ startAngle = _this$getPie2[0],
753
+ endAngle = _this$getPie2[1],
754
+ radius = _this$getPie2[2];
880
755
  var circle = arc().innerRadius(0).outerRadius(radius).startAngle(startAngle).endAngle(endAngle);
881
756
  return _ref8 = sstyled(styles), /*#__PURE__*/React.createElement(SPieRect, _ref8.cn("SPieRect", {
882
757
  "render": "path",
@@ -884,21 +759,17 @@ var Hover = /*#__PURE__*/function (_Component4) {
884
759
  }));
885
760
  } else {
886
761
  var _ref9;
887
-
888
762
  return _ref9 = sstyled(styles), /*#__PURE__*/React.createElement(SPieRect, _ref9.cn("SPieRect", {
889
763
  "render": "path",
890
764
  "d": line()(this.getPolygon(index))
891
765
  }));
892
766
  }
893
767
  }
894
-
895
768
  return null;
896
769
  }
897
770
  }]);
898
-
899
771
  return Hover;
900
772
  }(Component);
901
-
902
773
  var Axis = createElement(AxisRoot, {
903
774
  Ticks: AxisTicks,
904
775
  Labels: AxisLabels