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