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