@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
package/lib/es6/Donut.js CHANGED
@@ -1,14 +1,6 @@
1
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/createClass";
5
- import _callSuper from "@babel/runtime/helpers/callSuper";
6
- import _inherits from "@babel/runtime/helpers/inherits";
7
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
9
2
  import { sstyled as _sstyled } from "@semcore/core";
10
3
  import { assignProps as _assignProps } from "@semcore/core";
11
- var _excluded = ["Element", "styles", "d3Arc", "data", "color", "$animationActivePie", "active", "d3ArcOut", "name", "dataKey", "dataHintsHandler", "transparent", "innerRadius", "outerRadius", "resolveColor", "halfsize", "uid", "patterns", "onClick", "onClickPieRoot"];
12
4
  import { Component, Root, sstyled } from '@semcore/core';
13
5
  import { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';
14
6
  import canUseDOM from '@semcore/core/lib/utils/canUseDOM';
@@ -21,44 +13,43 @@ import React from 'react';
21
13
  import createElement from './createElement';
22
14
  import { PatternFill } from './Pattern';
23
15
  /*!__reshadow-styles__:"./style/donut.shadow.css"*/
24
- var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SPie_1yxlu_gg_{stroke:var(--intergalactic-chart-grid-border, #ffffff);fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SPie_1yxlu_gg_.__color_1yxlu_gg_{fill:var(--color_1yxlu)}.___SPie_1yxlu_gg_.__pattern_1yxlu_gg_.__color_1yxlu_gg_{fill:var(--pattern_1yxlu);stroke:var(--color_1yxlu);stroke-width:1px}.___SPie_1yxlu_gg_.__transparent_1yxlu_gg_{opacity:.3}.___SEmptyData_1yxlu_gg_{fill:var(--intergalactic-chart-palette-order-null, #e0e1e9)}.___SEmptyData_1yxlu_gg_.__color_1yxlu_gg_{fill:var(--color_1yxlu)}.___SLabel_1yxlu_gg_{text-anchor:middle;vertical-anchor:middle;font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}", /*__inner_css_end__*/"1yxlu_gg_"),
16
+ const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SPie_1s4vb_gg_{stroke:var(--intergalactic-chart-grid-border, #ffffff);fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SPie_1s4vb_gg_.__color_1s4vb_gg_{fill:var(--color_1s4vb)}.___SPie_1s4vb_gg_.__pattern_1s4vb_gg_.__color_1s4vb_gg_{fill:var(--pattern_1s4vb);stroke:var(--color_1s4vb);stroke-width:1px}.___SPie_1s4vb_gg_.__transparent_1s4vb_gg_{opacity:.3}.___SEmptyData_1s4vb_gg_{fill:var(--intergalactic-chart-palette-order-null, #e0e1e9)}.___SEmptyData_1s4vb_gg_.__color_1s4vb_gg_{fill:var(--color_1s4vb)}.___SLabel_1s4vb_gg_{text-anchor:middle;vertical-anchor:middle;font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}", /*__inner_css_end__*/"1s4vb_gg_"),
25
17
  /*__reshadow_css_end__*/
26
18
  {
27
- "__SPie": "___SPie_1yxlu_gg_",
28
- "_color": "__color_1yxlu_gg_",
29
- "--color": "--color_1yxlu",
30
- "_pattern": "__pattern_1yxlu_gg_",
31
- "--pattern": "--pattern_1yxlu",
32
- "_transparent": "__transparent_1yxlu_gg_",
33
- "__SEmptyData": "___SEmptyData_1yxlu_gg_",
34
- "__SLabel": "___SLabel_1yxlu_gg_"
19
+ "__SPie": "___SPie_1s4vb_gg_",
20
+ "_color": "__color_1s4vb_gg_",
21
+ "--color": "--color_1s4vb",
22
+ "_pattern": "__pattern_1s4vb_gg_",
23
+ "--pattern": "--pattern_1s4vb",
24
+ "_transparent": "__transparent_1s4vb_gg_",
25
+ "__SEmptyData": "___SEmptyData_1s4vb_gg_",
26
+ "__SLabel": "___SLabel_1s4vb_gg_"
35
27
  });
36
28
  import Tooltip from './Tooltip';
37
29
  import { getChartDefaultColorName } from './utils';
38
- var DEFAULT_INSTANCE = Symbol('DEFAULT_INSTANCE');
39
- function transitionAnglePie(_ref6) {
40
- var selector = _ref6.selector,
41
- duration = _ref6.duration,
42
- halfsize = _ref6.halfsize,
43
- d3Arc = _ref6.d3Arc,
44
- d3ArcOut = _ref6.d3ArcOut,
45
- arcs = _ref6.arcs,
46
- activeIndexPie = _ref6.activeIndexPie;
30
+ const DEFAULT_INSTANCE = Symbol('DEFAULT_INSTANCE');
31
+ function transitionAnglePie({
32
+ selector,
33
+ duration,
34
+ halfsize,
35
+ d3Arc,
36
+ d3ArcOut,
37
+ arcs,
38
+ activeIndexPie
39
+ }) {
47
40
  return transition().selection().selectAll(selector).interrupt().transition().duration(duration).attrTween('d', function (_, ind) {
48
- if (!arcs[ind]) return function () {
49
- return '';
50
- };
51
- var d = Object.assign({}, arcs[ind]);
52
- var self = this;
53
- var initAngle = halfsize ? -Math.PI / 2 : 0;
54
- var prevStartAngle = initAngle;
55
- var prevEndAngle = initAngle;
41
+ if (!arcs[ind]) return () => '';
42
+ const d = Object.assign({}, arcs[ind]);
43
+ const self = this;
44
+ const initAngle = halfsize ? -Math.PI / 2 : 0;
45
+ let prevStartAngle = initAngle;
46
+ let prevEndAngle = initAngle;
56
47
  if (self.arc) {
57
48
  prevStartAngle = self.arc.startAngle;
58
49
  prevEndAngle = self.arc.endAngle;
59
50
  }
60
- var iStartAngle = interpolate(prevStartAngle, d.startAngle);
61
- var iEndAngle = interpolate(prevEndAngle, d.endAngle);
51
+ const iStartAngle = interpolate(prevStartAngle, d.startAngle);
52
+ const iEndAngle = interpolate(prevEndAngle, d.endAngle);
62
53
  return function (t) {
63
54
  d.startAngle = iStartAngle(t);
64
55
  d.endAngle = iEndAngle(t);
@@ -67,365 +58,325 @@ function transitionAnglePie(_ref6) {
67
58
  };
68
59
  });
69
60
  }
70
- function transitionRadiusPie(_ref7) {
71
- var data = _ref7.data,
72
- selector = _ref7.selector,
73
- element = _ref7.element,
74
- duration = _ref7.duration,
75
- innerRadius = _ref7.innerRadius,
76
- outerRadiusStartEnd = _ref7.outerRadiusStartEnd,
77
- paddingAngle = _ref7.paddingAngle;
61
+ function transitionRadiusPie({
62
+ data,
63
+ selector,
64
+ element,
65
+ duration,
66
+ innerRadius,
67
+ outerRadiusStartEnd,
68
+ paddingAngle
69
+ }) {
78
70
  return transition().selection().select(selector).interrupt().transition().duration(duration).attrTween('d', function () {
79
- var _outerRadiusStartEnd = _slicedToArray(outerRadiusStartEnd, 2),
80
- start = _outerRadiusStartEnd[0],
81
- end = _outerRadiusStartEnd[1];
82
- var iOuterRadius = interpolate(start, end);
71
+ const [start, end] = outerRadiusStartEnd;
72
+ const iOuterRadius = interpolate(start, end);
83
73
  return function (t) {
84
- var outerRadiusPX = iOuterRadius(t);
74
+ const outerRadiusPX = iOuterRadius(t);
85
75
  element.dataset['currentRadius'] = outerRadiusPX;
86
- var d3ArcOut = arc().innerRadius(innerRadius).outerRadius(outerRadiusPX).padAngle(paddingAngle);
76
+ const d3ArcOut = arc().innerRadius(innerRadius).outerRadius(outerRadiusPX).padAngle(paddingAngle);
87
77
  return d3ArcOut(data);
88
78
  };
89
79
  });
90
80
  }
91
- var increaseFactor = 8;
92
- function getOuterRadius(_ref8) {
93
- var size = _ref8.size,
94
- halfsize = _ref8.halfsize;
95
- var _size = _slicedToArray(size, 2),
96
- width = _size[0],
97
- height = _size[1];
98
- var minORmax = halfsize ? Math.max : Math.min;
81
+ const increaseFactor = 8;
82
+ function getOuterRadius({
83
+ size,
84
+ halfsize
85
+ }) {
86
+ const [width, height] = size;
87
+ const minORmax = halfsize ? Math.max : Math.min;
99
88
  return minORmax(width - increaseFactor * 2, height - increaseFactor * 2) / 2;
100
89
  }
101
- var DonutRoot = /*#__PURE__*/function (_Component) {
102
- function DonutRoot() {
103
- var _this;
104
- _classCallCheck(this, DonutRoot);
105
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
106
- args[_key] = arguments[_key];
107
- }
108
- _this = _callSuper(this, DonutRoot, [].concat(args));
109
- _defineProperty(_this, "virtualElement", canUseDOM() ? document.createElement('div') : {});
110
- _defineProperty(_this, "activeIndexPie", undefined);
111
- _defineProperty(_this, "canAnimatedHover", false);
112
- _defineProperty(_this, "bindHandlerTooltip", function (visible, props, tooltipProps) {
113
- return function (_ref9) {
114
- var clientX = _ref9.clientX,
115
- clientY = _ref9.clientY;
116
- var _this$asProps = _this.asProps,
117
- eventEmitter = _this$asProps.eventEmitter,
118
- plotId = _this$asProps.plotId;
119
- eventEmitter.emit("setTooltipPosition_".concat(plotId), clientX, clientY);
120
- eventEmitter.emit("setTooltipRenderingProps_".concat(plotId), props, tooltipProps);
121
- eventEmitter.emit("setTooltipVisible_".concat(plotId), visible);
122
- };
90
+ class DonutRoot extends Component {
91
+ constructor(...args) {
92
+ super(...args);
93
+ _defineProperty(this, "virtualElement", canUseDOM() ? document.createElement('div') : {});
94
+ _defineProperty(this, "activeIndexPie", undefined);
95
+ _defineProperty(this, "canAnimatedHover", false);
96
+ _defineProperty(this, "bindHandlerTooltip", (visible, props, tooltipProps) => ({
97
+ clientX,
98
+ clientY
99
+ }) => {
100
+ const {
101
+ eventEmitter,
102
+ plotId
103
+ } = this.asProps;
104
+ eventEmitter.emit(`setTooltipPosition_${plotId}`, clientX, clientY);
105
+ eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, props, tooltipProps);
106
+ eventEmitter.emit(`setTooltipVisible_${plotId}`, visible);
123
107
  });
124
- _defineProperty(_this, "animationActivePie", function (_ref0) {
125
- var data = _ref0.data,
126
- active = _ref0.active,
127
- selector = _ref0.selector,
128
- element = _ref0.element;
129
- var _this$asProps2 = _this.asProps,
130
- duration = _this$asProps2.duration,
131
- innerRadius = _this$asProps2.innerRadius,
132
- d3Arc = _this$asProps2.d3Arc,
133
- paddingAngle = _this$asProps2.paddingAngle;
134
- var outerRadius = d3Arc.outerRadius()();
135
- var outerRadiusStartEnd = active ? [+element.dataset['currentRadius'] || outerRadius, outerRadius + increaseFactor] : [+element.dataset['currentRadius'] || outerRadius, outerRadius];
136
- if (_this.canAnimatedHover && duration > 0) {
108
+ _defineProperty(this, "animationActivePie", ({
109
+ data,
110
+ active,
111
+ selector,
112
+ element
113
+ }) => {
114
+ const {
115
+ duration,
116
+ innerRadius,
117
+ d3Arc,
118
+ paddingAngle
119
+ } = this.asProps;
120
+ const outerRadius = d3Arc.outerRadius()();
121
+ const outerRadiusStartEnd = active ? [+element.dataset['currentRadius'] || outerRadius, outerRadius + increaseFactor] : [+element.dataset['currentRadius'] || outerRadius, outerRadius];
122
+ if (this.canAnimatedHover && duration > 0) {
137
123
  transitionRadiusPie({
138
- data: data,
139
- selector: "#".concat(_this.id, " ").concat(selector),
140
- element: element,
124
+ data,
125
+ selector: `#${this.id} ${selector}`,
126
+ element,
141
127
  duration: duration === 0 ? 0 : 300,
142
- innerRadius: innerRadius,
143
- outerRadiusStartEnd: outerRadiusStartEnd,
144
- paddingAngle: paddingAngle
128
+ innerRadius,
129
+ outerRadiusStartEnd,
130
+ paddingAngle
145
131
  });
146
132
  }
147
133
  });
148
- _defineProperty(_this, "animationTimeout", null);
149
- _defineProperty(_this, "animationUpdatePie", function () {
150
- clearTimeout(_this.animationTimeout);
151
- _this.animationTimeout = setTimeout(function () {
152
- var _this$asProps3 = _this.asProps,
153
- duration = _this$asProps3.duration,
154
- d3Arc = _this$asProps3.d3Arc,
155
- halfsize = _this$asProps3.halfsize,
156
- d3ArcOut = _this$asProps3.d3ArcOut;
157
- _this.canAnimatedHover = false;
134
+ _defineProperty(this, "animationTimeout", null);
135
+ _defineProperty(this, "animationUpdatePie", () => {
136
+ clearTimeout(this.animationTimeout);
137
+ this.animationTimeout = setTimeout(() => {
138
+ const {
139
+ duration,
140
+ d3Arc,
141
+ halfsize,
142
+ d3ArcOut
143
+ } = this.asProps;
144
+ this.canAnimatedHover = false;
158
145
  if (duration > 0) {
159
146
  transitionAnglePie({
160
- selector: "#".concat(_this.id, " [data-ui-name=\"Donut.Pie\"]"),
161
- duration: duration,
162
- arcs: _this.arcs,
163
- halfsize: halfsize,
164
- d3Arc: d3Arc,
165
- d3ArcOut: d3ArcOut,
166
- activeIndexPie: _this.activeIndexPie
167
- }).on('end', function () {
168
- _this.canAnimatedHover = true;
147
+ selector: `#${this.id} [data-ui-name="Donut.Pie"]`,
148
+ duration,
149
+ arcs: this.arcs,
150
+ halfsize,
151
+ d3Arc,
152
+ d3ArcOut,
153
+ activeIndexPie: this.activeIndexPie
154
+ }).on('end', () => {
155
+ this.canAnimatedHover = true;
169
156
  });
170
157
  } else {
171
- _this.canAnimatedHover = true;
158
+ this.canAnimatedHover = true;
172
159
  }
173
160
  }, 0);
174
161
  });
175
- return _this;
176
162
  }
177
- _inherits(DonutRoot, _Component);
178
- return _createClass(DonutRoot, [{
179
- key: "id",
180
- get: function get() {
181
- var _this$asProps4 = this.asProps,
182
- uid = _this$asProps4.uid,
183
- id = _this$asProps4.id;
184
- return id || uid;
185
- }
186
- }, {
187
- key: "generateGetBoundingClientRect",
188
- value: function generateGetBoundingClientRect() {
189
- var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
190
- var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
191
- return function () {
192
- return {
193
- width: 0,
194
- height: 0,
195
- top: y,
196
- right: x,
197
- bottom: y,
198
- left: x
199
- };
200
- };
201
- }
202
- }, {
203
- key: "getArcs",
204
- value: function getArcs() {
205
- var _this$asProps5 = this.asProps,
206
- Children = _this$asProps5.Children,
207
- data = _this$asProps5.data,
208
- d3Pie = _this$asProps5.d3Pie;
209
- var pieData = Object.entries(data);
210
- if (d3Pie[DEFAULT_INSTANCE]) {
211
- var keys = React.Children.toArray(getOriginChildren(Children)).reduce(function (acc, child) {
212
- if (/*#__PURE__*/React.isValidElement(child) && child.type === Donut.Pie) {
213
- acc.push(child.props.dataKey);
214
- }
215
- return acc;
216
- }, []);
217
- pieData = Object.entries(data).filter(function (_ref1) {
218
- var _ref10 = _slicedToArray(_ref1, 2),
219
- key = _ref10[0],
220
- value = _ref10[1];
221
- return keys.includes(key) && value > 0;
222
- }).sort(function (_ref11, _ref12) {
223
- var _ref13 = _slicedToArray(_ref11, 1),
224
- a = _ref13[0];
225
- var _ref14 = _slicedToArray(_ref12, 1),
226
- b = _ref14[0];
227
- return keys.indexOf(a) > keys.indexOf(b) ? 1 : -1;
228
- });
229
- }
230
- var minValue = pieData.reduce(function (acc, cur) {
231
- if (cur[1]) acc += cur[1];
163
+ get id() {
164
+ const {
165
+ uid,
166
+ id
167
+ } = this.asProps;
168
+ return id || uid;
169
+ }
170
+ generateGetBoundingClientRect(x = 0, y = 0) {
171
+ return () => ({
172
+ width: 0,
173
+ height: 0,
174
+ top: y,
175
+ right: x,
176
+ bottom: y,
177
+ left: x
178
+ });
179
+ }
180
+ getArcs() {
181
+ const {
182
+ Children,
183
+ data,
184
+ d3Pie
185
+ } = this.asProps;
186
+ let pieData = Object.entries(data);
187
+ if (d3Pie[DEFAULT_INSTANCE]) {
188
+ const keys = React.Children.toArray(getOriginChildren(Children)).reduce((acc, child) => {
189
+ if (/*#__PURE__*/React.isValidElement(child) && child.type === Donut.Pie) {
190
+ acc.push(child.props.dataKey);
191
+ }
232
192
  return acc;
233
- }, 0) / 100;
234
- pieData = pieData.map(function (d) {
235
- if (d[1] && d[1] < minValue) d[1] = minValue;
236
- return d;
237
- });
238
- return d3Pie(pieData);
239
- }
240
- }, {
241
- key: "handlerOnClick",
242
- value: function handlerOnClick(key) {
243
- var _this2 = this;
244
- return function (e) {
245
- e.stopPropagation();
246
- var onClick = _this2.asProps.onClick;
247
- if (!onClick) return;
248
- onClick(key, e);
249
- };
250
- }
251
- }, {
252
- key: "getPieProps",
253
- value: function getPieProps(props, index) {
254
- var _this3 = this;
255
- var _this$asProps6 = this.asProps,
256
- d3Arc = _this$asProps6.d3Arc,
257
- d3ArcOut = _this$asProps6.d3ArcOut,
258
- innerRadius = _this$asProps6.innerRadius,
259
- outerRadius = _this$asProps6.outerRadius,
260
- halfsize = _this$asProps6.halfsize,
261
- resolveColor = _this$asProps6.resolveColor,
262
- uid = _this$asProps6.uid,
263
- patterns = _this$asProps6.patterns;
264
- var active = props.active;
265
- var data = this.arcs.find(function (arc) {
266
- return arc.data[0] === props.dataKey;
267
- });
268
- if (active) {
269
- this.activeIndexPie = index;
270
- }
271
- var tooltipProps = {
272
- dataKey: props.dataKey,
273
- name: props.name,
274
- resolveColor: resolveColor,
275
- color: props.color || getChartDefaultColorName(index),
276
- active: props.active,
277
- transparent: props.transparent,
278
- patterns: patterns
279
- };
280
- return {
281
- data: data,
282
- d3Arc: d3Arc,
283
- d3ArcOut: d3ArcOut,
284
- innerRadius: innerRadius,
285
- outerRadius: outerRadius,
286
- uid: "".concat(uid, "-").concat(index),
287
- patterns: patterns,
288
- halfsize: halfsize,
289
- color: props.color || getChartDefaultColorName(index),
290
- resolveColor: resolveColor,
291
- $animationActivePie: this.animationActivePie,
292
- onMouseMove: this.bindHandlerTooltip(true, props, tooltipProps),
293
- onMouseLeave: this.bindHandlerTooltip(false, props, tooltipProps),
294
- onMouseOver: function onMouseOver(e) {
295
- if (!active) {
296
- _this3.animationActivePie({
297
- active: true,
298
- data: data,
299
- selector: "[d=\"".concat(e.target.getAttribute('d'), "\"]"),
300
- element: e.target
301
- });
302
- }
303
- },
304
- onMouseOut: function onMouseOut(e) {
305
- if (!active) {
306
- _this3.animationActivePie({
307
- active: false,
308
- data: data,
309
- selector: "[d=\"".concat(e.target.getAttribute('d'), "\"]"),
310
- element: e.target
311
- });
312
- }
313
- },
314
- onClickPieRoot: this.handlerOnClick(props.dataKey)
315
- };
193
+ }, []);
194
+ pieData = Object.entries(data).filter(([key, value]) => keys.includes(key) && value > 0).sort(([a], [b]) => keys.indexOf(a) > keys.indexOf(b) ? 1 : -1);
316
195
  }
317
- }, {
318
- key: "getEmptyDataProps",
319
- value: function getEmptyDataProps() {
320
- var d3Arc = this.asProps.d3Arc;
321
- return {
322
- d3Arc: d3Arc
323
- };
324
- }
325
- }, {
326
- key: "componentDidUpdate",
327
- value: function componentDidUpdate(prevProps) {
328
- var data = this.asProps.data;
329
- if (prevProps.$rootProps.data !== data) {
330
- this.animationUpdatePie();
331
- }
196
+ const minValue = pieData.reduce((acc, cur) => {
197
+ if (cur[1]) acc += cur[1];
198
+ return acc;
199
+ }, 0) / 100;
200
+ pieData = pieData.map(d => {
201
+ if (d[1] && d[1] < minValue) d[1] = minValue;
202
+ return d;
203
+ });
204
+ return d3Pie(pieData);
205
+ }
206
+ handlerOnClick(key) {
207
+ return e => {
208
+ e.stopPropagation();
209
+ const {
210
+ onClick
211
+ } = this.asProps;
212
+ if (!onClick) return;
213
+ onClick(key, e);
214
+ };
215
+ }
216
+ getPieProps(props, index) {
217
+ const {
218
+ d3Arc,
219
+ d3ArcOut,
220
+ innerRadius,
221
+ outerRadius,
222
+ halfsize,
223
+ resolveColor,
224
+ uid,
225
+ patterns
226
+ } = this.asProps;
227
+ const {
228
+ active
229
+ } = props;
230
+ const data = this.arcs.find(arc => arc.data[0] === props.dataKey);
231
+ if (active) {
232
+ this.activeIndexPie = index;
332
233
  }
333
- }, {
334
- key: "componentDidMount",
335
- value: function componentDidMount() {
234
+ const tooltipProps = {
235
+ dataKey: props.dataKey,
236
+ name: props.name,
237
+ resolveColor,
238
+ color: props.color || getChartDefaultColorName(index),
239
+ active: props.active,
240
+ transparent: props.transparent,
241
+ patterns
242
+ };
243
+ return {
244
+ data,
245
+ d3Arc,
246
+ d3ArcOut,
247
+ innerRadius,
248
+ outerRadius,
249
+ uid: `${uid}-${index}`,
250
+ patterns,
251
+ halfsize,
252
+ color: props.color || getChartDefaultColorName(index),
253
+ resolveColor,
254
+ $animationActivePie: this.animationActivePie,
255
+ onMouseMove: this.bindHandlerTooltip(true, props, tooltipProps),
256
+ onMouseLeave: this.bindHandlerTooltip(false, props, tooltipProps),
257
+ onMouseOver: e => {
258
+ if (!active) {
259
+ this.animationActivePie({
260
+ active: true,
261
+ data,
262
+ selector: `[d="${e.target.getAttribute('d')}"]`,
263
+ element: e.target
264
+ });
265
+ }
266
+ },
267
+ onMouseOut: e => {
268
+ if (!active) {
269
+ this.animationActivePie({
270
+ active: false,
271
+ data,
272
+ selector: `[d="${e.target.getAttribute('d')}"]`,
273
+ element: e.target
274
+ });
275
+ }
276
+ },
277
+ onClickPieRoot: this.handlerOnClick(props.dataKey)
278
+ };
279
+ }
280
+ getEmptyDataProps() {
281
+ const {
282
+ d3Arc
283
+ } = this.asProps;
284
+ return {
285
+ d3Arc
286
+ };
287
+ }
288
+ componentDidUpdate(prevProps) {
289
+ const {
290
+ data
291
+ } = this.asProps;
292
+ if (prevProps.$rootProps.data !== data) {
336
293
  this.animationUpdatePie();
337
294
  }
338
- }, {
339
- key: "render",
340
- value: function render() {
341
- var _this$asProps7 = this.asProps,
342
- halfsize = _this$asProps7.halfsize,
343
- size = _this$asProps7.size;
344
- this.asProps.dataHintsHandler.establishDataType('values-set');
345
- var _size2 = _slicedToArray(size, 2),
346
- width = _size2[0],
347
- height = _size2[1];
348
- var Element = this.Element;
349
- var k = halfsize ? 1 : 2;
350
- this.arcs = this.getArcs();
351
- return /*#__PURE__*/React.createElement(Element, {
352
- "aria-hidden": true,
353
- id: this.id,
354
- render: "g",
355
- childrenPosition: "inside",
356
- transform: "translate(".concat(width / 2, ",").concat(height / k, ")")
357
- });
358
- }
359
- }]);
360
- }(Component);
295
+ }
296
+ componentDidMount() {
297
+ this.animationUpdatePie();
298
+ }
299
+ render() {
300
+ const {
301
+ halfsize,
302
+ size
303
+ } = this.asProps;
304
+ this.asProps.dataHintsHandler.establishDataType('values-set');
305
+ const [width, height] = size;
306
+ const Element = this.Element;
307
+ const k = halfsize ? 1 : 2;
308
+ this.arcs = this.getArcs();
309
+ return /*#__PURE__*/React.createElement(Element, {
310
+ "aria-hidden": true,
311
+ id: this.id,
312
+ render: "g",
313
+ childrenPosition: "inside",
314
+ transform: `translate(${width / 2},${height / k})`
315
+ });
316
+ }
317
+ }
361
318
  _defineProperty(DonutRoot, "displayName", 'Donut');
362
319
  _defineProperty(DonutRoot, "style", style);
363
320
  _defineProperty(DonutRoot, "enhance", [uniqueIDEnhancement()]);
364
- _defineProperty(DonutRoot, "defaultProps", function (_ref18) {
365
- var _ref18$innerRadius = _ref18.innerRadius,
366
- innerRadius = _ref18$innerRadius === void 0 ? 0 : _ref18$innerRadius,
367
- _ref18$paddingAngle = _ref18.paddingAngle,
368
- paddingAngle = _ref18$paddingAngle === void 0 ? 0 : _ref18$paddingAngle,
369
- outerRadius = _ref18.outerRadius,
370
- _ref18$halfsize = _ref18.halfsize,
371
- halfsize = _ref18$halfsize === void 0 ? false : _ref18$halfsize,
372
- size = _ref18.$rootProps.size;
373
- var d3Arc = arc().outerRadius(outerRadius || getOuterRadius({
374
- size: size,
375
- halfsize: halfsize,
376
- outerRadius: outerRadius
321
+ _defineProperty(DonutRoot, "defaultProps", ({
322
+ innerRadius = 0,
323
+ paddingAngle = 0,
324
+ outerRadius,
325
+ halfsize = false,
326
+ $rootProps: {
327
+ size
328
+ }
329
+ }) => {
330
+ const d3Arc = arc().outerRadius(outerRadius || getOuterRadius({
331
+ size,
332
+ halfsize,
333
+ outerRadius
377
334
  })).innerRadius(innerRadius).padAngle(paddingAngle);
378
- var d3ArcOut = arc().outerRadius((outerRadius || getOuterRadius({
379
- size: size,
380
- halfsize: halfsize
335
+ const d3ArcOut = arc().outerRadius((outerRadius || getOuterRadius({
336
+ size,
337
+ halfsize
381
338
  })) + increaseFactor).innerRadius(innerRadius).padAngle(paddingAngle);
382
- var d3Pie = pie().sort(null).value(function (_ref19) {
383
- var _ref20 = _slicedToArray(_ref19, 2),
384
- value = _ref20[1];
385
- return value;
386
- });
339
+ let d3Pie = pie().sort(null).value(([, value]) => value);
387
340
  d3Pie[DEFAULT_INSTANCE] = true;
388
341
  if (halfsize) {
389
342
  d3Pie = d3Pie.startAngle(-Math.PI / 2).endAngle(Math.PI / 2);
390
343
  }
391
344
  return {
392
- d3Pie: d3Pie,
393
- d3Arc: d3Arc,
394
- d3ArcOut: d3ArcOut,
345
+ d3Pie,
346
+ d3Arc,
347
+ d3ArcOut,
395
348
  duration: 500,
396
- paddingAngle: paddingAngle,
397
- innerRadius: innerRadius
349
+ paddingAngle,
350
+ innerRadius
398
351
  };
399
352
  });
400
- function Pie(_ref15) {
353
+ function Pie({
354
+ Element: SPie,
355
+ styles,
356
+ d3Arc,
357
+ data,
358
+ color,
359
+ $animationActivePie,
360
+ active,
361
+ d3ArcOut,
362
+ name,
363
+ dataKey,
364
+ dataHintsHandler,
365
+ transparent,
366
+ innerRadius,
367
+ outerRadius,
368
+ resolveColor,
369
+ halfsize,
370
+ uid,
371
+ patterns,
372
+ onClick,
373
+ onClickPieRoot,
374
+ ...other
375
+ }) {
401
376
  var _ref2;
402
- var SPie = _ref15.Element,
403
- styles = _ref15.styles,
404
- d3Arc = _ref15.d3Arc,
405
- data = _ref15.data,
406
- color = _ref15.color,
407
- $animationActivePie = _ref15.$animationActivePie,
408
- active = _ref15.active,
409
- d3ArcOut = _ref15.d3ArcOut,
410
- name = _ref15.name,
411
- dataKey = _ref15.dataKey,
412
- dataHintsHandler = _ref15.dataHintsHandler,
413
- transparent = _ref15.transparent,
414
- innerRadius = _ref15.innerRadius,
415
- outerRadius = _ref15.outerRadius,
416
- resolveColor = _ref15.resolveColor,
417
- halfsize = _ref15.halfsize,
418
- uid = _ref15.uid,
419
- patterns = _ref15.patterns,
420
- onClick = _ref15.onClick,
421
- onClickPieRoot = _ref15.onClickPieRoot,
422
- other = _objectWithoutProperties(_ref15, _excluded);
423
- var _React$useState = React.useState(false),
424
- _React$useState2 = _slicedToArray(_React$useState, 2),
425
- isMount = _React$useState2[0],
426
- setIsMount = _React$useState2[1];
427
- var pieRef = React.useRef(null);
428
- React.useEffect(function () {
377
+ const [isMount, setIsMount] = React.useState(false);
378
+ const pieRef = React.useRef(null);
379
+ React.useEffect(() => {
429
380
  if (!pieRef.current) return;
430
381
  pieRef.current.dataset['currentRadius'] = (active ? d3ArcOut : d3Arc).outerRadius()();
431
382
 
@@ -436,14 +387,14 @@ function Pie(_ref15) {
436
387
  }
437
388
  if (active !== undefined && active !== null) {
438
389
  $animationActivePie({
439
- active: active,
440
- data: data,
441
- selector: "[name=\"".concat(other.name, "\"]"),
390
+ active,
391
+ data,
392
+ selector: `[name="${other.name}"]`,
442
393
  element: pieRef.current
443
394
  });
444
395
  }
445
396
  }, [active, Boolean(data)]);
446
- React.useEffect(function () {
397
+ React.useEffect(() => {
447
398
  if (!pieRef.current) return;
448
399
  pieRef.current.dataset['currentRadius'] = (active ? d3ArcOut : d3Arc).outerRadius()();
449
400
  }, [active, innerRadius, outerRadius, halfsize, Boolean(data)]);
@@ -454,24 +405,25 @@ function Pie(_ref15) {
454
405
  "render": 'path',
455
406
  "ref": pieRef,
456
407
  "color": resolveColor(color),
457
- "pattern": patterns ? "url(#".concat(uid, "-pattern)") : undefined,
408
+ "pattern": patterns ? `url(#${uid}-pattern)` : undefined,
458
409
  "d": active ? d3ArcOut(data) : d3Arc(data),
459
410
  "transparent": transparent,
460
411
  "use:onClick": callAllEventHandlers(onClickPieRoot, onClick)
461
412
  }))), patterns && /*#__PURE__*/React.createElement(PatternFill, _ref2.cn("PatternFill", {
462
- "id": "".concat(uid, "-pattern"),
413
+ "id": `${uid}-pattern`,
463
414
  "patternKey": color,
464
415
  "color": resolveColor(color),
465
416
  "patterns": patterns
466
417
  })));
467
418
  }
468
- function EmptyData(_ref16) {
419
+ function EmptyData({
420
+ Element: SEmptyData,
421
+ styles,
422
+ d3Arc,
423
+ color,
424
+ resolveColor
425
+ }) {
469
426
  var _ref3;
470
- var SEmptyData = _ref16.Element,
471
- styles = _ref16.styles,
472
- d3Arc = _ref16.d3Arc,
473
- color = _ref16.color,
474
- resolveColor = _ref16.resolveColor;
475
427
  return _ref3 = sstyled(styles), /*#__PURE__*/React.createElement(SEmptyData, _ref3.cn("SEmptyData", {
476
428
  "render": 'path',
477
429
  "color": resolveColor(color),
@@ -481,18 +433,17 @@ function EmptyData(_ref16) {
481
433
  })
482
434
  }));
483
435
  }
484
- function Label(_ref17) {
436
+ function Label({
437
+ Element: SLabel,
438
+ styles,
439
+ Children,
440
+ children,
441
+ label,
442
+ dataHintsHandler,
443
+ x = 0,
444
+ y = 0
445
+ }) {
485
446
  var _ref4;
486
- var SLabel = _ref17.Element,
487
- styles = _ref17.styles,
488
- Children = _ref17.Children,
489
- children = _ref17.children,
490
- label = _ref17.label,
491
- dataHintsHandler = _ref17.dataHintsHandler,
492
- _ref17$x = _ref17.x,
493
- x = _ref17$x === void 0 ? 0 : _ref17$x,
494
- _ref17$y = _ref17.y,
495
- y = _ref17$y === void 0 ? 0 : _ref17$y;
496
447
  dataHintsHandler.setTitle('vertical', label || children);
497
448
  return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SLabel, _ref4.cn("SLabel", {
498
449
  "render": 'text',
@@ -504,16 +455,18 @@ function Label(_ref17) {
504
455
  function DonutTooltip(props) {
505
456
  var _ref = arguments[0],
506
457
  _ref5;
507
- var SDonutTooltip = Tooltip;
508
- return _ref5 = sstyled(props.styles), /*#__PURE__*/React.createElement(SDonutTooltip, _ref5.cn("SDonutTooltip", _objectSpread({}, _assignProps({
509
- "excludeAnchorProps": true
510
- }, _ref))));
458
+ const SDonutTooltip = Tooltip;
459
+ return _ref5 = sstyled(props.styles), /*#__PURE__*/React.createElement(SDonutTooltip, _ref5.cn("SDonutTooltip", {
460
+ ..._assignProps({
461
+ "excludeAnchorProps": true
462
+ }, _ref)
463
+ }));
511
464
  }
512
465
  ;
513
- var Donut = createElement(DonutRoot, {
514
- Pie: Pie,
515
- Label: Label,
516
- EmptyData: EmptyData,
466
+ const Donut = createElement(DonutRoot, {
467
+ Pie,
468
+ Label,
469
+ EmptyData,
517
470
  Tooltip: [DonutTooltip, Tooltip._______childrenComponents]
518
471
  });
519
472
  export default Donut;