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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (439) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/lib/cjs/AnimatedClipPath.js +28 -41
  3. package/lib/cjs/AnimatedClipPath.js.map +1 -1
  4. package/lib/cjs/Area.js +187 -223
  5. package/lib/cjs/Area.js.map +1 -1
  6. package/lib/cjs/Axis.js +248 -327
  7. package/lib/cjs/Axis.js.map +1 -1
  8. package/lib/cjs/Bar.js +162 -185
  9. package/lib/cjs/Bar.js.map +1 -1
  10. package/lib/cjs/Bubble.js +219 -248
  11. package/lib/cjs/Bubble.js.map +1 -1
  12. package/lib/cjs/CompactHorizontalBar.js +448 -482
  13. package/lib/cjs/CompactHorizontalBar.js.map +1 -1
  14. package/lib/cjs/Donut.js +349 -396
  15. package/lib/cjs/Donut.js.map +1 -1
  16. package/lib/cjs/Dots.js +67 -86
  17. package/lib/cjs/Dots.js.map +1 -1
  18. package/lib/cjs/GroupBar.js +78 -93
  19. package/lib/cjs/GroupBar.js.map +1 -1
  20. package/lib/cjs/HorizontalBar.js +149 -167
  21. package/lib/cjs/HorizontalBar.js.map +1 -1
  22. package/lib/cjs/Hover.js +178 -207
  23. package/lib/cjs/Hover.js.map +1 -1
  24. package/lib/cjs/Line.js +182 -222
  25. package/lib/cjs/Line.js.map +1 -1
  26. package/lib/cjs/Pattern.js +124 -126
  27. package/lib/cjs/Pattern.js.map +1 -1
  28. package/lib/cjs/Plot.js +100 -126
  29. package/lib/cjs/Plot.js.map +1 -1
  30. package/lib/cjs/Radar.js +576 -681
  31. package/lib/cjs/Radar.js.map +1 -1
  32. package/lib/cjs/RadialTree.js +518 -571
  33. package/lib/cjs/RadialTree.js.map +1 -1
  34. package/lib/cjs/Reference.js +147 -178
  35. package/lib/cjs/Reference.js.map +1 -1
  36. package/lib/cjs/ResponsiveContainer.js +64 -82
  37. package/lib/cjs/ResponsiveContainer.js.map +1 -1
  38. package/lib/cjs/ScatterPlot.js +169 -199
  39. package/lib/cjs/ScatterPlot.js.map +1 -1
  40. package/lib/cjs/StackBar.js +135 -177
  41. package/lib/cjs/StackBar.js.map +1 -1
  42. package/lib/cjs/StackedArea.js +60 -73
  43. package/lib/cjs/StackedArea.js.map +1 -1
  44. package/lib/cjs/Tooltip.js +193 -208
  45. package/lib/cjs/Tooltip.js.map +1 -1
  46. package/lib/cjs/Venn.js +182 -217
  47. package/lib/cjs/Venn.js.map +1 -1
  48. package/lib/cjs/a11y/DataAccessibilityTable.js +45 -83
  49. package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
  50. package/lib/cjs/a11y/PlotA11yModule.js +37 -97
  51. package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
  52. package/lib/cjs/a11y/PlotA11yView.js +97 -91
  53. package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
  54. package/lib/cjs/a11y/bezier.js +17 -23
  55. package/lib/cjs/a11y/bezier.js.map +1 -1
  56. package/lib/cjs/a11y/focus.js +16 -16
  57. package/lib/cjs/a11y/focus.js.map +1 -1
  58. package/lib/cjs/a11y/hints.js +72 -75
  59. package/lib/cjs/a11y/hints.js.map +1 -1
  60. package/lib/cjs/a11y/insights.js +354 -525
  61. package/lib/cjs/a11y/insights.js.map +1 -1
  62. package/lib/cjs/a11y/intl.js +5 -5
  63. package/lib/cjs/a11y/intl.js.map +1 -1
  64. package/lib/cjs/a11y/locale.js +12 -19
  65. package/lib/cjs/a11y/locale.js.map +1 -1
  66. package/lib/cjs/a11y/serialize.js +164 -203
  67. package/lib/cjs/a11y/serialize.js.map +1 -1
  68. package/lib/cjs/a11y/summarize.js +7 -6
  69. package/lib/cjs/a11y/summarize.js.map +1 -1
  70. package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js +16 -16
  71. package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
  72. package/lib/cjs/a11y/translations/module/de.json +2 -2
  73. package/lib/cjs/a11y/translations/module/en.json +2 -2
  74. package/lib/cjs/a11y/translations/module/es.json +2 -2
  75. package/lib/cjs/a11y/translations/module/fr.json +2 -2
  76. package/lib/cjs/a11y/translations/module/it.json +2 -2
  77. package/lib/cjs/a11y/translations/module/ja.json +2 -2
  78. package/lib/cjs/a11y/translations/module/ko.json +2 -2
  79. package/lib/cjs/a11y/translations/module/nl.json +2 -2
  80. package/lib/cjs/a11y/translations/module/pl.json +2 -2
  81. package/lib/cjs/a11y/translations/module/pt.json +2 -2
  82. package/lib/cjs/a11y/translations/module/sv.json +2 -2
  83. package/lib/cjs/a11y/translations/module/tr.json +2 -2
  84. package/lib/cjs/a11y/translations/module/vi.json +2 -2
  85. package/lib/cjs/a11y/translations/module/zh.json +2 -2
  86. package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js +16 -16
  87. package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
  88. package/lib/cjs/color.js +1 -1
  89. package/lib/cjs/color.js.map +1 -1
  90. package/lib/cjs/component/Chart/AbstractChart.js +421 -466
  91. package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
  92. package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
  93. package/lib/cjs/component/Chart/AreaChart.js +97 -115
  94. package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
  95. package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
  96. package/lib/cjs/component/Chart/BarChart.js +229 -216
  97. package/lib/cjs/component/Chart/BarChart.js.map +1 -1
  98. package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
  99. package/lib/cjs/component/Chart/BubbleChart.js +114 -136
  100. package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
  101. package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
  102. package/lib/cjs/component/Chart/CigaretteChart.js +280 -305
  103. package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
  104. package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +76 -108
  105. package/lib/cjs/component/Chart/CompactHorizontalBarChart.js.map +1 -1
  106. package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  107. package/lib/cjs/component/Chart/DonutChart.js +80 -95
  108. package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
  109. package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
  110. package/lib/cjs/component/Chart/HistogramChart.js +126 -148
  111. package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
  112. package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
  113. package/lib/cjs/component/Chart/LineChart.js +95 -113
  114. package/lib/cjs/component/Chart/LineChart.js.map +1 -1
  115. package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
  116. package/lib/cjs/component/Chart/RadarChart.js +84 -110
  117. package/lib/cjs/component/Chart/RadarChart.js.map +1 -1
  118. package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
  119. package/lib/cjs/component/Chart/ScatterPlotChart.js +119 -143
  120. package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
  121. package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
  122. package/lib/cjs/component/Chart/VennChart.js +103 -122
  123. package/lib/cjs/component/Chart/VennChart.js.map +1 -1
  124. package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
  125. package/lib/cjs/component/Chart/index.js +2 -2
  126. package/lib/cjs/component/Chart/index.js.map +1 -1
  127. package/lib/cjs/component/ChartLegend/BaseLegend.js +72 -105
  128. package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
  129. package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
  130. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +58 -70
  131. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  132. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
  133. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +208 -221
  134. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  135. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
  136. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  137. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +63 -73
  138. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  139. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  140. package/lib/cjs/component/ChartLegend/index.js +4 -4
  141. package/lib/cjs/component/ChartLegend/index.js.map +1 -1
  142. package/lib/cjs/component/Cigarette/Cigarette.js +115 -129
  143. package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
  144. package/lib/cjs/component/StackGroupBar/StackGroupBar.js +107 -137
  145. package/lib/cjs/component/StackGroupBar/StackGroupBar.js.map +1 -1
  146. package/lib/cjs/component/SvgElement.js +7 -7
  147. package/lib/cjs/component/SvgElement.js.map +1 -1
  148. package/lib/cjs/createElement.js +66 -65
  149. package/lib/cjs/createElement.js.map +1 -1
  150. package/lib/cjs/index.js +62 -62
  151. package/lib/cjs/style/axis.shadow.css +3 -0
  152. package/lib/cjs/style/plot.shadow.css +1 -3
  153. package/lib/cjs/style/plotA11yModule.shadow.css +10 -11
  154. package/lib/cjs/style/plotA11yView.shadow.css +13 -26
  155. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +15 -15
  156. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
  157. package/lib/cjs/types/Axis.d.js.map +1 -1
  158. package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
  159. package/lib/cjs/types/Hover.d.js.map +1 -1
  160. package/lib/cjs/types/Line.d.js.map +1 -1
  161. package/lib/cjs/types/Plot.d.js.map +1 -1
  162. package/lib/cjs/types/Radar.d.js.map +1 -1
  163. package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
  164. package/lib/cjs/types/Tooltip.d.js.map +1 -1
  165. package/lib/cjs/types/Venn.d.js.map +1 -1
  166. package/lib/cjs/types/index.d.js +80 -80
  167. package/lib/cjs/types/index.d.js.map +1 -1
  168. package/lib/cjs/utils.js +122 -145
  169. package/lib/cjs/utils.js.map +1 -1
  170. package/lib/es6/AnimatedClipPath.js +24 -37
  171. package/lib/es6/AnimatedClipPath.js.map +1 -1
  172. package/lib/es6/Area.js +179 -215
  173. package/lib/es6/Area.js.map +1 -1
  174. package/lib/es6/Axis.js +242 -321
  175. package/lib/es6/Axis.js.map +1 -1
  176. package/lib/es6/Bar.js +154 -177
  177. package/lib/es6/Bar.js.map +1 -1
  178. package/lib/es6/Bubble.js +206 -235
  179. package/lib/es6/Bubble.js.map +1 -1
  180. package/lib/es6/CompactHorizontalBar.js +433 -467
  181. package/lib/es6/CompactHorizontalBar.js.map +1 -1
  182. package/lib/es6/Donut.js +337 -384
  183. package/lib/es6/Donut.js.map +1 -1
  184. package/lib/es6/Dots.js +60 -79
  185. package/lib/es6/Dots.js.map +1 -1
  186. package/lib/es6/GroupBar.js +74 -89
  187. package/lib/es6/GroupBar.js.map +1 -1
  188. package/lib/es6/HorizontalBar.js +141 -159
  189. package/lib/es6/HorizontalBar.js.map +1 -1
  190. package/lib/es6/Hover.js +174 -203
  191. package/lib/es6/Hover.js.map +1 -1
  192. package/lib/es6/Line.js +173 -213
  193. package/lib/es6/Line.js.map +1 -1
  194. package/lib/es6/Pattern.js +68 -74
  195. package/lib/es6/Pattern.js.map +1 -1
  196. package/lib/es6/Plot.js +95 -121
  197. package/lib/es6/Plot.js.map +1 -1
  198. package/lib/es6/Radar.js +554 -659
  199. package/lib/es6/Radar.js.map +1 -1
  200. package/lib/es6/RadialTree.js +500 -553
  201. package/lib/es6/RadialTree.js.map +1 -1
  202. package/lib/es6/Reference.js +140 -171
  203. package/lib/es6/Reference.js.map +1 -1
  204. package/lib/es6/ResponsiveContainer.js +58 -76
  205. package/lib/es6/ResponsiveContainer.js.map +1 -1
  206. package/lib/es6/ScatterPlot.js +161 -191
  207. package/lib/es6/ScatterPlot.js.map +1 -1
  208. package/lib/es6/StackBar.js +130 -172
  209. package/lib/es6/StackBar.js.map +1 -1
  210. package/lib/es6/StackedArea.js +56 -69
  211. package/lib/es6/StackedArea.js.map +1 -1
  212. package/lib/es6/Tooltip.js +183 -198
  213. package/lib/es6/Tooltip.js.map +1 -1
  214. package/lib/es6/Venn.js +169 -204
  215. package/lib/es6/Venn.js.map +1 -1
  216. package/lib/es6/a11y/DataAccessibilityTable.js +41 -80
  217. package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
  218. package/lib/es6/a11y/PlotA11yModule.js +35 -95
  219. package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
  220. package/lib/es6/a11y/PlotA11yView.js +89 -84
  221. package/lib/es6/a11y/PlotA11yView.js.map +1 -1
  222. package/lib/es6/a11y/bezier.js +16 -23
  223. package/lib/es6/a11y/bezier.js.map +1 -1
  224. package/lib/es6/a11y/focus.js +15 -16
  225. package/lib/es6/a11y/focus.js.map +1 -1
  226. package/lib/es6/a11y/hints.js +67 -73
  227. package/lib/es6/a11y/hints.js.map +1 -1
  228. package/lib/es6/a11y/insights.js +353 -524
  229. package/lib/es6/a11y/insights.js.map +1 -1
  230. package/lib/es6/a11y/intl.js +4 -5
  231. package/lib/es6/a11y/intl.js.map +1 -1
  232. package/lib/es6/a11y/locale.js +11 -18
  233. package/lib/es6/a11y/locale.js.map +1 -1
  234. package/lib/es6/a11y/serialize.js +162 -203
  235. package/lib/es6/a11y/serialize.js.map +1 -1
  236. package/lib/es6/a11y/summarize.js +6 -6
  237. package/lib/es6/a11y/summarize.js.map +1 -1
  238. package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js +15 -15
  239. package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
  240. package/lib/es6/a11y/translations/module/de.json +2 -2
  241. package/lib/es6/a11y/translations/module/en.json +2 -2
  242. package/lib/es6/a11y/translations/module/es.json +2 -2
  243. package/lib/es6/a11y/translations/module/fr.json +2 -2
  244. package/lib/es6/a11y/translations/module/it.json +2 -2
  245. package/lib/es6/a11y/translations/module/ja.json +2 -2
  246. package/lib/es6/a11y/translations/module/ko.json +2 -2
  247. package/lib/es6/a11y/translations/module/nl.json +2 -2
  248. package/lib/es6/a11y/translations/module/pl.json +2 -2
  249. package/lib/es6/a11y/translations/module/pt.json +2 -2
  250. package/lib/es6/a11y/translations/module/sv.json +2 -2
  251. package/lib/es6/a11y/translations/module/tr.json +2 -2
  252. package/lib/es6/a11y/translations/module/vi.json +2 -2
  253. package/lib/es6/a11y/translations/module/zh.json +2 -2
  254. package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js +15 -15
  255. package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
  256. package/lib/es6/color.js +1 -1
  257. package/lib/es6/color.js.map +1 -1
  258. package/lib/es6/component/Chart/AbstractChart.js +416 -462
  259. package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
  260. package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
  261. package/lib/es6/component/Chart/AreaChart.js +92 -111
  262. package/lib/es6/component/Chart/AreaChart.js.map +1 -1
  263. package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
  264. package/lib/es6/component/Chart/BarChart.js +225 -213
  265. package/lib/es6/component/Chart/BarChart.js.map +1 -1
  266. package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
  267. package/lib/es6/component/Chart/BubbleChart.js +109 -132
  268. package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
  269. package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
  270. package/lib/es6/component/Chart/CigaretteChart.js +276 -301
  271. package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
  272. package/lib/es6/component/Chart/CompactHorizontalBarChart.js +70 -103
  273. package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -1
  274. package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  275. package/lib/es6/component/Chart/DonutChart.js +74 -90
  276. package/lib/es6/component/Chart/DonutChart.js.map +1 -1
  277. package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
  278. package/lib/es6/component/Chart/HistogramChart.js +121 -144
  279. package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
  280. package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
  281. package/lib/es6/component/Chart/LineChart.js +90 -109
  282. package/lib/es6/component/Chart/LineChart.js.map +1 -1
  283. package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
  284. package/lib/es6/component/Chart/RadarChart.js +80 -107
  285. package/lib/es6/component/Chart/RadarChart.js.map +1 -1
  286. package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
  287. package/lib/es6/component/Chart/ScatterPlotChart.js +113 -138
  288. package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
  289. package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
  290. package/lib/es6/component/Chart/VennChart.js +97 -117
  291. package/lib/es6/component/Chart/VennChart.js.map +1 -1
  292. package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
  293. package/lib/es6/component/ChartLegend/BaseLegend.js +70 -104
  294. package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
  295. package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
  296. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +53 -65
  297. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  298. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
  299. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +198 -211
  300. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  301. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
  302. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  303. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +58 -68
  304. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  305. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  306. package/lib/es6/component/Cigarette/Cigarette.js +108 -122
  307. package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
  308. package/lib/es6/component/StackGroupBar/StackGroupBar.js +100 -130
  309. package/lib/es6/component/StackGroupBar/StackGroupBar.js.map +1 -1
  310. package/lib/es6/component/SvgElement.js +4 -5
  311. package/lib/es6/component/SvgElement.js.map +1 -1
  312. package/lib/es6/createElement.js +55 -54
  313. package/lib/es6/createElement.js.map +1 -1
  314. package/lib/es6/style/axis.shadow.css +3 -0
  315. package/lib/es6/style/plot.shadow.css +1 -3
  316. package/lib/es6/style/plotA11yModule.shadow.css +10 -11
  317. package/lib/es6/style/plotA11yView.shadow.css +13 -26
  318. package/lib/es6/translations/__intergalactic-dynamic-locales.js +14 -14
  319. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
  320. package/lib/es6/types/Axis.d.js.map +1 -1
  321. package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
  322. package/lib/es6/types/Hover.d.js.map +1 -1
  323. package/lib/es6/types/Line.d.js.map +1 -1
  324. package/lib/es6/types/Plot.d.js.map +1 -1
  325. package/lib/es6/types/Radar.d.js.map +1 -1
  326. package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
  327. package/lib/es6/types/Tooltip.d.js.map +1 -1
  328. package/lib/es6/types/Venn.d.js.map +1 -1
  329. package/lib/es6/utils.js +105 -144
  330. package/lib/es6/utils.js.map +1 -1
  331. package/lib/esm/AnimatedClipPath.mjs +24 -36
  332. package/lib/esm/Area.mjs +178 -149
  333. package/lib/esm/Axis.mjs +241 -242
  334. package/lib/esm/Bar.mjs +155 -137
  335. package/lib/esm/Bubble.mjs +205 -171
  336. package/lib/esm/CompactHorizontalBar.mjs +428 -383
  337. package/lib/esm/Donut.mjs +315 -266
  338. package/lib/esm/Dots.mjs +60 -49
  339. package/lib/esm/GroupBar.mjs +71 -75
  340. package/lib/esm/HorizontalBar.mjs +142 -120
  341. package/lib/esm/Hover.mjs +173 -163
  342. package/lib/esm/Line.mjs +174 -145
  343. package/lib/esm/Pattern.mjs +67 -63
  344. package/lib/esm/Plot.mjs +98 -95
  345. package/lib/esm/Radar.mjs +550 -498
  346. package/lib/esm/RadialTree.mjs +512 -416
  347. package/lib/esm/Reference.mjs +137 -122
  348. package/lib/esm/ResponsiveContainer.mjs +58 -69
  349. package/lib/esm/ScatterPlot.mjs +163 -162
  350. package/lib/esm/StackBar.mjs +126 -147
  351. package/lib/esm/StackedArea.mjs +53 -61
  352. package/lib/esm/Tooltip.mjs +185 -175
  353. package/lib/esm/Venn.mjs +170 -170
  354. package/lib/esm/a11y/DataAccessibilityTable.mjs +46 -73
  355. package/lib/esm/a11y/PlotA11yModule.mjs +37 -80
  356. package/lib/esm/a11y/PlotA11yView.mjs +99 -74
  357. package/lib/esm/a11y/bezier.mjs +16 -23
  358. package/lib/esm/a11y/focus.mjs +15 -16
  359. package/lib/esm/a11y/hints.mjs +65 -71
  360. package/lib/esm/a11y/insights.mjs +347 -495
  361. package/lib/esm/a11y/intl.mjs +4 -5
  362. package/lib/esm/a11y/locale.mjs +12 -14
  363. package/lib/esm/a11y/serialize.mjs +139 -152
  364. package/lib/esm/a11y/summarize.mjs +3 -3
  365. package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +1 -1
  366. package/lib/esm/a11y/translations/module/de.json.mjs +2 -4
  367. package/lib/esm/a11y/translations/module/en.json.mjs +2 -4
  368. package/lib/esm/a11y/translations/module/es.json.mjs +2 -4
  369. package/lib/esm/a11y/translations/module/fr.json.mjs +2 -4
  370. package/lib/esm/a11y/translations/module/it.json.mjs +2 -4
  371. package/lib/esm/a11y/translations/module/ja.json.mjs +2 -4
  372. package/lib/esm/a11y/translations/module/ko.json.mjs +2 -4
  373. package/lib/esm/a11y/translations/module/nl.json.mjs +2 -4
  374. package/lib/esm/a11y/translations/module/pl.json.mjs +2 -4
  375. package/lib/esm/a11y/translations/module/pt.json.mjs +2 -4
  376. package/lib/esm/a11y/translations/module/sv.json.mjs +2 -4
  377. package/lib/esm/a11y/translations/module/tr.json.mjs +2 -4
  378. package/lib/esm/a11y/translations/module/vi.json.mjs +2 -4
  379. package/lib/esm/a11y/translations/module/zh.json.mjs +2 -4
  380. package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +1 -1
  381. package/lib/esm/color.mjs +1 -1
  382. package/lib/esm/component/Chart/AbstractChart.mjs +422 -415
  383. package/lib/esm/component/Chart/AreaChart.mjs +92 -91
  384. package/lib/esm/component/Chart/BarChart.mjs +225 -177
  385. package/lib/esm/component/Chart/BubbleChart.mjs +110 -118
  386. package/lib/esm/component/Chart/CigaretteChart.mjs +277 -268
  387. package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +70 -87
  388. package/lib/esm/component/Chart/DonutChart.mjs +74 -84
  389. package/lib/esm/component/Chart/HistogramChart.mjs +121 -117
  390. package/lib/esm/component/Chart/LineChart.mjs +90 -89
  391. package/lib/esm/component/Chart/RadarChart.mjs +81 -97
  392. package/lib/esm/component/Chart/ScatterPlotChart.mjs +113 -111
  393. package/lib/esm/component/Chart/VennChart.mjs +98 -111
  394. package/lib/esm/component/ChartLegend/BaseLegend.mjs +75 -97
  395. package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +54 -55
  396. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +194 -165
  397. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +1 -1
  398. package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +60 -58
  399. package/lib/esm/component/Cigarette/Cigarette.mjs +109 -99
  400. package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +97 -111
  401. package/lib/esm/component/SvgElement.mjs +4 -4
  402. package/lib/esm/createElement.mjs +54 -37
  403. package/lib/esm/style/axis.shadow.css +3 -0
  404. package/lib/esm/style/plot.shadow.css +1 -3
  405. package/lib/esm/style/plotA11yModule.shadow.css +10 -11
  406. package/lib/esm/style/plotA11yView.shadow.css +13 -26
  407. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
  408. package/lib/esm/utils.mjs +103 -138
  409. package/lib/types/Axis.d.ts +4 -0
  410. package/lib/types/CompactHorizontalBar.d.ts +1 -1
  411. package/lib/types/Hover.d.ts +1 -1
  412. package/lib/types/Line.d.ts +1 -1
  413. package/lib/types/Plot.d.ts +1 -1
  414. package/lib/types/Radar.d.ts +1 -1
  415. package/lib/types/ResponsiveContainer.d.ts +1 -1
  416. package/lib/types/Tooltip.d.ts +1 -3
  417. package/lib/types/Venn.d.ts +1 -1
  418. package/lib/types/a11y/PlotA11yModule.d.ts +4 -11
  419. package/lib/types/a11y/PlotA11yView.d.ts +12 -1
  420. package/lib/types/a11y/translations/module/__intergalactic-dynamic-locales.d.ts +14 -14
  421. package/lib/types/component/Chart/AbstractChart.d.ts +1 -1
  422. package/lib/types/component/Chart/AbstractChart.type.d.ts +1 -1
  423. package/lib/types/component/Chart/AreaChart.type.d.ts +1 -1
  424. package/lib/types/component/Chart/BarChart.type.d.ts +1 -1
  425. package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
  426. package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
  427. package/lib/types/component/Chart/DonutChart.type.d.ts +1 -1
  428. package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -1
  429. package/lib/types/component/Chart/LineChart.type.d.ts +1 -1
  430. package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
  431. package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
  432. package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
  433. package/lib/types/component/ChartLegend/BaseLegend.d.ts +1 -1
  434. package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -1
  435. package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +1 -1
  436. package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +1 -1
  437. package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +1 -1
  438. package/lib/types/utils.d.ts +10 -10
  439. package/package.json +11 -14
@@ -1,298 +1,259 @@
1
- import _readOnlyError from "@babel/runtime/helpers/readOnlyError";
2
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
3
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
- import _createClass from "@babel/runtime/helpers/createClass";
6
- import _callSuper from "@babel/runtime/helpers/callSuper";
7
- import _inherits from "@babel/runtime/helpers/inherits";
8
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
2
  import { sstyled as _sstyled } from "@semcore/core";
10
3
  import { assignProps as _assignProps4 } from "@semcore/core";
11
4
  import { assignProps as _assignProps3 } from "@semcore/core";
12
5
  import { assignProps as _assignProps2 } from "@semcore/core";
13
6
  import { assignProps as _assignProps } from "@semcore/core";
7
+ import { Box } from '@semcore/base-components';
14
8
  import { Component, Root, sstyled } from '@semcore/core';
15
9
  import { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';
16
10
  import canUseDOM from '@semcore/core/lib/utils/canUseDOM';
17
11
  import trottle from '@semcore/core/lib/utils/rafTrottle';
18
12
  import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
19
- import { Box } from '@semcore/flex-box';
20
13
  import React from 'react';
21
14
  import AnimatedClipPath from './AnimatedClipPath';
22
15
  import createElement from './createElement';
23
16
  import { PatternFill } from './Pattern';
24
17
  /*!__reshadow-styles__:"./style/bar.shadow.css"*/
25
- var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SBar_194w8_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_194w8);transition-timing-function:ease-in-out}.___SBar_194w8_gg_.__color_194w8_gg_{fill:var(--color_194w8)}.___SBar_194w8_gg_.__pattern_194w8_gg_.__color_194w8_gg_{fill:var(--pattern_194w8);stroke:var(--color_194w8);stroke-width:1px}.___SBar_194w8_gg_.__hide_194w8_gg_{display:none}.___SBar_194w8_gg_.__transparent_194w8_gg_{opacity:.3}.___SBackground_194w8_gg_.__onClick_194w8_gg_,.___SBar_194w8_gg_.__onClick_194w8_gg_{cursor:pointer}.___SBackground_194w8_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9)}.___SBarAnnotation_194w8_gg_{display:flex;justify-content:space-between}.___SBarLabel_194w8_gg_{color:var(--intergalactic-text-primary, #191b23);margin-right:auto}.___SBarLabel_194w8_gg_,.___SBarPercent_194w8_gg_,.___SBarValue_194w8_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SBarPercent_194w8_gg_{color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SBarValue_194w8_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary, #191b23);text-align:right}.___SCompactHorizontalBarHoverRect_194w8_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}", /*__inner_css_end__*/"194w8_gg_"),
18
+ const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SBar_1j50a_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_1j50a);transition-timing-function:ease-in-out}.___SBar_1j50a_gg_.__color_1j50a_gg_{fill:var(--color_1j50a)}.___SBar_1j50a_gg_.__pattern_1j50a_gg_.__color_1j50a_gg_{fill:var(--pattern_1j50a);stroke:var(--color_1j50a);stroke-width:1px}.___SBar_1j50a_gg_.__hide_1j50a_gg_{display:none}.___SBar_1j50a_gg_.__transparent_1j50a_gg_{opacity:.3}.___SBackground_1j50a_gg_.__onClick_1j50a_gg_,.___SBar_1j50a_gg_.__onClick_1j50a_gg_{cursor:pointer}.___SBackground_1j50a_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9)}.___SBarAnnotation_1j50a_gg_{display:flex;justify-content:space-between}.___SBarLabel_1j50a_gg_{color:var(--intergalactic-text-primary, #191b23);margin-right:auto}.___SBarLabel_1j50a_gg_,.___SBarPercent_1j50a_gg_,.___SBarValue_1j50a_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SBarPercent_1j50a_gg_{color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SBarValue_1j50a_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary, #191b23);text-align:right}.___SCompactHorizontalBarHoverRect_1j50a_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}", /*__inner_css_end__*/"1j50a_gg_"),
26
19
  /*__reshadow_css_end__*/
27
20
  {
28
- "__SBar": "___SBar_194w8_gg_",
29
- "--duration": "--duration_194w8",
30
- "_color": "__color_194w8_gg_",
31
- "--color": "--color_194w8",
32
- "_pattern": "__pattern_194w8_gg_",
33
- "--pattern": "--pattern_194w8",
34
- "_hide": "__hide_194w8_gg_",
35
- "_transparent": "__transparent_194w8_gg_",
36
- "_onClick": "__onClick_194w8_gg_",
37
- "__SBackground": "___SBackground_194w8_gg_",
38
- "__SBarAnnotation": "___SBarAnnotation_194w8_gg_",
39
- "__SBarLabel": "___SBarLabel_194w8_gg_",
40
- "__SBarPercent": "___SBarPercent_194w8_gg_",
41
- "__SBarValue": "___SBarValue_194w8_gg_",
42
- "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_194w8_gg_"
21
+ "__SBar": "___SBar_1j50a_gg_",
22
+ "--duration": "--duration_1j50a",
23
+ "_color": "__color_1j50a_gg_",
24
+ "--color": "--color_1j50a",
25
+ "_pattern": "__pattern_1j50a_gg_",
26
+ "--pattern": "--pattern_1j50a",
27
+ "_hide": "__hide_1j50a_gg_",
28
+ "_transparent": "__transparent_1j50a_gg_",
29
+ "_onClick": "__onClick_1j50a_gg_",
30
+ "__SBackground": "___SBackground_1j50a_gg_",
31
+ "__SBarAnnotation": "___SBarAnnotation_1j50a_gg_",
32
+ "__SBarLabel": "___SBarLabel_1j50a_gg_",
33
+ "__SBarPercent": "___SBarPercent_1j50a_gg_",
34
+ "__SBarValue": "___SBarValue_1j50a_gg_",
35
+ "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1j50a_gg_"
43
36
  });
44
37
  import Tooltip from './Tooltip';
45
38
  import { roundedPath, scaleToBand, eventToPoint } from './utils';
46
- export var MIN_WIDTH = 4;
47
- var barHeight = 20;
48
- var hoverOffset = 6;
49
- var CompactHorizontalBarRoot = /*#__PURE__*/function (_Component) {
50
- function CompactHorizontalBarRoot() {
51
- var _this;
52
- _classCallCheck(this, CompactHorizontalBarRoot);
53
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
54
- args[_key] = arguments[_key];
55
- }
56
- _this = _callSuper(this, CompactHorizontalBarRoot, [].concat(args));
57
- _defineProperty(_this, "state", {
39
+ export const MIN_WIDTH = 4;
40
+ const barHeight = 20;
41
+ const hoverOffset = 6;
42
+ class CompactHorizontalBarRoot extends Component {
43
+ constructor(...args) {
44
+ super(...args);
45
+ _defineProperty(this, "state", {
58
46
  indexToHover: null
59
47
  });
60
- _defineProperty(_this, "percentFormatter", null);
61
- _defineProperty(_this, "percentFormatterLocale", null);
62
- _defineProperty(_this, "valueFormatter", null);
63
- _defineProperty(_this, "valueFormatterLocale", null);
64
- return _this;
48
+ _defineProperty(this, "percentFormatter", null);
49
+ _defineProperty(this, "percentFormatterLocale", null);
50
+ _defineProperty(this, "valueFormatter", null);
51
+ _defineProperty(this, "valueFormatterLocale", null);
65
52
  }
66
- _inherits(CompactHorizontalBarRoot, _Component);
67
- return _createClass(CompactHorizontalBarRoot, [{
68
- key: "getBarProps",
69
- value: function getBarProps(_props, index) {
70
- return {
71
- index: index
72
- };
73
- }
74
- }, {
75
- key: "getBarBackgroundProps",
76
- value: function getBarBackgroundProps(_props, index) {
77
- var _this$asProps = this.asProps,
78
- data = _this$asProps.data,
79
- scale = _this$asProps.scale;
80
- var bar = this.computeBarData(data[index], index);
81
- return {
82
- scale: scale,
83
- index: index,
84
- x: bar.x,
85
- y: bar.y + bar.height - barHeight - hoverOffset,
86
- height: barHeight,
87
- width: bar.fullWidth
88
- };
89
- }
90
- }, {
91
- key: "getBarFillProps",
92
- value: function getBarFillProps(_props, index) {
93
- var _this$asProps2 = this.asProps,
94
- data = _this$asProps2.data,
95
- uid = _this$asProps2.uid,
96
- patterns = _this$asProps2.patterns,
97
- color = _this$asProps2.color,
98
- transparent = _this$asProps2.transparent,
99
- hide = _this$asProps2.hide,
100
- scale = _this$asProps2.scale;
101
- var bar = this.computeBarData(data[index], index);
102
- return {
103
- x: bar.x,
104
- y: bar.y + bar.height - barHeight - hoverOffset,
105
- height: barHeight,
106
- width: bar.width,
107
- i: index,
108
- uid: uid,
109
- resolveColor: this.asProps.resolveColor,
110
- patterns: patterns,
111
- color: color,
112
- transparent: transparent,
113
- hide: hide,
114
- scale: scale,
115
- index: index
116
- };
117
- }
118
- }, {
119
- key: "getAnnotationProps",
120
- value: function getAnnotationProps(_props, index) {
121
- var _this$asProps3 = this.asProps,
122
- data = _this$asProps3.data,
123
- size = _this$asProps3.size;
124
- var bar = this.computeBarData(data[index], index);
125
- return {
126
- y: bar.y,
127
- height: barHeight * 2,
128
- width: size[0],
129
- index: index
130
- };
131
- }
132
- }, {
133
- key: "getLabelProps",
134
- value: function getLabelProps(_props, index) {
135
- var _this$asProps4 = this.asProps,
136
- data = _this$asProps4.data,
137
- y = _this$asProps4.y;
138
- var label = data[index][y];
139
- return {
140
- children: label,
141
- index: index
142
- };
143
- }
144
- }, {
145
- key: "getPercentFormatter",
146
- value: function getPercentFormatter() {
147
- if (!this.percentFormatter || this.percentFormatterLocale !== this.asProps.locale) {
148
- this.percentFormatter = new Intl.NumberFormat(this.asProps.locale, {
149
- style: 'percent'
150
- });
151
- this.percentFormatterLocale = this.asProps.locale;
152
- }
153
- return this.percentFormatter;
154
- }
155
- }, {
156
- key: "getValueFormatter",
157
- value: function getValueFormatter() {
158
- if (!this.valueFormatter || this.valueFormatterLocale !== this.asProps.locale) {
159
- this.valueFormatter = new Intl.NumberFormat(this.asProps.locale);
160
- this.valueFormatterLocale = this.asProps.locale;
161
- }
162
- return this.valueFormatter;
163
- }
164
- }, {
165
- key: "getPercentProps",
166
- value: function getPercentProps(_props, index) {
167
- var _this$asProps5 = this.asProps,
168
- data = _this$asProps5.data,
169
- x = _this$asProps5.x,
170
- scale = _this$asProps5.scale;
171
- var value = data[index][x];
172
- var domain = scale[0].domain();
173
- var percent = value / domain[1];
174
- var formatter = this.getPercentFormatter();
175
- var formatted = formatter.format(percent);
176
- return {
177
- children: formatted,
178
- formatted: formatted,
179
- percent: percent
180
- };
181
- }
182
- }, {
183
- key: "getValueProps",
184
- value: function getValueProps(_props, index) {
185
- var _this$asProps6 = this.asProps,
186
- data = _this$asProps6.data,
187
- x = _this$asProps6.x;
188
- var value = data[index][x];
189
- var formatter = this.getValueFormatter();
190
- var formatted = formatter.format(value);
191
- return {
192
- children: formatted,
193
- formatted: formatted,
194
- value: value
195
- };
196
- }
197
- }, {
198
- key: "getHoverProps",
199
- value: function getHoverProps(_props, index) {
200
- var _this2 = this;
201
- var data = this.asProps.data;
202
- return {
203
- data: data,
204
- getBarData: function getBarData(index) {
205
- return _this2.computeBarData(data[index], index);
206
- },
207
- render: index === 0,
208
- updateIndexToHover: function updateIndexToHover(index) {
209
- return _this2.setState({
210
- indexToHover: index
211
- });
212
- }
213
- };
214
- }
215
- }, {
216
- key: "getTooltipProps",
217
- value: function getTooltipProps(_props, index) {
218
- return {
219
- render: index === 0,
220
- index: this.state.indexToHover
221
- };
222
- }
223
- }, {
224
- key: "computeBarData",
225
- value: function computeBarData(d) {
226
- var _this$asProps7 = this.asProps,
227
- x = _this$asProps7.x,
228
- y = _this$asProps7.y,
229
- scale = _this$asProps7.scale,
230
- offsetProps = _this$asProps7.offset,
231
- wMin = _this$asProps7.wMin,
232
- heightProps = _this$asProps7.height,
233
- _this$asProps7$maxBar = _this$asProps7.maxBarSize,
234
- maxBarSize = _this$asProps7$maxBar === void 0 ? Number.POSITIVE_INFINITY : _this$asProps7$maxBar,
235
- size = _this$asProps7.size;
236
- var offset = typeof offsetProps === 'function' ? offsetProps(i) : offsetProps;
237
- var _scale = _slicedToArray(scale, 2),
238
- xScale = _scale[0],
239
- yScale = _scale[1];
240
- var absWidth = xScale(d[x]);
241
- var bandHeight = heightProps || scaleToBand(yScale).bandwidth();
242
- var height = Math.min(bandHeight, maxBarSize);
243
- var width = absWidth === 0 ? 0 : Math.max(absWidth, wMin);
244
- var barY = yScale(d[y]) + bandHeight / 2 - height / 2 + offset[1];
245
- return {
246
- x: 0,
247
- y: barY,
248
- width: width,
249
- fullWidth: size[0],
250
- height: height
251
- };
252
- }
253
- }, {
254
- key: "renderBar",
255
- value: function renderBar(d, i) {
256
- var _ref5;
257
- var SCompactHorizontalBarGroup = this.Element;
258
- var _this$asProps8 = this.asProps,
259
- styles = _this$asProps8.styles,
260
- groupKey = _this$asProps8.groupKey;
261
- var _this$computeBarData = this.computeBarData(d, i),
262
- x = _this$computeBarData.x,
263
- y = _this$computeBarData.y;
264
- this.asProps.dataHintsHandler.describeValueEntity("".concat(i, ".").concat(x), groupKey !== null && groupKey !== void 0 ? groupKey : d[y]);
265
- return /*#__PURE__*/React.createElement(React.Fragment, {
266
- key: "horizontal-bar-".concat(i)
267
- }, (_ref5 = sstyled(styles), /*#__PURE__*/React.createElement(SCompactHorizontalBarGroup, _ref5.cn("SCompactHorizontalBarGroup", {
268
- "render": 'g'
269
- }))));
270
- }
271
- }, {
272
- key: "renderBars",
273
- value: function renderBars() {
274
- var data = this.asProps.data;
275
- return data.map(this.renderBar.bind(this));
53
+ getBarProps(_props, index) {
54
+ return {
55
+ index
56
+ };
57
+ }
58
+ getBarBackgroundProps(_props, index) {
59
+ const {
60
+ data,
61
+ scale
62
+ } = this.asProps;
63
+ const bar = this.computeBarData(data[index], index);
64
+ return {
65
+ scale,
66
+ index,
67
+ x: bar.x,
68
+ y: bar.y + bar.height - barHeight - hoverOffset,
69
+ height: barHeight,
70
+ width: bar.fullWidth
71
+ };
72
+ }
73
+ getBarFillProps(_props, index) {
74
+ const {
75
+ data,
76
+ uid,
77
+ patterns,
78
+ color,
79
+ transparent,
80
+ hide,
81
+ scale
82
+ } = this.asProps;
83
+ const bar = this.computeBarData(data[index], index);
84
+ return {
85
+ x: bar.x,
86
+ y: bar.y + bar.height - barHeight - hoverOffset,
87
+ height: barHeight,
88
+ width: bar.width,
89
+ i: index,
90
+ uid,
91
+ resolveColor: this.asProps.resolveColor,
92
+ patterns,
93
+ color,
94
+ transparent,
95
+ hide,
96
+ scale,
97
+ index
98
+ };
99
+ }
100
+ getAnnotationProps(_props, index) {
101
+ const {
102
+ data,
103
+ size
104
+ } = this.asProps;
105
+ const bar = this.computeBarData(data[index], index);
106
+ return {
107
+ y: bar.y,
108
+ height: barHeight * 2,
109
+ width: size[0],
110
+ index
111
+ };
112
+ }
113
+ getLabelProps(_props, index) {
114
+ const {
115
+ data,
116
+ y
117
+ } = this.asProps;
118
+ const label = data[index][y];
119
+ return {
120
+ children: label,
121
+ index
122
+ };
123
+ }
124
+ getPercentFormatter() {
125
+ if (!this.percentFormatter || this.percentFormatterLocale !== this.asProps.locale) {
126
+ this.percentFormatter = new Intl.NumberFormat(this.asProps.locale, {
127
+ style: 'percent'
128
+ });
129
+ this.percentFormatterLocale = this.asProps.locale;
276
130
  }
277
- }, {
278
- key: "render",
279
- value: function render() {
280
- var _this$asProps9 = this.asProps,
281
- uid = _this$asProps9.uid,
282
- size = _this$asProps9.size,
283
- duration = _this$asProps9.duration;
284
- return /*#__PURE__*/React.createElement(React.Fragment, null, this.renderBars(), duration && /*#__PURE__*/React.createElement(AnimatedClipPath, {
285
- "aria-hidden": true,
286
- duration: duration,
287
- id: uid,
288
- x: "0",
289
- y: "0",
290
- width: 0,
291
- height: size[1]
292
- }));
131
+ return this.percentFormatter;
132
+ }
133
+ getValueFormatter() {
134
+ if (!this.valueFormatter || this.valueFormatterLocale !== this.asProps.locale) {
135
+ this.valueFormatter = new Intl.NumberFormat(this.asProps.locale);
136
+ this.valueFormatterLocale = this.asProps.locale;
293
137
  }
294
- }]);
295
- }(Component);
138
+ return this.valueFormatter;
139
+ }
140
+ getPercentProps(_props, index) {
141
+ const {
142
+ data,
143
+ x,
144
+ scale
145
+ } = this.asProps;
146
+ const value = data[index][x];
147
+ const domain = scale[0].domain();
148
+ const percent = value / domain[1];
149
+ const formatter = this.getPercentFormatter();
150
+ const formatted = formatter.format(percent);
151
+ return {
152
+ children: formatted,
153
+ formatted,
154
+ percent
155
+ };
156
+ }
157
+ getValueProps(_props, index) {
158
+ const {
159
+ data,
160
+ x
161
+ } = this.asProps;
162
+ const value = data[index][x];
163
+ const formatter = this.getValueFormatter();
164
+ const formatted = formatter.format(value);
165
+ return {
166
+ children: formatted,
167
+ formatted,
168
+ value
169
+ };
170
+ }
171
+ getHoverProps(_props, index) {
172
+ const {
173
+ data
174
+ } = this.asProps;
175
+ return {
176
+ data,
177
+ getBarData: index => this.computeBarData(data[index], index),
178
+ render: index === 0,
179
+ updateIndexToHover: index => this.setState({
180
+ indexToHover: index
181
+ })
182
+ };
183
+ }
184
+ getTooltipProps(_props, index) {
185
+ return {
186
+ render: index === 0,
187
+ index: this.state.indexToHover
188
+ };
189
+ }
190
+ computeBarData(d) {
191
+ const {
192
+ x,
193
+ y,
194
+ scale,
195
+ offset: offsetProps,
196
+ wMin,
197
+ height: heightProps,
198
+ maxBarSize = Number.POSITIVE_INFINITY,
199
+ size
200
+ } = this.asProps;
201
+ const offset = typeof offsetProps === 'function' ? offsetProps(i) : offsetProps;
202
+ const [xScale, yScale] = scale;
203
+ const absWidth = xScale(d[x]);
204
+ const bandHeight = heightProps || scaleToBand(yScale).bandwidth();
205
+ const height = Math.min(bandHeight, maxBarSize);
206
+ const width = absWidth === 0 ? 0 : Math.max(absWidth, wMin);
207
+ const barY = yScale(d[y]) + bandHeight / 2 - height / 2 + offset[1];
208
+ return {
209
+ x: 0,
210
+ y: barY,
211
+ width,
212
+ fullWidth: size[0],
213
+ height
214
+ };
215
+ }
216
+ renderBar(d, i) {
217
+ var _ref5;
218
+ const SCompactHorizontalBarGroup = this.Element;
219
+ const {
220
+ styles,
221
+ groupKey
222
+ } = this.asProps;
223
+ const {
224
+ x,
225
+ y
226
+ } = this.computeBarData(d, i);
227
+ this.asProps.dataHintsHandler.describeValueEntity(`${i}.${x}`, groupKey ?? d[y]);
228
+ return /*#__PURE__*/React.createElement(React.Fragment, {
229
+ key: `horizontal-bar-${i}`
230
+ }, (_ref5 = sstyled(styles), /*#__PURE__*/React.createElement(SCompactHorizontalBarGroup, _ref5.cn("SCompactHorizontalBarGroup", {
231
+ "render": 'g'
232
+ }))));
233
+ }
234
+ renderBars() {
235
+ const {
236
+ data
237
+ } = this.asProps;
238
+ return data.map(this.renderBar.bind(this));
239
+ }
240
+ render() {
241
+ const {
242
+ uid,
243
+ size,
244
+ duration
245
+ } = this.asProps;
246
+ return /*#__PURE__*/React.createElement(React.Fragment, null, this.renderBars(), duration && /*#__PURE__*/React.createElement(AnimatedClipPath, {
247
+ "aria-hidden": true,
248
+ duration: duration,
249
+ id: uid,
250
+ x: "0",
251
+ y: "0",
252
+ width: 0,
253
+ height: size[1]
254
+ }));
255
+ }
256
+ }
296
257
  _defineProperty(CompactHorizontalBarRoot, "displayName", 'CompactHorizontalBar');
297
258
  _defineProperty(CompactHorizontalBarRoot, "enhance", [uniqueIDEnhancement()]);
298
259
  _defineProperty(CompactHorizontalBarRoot, "style", style);
@@ -305,12 +266,14 @@ _defineProperty(CompactHorizontalBarRoot, "defaultProps", {
305
266
  });
306
267
  function Annotation(props) {
307
268
  var _ref6;
308
- var Children = props.Children,
309
- y = props.y,
310
- height = props.height,
311
- width = props.width,
312
- styles = props.styles;
313
- var SBarAnnotation = 'div';
269
+ const {
270
+ Children,
271
+ y,
272
+ height,
273
+ width,
274
+ styles
275
+ } = props;
276
+ const SBarAnnotation = 'div';
314
277
  return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement("foreignObject", _ref6.cn("foreignObject", {
315
278
  "x": '0',
316
279
  "y": y - barHeight,
@@ -319,105 +282,118 @@ function Annotation(props) {
319
282
  "overflow": 'visible'
320
283
  }), /*#__PURE__*/React.createElement(SBarAnnotation, _ref6.cn("SBarAnnotation", {}), /*#__PURE__*/React.createElement(Children, _ref6.cn("Children", {}))));
321
284
  }
322
- var excludeProps = ['data', 'scale', 'value', 'offset'];
285
+ const excludeProps = ['data', 'scale', 'value', 'offset'];
323
286
  function Label(props) {
324
287
  var _ref = arguments[0],
325
288
  _ref7;
326
- var SBarLabel = Box;
327
- var styles = props.styles,
328
- Children = props.Children;
329
- return _ref7 = sstyled(styles), /*#__PURE__*/React.createElement(SBarLabel, _ref7.cn("SBarLabel", _objectSpread({}, _assignProps({
330
- "__excludeProps": excludeProps
331
- }, _ref))), /*#__PURE__*/React.createElement(Children, _ref7.cn("Children", {})));
289
+ const SBarLabel = Box;
290
+ const {
291
+ styles,
292
+ Children
293
+ } = props;
294
+ return _ref7 = sstyled(styles), /*#__PURE__*/React.createElement(SBarLabel, _ref7.cn("SBarLabel", {
295
+ ..._assignProps({
296
+ "__excludeProps": excludeProps
297
+ }, _ref)
298
+ }), /*#__PURE__*/React.createElement(Children, _ref7.cn("Children", {})));
332
299
  }
333
300
  function Percent(props) {
334
301
  var _ref2 = arguments[0],
335
302
  _ref8;
336
- var SBarPercent = Box;
337
- var styles = props.styles,
338
- Children = props.Children;
339
- return _ref8 = sstyled(styles), /*#__PURE__*/React.createElement(SBarPercent, _ref8.cn("SBarPercent", _objectSpread({}, _assignProps2({
340
- "__excludeProps": excludeProps
341
- }, _ref2))), /*#__PURE__*/React.createElement(Children, _ref8.cn("Children", {})));
303
+ const SBarPercent = Box;
304
+ const {
305
+ styles,
306
+ Children
307
+ } = props;
308
+ return _ref8 = sstyled(styles), /*#__PURE__*/React.createElement(SBarPercent, _ref8.cn("SBarPercent", {
309
+ ..._assignProps2({
310
+ "__excludeProps": excludeProps
311
+ }, _ref2)
312
+ }), /*#__PURE__*/React.createElement(Children, _ref8.cn("Children", {})));
342
313
  }
343
314
  function Value(props) {
344
315
  var _ref3 = arguments[0],
345
316
  _ref9;
346
- var SBarValue = Box;
347
- var styles = props.styles,
348
- Children = props.Children;
349
- return _ref9 = sstyled(styles), /*#__PURE__*/React.createElement(SBarValue, _ref9.cn("SBarValue", _objectSpread({}, _assignProps3({
350
- "__excludeProps": excludeProps
351
- }, _ref3))), /*#__PURE__*/React.createElement(Children, _ref9.cn("Children", {})));
317
+ const SBarValue = Box;
318
+ const {
319
+ styles,
320
+ Children
321
+ } = props;
322
+ return _ref9 = sstyled(styles), /*#__PURE__*/React.createElement(SBarValue, _ref9.cn("SBarValue", {
323
+ ..._assignProps3({
324
+ "__excludeProps": excludeProps
325
+ }, _ref3)
326
+ }), /*#__PURE__*/React.createElement(Children, _ref9.cn("Children", {})));
352
327
  }
353
- var BarContext = /*#__PURE__*/React.createContext({});
328
+ const BarContext = /*#__PURE__*/React.createContext({});
354
329
  function Bar(props) {
355
- var Children = props.Children,
356
- index = props.index,
357
- onClick = props.onClick,
358
- transparent = props.transparent,
359
- hide = props.hide;
360
- var onClickHandler = React.useCallback(function (event) {
361
- onClick === null || onClick === void 0 || onClick(index, event);
330
+ const {
331
+ Children,
332
+ index,
333
+ onClick,
334
+ transparent,
335
+ hide
336
+ } = props;
337
+ const onClickHandler = React.useCallback(event => {
338
+ onClick?.(index, event);
362
339
  }, [onClick, index]);
363
- var contextValue = React.useMemo(function () {
364
- return {
365
- onClick: onClickHandler,
366
- transparent: transparent,
367
- hide: hide
368
- };
369
- }, [onClickHandler, transparent, hide]);
340
+ const contextValue = React.useMemo(() => ({
341
+ onClick: onClickHandler,
342
+ transparent,
343
+ hide
344
+ }), [onClickHandler, transparent, hide]);
370
345
  return /*#__PURE__*/React.createElement(BarContext.Provider, {
371
346
  value: contextValue
372
347
  }, /*#__PURE__*/React.createElement(Children, null));
373
348
  }
374
349
  function BarFill(props) {
375
350
  var _ref0;
376
- var SBar = props.Element,
377
- styles = props.styles,
378
- color = props.color,
379
- x = props.x,
380
- y = props.y,
381
- width = props.width,
382
- height = props.height,
383
- uid = props.uid,
384
- duration = props.duration,
385
- resolveColor = props.resolveColor,
386
- patterns = props.patterns,
387
- i = props.i,
388
- scale = props.scale;
389
- var _scale2 = _slicedToArray(scale, 1),
390
- xScale = _scale2[0];
391
- var xRange = xScale.range();
392
- var backgroundWidth = xRange[1] - xRange[0];
393
- var radius = 0; // left it here in case we will change our mind and return to rounded bars
394
- var pathD = React.useMemo(function () {
351
+ const {
352
+ Element: SBar,
353
+ styles,
354
+ color,
355
+ x,
356
+ y,
357
+ width,
358
+ height,
359
+ uid,
360
+ duration,
361
+ resolveColor,
362
+ patterns,
363
+ i,
364
+ scale
365
+ } = props;
366
+ const [xScale] = scale;
367
+ const xRange = xScale.range();
368
+ const backgroundWidth = xRange[1] - xRange[0];
369
+ const radius = 0; // left it here in case we will change our mind and return to rounded bars
370
+ const pathD = React.useMemo(() => {
395
371
  if (backgroundWidth - radius > width) {
396
372
  return roundedPath(x, y, width, height, radius);
397
373
  }
398
374
  return roundedPath(x, y, width, height, radius, false, true, false, true);
399
375
  }, [x, y, height, width, radius]);
400
- var barProps = React.useContext(BarContext);
376
+ const barProps = React.useContext(BarContext);
401
377
  return /*#__PURE__*/React.createElement(React.Fragment, null, (_ref0 = sstyled(styles), /*#__PURE__*/React.createElement(SBar, _ref0.cn("SBar", {
402
378
  "aria-hidden": true,
403
379
  "render": 'path',
404
380
  "d": pathD,
405
- "clipPath": "url(#".concat(uid, ")"),
381
+ "clipPath": `url(#${uid})`,
406
382
  "__excludeProps": ['data', 'scale', 'value', 'offset'],
407
383
  "childrenPosition": 'above',
408
384
  "index": i,
409
385
  "color": resolveColor(color),
410
- "pattern": patterns ? "url(#".concat(uid, "-").concat(i, "-pattern)") : undefined,
386
+ "pattern": patterns ? `url(#${uid}-${i}-pattern)` : undefined,
411
387
  "x": x,
412
388
  "y": y,
413
389
  "width": width,
414
390
  "height": height,
415
- "use:duration": "".concat(duration, "ms"),
391
+ "use:duration": `${duration}ms`,
416
392
  "onClick": callAllEventHandlers(props.onClick, barProps.onClick),
417
393
  "transparent": barProps.transparent || props.transparent,
418
394
  "hide": barProps.hide || props.hide
419
395
  }))), patterns && /*#__PURE__*/React.createElement(PatternFill, _ref0.cn("PatternFill", {
420
- "id": "".concat(uid, "-").concat(i, "-pattern"),
396
+ "id": `${uid}-${i}-pattern`,
421
397
  "patternKey": color,
422
398
  "color": resolveColor(color),
423
399
  "patterns": patterns
@@ -425,21 +401,22 @@ function BarFill(props) {
425
401
  }
426
402
  function BarBackground(props) {
427
403
  var _ref1;
428
- var SBackground = props.Element,
429
- styles = props.styles,
430
- scale = props.scale,
431
- y = props.y,
432
- x = props.x,
433
- height = props.height;
434
- var _scale3 = _slicedToArray(scale, 1),
435
- xScale = _scale3[0];
436
- var xRange = xScale.range();
437
- var width = xRange[1] - xRange[0];
438
- var radius = 0; // left it here in case we will change our mind and return to rounded bars
439
- var pathD = React.useMemo(function () {
404
+ const {
405
+ Element: SBackground,
406
+ styles,
407
+ scale,
408
+ y,
409
+ x,
410
+ height
411
+ } = props;
412
+ const [xScale] = scale;
413
+ const xRange = xScale.range();
414
+ const width = xRange[1] - xRange[0];
415
+ const radius = 0; // left it here in case we will change our mind and return to rounded bars
416
+ const pathD = React.useMemo(() => {
440
417
  return roundedPath(x, y, width, height, radius, false, true, false, true);
441
418
  }, [x, y, height, width, radius]);
442
- var barProps = React.useContext(BarContext);
419
+ const barProps = React.useContext(BarContext);
443
420
  return _ref1 = sstyled(styles), /*#__PURE__*/React.createElement(SBackground, _ref1.cn("SBackground", {
444
421
  "aria-hidden": true,
445
422
  "render": 'path',
@@ -453,152 +430,141 @@ function BarBackground(props) {
453
430
  "onClick": callAllEventHandlers(props.onClick, barProps.onClick)
454
431
  }));
455
432
  }
456
- var Hover = /*#__PURE__*/function (_Component2) {
457
- function Hover() {
458
- var _this3;
459
- _classCallCheck(this, Hover);
460
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
461
- args[_key2] = arguments[_key2];
462
- }
463
- _this3 = _callSuper(this, Hover, [].concat(args));
464
- _defineProperty(_this3, "state", {
433
+ class Hover extends Component {
434
+ constructor(...args) {
435
+ super(...args);
436
+ _defineProperty(this, "state", {
465
437
  index: null
466
438
  });
467
- _defineProperty(_this3, "virtualElement", canUseDOM() ? document.createElement('div') : {});
468
- _defineProperty(_this3, "unsubscribeMouseMoveRoot", null);
469
- _defineProperty(_this3, "unsubscribeMouseLeaveRoot", null);
470
- _defineProperty(_this3, "handlerMouseMoveRoot", trottle(function (e) {
471
- var _this3$asProps = _this3.asProps,
472
- eventEmitter = _this3$asProps.eventEmitter,
473
- rootRef = _this3$asProps.rootRef,
474
- patterns = _this3$asProps.patterns,
475
- updateIndexToHover = _this3$asProps.updateIndexToHover,
476
- plotId = _this3$asProps.plotId;
477
- var point = eventToPoint(e, rootRef.current);
478
- var clientX = e.clientX,
479
- clientY = e.clientY;
480
- var index = _this3.getIndex(point);
481
- _this3.setState({
482
- index: index
483
- }, function () {
484
- eventEmitter.emit("setTooltipPosition_".concat(plotId), clientX, clientY);
485
- eventEmitter.emit("setTooltipRenderingProps_".concat(plotId), {}, {
486
- index: index,
487
- patterns: patterns
439
+ _defineProperty(this, "virtualElement", canUseDOM() ? document.createElement('div') : {});
440
+ _defineProperty(this, "unsubscribeMouseMoveRoot", null);
441
+ _defineProperty(this, "unsubscribeMouseLeaveRoot", null);
442
+ _defineProperty(this, "handlerMouseMoveRoot", trottle(e => {
443
+ const {
444
+ eventEmitter,
445
+ rootRef,
446
+ patterns,
447
+ updateIndexToHover,
448
+ plotId
449
+ } = this.asProps;
450
+ const point = eventToPoint(e, rootRef.current);
451
+ const {
452
+ clientX,
453
+ clientY
454
+ } = e;
455
+ const index = this.getIndex(point);
456
+ this.setState({
457
+ index
458
+ }, () => {
459
+ eventEmitter.emit(`setTooltipPosition_${plotId}`, clientX, clientY);
460
+ eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, {}, {
461
+ index,
462
+ patterns
488
463
  });
489
- eventEmitter.emit("setTooltipVisible_".concat(plotId), index !== null);
464
+ eventEmitter.emit(`setTooltipVisible_${plotId}`, index !== null);
490
465
  updateIndexToHover(index);
491
466
  });
492
467
  }));
493
- _defineProperty(_this3, "handlerMouseLeaveRoot", trottle(function () {
494
- var _this3$asProps2 = _this3.asProps,
495
- updateIndexToHover = _this3$asProps2.updateIndexToHover,
496
- plotId = _this3$asProps2.plotId;
497
- _this3.setState({
468
+ _defineProperty(this, "handlerMouseLeaveRoot", trottle(() => {
469
+ const {
470
+ updateIndexToHover,
471
+ plotId
472
+ } = this.asProps;
473
+ this.setState({
498
474
  index: null
499
- }, function () {
500
- _this3.asProps.eventEmitter.emit("setTooltipVisible_".concat(plotId), false);
475
+ }, () => {
476
+ this.asProps.eventEmitter.emit(`setTooltipVisible_${plotId}`, false);
501
477
  updateIndexToHover(null);
502
478
  });
503
479
  }));
504
- return _this3;
505
480
  }
506
- _inherits(Hover, _Component2);
507
- return _createClass(Hover, [{
508
- key: "generateGetBoundingClientRect",
509
- value: function generateGetBoundingClientRect() {
510
- var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
511
- var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
512
- return function () {
513
- return {
514
- width: 0,
515
- height: 0,
516
- top: y,
517
- right: x,
518
- bottom: y,
519
- left: x
520
- };
521
- };
522
- }
523
- }, {
524
- key: "getIndex",
525
- value: function getIndex(point) {
526
- var _this$asProps0 = this.asProps,
527
- data = _this$asProps0.data,
528
- getBarData = _this$asProps0.getBarData;
529
- for (var _i = 0; _i < data.length; _i++) {
530
- var bar = getBarData(_i);
531
- if (point[0] >= bar.x && point[0] <= bar.x + bar.fullWidth && point[1] >= bar.y && point[1] <= bar.y + bar.height) {
532
- return _i;
533
- }
481
+ generateGetBoundingClientRect(x = 0, y = 0) {
482
+ return () => ({
483
+ width: 0,
484
+ height: 0,
485
+ top: y,
486
+ right: x,
487
+ bottom: y,
488
+ left: x
489
+ });
490
+ }
491
+ getIndex(point) {
492
+ const {
493
+ data,
494
+ getBarData
495
+ } = this.asProps;
496
+ for (let i = 0; i < data.length; i++) {
497
+ const bar = getBarData(i);
498
+ if (point[0] >= bar.x && point[0] <= bar.x + bar.fullWidth && point[1] >= bar.y && point[1] <= bar.y + bar.height) {
499
+ return i;
534
500
  }
535
- return null;
536
- }
537
- }, {
538
- key: "componentDidMount",
539
- value: function componentDidMount() {
540
- var _this4 = this;
541
- var eventEmitter = this.asProps.eventEmitter;
542
- this.unsubscribeMouseMoveRoot = eventEmitter.subscribe('onMouseMoveRoot', function (e) {
543
- e.persist();
544
- _this4.handlerMouseMoveRoot(e);
545
- });
546
- this.unsubscribeMouseLeaveRoot = eventEmitter.subscribe('onMouseLeaveRoot', this.handlerMouseLeaveRoot);
547
501
  }
548
- }, {
549
- key: "componentWillUnmount",
550
- value: function componentWillUnmount() {
551
- if (this.unsubscribeMouseMoveRoot) {
552
- this.unsubscribeMouseMoveRoot();
553
- }
554
- if (this.unsubscribeMouseLeaveRoot) {
555
- this.unsubscribeMouseLeaveRoot();
556
- }
502
+ return null;
503
+ }
504
+ componentDidMount() {
505
+ const {
506
+ eventEmitter
507
+ } = this.asProps;
508
+ this.unsubscribeMouseMoveRoot = eventEmitter.subscribe('onMouseMoveRoot', e => {
509
+ e.persist();
510
+ this.handlerMouseMoveRoot(e);
511
+ });
512
+ this.unsubscribeMouseLeaveRoot = eventEmitter.subscribe('onMouseLeaveRoot', this.handlerMouseLeaveRoot);
513
+ }
514
+ componentWillUnmount() {
515
+ if (this.unsubscribeMouseMoveRoot) {
516
+ this.unsubscribeMouseMoveRoot();
557
517
  }
558
- }, {
559
- key: "render",
560
- value: function render() {
561
- var _ref10;
562
- var _this$asProps1 = this.asProps,
563
- styles = _this$asProps1.styles,
564
- getBarData = _this$asProps1.getBarData,
565
- render = _this$asProps1.render;
566
- if (!render) return null;
567
- var index = this.state.index;
568
- var SCompactHorizontalBarHoverRect = this.Element;
569
- if (index === null) return null;
570
- var bar = getBarData(index);
571
- return _ref10 = sstyled(styles), /*#__PURE__*/React.createElement(SCompactHorizontalBarHoverRect, _ref10.cn("SCompactHorizontalBarHoverRect", {
572
- "render": 'rect',
573
- "x": bar.x,
574
- "y": bar.y + bar.height - barHeight - hoverOffset * 2,
575
- "width": bar.fullWidth,
576
- "height": barHeight + hoverOffset * 2
577
- }));
518
+ if (this.unsubscribeMouseLeaveRoot) {
519
+ this.unsubscribeMouseLeaveRoot();
578
520
  }
579
- }]);
580
- }(Component);
521
+ }
522
+ render() {
523
+ var _ref10;
524
+ const {
525
+ styles,
526
+ getBarData,
527
+ render
528
+ } = this.asProps;
529
+ if (!render) return null;
530
+ const {
531
+ index
532
+ } = this.state;
533
+ const SCompactHorizontalBarHoverRect = this.Element;
534
+ if (index === null) return null;
535
+ const bar = getBarData(index);
536
+ return _ref10 = sstyled(styles), /*#__PURE__*/React.createElement(SCompactHorizontalBarHoverRect, _ref10.cn("SCompactHorizontalBarHoverRect", {
537
+ "render": 'rect',
538
+ "x": bar.x,
539
+ "y": bar.y + bar.height - barHeight - hoverOffset * 2,
540
+ "width": bar.fullWidth,
541
+ "height": barHeight + hoverOffset * 2
542
+ }));
543
+ }
544
+ }
581
545
  function CompactHorizontalBarTooltip(props) {
582
546
  var _ref4 = arguments[0],
583
547
  _ref11;
584
548
  if (!props.render) return null;
585
- var SCompactHorizontalBarRadarTooltip = Tooltip;
586
- return _ref11 = sstyled(props.styles), /*#__PURE__*/React.createElement(SCompactHorizontalBarRadarTooltip, _ref11.cn("SCompactHorizontalBarRadarTooltip", _objectSpread({}, _assignProps4({
587
- "tag": CompactHorizontalBar.Hover,
588
- "excludeAnchorProps": true
589
- }, _ref4))));
549
+ const SCompactHorizontalBarRadarTooltip = Tooltip;
550
+ return _ref11 = sstyled(props.styles), /*#__PURE__*/React.createElement(SCompactHorizontalBarRadarTooltip, _ref11.cn("SCompactHorizontalBarRadarTooltip", {
551
+ ..._assignProps4({
552
+ "tag": CompactHorizontalBar.Hover,
553
+ "excludeAnchorProps": true
554
+ }, _ref4)
555
+ }));
590
556
  }
591
557
  ;
592
- var CompactHorizontalBar = createElement(CompactHorizontalBarRoot, {
593
- Annotation: Annotation,
594
- Label: Label,
595
- Percent: Percent,
596
- Value: Value,
558
+ const CompactHorizontalBar = createElement(CompactHorizontalBarRoot, {
559
+ Annotation,
560
+ Label,
561
+ Percent,
562
+ Value,
597
563
  Bar: [Bar, {
598
564
  Fill: BarFill,
599
565
  Background: BarBackground
600
566
  }],
601
- Hover: Hover,
567
+ Hover,
602
568
  Tooltip: [CompactHorizontalBarTooltip, Tooltip._______childrenComponents]
603
569
  });
604
570
  export default CompactHorizontalBar;