@semcore/d3-chart 16.5.0 → 17.0.0-prerelease.8

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 (439) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/lib/cjs/AnimatedClipPath.js +28 -41
  3. package/lib/cjs/AnimatedClipPath.js.map +1 -1
  4. package/lib/cjs/Area.js +187 -223
  5. package/lib/cjs/Area.js.map +1 -1
  6. package/lib/cjs/Axis.js +248 -327
  7. package/lib/cjs/Axis.js.map +1 -1
  8. package/lib/cjs/Bar.js +162 -185
  9. package/lib/cjs/Bar.js.map +1 -1
  10. package/lib/cjs/Bubble.js +219 -248
  11. package/lib/cjs/Bubble.js.map +1 -1
  12. package/lib/cjs/CompactHorizontalBar.js +448 -482
  13. package/lib/cjs/CompactHorizontalBar.js.map +1 -1
  14. package/lib/cjs/Donut.js +349 -396
  15. package/lib/cjs/Donut.js.map +1 -1
  16. package/lib/cjs/Dots.js +67 -86
  17. package/lib/cjs/Dots.js.map +1 -1
  18. package/lib/cjs/GroupBar.js +78 -93
  19. package/lib/cjs/GroupBar.js.map +1 -1
  20. package/lib/cjs/HorizontalBar.js +149 -167
  21. package/lib/cjs/HorizontalBar.js.map +1 -1
  22. package/lib/cjs/Hover.js +178 -207
  23. package/lib/cjs/Hover.js.map +1 -1
  24. package/lib/cjs/Line.js +182 -222
  25. package/lib/cjs/Line.js.map +1 -1
  26. package/lib/cjs/Pattern.js +124 -126
  27. package/lib/cjs/Pattern.js.map +1 -1
  28. package/lib/cjs/Plot.js +100 -126
  29. package/lib/cjs/Plot.js.map +1 -1
  30. package/lib/cjs/Radar.js +576 -681
  31. package/lib/cjs/Radar.js.map +1 -1
  32. package/lib/cjs/RadialTree.js +518 -571
  33. package/lib/cjs/RadialTree.js.map +1 -1
  34. package/lib/cjs/Reference.js +147 -178
  35. package/lib/cjs/Reference.js.map +1 -1
  36. package/lib/cjs/ResponsiveContainer.js +64 -82
  37. package/lib/cjs/ResponsiveContainer.js.map +1 -1
  38. package/lib/cjs/ScatterPlot.js +169 -199
  39. package/lib/cjs/ScatterPlot.js.map +1 -1
  40. package/lib/cjs/StackBar.js +135 -177
  41. package/lib/cjs/StackBar.js.map +1 -1
  42. package/lib/cjs/StackedArea.js +60 -73
  43. package/lib/cjs/StackedArea.js.map +1 -1
  44. package/lib/cjs/Tooltip.js +193 -208
  45. package/lib/cjs/Tooltip.js.map +1 -1
  46. package/lib/cjs/Venn.js +182 -217
  47. package/lib/cjs/Venn.js.map +1 -1
  48. package/lib/cjs/a11y/DataAccessibilityTable.js +45 -83
  49. package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
  50. package/lib/cjs/a11y/PlotA11yModule.js +37 -97
  51. package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
  52. package/lib/cjs/a11y/PlotA11yView.js +97 -91
  53. package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
  54. package/lib/cjs/a11y/bezier.js +17 -23
  55. package/lib/cjs/a11y/bezier.js.map +1 -1
  56. package/lib/cjs/a11y/focus.js +16 -16
  57. package/lib/cjs/a11y/focus.js.map +1 -1
  58. package/lib/cjs/a11y/hints.js +72 -75
  59. package/lib/cjs/a11y/hints.js.map +1 -1
  60. package/lib/cjs/a11y/insights.js +354 -525
  61. package/lib/cjs/a11y/insights.js.map +1 -1
  62. package/lib/cjs/a11y/intl.js +5 -5
  63. package/lib/cjs/a11y/intl.js.map +1 -1
  64. package/lib/cjs/a11y/locale.js +12 -19
  65. package/lib/cjs/a11y/locale.js.map +1 -1
  66. package/lib/cjs/a11y/serialize.js +164 -203
  67. package/lib/cjs/a11y/serialize.js.map +1 -1
  68. package/lib/cjs/a11y/summarize.js +7 -6
  69. package/lib/cjs/a11y/summarize.js.map +1 -1
  70. package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js +16 -16
  71. package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
  72. package/lib/cjs/a11y/translations/module/de.json +2 -2
  73. package/lib/cjs/a11y/translations/module/en.json +2 -2
  74. package/lib/cjs/a11y/translations/module/es.json +2 -2
  75. package/lib/cjs/a11y/translations/module/fr.json +2 -2
  76. package/lib/cjs/a11y/translations/module/it.json +2 -2
  77. package/lib/cjs/a11y/translations/module/ja.json +2 -2
  78. package/lib/cjs/a11y/translations/module/ko.json +2 -2
  79. package/lib/cjs/a11y/translations/module/nl.json +2 -2
  80. package/lib/cjs/a11y/translations/module/pl.json +2 -2
  81. package/lib/cjs/a11y/translations/module/pt.json +2 -2
  82. package/lib/cjs/a11y/translations/module/sv.json +2 -2
  83. package/lib/cjs/a11y/translations/module/tr.json +2 -2
  84. package/lib/cjs/a11y/translations/module/vi.json +2 -2
  85. package/lib/cjs/a11y/translations/module/zh.json +2 -2
  86. package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js +16 -16
  87. package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
  88. package/lib/cjs/color.js +1 -1
  89. package/lib/cjs/color.js.map +1 -1
  90. package/lib/cjs/component/Chart/AbstractChart.js +421 -466
  91. package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
  92. package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
  93. package/lib/cjs/component/Chart/AreaChart.js +97 -115
  94. package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
  95. package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
  96. package/lib/cjs/component/Chart/BarChart.js +229 -216
  97. package/lib/cjs/component/Chart/BarChart.js.map +1 -1
  98. package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
  99. package/lib/cjs/component/Chart/BubbleChart.js +114 -136
  100. package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
  101. package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
  102. package/lib/cjs/component/Chart/CigaretteChart.js +280 -305
  103. package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
  104. package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +76 -108
  105. package/lib/cjs/component/Chart/CompactHorizontalBarChart.js.map +1 -1
  106. package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  107. package/lib/cjs/component/Chart/DonutChart.js +80 -95
  108. package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
  109. package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
  110. package/lib/cjs/component/Chart/HistogramChart.js +126 -148
  111. package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
  112. package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
  113. package/lib/cjs/component/Chart/LineChart.js +95 -113
  114. package/lib/cjs/component/Chart/LineChart.js.map +1 -1
  115. package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
  116. package/lib/cjs/component/Chart/RadarChart.js +84 -110
  117. package/lib/cjs/component/Chart/RadarChart.js.map +1 -1
  118. package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
  119. package/lib/cjs/component/Chart/ScatterPlotChart.js +119 -143
  120. package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
  121. package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
  122. package/lib/cjs/component/Chart/VennChart.js +103 -122
  123. package/lib/cjs/component/Chart/VennChart.js.map +1 -1
  124. package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
  125. package/lib/cjs/component/Chart/index.js +2 -2
  126. package/lib/cjs/component/Chart/index.js.map +1 -1
  127. package/lib/cjs/component/ChartLegend/BaseLegend.js +72 -105
  128. package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
  129. package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
  130. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +58 -70
  131. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  132. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
  133. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +208 -221
  134. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  135. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
  136. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  137. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +63 -73
  138. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  139. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  140. package/lib/cjs/component/ChartLegend/index.js +4 -4
  141. package/lib/cjs/component/ChartLegend/index.js.map +1 -1
  142. package/lib/cjs/component/Cigarette/Cigarette.js +115 -129
  143. package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
  144. package/lib/cjs/component/StackGroupBar/StackGroupBar.js +107 -137
  145. package/lib/cjs/component/StackGroupBar/StackGroupBar.js.map +1 -1
  146. package/lib/cjs/component/SvgElement.js +7 -7
  147. package/lib/cjs/component/SvgElement.js.map +1 -1
  148. package/lib/cjs/createElement.js +66 -65
  149. package/lib/cjs/createElement.js.map +1 -1
  150. package/lib/cjs/index.js +62 -62
  151. package/lib/cjs/style/axis.shadow.css +3 -0
  152. package/lib/cjs/style/plot.shadow.css +1 -3
  153. package/lib/cjs/style/plotA11yModule.shadow.css +10 -11
  154. package/lib/cjs/style/plotA11yView.shadow.css +13 -26
  155. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +15 -15
  156. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
  157. package/lib/cjs/types/Axis.d.js.map +1 -1
  158. package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
  159. package/lib/cjs/types/Hover.d.js.map +1 -1
  160. package/lib/cjs/types/Line.d.js.map +1 -1
  161. package/lib/cjs/types/Plot.d.js.map +1 -1
  162. package/lib/cjs/types/Radar.d.js.map +1 -1
  163. package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
  164. package/lib/cjs/types/Tooltip.d.js.map +1 -1
  165. package/lib/cjs/types/Venn.d.js.map +1 -1
  166. package/lib/cjs/types/index.d.js +80 -80
  167. package/lib/cjs/types/index.d.js.map +1 -1
  168. package/lib/cjs/utils.js +122 -145
  169. package/lib/cjs/utils.js.map +1 -1
  170. package/lib/es6/AnimatedClipPath.js +24 -37
  171. package/lib/es6/AnimatedClipPath.js.map +1 -1
  172. package/lib/es6/Area.js +179 -215
  173. package/lib/es6/Area.js.map +1 -1
  174. package/lib/es6/Axis.js +242 -321
  175. package/lib/es6/Axis.js.map +1 -1
  176. package/lib/es6/Bar.js +154 -177
  177. package/lib/es6/Bar.js.map +1 -1
  178. package/lib/es6/Bubble.js +206 -235
  179. package/lib/es6/Bubble.js.map +1 -1
  180. package/lib/es6/CompactHorizontalBar.js +433 -467
  181. package/lib/es6/CompactHorizontalBar.js.map +1 -1
  182. package/lib/es6/Donut.js +337 -384
  183. package/lib/es6/Donut.js.map +1 -1
  184. package/lib/es6/Dots.js +60 -79
  185. package/lib/es6/Dots.js.map +1 -1
  186. package/lib/es6/GroupBar.js +74 -89
  187. package/lib/es6/GroupBar.js.map +1 -1
  188. package/lib/es6/HorizontalBar.js +141 -159
  189. package/lib/es6/HorizontalBar.js.map +1 -1
  190. package/lib/es6/Hover.js +174 -203
  191. package/lib/es6/Hover.js.map +1 -1
  192. package/lib/es6/Line.js +173 -213
  193. package/lib/es6/Line.js.map +1 -1
  194. package/lib/es6/Pattern.js +68 -74
  195. package/lib/es6/Pattern.js.map +1 -1
  196. package/lib/es6/Plot.js +95 -121
  197. package/lib/es6/Plot.js.map +1 -1
  198. package/lib/es6/Radar.js +554 -659
  199. package/lib/es6/Radar.js.map +1 -1
  200. package/lib/es6/RadialTree.js +500 -553
  201. package/lib/es6/RadialTree.js.map +1 -1
  202. package/lib/es6/Reference.js +140 -171
  203. package/lib/es6/Reference.js.map +1 -1
  204. package/lib/es6/ResponsiveContainer.js +58 -76
  205. package/lib/es6/ResponsiveContainer.js.map +1 -1
  206. package/lib/es6/ScatterPlot.js +161 -191
  207. package/lib/es6/ScatterPlot.js.map +1 -1
  208. package/lib/es6/StackBar.js +130 -172
  209. package/lib/es6/StackBar.js.map +1 -1
  210. package/lib/es6/StackedArea.js +56 -69
  211. package/lib/es6/StackedArea.js.map +1 -1
  212. package/lib/es6/Tooltip.js +183 -198
  213. package/lib/es6/Tooltip.js.map +1 -1
  214. package/lib/es6/Venn.js +169 -204
  215. package/lib/es6/Venn.js.map +1 -1
  216. package/lib/es6/a11y/DataAccessibilityTable.js +41 -80
  217. package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
  218. package/lib/es6/a11y/PlotA11yModule.js +35 -95
  219. package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
  220. package/lib/es6/a11y/PlotA11yView.js +89 -84
  221. package/lib/es6/a11y/PlotA11yView.js.map +1 -1
  222. package/lib/es6/a11y/bezier.js +16 -23
  223. package/lib/es6/a11y/bezier.js.map +1 -1
  224. package/lib/es6/a11y/focus.js +15 -16
  225. package/lib/es6/a11y/focus.js.map +1 -1
  226. package/lib/es6/a11y/hints.js +67 -73
  227. package/lib/es6/a11y/hints.js.map +1 -1
  228. package/lib/es6/a11y/insights.js +353 -524
  229. package/lib/es6/a11y/insights.js.map +1 -1
  230. package/lib/es6/a11y/intl.js +4 -5
  231. package/lib/es6/a11y/intl.js.map +1 -1
  232. package/lib/es6/a11y/locale.js +11 -18
  233. package/lib/es6/a11y/locale.js.map +1 -1
  234. package/lib/es6/a11y/serialize.js +162 -203
  235. package/lib/es6/a11y/serialize.js.map +1 -1
  236. package/lib/es6/a11y/summarize.js +6 -6
  237. package/lib/es6/a11y/summarize.js.map +1 -1
  238. package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js +15 -15
  239. package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
  240. package/lib/es6/a11y/translations/module/de.json +2 -2
  241. package/lib/es6/a11y/translations/module/en.json +2 -2
  242. package/lib/es6/a11y/translations/module/es.json +2 -2
  243. package/lib/es6/a11y/translations/module/fr.json +2 -2
  244. package/lib/es6/a11y/translations/module/it.json +2 -2
  245. package/lib/es6/a11y/translations/module/ja.json +2 -2
  246. package/lib/es6/a11y/translations/module/ko.json +2 -2
  247. package/lib/es6/a11y/translations/module/nl.json +2 -2
  248. package/lib/es6/a11y/translations/module/pl.json +2 -2
  249. package/lib/es6/a11y/translations/module/pt.json +2 -2
  250. package/lib/es6/a11y/translations/module/sv.json +2 -2
  251. package/lib/es6/a11y/translations/module/tr.json +2 -2
  252. package/lib/es6/a11y/translations/module/vi.json +2 -2
  253. package/lib/es6/a11y/translations/module/zh.json +2 -2
  254. package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js +15 -15
  255. package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
  256. package/lib/es6/color.js +1 -1
  257. package/lib/es6/color.js.map +1 -1
  258. package/lib/es6/component/Chart/AbstractChart.js +416 -462
  259. package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
  260. package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
  261. package/lib/es6/component/Chart/AreaChart.js +92 -111
  262. package/lib/es6/component/Chart/AreaChart.js.map +1 -1
  263. package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
  264. package/lib/es6/component/Chart/BarChart.js +225 -213
  265. package/lib/es6/component/Chart/BarChart.js.map +1 -1
  266. package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
  267. package/lib/es6/component/Chart/BubbleChart.js +109 -132
  268. package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
  269. package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
  270. package/lib/es6/component/Chart/CigaretteChart.js +276 -301
  271. package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
  272. package/lib/es6/component/Chart/CompactHorizontalBarChart.js +70 -103
  273. package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -1
  274. package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  275. package/lib/es6/component/Chart/DonutChart.js +74 -90
  276. package/lib/es6/component/Chart/DonutChart.js.map +1 -1
  277. package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
  278. package/lib/es6/component/Chart/HistogramChart.js +121 -144
  279. package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
  280. package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
  281. package/lib/es6/component/Chart/LineChart.js +90 -109
  282. package/lib/es6/component/Chart/LineChart.js.map +1 -1
  283. package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
  284. package/lib/es6/component/Chart/RadarChart.js +80 -107
  285. package/lib/es6/component/Chart/RadarChart.js.map +1 -1
  286. package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
  287. package/lib/es6/component/Chart/ScatterPlotChart.js +113 -138
  288. package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
  289. package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
  290. package/lib/es6/component/Chart/VennChart.js +97 -117
  291. package/lib/es6/component/Chart/VennChart.js.map +1 -1
  292. package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
  293. package/lib/es6/component/ChartLegend/BaseLegend.js +70 -104
  294. package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
  295. package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
  296. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +53 -65
  297. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  298. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
  299. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +198 -211
  300. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  301. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
  302. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  303. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +58 -68
  304. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  305. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  306. package/lib/es6/component/Cigarette/Cigarette.js +108 -122
  307. package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
  308. package/lib/es6/component/StackGroupBar/StackGroupBar.js +100 -130
  309. package/lib/es6/component/StackGroupBar/StackGroupBar.js.map +1 -1
  310. package/lib/es6/component/SvgElement.js +4 -5
  311. package/lib/es6/component/SvgElement.js.map +1 -1
  312. package/lib/es6/createElement.js +55 -54
  313. package/lib/es6/createElement.js.map +1 -1
  314. package/lib/es6/style/axis.shadow.css +3 -0
  315. package/lib/es6/style/plot.shadow.css +1 -3
  316. package/lib/es6/style/plotA11yModule.shadow.css +10 -11
  317. package/lib/es6/style/plotA11yView.shadow.css +13 -26
  318. package/lib/es6/translations/__intergalactic-dynamic-locales.js +14 -14
  319. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
  320. package/lib/es6/types/Axis.d.js.map +1 -1
  321. package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
  322. package/lib/es6/types/Hover.d.js.map +1 -1
  323. package/lib/es6/types/Line.d.js.map +1 -1
  324. package/lib/es6/types/Plot.d.js.map +1 -1
  325. package/lib/es6/types/Radar.d.js.map +1 -1
  326. package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
  327. package/lib/es6/types/Tooltip.d.js.map +1 -1
  328. package/lib/es6/types/Venn.d.js.map +1 -1
  329. package/lib/es6/utils.js +105 -144
  330. package/lib/es6/utils.js.map +1 -1
  331. package/lib/esm/AnimatedClipPath.mjs +24 -36
  332. package/lib/esm/Area.mjs +178 -149
  333. package/lib/esm/Axis.mjs +241 -242
  334. package/lib/esm/Bar.mjs +155 -137
  335. package/lib/esm/Bubble.mjs +205 -171
  336. package/lib/esm/CompactHorizontalBar.mjs +428 -383
  337. package/lib/esm/Donut.mjs +315 -266
  338. package/lib/esm/Dots.mjs +60 -49
  339. package/lib/esm/GroupBar.mjs +71 -75
  340. package/lib/esm/HorizontalBar.mjs +142 -120
  341. package/lib/esm/Hover.mjs +173 -163
  342. package/lib/esm/Line.mjs +174 -145
  343. package/lib/esm/Pattern.mjs +67 -63
  344. package/lib/esm/Plot.mjs +98 -95
  345. package/lib/esm/Radar.mjs +550 -498
  346. package/lib/esm/RadialTree.mjs +512 -416
  347. package/lib/esm/Reference.mjs +137 -122
  348. package/lib/esm/ResponsiveContainer.mjs +58 -69
  349. package/lib/esm/ScatterPlot.mjs +163 -162
  350. package/lib/esm/StackBar.mjs +126 -147
  351. package/lib/esm/StackedArea.mjs +53 -61
  352. package/lib/esm/Tooltip.mjs +185 -175
  353. package/lib/esm/Venn.mjs +170 -170
  354. package/lib/esm/a11y/DataAccessibilityTable.mjs +46 -73
  355. package/lib/esm/a11y/PlotA11yModule.mjs +37 -80
  356. package/lib/esm/a11y/PlotA11yView.mjs +99 -74
  357. package/lib/esm/a11y/bezier.mjs +16 -23
  358. package/lib/esm/a11y/focus.mjs +15 -16
  359. package/lib/esm/a11y/hints.mjs +65 -71
  360. package/lib/esm/a11y/insights.mjs +347 -495
  361. package/lib/esm/a11y/intl.mjs +4 -5
  362. package/lib/esm/a11y/locale.mjs +12 -14
  363. package/lib/esm/a11y/serialize.mjs +139 -152
  364. package/lib/esm/a11y/summarize.mjs +3 -3
  365. package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +1 -1
  366. package/lib/esm/a11y/translations/module/de.json.mjs +2 -4
  367. package/lib/esm/a11y/translations/module/en.json.mjs +2 -4
  368. package/lib/esm/a11y/translations/module/es.json.mjs +2 -4
  369. package/lib/esm/a11y/translations/module/fr.json.mjs +2 -4
  370. package/lib/esm/a11y/translations/module/it.json.mjs +2 -4
  371. package/lib/esm/a11y/translations/module/ja.json.mjs +2 -4
  372. package/lib/esm/a11y/translations/module/ko.json.mjs +2 -4
  373. package/lib/esm/a11y/translations/module/nl.json.mjs +2 -4
  374. package/lib/esm/a11y/translations/module/pl.json.mjs +2 -4
  375. package/lib/esm/a11y/translations/module/pt.json.mjs +2 -4
  376. package/lib/esm/a11y/translations/module/sv.json.mjs +2 -4
  377. package/lib/esm/a11y/translations/module/tr.json.mjs +2 -4
  378. package/lib/esm/a11y/translations/module/vi.json.mjs +2 -4
  379. package/lib/esm/a11y/translations/module/zh.json.mjs +2 -4
  380. package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +1 -1
  381. package/lib/esm/color.mjs +1 -1
  382. package/lib/esm/component/Chart/AbstractChart.mjs +422 -415
  383. package/lib/esm/component/Chart/AreaChart.mjs +92 -91
  384. package/lib/esm/component/Chart/BarChart.mjs +225 -177
  385. package/lib/esm/component/Chart/BubbleChart.mjs +110 -118
  386. package/lib/esm/component/Chart/CigaretteChart.mjs +277 -268
  387. package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +70 -87
  388. package/lib/esm/component/Chart/DonutChart.mjs +74 -84
  389. package/lib/esm/component/Chart/HistogramChart.mjs +121 -117
  390. package/lib/esm/component/Chart/LineChart.mjs +90 -89
  391. package/lib/esm/component/Chart/RadarChart.mjs +81 -97
  392. package/lib/esm/component/Chart/ScatterPlotChart.mjs +113 -111
  393. package/lib/esm/component/Chart/VennChart.mjs +98 -111
  394. package/lib/esm/component/ChartLegend/BaseLegend.mjs +75 -97
  395. package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +54 -55
  396. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +194 -165
  397. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +1 -1
  398. package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +60 -58
  399. package/lib/esm/component/Cigarette/Cigarette.mjs +109 -99
  400. package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +97 -111
  401. package/lib/esm/component/SvgElement.mjs +4 -4
  402. package/lib/esm/createElement.mjs +54 -37
  403. package/lib/esm/style/axis.shadow.css +3 -0
  404. package/lib/esm/style/plot.shadow.css +1 -3
  405. package/lib/esm/style/plotA11yModule.shadow.css +10 -11
  406. package/lib/esm/style/plotA11yView.shadow.css +13 -26
  407. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
  408. package/lib/esm/utils.mjs +103 -138
  409. package/lib/types/Axis.d.ts +4 -0
  410. package/lib/types/CompactHorizontalBar.d.ts +1 -1
  411. package/lib/types/Hover.d.ts +1 -1
  412. package/lib/types/Line.d.ts +1 -1
  413. package/lib/types/Plot.d.ts +1 -1
  414. package/lib/types/Radar.d.ts +1 -1
  415. package/lib/types/ResponsiveContainer.d.ts +1 -1
  416. package/lib/types/Tooltip.d.ts +1 -3
  417. package/lib/types/Venn.d.ts +1 -1
  418. package/lib/types/a11y/PlotA11yModule.d.ts +4 -11
  419. package/lib/types/a11y/PlotA11yView.d.ts +12 -1
  420. package/lib/types/a11y/translations/module/__intergalactic-dynamic-locales.d.ts +14 -14
  421. package/lib/types/component/Chart/AbstractChart.d.ts +1 -1
  422. package/lib/types/component/Chart/AbstractChart.type.d.ts +1 -1
  423. package/lib/types/component/Chart/AreaChart.type.d.ts +1 -1
  424. package/lib/types/component/Chart/BarChart.type.d.ts +1 -1
  425. package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
  426. package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
  427. package/lib/types/component/Chart/DonutChart.type.d.ts +1 -1
  428. package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -1
  429. package/lib/types/component/Chart/LineChart.type.d.ts +1 -1
  430. package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
  431. package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
  432. package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
  433. package/lib/types/component/ChartLegend/BaseLegend.d.ts +1 -1
  434. package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -1
  435. package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +1 -1
  436. package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +1 -1
  437. package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +1 -1
  438. package/lib/types/utils.d.ts +10 -10
  439. package/package.json +11 -14
@@ -1,14 +1,5 @@
1
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
5
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
6
- import _createClass from "@babel/runtime/helpers/createClass";
7
- import _callSuper from "@babel/runtime/helpers/callSuper";
8
- import _inherits from "@babel/runtime/helpers/inherits";
9
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
2
  import { sstyled as _sstyled } from "@semcore/core";
11
- var _excluded = ["data"];
12
3
  import { Component, sstyled } from '@semcore/core';
13
4
  import assignProps from '@semcore/core/lib/utils/assignProps';
14
5
  import canUseDOM from '@semcore/core/lib/utils/canUseDOM';
@@ -19,257 +10,199 @@ import React from 'react';
19
10
  import createElement from './createElement';
20
11
  import { PatternSymbol, getPatternSymbolSize } from './Pattern';
21
12
  /*!__reshadow-styles__:"./style/radial-tree.shadow.css"*/
22
- var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SRadian_1sbqs_gg_{cursor:pointer;fill:var(--intergalactic-text-large-info, #008ff8)}.___SLine_1sbqs_gg_{stroke:var(--intergalactic-text-large-info, #008ff8)}.___SLine_1sbqs_gg_.__stroke_1sbqs_gg_{stroke:var(--stroke_1sbqs)}.___SLine_1sbqs_gg_.__transparent_1sbqs_gg_{opacity:.3}.___SCap_1sbqs_gg_{transition:r .1s}.___SCap_1sbqs_gg_.__pattern_1sbqs_gg_{stroke:var(--intergalactic-chart-grid-border, #ffffff);stroke-width:1px}.___SCap_1sbqs_gg_.__transparent_1sbqs_gg_,.___SIcon_1sbqs_gg_.__transparent_1sbqs_gg_,.___SLabel_1sbqs_gg_.__transparent_1sbqs_gg_{opacity:.3}.___SLabel_1sbqs_gg_{fill:var(--color_1sbqs)}@media (hover:hover){.___SRadian_1sbqs_gg_:hover .___SLabel_1sbqs_gg_{cursor:pointer;filter:brightness(.6)}}@media (prefers-reduced-motion){.___SLineCap_1sbqs_gg_{transition:none}}", /*__inner_css_end__*/"1sbqs_gg_"),
13
+ const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SRadian_56jyw_gg_{cursor:pointer;fill:var(--intergalactic-text-large-info, #008ff8)}.___SLine_56jyw_gg_{stroke:var(--intergalactic-text-large-info, #008ff8)}.___SLine_56jyw_gg_.__stroke_56jyw_gg_{stroke:var(--stroke_56jyw)}.___SLine_56jyw_gg_.__transparent_56jyw_gg_{opacity:.3}.___SCap_56jyw_gg_{transition:r .1s}.___SCap_56jyw_gg_.__pattern_56jyw_gg_{stroke:var(--intergalactic-chart-grid-border, #ffffff);stroke-width:1px}.___SCap_56jyw_gg_.__transparent_56jyw_gg_,.___SIcon_56jyw_gg_.__transparent_56jyw_gg_,.___SLabel_56jyw_gg_.__transparent_56jyw_gg_{opacity:.3}.___SLabel_56jyw_gg_{fill:var(--color_56jyw)}@media (hover:hover){.___SRadian_56jyw_gg_:hover .___SLabel_56jyw_gg_{cursor:pointer;filter:brightness(.6)}}@media (prefers-reduced-motion){.___SLineCap_56jyw_gg_{transition:none}}", /*__inner_css_end__*/"56jyw_gg_"),
23
14
  /*__reshadow_css_end__*/
24
15
  {
25
- "__SRadian": "___SRadian_1sbqs_gg_",
26
- "__SLine": "___SLine_1sbqs_gg_",
27
- "_stroke": "__stroke_1sbqs_gg_",
28
- "--stroke": "--stroke_1sbqs",
29
- "_transparent": "__transparent_1sbqs_gg_",
30
- "__SCap": "___SCap_1sbqs_gg_",
31
- "_pattern": "__pattern_1sbqs_gg_",
32
- "__SIcon": "___SIcon_1sbqs_gg_",
33
- "__SLabel": "___SLabel_1sbqs_gg_",
34
- "--color": "--color_1sbqs",
35
- "__SLineCap": "___SLineCap_1sbqs_gg_"
16
+ "__SRadian": "___SRadian_56jyw_gg_",
17
+ "__SLine": "___SLine_56jyw_gg_",
18
+ "_stroke": "__stroke_56jyw_gg_",
19
+ "--stroke": "--stroke_56jyw",
20
+ "_transparent": "__transparent_56jyw_gg_",
21
+ "__SCap": "___SCap_56jyw_gg_",
22
+ "_pattern": "__pattern_56jyw_gg_",
23
+ "__SIcon": "___SIcon_56jyw_gg_",
24
+ "__SLabel": "___SLabel_56jyw_gg_",
25
+ "--color": "--color_56jyw",
26
+ "__SLineCap": "___SLineCap_56jyw_gg_"
36
27
  });
37
28
  import { getChartDefaultColorName, measureText } from './utils';
38
- var baseAngle = -Math.PI / 2; // The top vertical line
29
+ const baseAngle = -Math.PI / 2; // The top vertical line
39
30
 
40
31
  /** @deprecated */
41
- var RadialTreeBase = /*#__PURE__*/function (_Component) {
42
- function RadialTreeBase(props) {
43
- var _this;
44
- _classCallCheck(this, RadialTreeBase);
45
- _this = _callSuper(this, RadialTreeBase, [props]);
46
- _defineProperty(_this, "Element", void 0);
47
- _this.handleRadianClick = _this.handleRadianClick.bind(_this);
48
- return _this;
32
+
33
+ class RadialTreeBase extends Component {
34
+ constructor(props) {
35
+ super(props);
36
+ _defineProperty(this, "Element", void 0);
37
+ this.handleRadianClick = this.handleRadianClick.bind(this);
49
38
  }
50
- _inherits(RadialTreeBase, _Component);
51
- return _createClass(RadialTreeBase, [{
52
- key: "uncontrolledProps",
53
- value: function uncontrolledProps() {
54
- return {
55
- activeKey: null
56
- };
57
- }
58
- }, {
59
- key: "runAppearAnimation",
60
- value: function runAppearAnimation() {
61
- var _window$matchMedia;
62
- var _this$asProps = this.asProps,
63
- duration = _this$asProps.duration,
64
- uid = _this$asProps.uid;
65
- if (!canUseDOM()) return;
66
- var preferReduceMotion = (_window$matchMedia = window.matchMedia('(prefers-reduced-motion: reduce)')) === null || _window$matchMedia === void 0 ? void 0 : _window$matchMedia.matches;
39
+ uncontrolledProps() {
40
+ return {
41
+ activeKey: null
42
+ };
43
+ }
44
+ runAppearAnimation() {
45
+ const {
46
+ duration,
47
+ uid
48
+ } = this.asProps;
49
+ if (!canUseDOM()) return;
50
+ const preferReduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)')?.matches;
67
51
 
68
- /** using `!(>)` instead of `<=` to get true on Number.NaN and non numbers stuff */
69
- if (!(duration > 0)) return;
70
- if (preferReduceMotion) return;
71
- var circlesAnimation = transition().selection().selectAll("[data-radial-animation=".concat(uid, "-cap-circle]")).interrupt();
72
- var iconsAnimation = transition().selection().selectAll("[data-radial-animation=".concat(uid, "-cap-icon]")).interrupt();
73
- var linesAnimation = transition().selection().selectAll("[data-radial-animation=".concat(uid, "-line]")).interrupt();
74
- var labelsAnimation = transition().selection().selectAll("[data-radial-animation=".concat(uid, "-label]")).interrupt();
75
- var circlesNodes = circlesAnimation.nodes();
76
- var iconsNodes = iconsAnimation.nodes();
77
- var linesNodes = linesAnimation.nodes();
78
- var labelsNodes = linesAnimation.nodes();
79
- if (circlesNodes.length > 0) {
80
- var attrs = circlesNodes.map(function (node) {
81
- var _lineNode$x, _lineNode$y;
82
- var radianIndex = Number.parseInt(node.dataset.radianIndex, 10);
83
- var lineNode = linesNodes[radianIndex];
84
- return {
85
- from: {
86
- cx: (_lineNode$x = lineNode.x1) === null || _lineNode$x === void 0 || (_lineNode$x = _lineNode$x.baseVal) === null || _lineNode$x === void 0 ? void 0 : _lineNode$x.value,
87
- cy: (_lineNode$y = lineNode.y1) === null || _lineNode$y === void 0 || (_lineNode$y = _lineNode$y.baseVal) === null || _lineNode$y === void 0 ? void 0 : _lineNode$y.value
88
- },
89
- to: {
90
- cx: node.dataset['cx'],
91
- cy: node.dataset['cy']
92
- }
93
- };
94
- });
95
- circlesAnimation.attr('opacity', 0).attr('cx', function (_, index) {
96
- var _attrs$index$from;
97
- return (_attrs$index$from = attrs[index].from) === null || _attrs$index$from === void 0 ? void 0 : _attrs$index$from.cx;
98
- }).attr('cy', function (_, index) {
99
- var _attrs$index$from2;
100
- return (_attrs$index$from2 = attrs[index].from) === null || _attrs$index$from2 === void 0 ? void 0 : _attrs$index$from2.cy;
101
- }).transition().duration(duration).attr('opacity', 1)
102
- // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
103
- .attr('cx', function (_, index) {
104
- var _attrs$index$to;
105
- return (_attrs$index$to = attrs[index].to) === null || _attrs$index$to === void 0 ? void 0 : _attrs$index$to.cx;
106
- })
107
- // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
108
- .attr('cy', function (_, index) {
109
- var _attrs$index$to2;
110
- return (_attrs$index$to2 = attrs[index].to) === null || _attrs$index$to2 === void 0 ? void 0 : _attrs$index$to2.cy;
111
- });
112
- }
113
- if (iconsNodes.length > 0) {
114
- var _attrs = iconsNodes.map(function (node) {
115
- var _node$width, _node$height, _lineNode$x2, _lineNode$y2;
116
- var width = (_node$width = node.width) === null || _node$width === void 0 || (_node$width = _node$width.baseVal) === null || _node$width === void 0 ? void 0 : _node$width.value;
117
- var height = (_node$height = node.height) === null || _node$height === void 0 || (_node$height = _node$height.baseVal) === null || _node$height === void 0 ? void 0 : _node$height.value;
118
- var radianIndex = Number.parseInt(node.dataset.radianIndex, 10);
119
- var lineNode = linesNodes[radianIndex];
120
- return {
121
- from: {
122
- x: ((_lineNode$x2 = lineNode.x1) === null || _lineNode$x2 === void 0 || (_lineNode$x2 = _lineNode$x2.baseVal) === null || _lineNode$x2 === void 0 ? void 0 : _lineNode$x2.value) - width / 2,
123
- y: ((_lineNode$y2 = lineNode.y1) === null || _lineNode$y2 === void 0 || (_lineNode$y2 = _lineNode$y2.baseVal) === null || _lineNode$y2 === void 0 ? void 0 : _lineNode$y2.value) - height / 2
124
- },
125
- to: {
126
- x: node.dataset['x'],
127
- y: node.dataset['y']
128
- }
129
- };
130
- });
131
- iconsAnimation.attr('opacity', 0)
132
- // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
133
- .attr('x', function (_, index) {
134
- var _attrs$index$from3;
135
- return (_attrs$index$from3 = _attrs[index].from) === null || _attrs$index$from3 === void 0 ? void 0 : _attrs$index$from3.x;
136
- })
137
- // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
138
- .attr('y', function (_, index) {
139
- var _attrs$index$from4;
140
- return (_attrs$index$from4 = _attrs[index].from) === null || _attrs$index$from4 === void 0 ? void 0 : _attrs$index$from4.y;
141
- }).transition().duration(duration).attr('opacity', 1)
142
- // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
143
- .attr('x', function (_, index) {
144
- var _attrs$index$to3;
145
- return (_attrs$index$to3 = _attrs[index].to) === null || _attrs$index$to3 === void 0 ? void 0 : _attrs$index$to3.x;
146
- })
147
- // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
148
- .attr('y', function (_, index) {
149
- var _attrs$index$to4;
150
- return (_attrs$index$to4 = _attrs[index].to) === null || _attrs$index$to4 === void 0 ? void 0 : _attrs$index$to4.y;
151
- });
152
- }
153
- if (linesNodes.length > 0) {
154
- var _attrs2 = linesNodes.map(function (node) {
155
- var _node$x, _node$y;
156
- return {
157
- from: {
158
- x2: (_node$x = node.x1) === null || _node$x === void 0 || (_node$x = _node$x.baseVal) === null || _node$x === void 0 ? void 0 : _node$x.value,
159
- y2: (_node$y = node.y1) === null || _node$y === void 0 || (_node$y = _node$y.baseVal) === null || _node$y === void 0 ? void 0 : _node$y.value
160
- },
161
- to: {
162
- x2: node.dataset['x2'],
163
- y2: node.dataset['y2']
164
- }
165
- };
166
- });
167
- linesAnimation.attr('opacity', 0)
168
- // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
169
- .attr('x2', function (_, index) {
170
- var _attrs2$index$from;
171
- return (_attrs2$index$from = _attrs2[index].from) === null || _attrs2$index$from === void 0 ? void 0 : _attrs2$index$from.x2;
172
- })
173
- // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
174
- .attr('y2', function (_, index) {
175
- var _attrs2$index$from2;
176
- return (_attrs2$index$from2 = _attrs2[index].from) === null || _attrs2$index$from2 === void 0 ? void 0 : _attrs2$index$from2.y2;
177
- }).transition().duration(duration).attr('opacity', 1)
178
- // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
179
- .attr('x2', function (_, index) {
180
- var _attrs2$index$to;
181
- return (_attrs2$index$to = _attrs2[index].to) === null || _attrs2$index$to === void 0 ? void 0 : _attrs2$index$to.x2;
182
- })
183
- // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
184
- .attr('y2', function (_, index) {
185
- var _attrs2$index$to2;
186
- return (_attrs2$index$to2 = _attrs2[index].to) === null || _attrs2$index$to2 === void 0 ? void 0 : _attrs2$index$to2.y2;
187
- });
188
- }
189
- if (labelsNodes.length > 0) {
190
- labelsAnimation.attr('opacity', 0);
191
- labelsAnimation.transition().duration(duration).attr('opacity', 1);
192
- }
193
- }
194
- }, {
195
- key: "componentDidUpdate",
196
- value: function componentDidUpdate(prevProps) {
197
- if (prevProps.$rootProps.data !== this.asProps.data) {
198
- this.runAppearAnimation();
199
- }
200
- }
201
- }, {
202
- key: "componentDidMount",
203
- value: function componentDidMount() {
204
- this.runAppearAnimation();
205
- }
206
- }, {
207
- key: "handleRadianClick",
208
- value: function handleRadianClick(key) {
209
- var _this2 = this;
210
- return function (event) {
211
- var newKey = key !== _this2.asProps.activeKey ? key : null;
212
- _this2.handlers.activeKey(newKey, event);
213
- };
214
- }
215
- }, {
216
- key: "computeTextWidth",
217
- value: function computeTextWidth() {
218
- var _this$asProps2 = this.asProps,
219
- data = _this$asProps2.data,
220
- textSize = _this$asProps2.textSize;
221
- var widths = data.map(function (_ref0) {
222
- var label = _ref0.label;
223
- return measureText(label, textSize);
52
+ /** using `!(>)` instead of `<=` to get true on Number.NaN and non numbers stuff */
53
+ if (!(duration > 0)) return;
54
+ if (preferReduceMotion) return;
55
+ const circlesAnimation = transition().selection().selectAll(`[data-radial-animation=${uid}-cap-circle]`).interrupt();
56
+ const iconsAnimation = transition().selection().selectAll(`[data-radial-animation=${uid}-cap-icon]`).interrupt();
57
+ const linesAnimation = transition().selection().selectAll(`[data-radial-animation=${uid}-line]`).interrupt();
58
+ const labelsAnimation = transition().selection().selectAll(`[data-radial-animation=${uid}-label]`).interrupt();
59
+ const circlesNodes = circlesAnimation.nodes();
60
+ const iconsNodes = iconsAnimation.nodes();
61
+ const linesNodes = linesAnimation.nodes();
62
+ const labelsNodes = linesAnimation.nodes();
63
+ if (circlesNodes.length > 0) {
64
+ const attrs = circlesNodes.map(node => {
65
+ const radianIndex = Number.parseInt(node.dataset.radianIndex, 10);
66
+ const lineNode = linesNodes[radianIndex];
67
+ return {
68
+ from: {
69
+ cx: lineNode.x1?.baseVal?.value,
70
+ cy: lineNode.y1?.baseVal?.value
71
+ },
72
+ to: {
73
+ cx: node.dataset['cx'],
74
+ cy: node.dataset['cy']
75
+ }
76
+ };
224
77
  });
225
- return Math.max.apply(Math, _toConsumableArray(widths));
78
+ circlesAnimation.attr('opacity', 0).attr('cx', (_, index) => attrs[index].from?.cx).attr('cy', (_, index) => attrs[index].from?.cy).transition().duration(duration).attr('opacity', 1)
79
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
80
+ .attr('cx', (_, index) => attrs[index].to?.cx)
81
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
82
+ .attr('cy', (_, index) => attrs[index].to?.cy);
226
83
  }
227
- }, {
228
- key: "getTitleProps",
229
- value: function getTitleProps() {
230
- var _this$asProps3 = this.asProps,
231
- uid = _this$asProps3.uid,
232
- size = _this$asProps3.size,
233
- textSize = _this$asProps3.textSize;
234
- var _size = _slicedToArray(size, 2),
235
- width = _size[0],
236
- height = _size[1];
237
- var center = [width / 2, height / 2];
238
- var x = center[0],
239
- y = center[1];
240
- return _defineProperty({
241
- x: x,
242
- y: y,
243
- textSize: textSize * 1.5
244
- }, 'data-radial-animation', "".concat(uid, "-label"));
84
+ if (iconsNodes.length > 0) {
85
+ const attrs = iconsNodes.map(node => {
86
+ const width = node.width?.baseVal?.value;
87
+ const height = node.height?.baseVal?.value;
88
+ const radianIndex = Number.parseInt(node.dataset.radianIndex, 10);
89
+ const lineNode = linesNodes[radianIndex];
90
+ return {
91
+ from: {
92
+ x: lineNode.x1?.baseVal?.value - width / 2,
93
+ y: lineNode.y1?.baseVal?.value - height / 2
94
+ },
95
+ to: {
96
+ x: node.dataset['x'],
97
+ y: node.dataset['y']
98
+ }
99
+ };
100
+ });
101
+ iconsAnimation.attr('opacity', 0)
102
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
103
+ .attr('x', (_, index) => attrs[index].from?.x)
104
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
105
+ .attr('y', (_, index) => attrs[index].from?.y).transition().duration(duration).attr('opacity', 1)
106
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
107
+ .attr('x', (_, index) => attrs[index].to?.x)
108
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
109
+ .attr('y', (_, index) => attrs[index].to?.y);
245
110
  }
246
- }, {
247
- key: "getRadianProps",
248
- value: function getRadianProps() {
249
- var _this$asProps4 = this.asProps,
250
- data = _this$asProps4.data,
251
- restRootProps = _objectWithoutProperties(_this$asProps4, _excluded);
252
- var textWidth = this.computeTextWidth();
253
- return _objectSpread(_objectSpread({}, restRootProps), {}, {
254
- radiansCount: data.length,
255
- data: data,
256
- textWidth: textWidth,
257
- onRadianClick: this.handleRadianClick
111
+ if (linesNodes.length > 0) {
112
+ const attrs = linesNodes.map(node => {
113
+ return {
114
+ from: {
115
+ x2: node.x1?.baseVal?.value,
116
+ y2: node.y1?.baseVal?.value
117
+ },
118
+ to: {
119
+ x2: node.dataset['x2'],
120
+ y2: node.dataset['y2']
121
+ }
122
+ };
258
123
  });
124
+ linesAnimation.attr('opacity', 0)
125
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
126
+ .attr('x2', (_, index) => attrs[index].from?.x2)
127
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
128
+ .attr('y2', (_, index) => attrs[index].from?.y2).transition().duration(duration).attr('opacity', 1)
129
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
130
+ .attr('x2', (_, index) => attrs[index].to?.x2)
131
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
132
+ .attr('y2', (_, index) => attrs[index].to?.y2);
259
133
  }
260
- }, {
261
- key: "render",
262
- value: function render() {
263
- var _ref;
264
- var SRadialTree = this.Element;
265
- var Children = this.asProps.Children;
266
- this.asProps.dataHintsHandler.establishDataType('values-set');
267
- return _ref = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SRadialTree, _ref.cn("SRadialTree", {
268
- "render": 'g'
269
- }), /*#__PURE__*/React.createElement(Children, _ref.cn("Children", {})));
134
+ if (labelsNodes.length > 0) {
135
+ labelsAnimation.attr('opacity', 0);
136
+ labelsAnimation.transition().duration(duration).attr('opacity', 1);
270
137
  }
271
- }]);
272
- }(Component);
138
+ }
139
+ componentDidUpdate(prevProps) {
140
+ if (prevProps.$rootProps.data !== this.asProps.data) {
141
+ this.runAppearAnimation();
142
+ }
143
+ }
144
+ componentDidMount() {
145
+ this.runAppearAnimation();
146
+ }
147
+ handleRadianClick(key) {
148
+ return event => {
149
+ const newKey = key !== this.asProps.activeKey ? key : null;
150
+ this.handlers.activeKey(newKey, event);
151
+ };
152
+ }
153
+ computeTextWidth() {
154
+ const {
155
+ data,
156
+ textSize
157
+ } = this.asProps;
158
+ const widths = data.map(({
159
+ label
160
+ }) => measureText(label, textSize));
161
+ return Math.max(...widths);
162
+ }
163
+ getTitleProps() {
164
+ const {
165
+ uid,
166
+ size,
167
+ textSize
168
+ } = this.asProps;
169
+ const [width, height] = size;
170
+ const center = [width / 2, height / 2];
171
+ const [x, y] = center;
172
+ return {
173
+ x,
174
+ y,
175
+ textSize: textSize * 1.5,
176
+ ['data-radial-animation']: `${uid}-label`
177
+ };
178
+ }
179
+ getRadianProps() {
180
+ const {
181
+ data,
182
+ ...restRootProps
183
+ } = this.asProps;
184
+ const textWidth = this.computeTextWidth();
185
+ return {
186
+ ...restRootProps,
187
+ radiansCount: data.length,
188
+ data,
189
+ textWidth,
190
+ onRadianClick: this.handleRadianClick
191
+ };
192
+ }
193
+ render() {
194
+ var _ref;
195
+ const SRadialTree = this.Element;
196
+ const {
197
+ Children
198
+ } = this.asProps;
199
+ this.asProps.dataHintsHandler.establishDataType('values-set');
200
+ return _ref = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SRadialTree, _ref.cn("SRadialTree", {
201
+ "render": 'g'
202
+ }), /*#__PURE__*/React.createElement(Children, _ref.cn("Children", {})));
203
+ }
204
+ }
205
+
273
206
  /** @deprecated */
274
207
  _defineProperty(RadialTreeBase, "displayName", 'RadialTree');
275
208
  _defineProperty(RadialTreeBase, "style", style);
@@ -285,227 +218,242 @@ _defineProperty(RadialTreeBase, "defaultProps", {
285
218
  textSize: 14,
286
219
  defaultActiveKey: null
287
220
  });
288
- var RadialTreeRadian = /*#__PURE__*/function (_Component2) {
289
- function RadialTreeRadian(props) {
290
- var _this3;
291
- _classCallCheck(this, RadialTreeRadian);
292
- _this3 = _callSuper(this, RadialTreeRadian, [props]);
293
- _defineProperty(_this3, "Element", void 0);
294
- _this3.renderRadian = _this3.renderRadian.bind(_this3);
295
- return _this3;
221
+ class RadialTreeRadian extends Component {
222
+ constructor(props) {
223
+ super(props);
224
+ _defineProperty(this, "Element", void 0);
225
+ this.renderRadian = this.renderRadian.bind(this);
296
226
  }
297
- _inherits(RadialTreeRadian, _Component2);
298
- return _createClass(RadialTreeRadian, [{
299
- key: "getInteractiveAreaProps",
300
- value: function getInteractiveAreaProps(_ref10, index) {
301
- var _$rootProps$data;
302
- var $rootProps = _ref10.$rootProps;
303
- var data = (_$rootProps$data = $rootProps.data) === null || _$rootProps$data === void 0 ? void 0 : _$rootProps$data[index];
304
- var _this$computeRadianPo = this.computeRadianPosition(data, index),
305
- xStart = _this$computeRadianPo.xStart,
306
- yStart = _this$computeRadianPo.yStart,
307
- xLabelCenter = _this$computeRadianPo.xLabelCenter,
308
- yLabelCenter = _this$computeRadianPo.yLabelCenter,
309
- capSize = _this$computeRadianPo.capSize;
310
- return {
311
- x1: xStart,
312
- y1: yStart,
313
- x2: xLabelCenter,
314
- y2: yLabelCenter,
315
- strokeWidth: capSize * 3
316
- };
317
- }
318
- }, {
319
- key: "getLineProps",
320
- value: function getLineProps(_ref11, index) {
321
- var _$rootProps$data2, _color;
322
- var $rootProps = _ref11.$rootProps;
323
- var data = (_$rootProps$data2 = $rootProps.data) === null || _$rootProps$data2 === void 0 ? void 0 : _$rootProps$data2[index];
324
- var _this$computeRadianPo2 = this.computeRadianPosition(data, index),
325
- xStart = _this$computeRadianPo2.xStart,
326
- yStart = _this$computeRadianPo2.yStart,
327
- xEnd = _this$computeRadianPo2.xEnd,
328
- yEnd = _this$computeRadianPo2.yEnd;
329
- var _this$asProps5 = this.asProps,
330
- uid = _this$asProps5.uid,
331
- transparent = _this$asProps5.transparent,
332
- resolveColor = _this$asProps5.resolveColor;
333
- var color = (_color = data.color) !== null && _color !== void 0 ? _color : this.asProps.color;
334
- return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
335
- x1: xStart,
336
- y1: yStart,
337
- x2: xEnd,
338
- y2: yEnd,
339
- stroke: color,
340
- resolveColor: resolveColor,
341
- transparent: transparent
342
- }, 'data-x1', xStart), 'data-y1', yStart), 'data-x2', xEnd), 'data-y2', yEnd), 'data-radial-animation', "".concat(uid, "-line")), 'data-radian-index', index);
343
- }
344
- }, {
345
- key: "getCapProps",
346
- value: function getCapProps(_ref13, index) {
347
- var _$rootProps$data3, _color2;
348
- var $rootProps = _ref13.$rootProps;
349
- var data = (_$rootProps$data3 = $rootProps.data) === null || _$rootProps$data3 === void 0 ? void 0 : _$rootProps$data3[index];
350
- var _this$computeRadianPo3 = this.computeRadianPosition(data, index),
351
- xEnd = _this$computeRadianPo3.xEnd,
352
- yEnd = _this$computeRadianPo3.yEnd,
353
- capSize = _this$computeRadianPo3.capSize;
354
- var _this$asProps6 = this.asProps,
355
- uid = _this$asProps6.uid,
356
- transparent = _this$asProps6.transparent,
357
- resolveColor = _this$asProps6.resolveColor,
358
- patterns = _this$asProps6.patterns;
359
- var color = (_color2 = data.color) !== null && _color2 !== void 0 ? _color2 : this.asProps.color;
360
- return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
361
- x: xEnd,
362
- y: yEnd
363
- }, 'data-cx', xEnd), 'data-cy', yEnd), "radius", capSize), "color", color), "resolveColor", resolveColor), "transparent", transparent), "patterns", patterns), "uid", "".concat(uid, "-cap-").concat(index)), 'data-radial-animation', "".concat(uid, "-cap-circle")), 'data-radian-index', index);
364
- }
365
- }, {
366
- key: "getIconProps",
367
- value: function getIconProps(_ref15, index) {
368
- var _$rootProps$data4, _iconColor, _iconSize, _icon;
369
- var $rootProps = _ref15.$rootProps;
370
- var data = (_$rootProps$data4 = $rootProps.data) === null || _$rootProps$data4 === void 0 ? void 0 : _$rootProps$data4[index];
371
- var _this$computeRadianPo4 = this.computeRadianPosition(data, index),
372
- xEnd = _this$computeRadianPo4.xEnd,
373
- yEnd = _this$computeRadianPo4.yEnd,
374
- isActive = _this$computeRadianPo4.isActive;
375
- var _this$asProps7 = this.asProps,
376
- uid = _this$asProps7.uid,
377
- resolveColor = _this$asProps7.resolveColor;
378
- var iconColor = (_iconColor = data.iconColor) !== null && _iconColor !== void 0 ? _iconColor : this.asProps.iconColor;
379
- var iconSize = (_iconSize = data.iconSize) !== null && _iconSize !== void 0 ? _iconSize : this.asProps.iconSize;
380
- var icon = (_icon = data.icon) !== null && _icon !== void 0 ? _icon : this.asProps.icon;
381
- var x = xEnd - iconSize / 2;
382
- var y = yEnd - iconSize / 2;
383
- return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
384
- x: x,
385
- y: y
386
- }, 'data-x', x), 'data-y', y), "iconSize", iconSize), "color", iconColor !== null && iconColor !== void 0 ? iconColor : '#fff'), "resolveColor", resolveColor), 'data-radial-animation', "".concat(uid, "-cap-icon")), 'data-radian-index', index), "icon", icon), "tag", icon), "isActive", isActive);
387
- }
388
- }, {
389
- key: "getLabelProps",
390
- value: function getLabelProps(_ref17, index) {
391
- var _$rootProps$data5, _color3;
392
- var $rootProps = _ref17.$rootProps;
393
- var data = (_$rootProps$data5 = $rootProps.data) === null || _$rootProps$data5 === void 0 ? void 0 : _$rootProps$data5[index];
394
- var _this$computeRadianPo5 = this.computeRadianPosition(data, index),
395
- xLabelCenter = _this$computeRadianPo5.xLabelCenter,
396
- yLabelCenter = _this$computeRadianPo5.yLabelCenter,
397
- labelAngle = _this$computeRadianPo5.labelAngle,
398
- isHorizontal = _this$computeRadianPo5.isHorizontal;
399
- var _this$asProps8 = this.asProps,
400
- uid = _this$asProps8.uid,
401
- textSize = _this$asProps8.textSize,
402
- transparent = _this$asProps8.transparent,
403
- resolveColor = _this$asProps8.resolveColor;
404
- var _ref18 = data,
405
- label = _ref18.label;
406
- var color = (_color3 = data.color) !== null && _color3 !== void 0 ? _color3 : this.asProps.color;
407
- return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
408
- x: xLabelCenter,
409
- y: yLabelCenter,
410
- angle: labelAngle
411
- }, 'data-radial-animation', "".concat(uid, "-label")), 'data-radian-index', index), "label", label), "color", color), "resolveColor", resolveColor), "isHorizontal", isHorizontal), "textSize", textSize), "transparent", transparent);
412
- }
413
- }, {
414
- key: "getRadianKey",
415
- value: function getRadianKey(data, index) {
416
- var _data$key;
417
- return (_data$key = data.key) !== null && _data$key !== void 0 ? _data$key : "radian-".concat(index);
418
- }
419
- }, {
420
- key: "computeRadianPosition",
421
- value: function computeRadianPosition(data, index) {
422
- var _data$capSize;
423
- var _this$asProps9 = this.asProps,
424
- centralMargin = _this$asProps9.centralMargin,
425
- labelMargin = _this$asProps9.labelMargin,
426
- angleOffset = _this$asProps9.angleOffset,
427
- activeKey = _this$asProps9.activeKey,
428
- size = _this$asProps9.size,
429
- radiansCount = _this$asProps9.radiansCount,
430
- textWidth = _this$asProps9.textWidth;
431
- var _size2 = _slicedToArray(size, 2),
432
- width = _size2[0],
433
- height = _size2[1];
434
- var key = this.getRadianKey(data, index);
435
- var isActive = activeKey === key;
436
- var baseCapSize = (_data$capSize = data.capSize) !== null && _data$capSize !== void 0 ? _data$capSize : this.asProps.capSize;
437
- var capSize = baseCapSize * (isActive ? 1 : 0.5);
438
- var minDemSize = Math.min(width, height) / 2;
439
- var length = Math.max(minDemSize - textWidth - baseCapSize - centralMargin - labelMargin * 2, 10);
440
- var angle = baseAngle + angleOffset + index / radiansCount * (Math.PI * 2);
441
- var isHorizontal = angle - baseAngle > 1 / 6 * Math.PI && angle - baseAngle < 5 / 6 * Math.PI || angle - baseAngle > 7 / 6 * Math.PI && angle - baseAngle < 11 / 6 * Math.PI;
442
- var topAngle = -Math.PI / 2;
443
- var labelAngle = (angle - topAngle) % Math.PI + topAngle;
444
- var center = [width / 2, height / 2];
445
- var xCenter = center[0],
446
- yCenter = center[1];
447
- var start = [xCenter + Math.cos(angle) * centralMargin, yCenter + Math.sin(angle) * centralMargin];
448
- var end = [xCenter + Math.cos(angle) * (centralMargin + length), yCenter + Math.sin(angle) * (centralMargin + length)];
449
- var xStart = start[0],
450
- yStart = start[1];
451
- var xEnd = end[0],
452
- yEnd = end[1];
453
- var labelCenter = [xCenter + Math.cos(angle) * (centralMargin + length + baseCapSize + textWidth / 2 + labelMargin), yCenter + Math.sin(angle) * (centralMargin + length + baseCapSize + textWidth / 2 + labelMargin)];
454
- var xLabelCenter = labelCenter[0],
455
- yLabelCenter = labelCenter[1];
456
- return {
457
- xStart: xStart,
458
- yStart: yStart,
459
- xEnd: xEnd,
460
- yEnd: yEnd,
461
- xLabelCenter: xLabelCenter,
462
- yLabelCenter: yLabelCenter,
463
- labelAngle: labelAngle,
464
- isHorizontal: isHorizontal,
465
- capSize: capSize,
466
- isActive: isActive
467
- };
227
+ getInteractiveAreaProps({
228
+ $rootProps
229
+ }, index) {
230
+ const data = $rootProps.data?.[index];
231
+ const {
232
+ xStart,
233
+ yStart,
234
+ xLabelCenter,
235
+ yLabelCenter,
236
+ capSize
237
+ } = this.computeRadianPosition(data, index);
238
+ return {
239
+ x1: xStart,
240
+ y1: yStart,
241
+ x2: xLabelCenter,
242
+ y2: yLabelCenter,
243
+ strokeWidth: capSize * 3
244
+ };
245
+ }
246
+ getLineProps({
247
+ $rootProps
248
+ }, index) {
249
+ const data = $rootProps.data?.[index];
250
+ const {
251
+ xStart,
252
+ yStart,
253
+ xEnd,
254
+ yEnd
255
+ } = this.computeRadianPosition(data, index);
256
+ const {
257
+ uid,
258
+ transparent,
259
+ resolveColor
260
+ } = this.asProps;
261
+ const color = data.color ?? this.asProps.color;
262
+ return {
263
+ x1: xStart,
264
+ y1: yStart,
265
+ x2: xEnd,
266
+ y2: yEnd,
267
+ stroke: color,
268
+ resolveColor,
269
+ transparent,
270
+ ['data-x1']: xStart,
271
+ ['data-y1']: yStart,
272
+ ['data-x2']: xEnd,
273
+ ['data-y2']: yEnd,
274
+ ['data-radial-animation']: `${uid}-line`,
275
+ ['data-radian-index']: index
276
+ };
277
+ }
278
+ getCapProps({
279
+ $rootProps
280
+ }, index) {
281
+ const data = $rootProps.data?.[index];
282
+ const {
283
+ xEnd,
284
+ yEnd,
285
+ capSize
286
+ } = this.computeRadianPosition(data, index);
287
+ const {
288
+ uid,
289
+ transparent,
290
+ resolveColor,
291
+ patterns
292
+ } = this.asProps;
293
+ const color = data.color ?? this.asProps.color;
294
+ return {
295
+ x: xEnd,
296
+ y: yEnd,
297
+ ['data-cx']: xEnd,
298
+ ['data-cy']: yEnd,
299
+ radius: capSize,
300
+ color,
301
+ resolveColor,
302
+ transparent,
303
+ patterns,
304
+ uid: `${uid}-cap-${index}`,
305
+ ['data-radial-animation']: `${uid}-cap-circle`,
306
+ ['data-radian-index']: index
307
+ };
308
+ }
309
+ getIconProps({
310
+ $rootProps
311
+ }, index) {
312
+ const data = $rootProps.data?.[index];
313
+ const {
314
+ xEnd,
315
+ yEnd,
316
+ isActive
317
+ } = this.computeRadianPosition(data, index);
318
+ const {
319
+ uid,
320
+ resolveColor
321
+ } = this.asProps;
322
+ const iconColor = data.iconColor ?? this.asProps.iconColor;
323
+ const iconSize = data.iconSize ?? this.asProps.iconSize;
324
+ const icon = data.icon ?? this.asProps.icon;
325
+ const x = xEnd - iconSize / 2;
326
+ const y = yEnd - iconSize / 2;
327
+ return {
328
+ x,
329
+ y,
330
+ ['data-x']: x,
331
+ ['data-y']: y,
332
+ iconSize,
333
+ color: iconColor ?? '#fff',
334
+ resolveColor,
335
+ ['data-radial-animation']: `${uid}-cap-icon`,
336
+ ['data-radian-index']: index,
337
+ icon,
338
+ tag: icon,
339
+ isActive
340
+ };
341
+ }
342
+ getLabelProps({
343
+ $rootProps
344
+ }, index) {
345
+ const data = $rootProps.data?.[index];
346
+ const {
347
+ xLabelCenter,
348
+ yLabelCenter,
349
+ labelAngle,
350
+ isHorizontal
351
+ } = this.computeRadianPosition(data, index);
352
+ const {
353
+ uid,
354
+ textSize,
355
+ transparent,
356
+ resolveColor
357
+ } = this.asProps;
358
+ const {
359
+ label
360
+ } = data;
361
+ const color = data.color ?? this.asProps.color;
362
+ return {
363
+ x: xLabelCenter,
364
+ y: yLabelCenter,
365
+ angle: labelAngle,
366
+ ['data-radial-animation']: `${uid}-label`,
367
+ ['data-radian-index']: index,
368
+ label,
369
+ color,
370
+ resolveColor,
371
+ isHorizontal,
372
+ textSize,
373
+ transparent
374
+ };
375
+ }
376
+ getRadianKey(data, index) {
377
+ return data.key ?? `radian-${index}`;
378
+ }
379
+ computeRadianPosition(data, index) {
380
+ const {
381
+ centralMargin,
382
+ labelMargin,
383
+ angleOffset,
384
+ activeKey,
385
+ size,
386
+ radiansCount,
387
+ textWidth
388
+ } = this.asProps;
389
+ const [width, height] = size;
390
+ const key = this.getRadianKey(data, index);
391
+ const isActive = activeKey === key;
392
+ const baseCapSize = data.capSize ?? this.asProps.capSize;
393
+ const capSize = baseCapSize * (isActive ? 1 : 0.5);
394
+ const minDemSize = Math.min(width, height) / 2;
395
+ const length = Math.max(minDemSize - textWidth - baseCapSize - centralMargin - labelMargin * 2, 10);
396
+ const angle = baseAngle + angleOffset + index / radiansCount * (Math.PI * 2);
397
+ const isHorizontal = angle - baseAngle > 1 / 6 * Math.PI && angle - baseAngle < 5 / 6 * Math.PI || angle - baseAngle > 7 / 6 * Math.PI && angle - baseAngle < 11 / 6 * Math.PI;
398
+ const topAngle = -Math.PI / 2;
399
+ const labelAngle = (angle - topAngle) % Math.PI + topAngle;
400
+ const center = [width / 2, height / 2];
401
+ const [xCenter, yCenter] = center;
402
+ const start = [xCenter + Math.cos(angle) * centralMargin, yCenter + Math.sin(angle) * centralMargin];
403
+ const end = [xCenter + Math.cos(angle) * (centralMargin + length), yCenter + Math.sin(angle) * (centralMargin + length)];
404
+ const [xStart, yStart] = start;
405
+ const [xEnd, yEnd] = end;
406
+ const labelCenter = [xCenter + Math.cos(angle) * (centralMargin + length + baseCapSize + textWidth / 2 + labelMargin), yCenter + Math.sin(angle) * (centralMargin + length + baseCapSize + textWidth / 2 + labelMargin)];
407
+ const [xLabelCenter, yLabelCenter] = labelCenter;
408
+ return {
409
+ xStart,
410
+ yStart,
411
+ xEnd,
412
+ yEnd,
413
+ xLabelCenter,
414
+ yLabelCenter,
415
+ labelAngle,
416
+ isHorizontal,
417
+ capSize,
418
+ isActive
419
+ };
420
+ }
421
+ renderRadian(data, index) {
422
+ var _ref2;
423
+ const {
424
+ styles,
425
+ Children,
426
+ onRadianClick
427
+ } = this.asProps;
428
+ const key = this.getRadianKey(data, index);
429
+ const SRadian = 'g';
430
+ let children = getOriginChildren(Children);
431
+ if (typeof children === 'function') {
432
+ const _child = this.asProps.children;
433
+ const mergedProps = assignProps(children(this.asProps), this.asProps);
434
+ children = mergedProps.children;
435
+ mergedProps.children = _child;
468
436
  }
469
- }, {
470
- key: "renderRadian",
471
- value: function renderRadian(data, index) {
472
- var _ref2;
473
- var _this$asProps0 = this.asProps,
474
- styles = _this$asProps0.styles,
475
- Children = _this$asProps0.Children,
476
- onRadianClick = _this$asProps0.onRadianClick;
477
- var key = this.getRadianKey(data, index);
478
- var SRadian = 'g';
479
- var children = getOriginChildren(Children);
480
- if (typeof children === 'function') {
481
- var _child = this.asProps.children;
482
- var mergedProps = assignProps(children(this.asProps), this.asProps);
483
- children = mergedProps.children;
484
- mergedProps.children = _child;
485
- }
486
- this.asProps.dataHintsHandler.describeValueEntity("".concat(index, ".").concat(data.label), data.label);
437
+ this.asProps.dataHintsHandler.describeValueEntity(`${index}.${data.label}`, data.label);
438
+
439
+ // hidden from publicly typed export
440
+ const InteractiveArea = RadialTree.Radian.InteractiveArea;
441
+ return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(SRadian, _ref2.cn("SRadian", {
442
+ "aria-hidden": true,
443
+ "key": key,
444
+ "onClick": onRadianClick(key)
445
+ }), /*#__PURE__*/React.createElement(InteractiveArea, _ref2.cn("InteractiveArea", {})), children);
446
+ }
447
+ render() {
448
+ var _ref3;
449
+ const {
450
+ data
451
+ } = this.asProps;
452
+ const SRadianList = 'g';
453
+ return _ref3 = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SRadianList, _ref3.cn("SRadianList", {}), data.map((data, index) => this.renderRadian(data, index)));
454
+ }
455
+ }
487
456
 
488
- // hidden from publicly typed export
489
- var InteractiveArea = RadialTree.Radian.InteractiveArea;
490
- return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(SRadian, _ref2.cn("SRadian", {
491
- "aria-hidden": true,
492
- "key": key,
493
- "onClick": onRadianClick(key)
494
- }), /*#__PURE__*/React.createElement(InteractiveArea, _ref2.cn("InteractiveArea", {})), children);
495
- }
496
- }, {
497
- key: "render",
498
- value: function render() {
499
- var _ref3,
500
- _this4 = this;
501
- var data = this.asProps.data;
502
- var SRadianList = 'g';
503
- return _ref3 = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SRadianList, _ref3.cn("SRadianList", {}), data.map(function (data, index) {
504
- return _this4.renderRadian(data, index);
505
- }));
506
- }
507
- }]);
508
- }(Component);
509
457
  /** @deprecated */
510
458
  _defineProperty(RadialTreeRadian, "displayName", 'RadialTreeRadian');
511
459
  _defineProperty(RadialTreeRadian, "style", style);
@@ -517,10 +465,11 @@ _defineProperty(RadialTreeRadian, "defaultProps", {
517
465
  iconSize: 16,
518
466
  textSize: 14
519
467
  });
520
- function InteractiveArea(_ref20) {
468
+ function InteractiveArea({
469
+ Element: SInteractiveArea,
470
+ styles
471
+ }) {
521
472
  var _ref4;
522
- var SInteractiveArea = _ref20.Element,
523
- styles = _ref20.styles;
524
473
  return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SInteractiveArea, _ref4.cn("SInteractiveArea", {
525
474
  "stroke": 'transparent',
526
475
  "render": 'line'
@@ -529,13 +478,14 @@ function InteractiveArea(_ref20) {
529
478
 
530
479
  /** @deprecated */
531
480
 
532
- function Line(_ref21) {
481
+ function Line({
482
+ Element: SLine,
483
+ styles,
484
+ stroke,
485
+ resolveColor,
486
+ transparent
487
+ }) {
533
488
  var _ref5;
534
- var SLine = _ref21.Element,
535
- styles = _ref21.styles,
536
- stroke = _ref21.stroke,
537
- resolveColor = _ref21.resolveColor,
538
- transparent = _ref21.transparent;
539
489
  return _ref5 = sstyled(styles), /*#__PURE__*/React.createElement(SLine, _ref5.cn("SLine", {
540
490
  "render": 'line',
541
491
  "stroke": resolveColor(stroke),
@@ -545,19 +495,18 @@ function Line(_ref21) {
545
495
 
546
496
  /** @deprecated */
547
497
 
548
- function Cap(_ref22) {
498
+ function Cap({
499
+ Element: SCap,
500
+ styles,
501
+ x = 0,
502
+ y = 0,
503
+ radius,
504
+ color,
505
+ resolveColor,
506
+ transparent,
507
+ patterns
508
+ }) {
549
509
  var _ref7;
550
- var SCap = _ref22.Element,
551
- styles = _ref22.styles,
552
- _ref22$x = _ref22.x,
553
- x = _ref22$x === void 0 ? 0 : _ref22$x,
554
- _ref22$y = _ref22.y,
555
- y = _ref22$y === void 0 ? 0 : _ref22$y,
556
- radius = _ref22.radius,
557
- color = _ref22.color,
558
- resolveColor = _ref22.resolveColor,
559
- transparent = _ref22.transparent,
560
- patterns = _ref22.patterns;
561
510
  if (!patterns) {
562
511
  var _ref6;
563
512
  return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SCap, _ref6.cn("SCap", {
@@ -569,14 +518,11 @@ function Cap(_ref22) {
569
518
  "transparent": transparent
570
519
  }));
571
520
  }
572
- var patternKey = color || getChartDefaultColorName(0);
573
- var _getPatternSymbolSize = getPatternSymbolSize({
574
- patternKey: patternKey,
575
- patterns: patterns
576
- }),
577
- _getPatternSymbolSize2 = _slicedToArray(_getPatternSymbolSize, 2),
578
- width = _getPatternSymbolSize2[0],
579
- height = _getPatternSymbolSize2[1];
521
+ const patternKey = color || getChartDefaultColorName(0);
522
+ const [width, height] = getPatternSymbolSize({
523
+ patternKey,
524
+ patterns
525
+ });
580
526
  return _ref7 = sstyled(styles), /*#__PURE__*/React.createElement(SCap, _ref7.cn("SCap", {
581
527
  "render": PatternSymbol,
582
528
  "patternKey": color,
@@ -590,19 +536,20 @@ function Cap(_ref22) {
590
536
 
591
537
  /** @deprecated */
592
538
 
593
- function Icon(_ref23) {
539
+ function Icon({
540
+ Element: SIcon,
541
+ styles,
542
+ isActive,
543
+ tag,
544
+ x,
545
+ y,
546
+ iconSize,
547
+ transparent
548
+ }) {
594
549
  var _ref8;
595
- var SIcon = _ref23.Element,
596
- styles = _ref23.styles,
597
- isActive = _ref23.isActive,
598
- tag = _ref23.tag,
599
- x = _ref23.x,
600
- y = _ref23.y,
601
- iconSize = _ref23.iconSize,
602
- transparent = _ref23.transparent;
603
550
  if (!(isActive && tag)) return null;
604
- var width = iconSize;
605
- var height = iconSize;
551
+ const width = iconSize;
552
+ const height = iconSize;
606
553
  return _ref8 = sstyled(styles), /*#__PURE__*/React.createElement(SIcon, _ref8.cn("SIcon", {
607
554
  "x": x,
608
555
  "y": y,
@@ -615,30 +562,31 @@ function Icon(_ref23) {
615
562
 
616
563
  /** @deprecated */
617
564
 
618
- function Label(_ref24) {
619
- var SLabel = _ref24.Element,
620
- Children = _ref24.Children,
621
- styles = _ref24.styles,
622
- label = _ref24.label,
623
- color = _ref24.color,
624
- resolveColor = _ref24.resolveColor,
625
- isHorizontal = _ref24.isHorizontal,
626
- x = _ref24.x,
627
- y = _ref24.y,
628
- textSize = _ref24.textSize,
629
- angle = _ref24.angle,
630
- transparent = _ref24.transparent;
631
- var lines = String(label).split('\n');
632
- var linesCount = lines.length;
633
- var SLabelLine = 'tspan';
634
- var angleDegs = (angle / Math.PI * 180).toFixed(2);
635
- var transformOrigin = [x.toFixed(2), y.toFixed(2)];
636
- var transform = "rotate(".concat([angleDegs].concat(transformOrigin).join(', '), ")");
637
- var sstyles = sstyled(styles);
638
- var sLabelStyles = sstyles.cn('SLabel', {
565
+ function Label({
566
+ Element: SLabel,
567
+ Children,
568
+ styles,
569
+ label,
570
+ color,
571
+ resolveColor,
572
+ isHorizontal,
573
+ x,
574
+ y,
575
+ textSize,
576
+ angle,
577
+ transparent
578
+ }) {
579
+ const lines = String(label).split('\n');
580
+ const linesCount = lines.length;
581
+ const SLabelLine = 'tspan';
582
+ const angleDegs = (angle / Math.PI * 180).toFixed(2);
583
+ const transformOrigin = [x.toFixed(2), y.toFixed(2)];
584
+ const transform = `rotate(${[angleDegs, ...transformOrigin].join(', ')})`;
585
+ const sstyles = sstyled(styles);
586
+ const sLabelStyles = sstyles.cn('SLabel', {
639
587
  'color': resolveColor(color),
640
588
  'text-cursor': isHorizontal ? 'text' : 'vertical-text',
641
- transparent: transparent
589
+ transparent
642
590
  });
643
591
  return /*#__PURE__*/React.createElement(SLabel, {
644
592
  "aria-hidden": true,
@@ -650,36 +598,35 @@ function Label(_ref24) {
650
598
  x: x.toFixed(2),
651
599
  y: y.toFixed(2),
652
600
  transform: transform
653
- }, lines.map(function (lineText, lineIndex) {
654
- return /*#__PURE__*/React.createElement(SLabelLine, {
655
- x: x,
656
- y: y + (lineIndex - (linesCount - 1) / 2) * textSize,
657
- key: "#".concat(lineIndex, "-").concat(lineText)
658
- }, lineText);
659
- }), /*#__PURE__*/React.createElement(Children, null));
601
+ }, lines.map((lineText, lineIndex) => /*#__PURE__*/React.createElement(SLabelLine, {
602
+ x: x,
603
+ y: y + (lineIndex - (linesCount - 1) / 2) * textSize,
604
+ key: `#${lineIndex}-${lineText}`
605
+ }, lineText)), /*#__PURE__*/React.createElement(Children, null));
660
606
  }
661
- var Radian = createElement(RadialTreeRadian, {
662
- InteractiveArea: InteractiveArea,
663
- Line: Line,
664
- Cap: Cap,
665
- Icon: Icon,
666
- Label: Label
607
+ const Radian = createElement(RadialTreeRadian, {
608
+ InteractiveArea,
609
+ Line,
610
+ Cap,
611
+ Icon,
612
+ Label
667
613
  });
668
614
 
669
615
  /** @deprecated */
670
616
 
671
- function Title(_ref25) {
617
+ function Title({
618
+ Element: STitle,
619
+ Children,
620
+ children,
621
+ styles,
622
+ textSize,
623
+ color,
624
+ resolveColor,
625
+ x,
626
+ y,
627
+ dataHintsHandler
628
+ }) {
672
629
  var _ref9;
673
- var STitle = _ref25.Element,
674
- Children = _ref25.Children,
675
- children = _ref25.children,
676
- styles = _ref25.styles,
677
- textSize = _ref25.textSize,
678
- color = _ref25.color,
679
- resolveColor = _ref25.resolveColor,
680
- x = _ref25.x,
681
- y = _ref25.y,
682
- dataHintsHandler = _ref25.dataHintsHandler;
683
630
  if (typeof children === 'string') {
684
631
  dataHintsHandler.setTitle('vertical', children);
685
632
  }
@@ -694,9 +641,9 @@ function Title(_ref25) {
694
641
  "y": y
695
642
  }), /*#__PURE__*/React.createElement(Children, _ref9.cn("Children", {})));
696
643
  }
697
- var RadialTree = createElement(RadialTreeBase, {
698
- Title: Title,
699
- Radian: Radian
644
+ const RadialTree = createElement(RadialTreeBase, {
645
+ Title,
646
+ Radian
700
647
  });
701
648
  export default RadialTree;
702
649
  //# sourceMappingURL=RadialTree.js.map