@semcore/d3-chart 3.61.0-prerelease.1 → 3.61.0-prerelease.5

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 (579) hide show
  1. package/lib/cjs/AnimatedClipPath.js +11 -15
  2. package/lib/cjs/AnimatedClipPath.js.map +1 -1
  3. package/lib/cjs/Area.js +71 -48
  4. package/lib/cjs/Area.js.map +1 -1
  5. package/lib/cjs/Axis.js +170 -108
  6. package/lib/cjs/Axis.js.map +1 -1
  7. package/lib/cjs/Bar.js +29 -34
  8. package/lib/cjs/Bar.js.map +1 -1
  9. package/lib/cjs/Bubble.js +211 -137
  10. package/lib/cjs/Bubble.js.map +1 -1
  11. package/lib/cjs/CompactHorizontalBar.js +92 -82
  12. package/lib/cjs/CompactHorizontalBar.js.map +1 -1
  13. package/lib/cjs/Donut.js +154 -139
  14. package/lib/cjs/Donut.js.map +1 -1
  15. package/lib/cjs/Dots.js +55 -38
  16. package/lib/cjs/Dots.js.map +1 -1
  17. package/lib/cjs/GroupBar.js +15 -18
  18. package/lib/cjs/GroupBar.js.map +1 -1
  19. package/lib/cjs/HorizontalBar.js +29 -34
  20. package/lib/cjs/HorizontalBar.js.map +1 -1
  21. package/lib/cjs/Hover.js +52 -45
  22. package/lib/cjs/Hover.js.map +1 -1
  23. package/lib/cjs/Line.js +63 -41
  24. package/lib/cjs/Line.js.map +1 -1
  25. package/lib/cjs/Pattern.js +16 -12
  26. package/lib/cjs/Pattern.js.map +1 -1
  27. package/lib/cjs/Plot.js +29 -36
  28. package/lib/cjs/Plot.js.map +1 -1
  29. package/lib/cjs/Radar.js +281 -261
  30. package/lib/cjs/Radar.js.map +1 -1
  31. package/lib/cjs/RadialTree.js +169 -154
  32. package/lib/cjs/RadialTree.js.map +1 -1
  33. package/lib/cjs/Reference.js +45 -51
  34. package/lib/cjs/Reference.js.map +1 -1
  35. package/lib/cjs/ResponsiveContainer.js +20 -25
  36. package/lib/cjs/ResponsiveContainer.js.map +1 -1
  37. package/lib/cjs/ScatterPlot.js +71 -61
  38. package/lib/cjs/ScatterPlot.js.map +1 -1
  39. package/lib/cjs/StackBar.js +20 -31
  40. package/lib/cjs/StackBar.js.map +1 -1
  41. package/lib/cjs/StackedArea.js +12 -16
  42. package/lib/cjs/StackedArea.js.map +1 -1
  43. package/lib/cjs/Tooltip.js +73 -73
  44. package/lib/cjs/Tooltip.js.map +1 -1
  45. package/lib/cjs/Venn.js +77 -52
  46. package/lib/cjs/Venn.js.map +1 -1
  47. package/lib/cjs/a11y/DataAccessibilityTable.js +2 -3
  48. package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
  49. package/lib/cjs/a11y/PlotA11yModule.js +43 -86
  50. package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
  51. package/lib/cjs/a11y/PlotA11yView.js +44 -19
  52. package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
  53. package/lib/cjs/a11y/bezier.js +1 -2
  54. package/lib/cjs/a11y/bezier.js.map +1 -1
  55. package/lib/cjs/a11y/focus.js +5 -6
  56. package/lib/cjs/a11y/focus.js.map +1 -1
  57. package/lib/cjs/a11y/hints.js +6 -9
  58. package/lib/cjs/a11y/hints.js.map +1 -1
  59. package/lib/cjs/a11y/insights.js +63 -64
  60. package/lib/cjs/a11y/insights.js.map +1 -1
  61. package/lib/cjs/a11y/intl.js +1 -2
  62. package/lib/cjs/a11y/intl.js.map +1 -1
  63. package/lib/cjs/a11y/locale.js +5 -5
  64. package/lib/cjs/a11y/locale.js.map +1 -1
  65. package/lib/cjs/a11y/serialize.js +15 -17
  66. package/lib/cjs/a11y/serialize.js.map +1 -1
  67. package/lib/cjs/a11y/summarize.js +1 -2
  68. package/lib/cjs/a11y/summarize.js.map +1 -1
  69. package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js +4 -5
  70. package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
  71. package/lib/cjs/a11y/translations/module/de.json +2 -2
  72. package/lib/cjs/a11y/translations/module/en.json +2 -2
  73. package/lib/cjs/a11y/translations/module/es.json +2 -2
  74. package/lib/cjs/a11y/translations/module/fr.json +2 -2
  75. package/lib/cjs/a11y/translations/module/it.json +2 -2
  76. package/lib/cjs/a11y/translations/module/ja.json +2 -2
  77. package/lib/cjs/a11y/translations/module/ko.json +2 -2
  78. package/lib/cjs/a11y/translations/module/nl.json +2 -2
  79. package/lib/cjs/a11y/translations/module/pl.json +2 -2
  80. package/lib/cjs/a11y/translations/module/pt.json +2 -2
  81. package/lib/cjs/a11y/translations/module/sv.json +2 -2
  82. package/lib/cjs/a11y/translations/module/tr.json +2 -2
  83. package/lib/cjs/a11y/translations/module/vi.json +2 -2
  84. package/lib/cjs/a11y/translations/module/zh.json +2 -2
  85. package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js +4 -5
  86. package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
  87. package/lib/cjs/color.js +2 -3
  88. package/lib/cjs/color.js.map +1 -1
  89. package/lib/cjs/component/Chart/AbstractChart.js +157 -83
  90. package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
  91. package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
  92. package/lib/cjs/component/Chart/AreaChart.js +24 -51
  93. package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
  94. package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
  95. package/lib/cjs/component/Chart/BarChart.js +85 -69
  96. package/lib/cjs/component/Chart/BarChart.js.map +1 -1
  97. package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
  98. package/lib/cjs/component/Chart/BubbleChart.js +31 -27
  99. package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
  100. package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
  101. package/lib/cjs/component/Chart/CigaretteChart.js +340 -147
  102. package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
  103. package/lib/cjs/component/Chart/CigaretteChart.type.js.map +1 -1
  104. package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +11 -15
  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 +16 -22
  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 +16 -44
  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 +22 -48
  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 +15 -19
  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 +16 -21
  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 +16 -19
  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 +7 -8
  126. package/lib/cjs/component/Chart/index.js.map +1 -1
  127. package/lib/cjs/component/ChartLegend/BaseLegend.js +45 -23
  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 +19 -24
  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 +108 -83
  134. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  135. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -2
  136. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  137. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +18 -23
  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 +1 -2
  141. package/lib/cjs/component/ChartLegend/index.js.map +1 -1
  142. package/lib/cjs/component/Cigarette/Cigarette.js +16 -20
  143. package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
  144. package/lib/cjs/component/StackGroupBar/StackGroupBar.js +19 -24
  145. package/lib/cjs/component/StackGroupBar/StackGroupBar.js.map +1 -1
  146. package/lib/cjs/component/StackGroupBar/StackGroupBar.type.js.map +1 -1
  147. package/lib/cjs/component/SvgElement.js +21 -0
  148. package/lib/cjs/component/SvgElement.js.map +1 -0
  149. package/lib/cjs/createElement.d.js.map +1 -1
  150. package/lib/cjs/createElement.js +10 -12
  151. package/lib/cjs/createElement.js.map +1 -1
  152. package/lib/cjs/index.js +9 -2
  153. package/lib/cjs/index.js.map +1 -1
  154. package/lib/cjs/style/abstract-chart.shadow.css +12 -0
  155. package/lib/cjs/style/area.shadow.css +2 -2
  156. package/lib/cjs/style/axis.shadow.css +39 -1
  157. package/lib/cjs/style/bar.shadow.css +1 -1
  158. package/lib/cjs/style/bubble.shadow.css +11 -3
  159. package/lib/cjs/style/donut.shadow.css +1 -1
  160. package/lib/cjs/style/dot.shadow.css +1 -1
  161. package/lib/cjs/style/hover.shadow.css +2 -2
  162. package/lib/cjs/style/line.shadow.css +2 -2
  163. package/lib/cjs/style/plot.shadow.css +8 -6
  164. package/lib/cjs/style/plotA11yModule.shadow.css +10 -11
  165. package/lib/cjs/style/plotA11yView.shadow.css +13 -26
  166. package/lib/cjs/style/radar.shadow.css +3 -3
  167. package/lib/cjs/style/radial-tree.shadow.css +2 -2
  168. package/lib/cjs/style/scatterplot.shadow.css +2 -2
  169. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
  170. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
  171. package/lib/cjs/translations/de.json +1 -0
  172. package/lib/cjs/translations/es.json +1 -0
  173. package/lib/cjs/translations/fr.json +1 -0
  174. package/lib/cjs/translations/it.json +1 -0
  175. package/lib/cjs/translations/ja.json +1 -0
  176. package/lib/cjs/translations/ko.json +1 -0
  177. package/lib/cjs/translations/nl.json +1 -0
  178. package/lib/cjs/translations/pl.json +1 -0
  179. package/lib/cjs/translations/pt.json +1 -0
  180. package/lib/cjs/translations/sv.json +1 -0
  181. package/lib/cjs/translations/tr.json +2 -1
  182. package/lib/cjs/translations/vi.json +1 -0
  183. package/lib/cjs/translations/zh.json +1 -0
  184. package/lib/cjs/types/Area.d.js.map +1 -1
  185. package/lib/cjs/types/Axis.d.js.map +1 -1
  186. package/lib/cjs/types/Bar.d.js.map +1 -1
  187. package/lib/cjs/types/Bubble.d.js.map +1 -1
  188. package/lib/cjs/types/ClipPath.d.js.map +1 -1
  189. package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
  190. package/lib/cjs/types/Donut.d.js.map +1 -1
  191. package/lib/cjs/types/GroupBar.d.js.map +1 -1
  192. package/lib/cjs/types/HorizontalBar.d.js.map +1 -1
  193. package/lib/cjs/types/Hover.d.js.map +1 -1
  194. package/lib/cjs/types/Line.d.js.map +1 -1
  195. package/lib/cjs/types/Plot.d.js.map +1 -1
  196. package/lib/cjs/types/Radar.d.js.map +1 -1
  197. package/lib/cjs/types/Reference.d.js.map +1 -1
  198. package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
  199. package/lib/cjs/types/ScatterPlot.d.js.map +1 -1
  200. package/lib/cjs/types/StackBar.d.js.map +1 -1
  201. package/lib/cjs/types/StackedArea.d.js.map +1 -1
  202. package/lib/cjs/types/Tooltip.d.js.map +1 -1
  203. package/lib/cjs/types/Venn.d.js.map +1 -1
  204. package/lib/cjs/types/context.d.js.map +1 -1
  205. package/lib/cjs/types/index.d.js +14 -2
  206. package/lib/cjs/types/index.d.js.map +1 -1
  207. package/lib/cjs/utils.js +36 -55
  208. package/lib/cjs/utils.js.map +1 -1
  209. package/lib/es6/AnimatedClipPath.js +9 -11
  210. package/lib/es6/AnimatedClipPath.js.map +1 -1
  211. package/lib/es6/Area.js +70 -45
  212. package/lib/es6/Area.js.map +1 -1
  213. package/lib/es6/Axis.js +168 -104
  214. package/lib/es6/Axis.js.map +1 -1
  215. package/lib/es6/Bar.js +27 -29
  216. package/lib/es6/Bar.js.map +1 -1
  217. package/lib/es6/Bubble.js +211 -135
  218. package/lib/es6/Bubble.js.map +1 -1
  219. package/lib/es6/CompactHorizontalBar.js +89 -77
  220. package/lib/es6/CompactHorizontalBar.js.map +1 -1
  221. package/lib/es6/Donut.js +154 -137
  222. package/lib/es6/Donut.js.map +1 -1
  223. package/lib/es6/Dots.js +55 -36
  224. package/lib/es6/Dots.js.map +1 -1
  225. package/lib/es6/GroupBar.js +13 -15
  226. package/lib/es6/GroupBar.js.map +1 -1
  227. package/lib/es6/HorizontalBar.js +27 -29
  228. package/lib/es6/HorizontalBar.js.map +1 -1
  229. package/lib/es6/Hover.js +51 -41
  230. package/lib/es6/Hover.js.map +1 -1
  231. package/lib/es6/Line.js +61 -37
  232. package/lib/es6/Line.js.map +1 -1
  233. package/lib/es6/Pattern.js +7 -3
  234. package/lib/es6/Pattern.js.map +1 -1
  235. package/lib/es6/Plot.js +28 -32
  236. package/lib/es6/Plot.js.map +1 -1
  237. package/lib/es6/Radar.js +279 -257
  238. package/lib/es6/Radar.js.map +1 -1
  239. package/lib/es6/RadialTree.js +168 -151
  240. package/lib/es6/RadialTree.js.map +1 -1
  241. package/lib/es6/Reference.js +43 -45
  242. package/lib/es6/Reference.js.map +1 -1
  243. package/lib/es6/ResponsiveContainer.js +16 -19
  244. package/lib/es6/ResponsiveContainer.js.map +1 -1
  245. package/lib/es6/ScatterPlot.js +71 -59
  246. package/lib/es6/ScatterPlot.js.map +1 -1
  247. package/lib/es6/StackBar.js +17 -27
  248. package/lib/es6/StackBar.js.map +1 -1
  249. package/lib/es6/StackedArea.js +10 -13
  250. package/lib/es6/StackedArea.js.map +1 -1
  251. package/lib/es6/Tooltip.js +68 -65
  252. package/lib/es6/Tooltip.js.map +1 -1
  253. package/lib/es6/Venn.js +75 -48
  254. package/lib/es6/Venn.js.map +1 -1
  255. package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
  256. package/lib/es6/a11y/PlotA11yModule.js +43 -86
  257. package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
  258. package/lib/es6/a11y/PlotA11yView.js +43 -16
  259. package/lib/es6/a11y/PlotA11yView.js.map +1 -1
  260. package/lib/es6/a11y/bezier.js.map +1 -1
  261. package/lib/es6/a11y/focus.js +4 -4
  262. package/lib/es6/a11y/focus.js.map +1 -1
  263. package/lib/es6/a11y/hints.js +2 -2
  264. package/lib/es6/a11y/hints.js.map +1 -1
  265. package/lib/es6/a11y/insights.js +61 -61
  266. package/lib/es6/a11y/insights.js.map +1 -1
  267. package/lib/es6/a11y/intl.js.map +1 -1
  268. package/lib/es6/a11y/locale.js +3 -2
  269. package/lib/es6/a11y/locale.js.map +1 -1
  270. package/lib/es6/a11y/serialize.js +14 -13
  271. package/lib/es6/a11y/serialize.js.map +1 -1
  272. package/lib/es6/a11y/summarize.js.map +1 -1
  273. package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js +2 -2
  274. package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
  275. package/lib/es6/a11y/translations/module/de.json +2 -2
  276. package/lib/es6/a11y/translations/module/en.json +2 -2
  277. package/lib/es6/a11y/translations/module/es.json +2 -2
  278. package/lib/es6/a11y/translations/module/fr.json +2 -2
  279. package/lib/es6/a11y/translations/module/it.json +2 -2
  280. package/lib/es6/a11y/translations/module/ja.json +2 -2
  281. package/lib/es6/a11y/translations/module/ko.json +2 -2
  282. package/lib/es6/a11y/translations/module/nl.json +2 -2
  283. package/lib/es6/a11y/translations/module/pl.json +2 -2
  284. package/lib/es6/a11y/translations/module/pt.json +2 -2
  285. package/lib/es6/a11y/translations/module/sv.json +2 -2
  286. package/lib/es6/a11y/translations/module/tr.json +2 -2
  287. package/lib/es6/a11y/translations/module/vi.json +2 -2
  288. package/lib/es6/a11y/translations/module/zh.json +2 -2
  289. package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js +2 -2
  290. package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
  291. package/lib/es6/color.js +1 -1
  292. package/lib/es6/color.js.map +1 -1
  293. package/lib/es6/component/Chart/AbstractChart.js +159 -80
  294. package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
  295. package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
  296. package/lib/es6/component/Chart/AreaChart.js +23 -48
  297. package/lib/es6/component/Chart/AreaChart.js.map +1 -1
  298. package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
  299. package/lib/es6/component/Chart/BarChart.js +84 -67
  300. package/lib/es6/component/Chart/BarChart.js.map +1 -1
  301. package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
  302. package/lib/es6/component/Chart/BubbleChart.js +30 -24
  303. package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
  304. package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
  305. package/lib/es6/component/Chart/CigaretteChart.js +341 -144
  306. package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
  307. package/lib/es6/component/Chart/CigaretteChart.type.js.map +1 -1
  308. package/lib/es6/component/Chart/CompactHorizontalBarChart.js +9 -12
  309. package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -1
  310. package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  311. package/lib/es6/component/Chart/DonutChart.js +14 -18
  312. package/lib/es6/component/Chart/DonutChart.js.map +1 -1
  313. package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
  314. package/lib/es6/component/Chart/HistogramChart.js +15 -41
  315. package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
  316. package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
  317. package/lib/es6/component/Chart/LineChart.js +20 -45
  318. package/lib/es6/component/Chart/LineChart.js.map +1 -1
  319. package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
  320. package/lib/es6/component/Chart/RadarChart.js +13 -16
  321. package/lib/es6/component/Chart/RadarChart.js.map +1 -1
  322. package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
  323. package/lib/es6/component/Chart/ScatterPlotChart.js +15 -18
  324. package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
  325. package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
  326. package/lib/es6/component/Chart/VennChart.js +14 -16
  327. package/lib/es6/component/Chart/VennChart.js.map +1 -1
  328. package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
  329. package/lib/es6/component/Chart/index.js +6 -6
  330. package/lib/es6/component/Chart/index.js.map +1 -1
  331. package/lib/es6/component/ChartLegend/BaseLegend.js +43 -20
  332. package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
  333. package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
  334. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +17 -19
  335. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  336. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
  337. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +102 -74
  338. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  339. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  340. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +15 -17
  341. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  342. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  343. package/lib/es6/component/ChartLegend/index.js.map +1 -1
  344. package/lib/es6/component/Cigarette/Cigarette.js +14 -17
  345. package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
  346. package/lib/es6/component/StackGroupBar/StackGroupBar.js +17 -21
  347. package/lib/es6/component/StackGroupBar/StackGroupBar.js.map +1 -1
  348. package/lib/es6/component/StackGroupBar/StackGroupBar.type.js.map +1 -1
  349. package/lib/es6/component/SvgElement.js +14 -0
  350. package/lib/es6/component/SvgElement.js.map +1 -0
  351. package/lib/es6/createElement.d.js.map +1 -1
  352. package/lib/es6/createElement.js +7 -7
  353. package/lib/es6/createElement.js.map +1 -1
  354. package/lib/es6/index.js +1 -0
  355. package/lib/es6/index.js.map +1 -1
  356. package/lib/es6/style/abstract-chart.shadow.css +12 -0
  357. package/lib/es6/style/area.shadow.css +2 -2
  358. package/lib/es6/style/axis.shadow.css +39 -1
  359. package/lib/es6/style/bar.shadow.css +1 -1
  360. package/lib/es6/style/bubble.shadow.css +11 -3
  361. package/lib/es6/style/donut.shadow.css +1 -1
  362. package/lib/es6/style/dot.shadow.css +1 -1
  363. package/lib/es6/style/hover.shadow.css +2 -2
  364. package/lib/es6/style/line.shadow.css +2 -2
  365. package/lib/es6/style/plot.shadow.css +8 -6
  366. package/lib/es6/style/plotA11yModule.shadow.css +10 -11
  367. package/lib/es6/style/plotA11yView.shadow.css +13 -26
  368. package/lib/es6/style/radar.shadow.css +3 -3
  369. package/lib/es6/style/radial-tree.shadow.css +2 -2
  370. package/lib/es6/style/scatterplot.shadow.css +2 -2
  371. package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
  372. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
  373. package/lib/es6/translations/de.json +1 -0
  374. package/lib/es6/translations/es.json +1 -0
  375. package/lib/es6/translations/fr.json +1 -0
  376. package/lib/es6/translations/it.json +1 -0
  377. package/lib/es6/translations/ja.json +1 -0
  378. package/lib/es6/translations/ko.json +1 -0
  379. package/lib/es6/translations/nl.json +1 -0
  380. package/lib/es6/translations/pl.json +1 -0
  381. package/lib/es6/translations/pt.json +1 -0
  382. package/lib/es6/translations/sv.json +1 -0
  383. package/lib/es6/translations/tr.json +2 -1
  384. package/lib/es6/translations/vi.json +1 -0
  385. package/lib/es6/translations/zh.json +1 -0
  386. package/lib/es6/types/Area.d.js.map +1 -1
  387. package/lib/es6/types/Axis.d.js.map +1 -1
  388. package/lib/es6/types/Bar.d.js.map +1 -1
  389. package/lib/es6/types/Bubble.d.js.map +1 -1
  390. package/lib/es6/types/ClipPath.d.js.map +1 -1
  391. package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
  392. package/lib/es6/types/Donut.d.js.map +1 -1
  393. package/lib/es6/types/GroupBar.d.js.map +1 -1
  394. package/lib/es6/types/HorizontalBar.d.js.map +1 -1
  395. package/lib/es6/types/Hover.d.js.map +1 -1
  396. package/lib/es6/types/Line.d.js.map +1 -1
  397. package/lib/es6/types/Plot.d.js.map +1 -1
  398. package/lib/es6/types/Radar.d.js.map +1 -1
  399. package/lib/es6/types/Reference.d.js.map +1 -1
  400. package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
  401. package/lib/es6/types/ScatterPlot.d.js.map +1 -1
  402. package/lib/es6/types/StackBar.d.js.map +1 -1
  403. package/lib/es6/types/StackedArea.d.js.map +1 -1
  404. package/lib/es6/types/Tooltip.d.js.map +1 -1
  405. package/lib/es6/types/Venn.d.js.map +1 -1
  406. package/lib/es6/types/context.d.js.map +1 -1
  407. package/lib/es6/types/index.d.js +2 -0
  408. package/lib/es6/types/index.d.js.map +1 -1
  409. package/lib/es6/utils.js +16 -16
  410. package/lib/es6/utils.js.map +1 -1
  411. package/lib/esm/AnimatedClipPath.mjs +9 -16
  412. package/lib/esm/Area.mjs +51 -36
  413. package/lib/esm/Axis.mjs +143 -86
  414. package/lib/esm/Bar.mjs +31 -34
  415. package/lib/esm/Bubble.mjs +154 -106
  416. package/lib/esm/CompactHorizontalBar.mjs +88 -80
  417. package/lib/esm/Donut.mjs +87 -75
  418. package/lib/esm/Dots.mjs +50 -34
  419. package/lib/esm/GroupBar.mjs +12 -14
  420. package/lib/esm/HorizontalBar.mjs +31 -34
  421. package/lib/esm/Hover.mjs +53 -50
  422. package/lib/esm/Line.mjs +45 -31
  423. package/lib/esm/Pattern.mjs +4 -2
  424. package/lib/esm/Plot.mjs +30 -35
  425. package/lib/esm/Radar.mjs +188 -175
  426. package/lib/esm/RadialTree.mjs +105 -111
  427. package/lib/esm/Reference.mjs +37 -40
  428. package/lib/esm/ResponsiveContainer.mjs +18 -21
  429. package/lib/esm/ScatterPlot.mjs +49 -40
  430. package/lib/esm/StackBar.mjs +18 -28
  431. package/lib/esm/StackedArea.mjs +13 -16
  432. package/lib/esm/Tooltip.mjs +56 -59
  433. package/lib/esm/Venn.mjs +67 -47
  434. package/lib/esm/a11y/DataAccessibilityTable.mjs +2 -2
  435. package/lib/esm/a11y/PlotA11yModule.mjs +35 -74
  436. package/lib/esm/a11y/PlotA11yView.mjs +41 -17
  437. package/lib/esm/a11y/focus.mjs +4 -4
  438. package/lib/esm/a11y/hints.mjs +2 -2
  439. package/lib/esm/a11y/insights.mjs +76 -76
  440. package/lib/esm/a11y/locale.mjs +2 -2
  441. package/lib/esm/a11y/serialize.mjs +12 -12
  442. package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +2 -2
  443. package/lib/esm/a11y/translations/module/de.json.mjs +2 -4
  444. package/lib/esm/a11y/translations/module/en.json.mjs +2 -4
  445. package/lib/esm/a11y/translations/module/es.json.mjs +2 -4
  446. package/lib/esm/a11y/translations/module/fr.json.mjs +2 -4
  447. package/lib/esm/a11y/translations/module/it.json.mjs +2 -4
  448. package/lib/esm/a11y/translations/module/ja.json.mjs +2 -4
  449. package/lib/esm/a11y/translations/module/ko.json.mjs +2 -4
  450. package/lib/esm/a11y/translations/module/nl.json.mjs +2 -4
  451. package/lib/esm/a11y/translations/module/pl.json.mjs +2 -4
  452. package/lib/esm/a11y/translations/module/pt.json.mjs +2 -4
  453. package/lib/esm/a11y/translations/module/sv.json.mjs +2 -4
  454. package/lib/esm/a11y/translations/module/tr.json.mjs +2 -4
  455. package/lib/esm/a11y/translations/module/vi.json.mjs +2 -4
  456. package/lib/esm/a11y/translations/module/zh.json.mjs +2 -4
  457. package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +2 -2
  458. package/lib/esm/component/Chart/AbstractChart.mjs +141 -65
  459. package/lib/esm/component/Chart/AreaChart.mjs +27 -51
  460. package/lib/esm/component/Chart/BarChart.mjs +64 -51
  461. package/lib/esm/component/Chart/BubbleChart.mjs +30 -25
  462. package/lib/esm/component/Chart/CigaretteChart.mjs +298 -119
  463. package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +13 -15
  464. package/lib/esm/component/Chart/DonutChart.mjs +16 -19
  465. package/lib/esm/component/Chart/HistogramChart.mjs +22 -46
  466. package/lib/esm/component/Chart/LineChart.mjs +23 -46
  467. package/lib/esm/component/Chart/RadarChart.mjs +16 -18
  468. package/lib/esm/component/Chart/ScatterPlotChart.mjs +18 -21
  469. package/lib/esm/component/Chart/VennChart.mjs +16 -19
  470. package/lib/esm/component/Chart/index.mjs +6 -6
  471. package/lib/esm/component/ChartLegend/BaseLegend.mjs +45 -22
  472. package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +19 -22
  473. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +88 -75
  474. package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +22 -25
  475. package/lib/esm/component/ChartLegend/index.mjs +2 -0
  476. package/lib/esm/component/Cigarette/Cigarette.mjs +16 -19
  477. package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +18 -22
  478. package/lib/esm/component/SvgElement.mjs +14 -0
  479. package/lib/esm/createElement.mjs +8 -10
  480. package/lib/esm/index.mjs +3 -0
  481. package/lib/esm/style/abstract-chart.shadow.css +12 -0
  482. package/lib/esm/style/area.shadow.css +2 -2
  483. package/lib/esm/style/axis.shadow.css +39 -1
  484. package/lib/esm/style/bar.shadow.css +1 -1
  485. package/lib/esm/style/bubble.shadow.css +11 -3
  486. package/lib/esm/style/donut.shadow.css +1 -1
  487. package/lib/esm/style/dot.shadow.css +1 -1
  488. package/lib/esm/style/hover.shadow.css +2 -2
  489. package/lib/esm/style/line.shadow.css +2 -2
  490. package/lib/esm/style/plot.shadow.css +8 -6
  491. package/lib/esm/style/plotA11yModule.shadow.css +10 -11
  492. package/lib/esm/style/plotA11yView.shadow.css +13 -26
  493. package/lib/esm/style/radar.shadow.css +3 -3
  494. package/lib/esm/style/radial-tree.shadow.css +2 -2
  495. package/lib/esm/style/scatterplot.shadow.css +2 -2
  496. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
  497. package/lib/esm/translations/es.json.mjs +1 -0
  498. package/lib/esm/translations/fr.json.mjs +1 -0
  499. package/lib/esm/translations/it.json.mjs +1 -0
  500. package/lib/esm/translations/ja.json.mjs +1 -0
  501. package/lib/esm/translations/ko.json.mjs +1 -0
  502. package/lib/esm/translations/nl.json.mjs +1 -0
  503. package/lib/esm/translations/pl.json.mjs +1 -0
  504. package/lib/esm/translations/pt.json.mjs +1 -0
  505. package/lib/esm/translations/sv.json.mjs +1 -0
  506. package/lib/esm/translations/tr.json.mjs +2 -1
  507. package/lib/esm/translations/vi.json.mjs +1 -0
  508. package/lib/esm/translations/zh.json.mjs +1 -0
  509. package/lib/esm/utils.mjs +11 -11
  510. package/lib/types/Area.d.ts +9 -6
  511. package/lib/types/Axis.d.ts +10 -3
  512. package/lib/types/Bar.d.ts +7 -6
  513. package/lib/types/Bubble.d.ts +21 -5
  514. package/lib/types/ClipPath.d.ts +4 -3
  515. package/lib/types/CompactHorizontalBar.d.ts +7 -8
  516. package/lib/types/Donut.d.ts +8 -5
  517. package/lib/types/GroupBar.d.ts +6 -6
  518. package/lib/types/HorizontalBar.d.ts +7 -6
  519. package/lib/types/Hover.d.ts +8 -8
  520. package/lib/types/Line.d.ts +9 -6
  521. package/lib/types/Pattern.d.ts +51 -51
  522. package/lib/types/Plot.d.ts +11 -9
  523. package/lib/types/Radar.d.ts +10 -7
  524. package/lib/types/RadialTree.d.ts +10 -54
  525. package/lib/types/Reference.d.ts +6 -5
  526. package/lib/types/ResponsiveContainer.d.ts +5 -4
  527. package/lib/types/ScatterPlot.d.ts +8 -5
  528. package/lib/types/StackBar.d.ts +7 -6
  529. package/lib/types/StackedArea.d.ts +6 -5
  530. package/lib/types/Tooltip.d.ts +12 -12
  531. package/lib/types/Venn.d.ts +7 -6
  532. package/lib/types/a11y/DataAccessibilityTable.d.ts +2 -2
  533. package/lib/types/a11y/PlotA11yModule.d.ts +4 -11
  534. package/lib/types/a11y/PlotA11yView.d.ts +13 -2
  535. package/lib/types/a11y/hints.d.ts +5 -5
  536. package/lib/types/a11y/insights.d.ts +1 -1
  537. package/lib/types/a11y/intl.d.ts +1 -1
  538. package/lib/types/a11y/serialize.d.ts +7 -7
  539. package/lib/types/a11y/summarize.d.ts +2 -2
  540. package/lib/types/a11y/translations/module/__intergalactic-dynamic-locales.d.ts +14 -14
  541. package/lib/types/component/Chart/AbstractChart.d.ts +20 -13
  542. package/lib/types/component/Chart/AbstractChart.type.d.ts +39 -25
  543. package/lib/types/component/Chart/AreaChart.d.ts +1 -1
  544. package/lib/types/component/Chart/AreaChart.type.d.ts +17 -7
  545. package/lib/types/component/Chart/BarChart.d.ts +1 -1
  546. package/lib/types/component/Chart/BarChart.type.d.ts +14 -9
  547. package/lib/types/component/Chart/BubbleChart.d.ts +1 -1
  548. package/lib/types/component/Chart/BubbleChart.type.d.ts +10 -5
  549. package/lib/types/component/Chart/CigaretteChart.d.ts +1 -1
  550. package/lib/types/component/Chart/CigaretteChart.type.d.ts +18 -8
  551. package/lib/types/component/Chart/CompactHorizontalBarChart.d.ts +1 -1
  552. package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +10 -6
  553. package/lib/types/component/Chart/DonutChart.d.ts +1 -1
  554. package/lib/types/component/Chart/DonutChart.type.d.ts +16 -7
  555. package/lib/types/component/Chart/HistogramChart.d.ts +1 -1
  556. package/lib/types/component/Chart/HistogramChart.type.d.ts +7 -4
  557. package/lib/types/component/Chart/LineChart.d.ts +1 -1
  558. package/lib/types/component/Chart/LineChart.type.d.ts +16 -7
  559. package/lib/types/component/Chart/RadarChart.d.ts +1 -1
  560. package/lib/types/component/Chart/RadarChart.type.d.ts +7 -5
  561. package/lib/types/component/Chart/ScatterPlotChart.d.ts +1 -1
  562. package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +12 -6
  563. package/lib/types/component/Chart/VennChart.d.ts +1 -1
  564. package/lib/types/component/Chart/VennChart.type.d.ts +12 -6
  565. package/lib/types/component/ChartLegend/BaseLegend.d.ts +8 -6
  566. package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +4 -5
  567. package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.d.ts +1 -1
  568. package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +4 -5
  569. package/lib/types/component/ChartLegend/LegendItem/LegendItem.d.ts +1 -1
  570. package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +17 -10
  571. package/lib/types/component/ChartLegend/LegendTable/LegendTable.d.ts +1 -1
  572. package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +5 -5
  573. package/lib/types/component/StackGroupBar/StackGroupBar.d.ts +1 -1
  574. package/lib/types/component/StackGroupBar/StackGroupBar.type.d.ts +3 -4
  575. package/lib/types/component/SvgElement.d.ts +10 -0
  576. package/lib/types/index.d.ts +3 -1
  577. package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +12 -0
  578. package/lib/types/utils.d.ts +17 -17
  579. package/package.json +13 -13
@@ -1 +1 @@
1
- {"version":3,"file":"StackedArea.d.js","names":[],"sources":["../../../src/types/StackedArea.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport Area from './Area';\nimport { IntergalacticD3Component } from './Plot';\nimport { PatternsConfig } from './Pattern';\n\n/** @deprecated */\nexport interface IStackedAreaProps extends StackedAreaProps, UnknownProperties {}\nexport type StackedAreaProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Stack generators\n * @default d3.stack() */\n /** @deprecated */\n stack?: any;\n\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n};\n\n/** @deprecated */\nexport interface IStackedAreaContext extends StackedAreaContext, UnknownProperties {}\nexport type StackedAreaContext = {\n /** Series is an array of points, where each point corresponds to the element in the input data. */\n /** @deprecated */\n series: any[];\n};\n\ndeclare const StackedArea: IntergalacticD3Component<'g', StackedAreaProps, StackedAreaContext> & {\n Area: typeof Area;\n};\n\nexport default StackedArea;\n"],"mappings":""}
1
+ {"version":3,"file":"StackedArea.d.js","names":[],"sources":["../../../src/types/StackedArea.d.ts"],"sourcesContent":["import type { UnknownProperties } from '@semcore/core';\n\nimport type Area from './Area';\nimport type { Context } from './context';\nimport type { PatternsConfig } from './Pattern';\nimport type { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface IStackedAreaProps extends StackedAreaProps, UnknownProperties {}\nexport type StackedAreaProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Stack generators\n * @default d3.stack() */\n /** @deprecated */\n stack?: any;\n\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n};\n\n/** @deprecated */\nexport interface IStackedAreaContext extends StackedAreaContext, UnknownProperties {}\nexport type StackedAreaContext = {\n /** Series is an array of points, where each point corresponds to the element in the input data. */\n /** @deprecated */\n series: any[];\n};\n\ndeclare const StackedArea: IntergalacticD3Component<'g', StackedAreaProps, StackedAreaContext> & {\n Area: typeof Area;\n};\n\nexport default StackedArea;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.js","names":[],"sources":["../../../src/types/Tooltip.d.ts"],"sourcesContent":["import React from 'react';\nimport Popper, { PopperProps, PopperTriggerProps } from '@semcore/popper';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { Context } from './context';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface ITooltipChartProps extends TooltipChartProps, UnknownProperties {}\nexport type TooltipChartProps = PopperProps &\n PopperTriggerProps &\n Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Handle click by trigger has an index - it is an index of the data array. */\n onClick?: (index: number, e: React.SyntheticEvent) => void;\n };\n\n/** @deprecated */\nexport interface ITooltipChartContext extends TooltipChartContext, UnknownProperties {\n /** Index active value for Axis x */\n xIndex: number | null;\n /** Index active value for Axis y */\n yIndex: number | null;\n}\nexport type TooltipChartContext = {\n getTriggerProps: PropGetterFn;\n getPopperProps: PropGetterFn;\n};\n\nexport type TooltipTypeBase = {\n Trigger: typeof Popper.Trigger;\n Popper: typeof Popper.Popper;\n Title: typeof Box;\n Dot: IntergalacticD3Component<'div', BoxProps & { color?: string }, TooltipChartContext>;\n Footer: typeof Box;\n};\n\nexport type TooltipType<ChildrenRenderProps = {}, TooltipProps = {}> = (<\n Tag extends Intergalactic.Tag = typeof Box,\n>(\n props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps<\n Tag,\n TooltipProps,\n ChildrenRenderProps & TooltipChartContext\n >,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<\n Intergalactic.Tag,\n Intergalactic.Tag,\n TooltipProps\n > &\n TooltipTypeBase;\n\n/**\n * @deprecated Consider migration to better typed Bubble.Tooltip, HoverLine.Tooltip,\n * HoverRect.Tooltip, Donut.Tooltip, Radar.Tooltip,\n * ScatterPlot.Tooltip or Venn.Tooltip.\n *\n * Migration examples:\n * 1. `<Tooltip tag={HoverLine}>...</Tooltip>` => `<HoverLine.Tooltip>...</HoverLine.Tooltip>`\n * 2. `<Tooltip tag={HoverRect}>...</Tooltip>` => `<HoverRect.Tooltip>...</HoverRect.Tooltip>`\n * 3. `<Tooltip tag={Radar.Hover}>...</Tooltip>` => `<Radar.Tooltip>...</Radar.Tooltip>`\n * 4. `<Tooltip>...</Tooltip>` => `<Bubble.Tooltip>...</Bubble.Tooltip>`\n * 5. `<Tooltip>...</Tooltip>` => `<Donut.Tooltip>...</Donut.Tooltip>`\n * 6. `<Tooltip>...</Tooltip>` => `<ScatterPlot.Tooltip>...</ScatterPlot.Tooltip>`\n * 7. `<Tooltip>...</Tooltip>` => `<Venn.Tooltip>...</Venn.Tooltip>`\n */\ndeclare const Tooltip: TooltipType;\n\nexport default Tooltip;\n"],"mappings":""}
1
+ {"version":3,"file":"Tooltip.d.js","names":[],"sources":["../../../src/types/Tooltip.d.ts"],"sourcesContent":["import type { Popper, Box, BoxProps, PopperProps, PopperTriggerProps } from '@semcore/base-components';\nimport type { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport type React from 'react';\n\nimport type { Context } from './context';\nimport type { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface ITooltipChartProps extends TooltipChartProps, UnknownProperties {}\nexport type TooltipChartProps = PopperProps &\n PopperTriggerProps &\n Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Handle click by trigger has an index - it is an index of the data array. */\n onClick?: (index: number, e: React.SyntheticEvent) => void;\n };\n\n/** @deprecated */\nexport interface ITooltipChartContext extends TooltipChartContext, UnknownProperties {\n /** Index active value for Axis x */\n xIndex: number | null;\n /** Index active value for Axis y */\n yIndex: number | null;\n}\nexport type TooltipChartContext = {\n getTriggerProps: PropGetterFn;\n getPopperProps: PropGetterFn;\n};\n\nexport type TooltipTypeBase = {\n Trigger: typeof Popper.Trigger;\n Popper: typeof Popper.Popper;\n Title: typeof Box;\n Dot: IntergalacticD3Component<'div', BoxProps & { color?: string }, TooltipChartContext>;\n Footer: typeof Box;\n};\n\nexport type TooltipType<ChildrenRenderProps = {}, TooltipProps = {}> = (<\n Tag extends Intergalactic.Tag = typeof Box,\n>(\n props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps<\n Tag,\n TooltipProps,\n ChildrenRenderProps & TooltipChartContext\n >,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\nIntergalactic.InternalTypings.ComponentAdditive<\n Intergalactic.Tag,\n Intergalactic.Tag,\n TooltipProps\n> &\nTooltipTypeBase;\n\n/**\n * @deprecated Consider migration to better typed Bubble.Tooltip, HoverLine.Tooltip,\n * HoverRect.Tooltip, Donut.Tooltip, Radar.Tooltip,\n * ScatterPlot.Tooltip or Venn.Tooltip.\n *\n * Migration examples:\n * 1. `<Tooltip tag={HoverLine}>...</Tooltip>` => `<HoverLine.Tooltip>...</HoverLine.Tooltip>`\n * 2. `<Tooltip tag={HoverRect}>...</Tooltip>` => `<HoverRect.Tooltip>...</HoverRect.Tooltip>`\n * 3. `<Tooltip tag={Radar.Hover}>...</Tooltip>` => `<Radar.Tooltip>...</Radar.Tooltip>`\n * 4. `<Tooltip>...</Tooltip>` => `<Bubble.Tooltip>...</Bubble.Tooltip>`\n * 5. `<Tooltip>...</Tooltip>` => `<Donut.Tooltip>...</Donut.Tooltip>`\n * 6. `<Tooltip>...</Tooltip>` => `<ScatterPlot.Tooltip>...</ScatterPlot.Tooltip>`\n * 7. `<Tooltip>...</Tooltip>` => `<Venn.Tooltip>...</Venn.Tooltip>`\n */\ndeclare const Tooltip: TooltipType;\n\nexport default Tooltip;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Venn.d.js","names":[],"sources":["../../../src/types/Venn.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { FadeInOutProps } from '@semcore/animation';\nimport { TooltipType } from './Tooltip';\nimport { IntergalacticD3Component } from './Plot';\nimport { PatternsConfig } from './Pattern';\n\n/** @deprecated */\nexport interface IVennProps extends VennProps, UnknownProperties {}\nexport type VennProps = Context &\n FadeInOutProps & {\n /**\n * Rotate sets in the chart\n * @default Math.PI / 2\n */\n orientation?: number;\n /**\n * The function for sorting sets inside the chart\n * @default (circle1, circle2) => circle2.radius - circle1.radius\n */\n orientationOrder?: (c1: number, c2: number) => number;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n /**\n * Fallback for minimum value radius\n * @default 6\n * */\n minRadius?: number;\n };\n\n/** @deprecated */\nexport interface ICircleProps extends CircleProps, UnknownProperties {}\nexport type CircleProps = Context & {\n /**\n * Name of the field in the data\n * */\n dataKey: string;\n /**\n * Human readable name of the circle\n * */\n name: string;\n /** Color circle\n @default #3AB011\n **/\n color?: string;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Enables element transparency */\n transparent?: boolean;\n};\n\n/** @deprecated */\nexport interface IIntersectionProps extends IntersectionProps, UnknownProperties {}\nexport type IntersectionProps = Context &\n FadeInOutProps & {\n /**\n * Name of the field in the data\n * */\n dataKey: string;\n /**\n * Human readable name of the intersection\n * */\n name: string;\n /** Enables element transparency */\n transparent?: boolean;\n };\n\ndeclare const Venn: IntergalacticD3Component<'g', VennProps, Context> & {\n Circle: IntergalacticD3Component<'circle', CircleProps, Context>;\n Intersection: IntergalacticD3Component<'path', IntersectionProps, Context>;\n Tooltip: TooltipType<CircleProps>;\n};\n\nexport default Venn;\n"],"mappings":""}
1
+ {"version":3,"file":"Venn.d.js","names":[],"sources":["../../../src/types/Venn.d.ts"],"sourcesContent":["import type { FadeInOutProps } from '@semcore/base-components';\nimport type { UnknownProperties } from '@semcore/core';\n\nimport type { Context } from './context';\nimport type { PatternsConfig } from './Pattern';\nimport type { IntergalacticD3Component } from './Plot';\nimport type { TooltipType } from './Tooltip';\n\n/** @deprecated */\nexport interface IVennProps extends VennProps, UnknownProperties {}\nexport type VennProps = Context &\n FadeInOutProps & {\n /**\n * Rotate sets in the chart\n * @default Math.PI / 2\n */\n orientation?: number;\n /**\n * The function for sorting sets inside the chart\n * @default (circle1, circle2) => circle2.radius - circle1.radius\n */\n orientationOrder?: (c1: number, c2: number) => number;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n /**\n * Fallback for minimum value radius\n * @default 6\n * */\n minRadius?: number;\n };\n\n/** @deprecated */\nexport interface ICircleProps extends CircleProps, UnknownProperties {}\nexport type CircleProps = Context & {\n /**\n * Name of the field in the data\n * */\n dataKey: string;\n /**\n * Human readable name of the circle\n * */\n name: string;\n /** Color circle\n @default #3AB011\n **/\n color?: string;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Enables element transparency */\n transparent?: boolean;\n};\n\n/** @deprecated */\nexport interface IIntersectionProps extends IntersectionProps, UnknownProperties {}\nexport type IntersectionProps = Context &\n FadeInOutProps & {\n /**\n * Name of the field in the data\n * */\n dataKey: string;\n /**\n * Human readable name of the intersection\n * */\n name: string;\n /** Enables element transparency */\n transparent?: boolean;\n };\n\ndeclare const Venn: IntergalacticD3Component<'g', VennProps, Context> & {\n Circle: IntergalacticD3Component<'circle', CircleProps, Context>;\n Intersection: IntergalacticD3Component<'path', IntersectionProps, Context>;\n Tooltip: TooltipType<CircleProps>;\n};\n\nexport default Venn;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.js","names":[],"sources":["../../../src/types/context.d.ts"],"sourcesContent":["export type Context = {\n /** Data for graphic */\n data?: unknown;\n /** Scale for svg element */\n scale?: unknown[];\n};\n\n/** @deprecated */\nexport default interface IContext {\n /** Data for graphic */\n /** @deprecated */\n data?: any;\n /** Scale for svg element */\n /** @deprecated */\n scale?: any[];\n\n [key: string]: unknown;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"context.d.js","names":[],"sources":["../../../src/types/context.d.ts"],"sourcesContent":["export type Context = {\n /** Data for graphic */\n data?: unknown;\n /** Scale for svg element */\n scale?: unknown[];\n};\n\n/** @deprecated */\nexport default interface IContext {\n /** Data for graphic */\n /** @deprecated */\n data?: any;\n /** Scale for svg element */\n /** @deprecated */\n scale?: any[];\n\n [key: string]: unknown;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  // Utils
2
2
  // @ts-ignore
3
+
3
4
  import { PlotEventEmitter } from './utils';
4
5
  export { PlotEventEmitter };
5
6
  export { makeDataHintsContainer } from './a11y/hints';
@@ -71,6 +72,7 @@ export * from './component/Chart/AbstractChart.type';
71
72
  export * from './component/Chart/LineChart.type';
72
73
  export * from './component/Chart/BarChart.type';
73
74
  export * from './component/Chart/HistogramChart.type';
75
+ export * from './component/Chart/CompactHorizontalBarChart.type';
74
76
  export * from './component/Chart/ScatterPlotChart.type';
75
77
  export * from './component/Chart/AreaChart.type';
76
78
  export * from './component/Chart/BubbleChart.type';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":["PlotEventEmitter","makeDataHintsContainer","default","Plot","ResponsiveContainer","Line","Bar","HorizontalBar","CompactHorizontalBar","GroupBar","StackBar","Area","StackedArea","Radar","Donut","Tooltip","ScatterPlot","Bubble","Venn","RadialTree","ChartLegend","ChartLegendTable","Chart","StackGroupBar"],"sources":["../../../src/types/index.d.ts"],"sourcesContent":["// Utils\n// @ts-ignore\nimport { interpolateValue as intValue, PlotEventEmitter } from './utils';\n\nexport declare const interpolateValue: typeof intValue;\nexport declare function minMax(data: any, key: string | number): any;\nexport declare function calculateBubbleDomain(\n data: Array<{ value: number; x: number; y: number }>,\n key: 'x' | 'y',\n range: [number, number],\n): [min: number, max: number];\nexport { PlotEventEmitter };\n\nexport { makeDataHintsContainer } from './a11y/hints';\n\n// Color\n/**\n * @deprecated\n * This export will be removed in the next major release.\n */\nexport declare const colors: { [key: string]: string };\n\nexport { default as Plot } from './Plot';\nexport * from './Plot';\n\nexport * from './Axis';\nexport * from './Hover';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport * from './ResponsiveContainer';\n\nexport { default as Line } from './Line';\nexport * from './Line';\n\nexport { default as Bar } from './Bar';\nexport * from './Bar';\n\nexport { default as HorizontalBar } from './HorizontalBar';\nexport * from './HorizontalBar';\n\nexport { default as CompactHorizontalBar } from './CompactHorizontalBar';\nexport * from './CompactHorizontalBar';\n\nexport { default as GroupBar } from './GroupBar';\nexport * from './GroupBar';\n\nexport { default as StackBar } from './StackBar';\nexport * from './StackBar';\n\nexport { default as Area } from './Area';\nexport * from './Area';\n\nexport { default as StackedArea } from './StackedArea';\nexport * from './StackedArea';\n\nexport { default as Radar } from './Radar';\nexport * from './Radar';\n\nexport { default as Donut } from './Donut';\nexport * from './Donut';\n\nexport { default as Tooltip } from './Tooltip';\nexport * from './Tooltip';\n\nexport { default as ScatterPlot } from './ScatterPlot';\nexport * from './ScatterPlot';\n\nexport { default as Bubble } from './Bubble';\nexport * from './Bubble';\n\nexport * from './Reference';\n\nexport { default as Venn } from './Venn';\nexport * from './Venn';\n\n/** It becomes resolvable after building and moving file to lib dir */\n\n// @ts-ignore\nexport { default as RadialTree } from './RadialTree';\n\n// @ts-ignore\nexport * from './RadialTree';\n\n// @ts-ignore\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\n\n// @ts-ignore\nexport * from './component/ChartLegend/LegendFlex/LegendFlex.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendTable/LegendTable.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendItem/LegendItem.type';\n\n// @ts-ignore\nexport * from './Pattern';\n\nexport { default as Chart } from './component/Chart';\nexport * from './component/Chart/AbstractChart.type';\nexport * from './component/Chart/LineChart.type';\nexport * from './component/Chart/BarChart.type';\nexport * from './component/Chart/HistogramChart.type';\nexport * from './component/Chart/ScatterPlotChart.type';\nexport * from './component/Chart/AreaChart.type';\nexport * from './component/Chart/BubbleChart.type';\nexport * from './component/Chart/DonutChart.type';\nexport * from './component/Chart/VennChart.type';\nexport * from './component/Chart/RadarChart.type';\nexport * from './component/Chart/ScatterPlotChart.type';\nexport * from './component/Chart/CigaretteChart.type';\n\nexport { default as StackGroupBar } from './component/StackGroupBar/StackGroupBar';\n"],"mappings":"AAAA;AACA;AACA,SAAuCA,gBAAgB,QAAQ,SAAS;AASxE,SAASA,gBAAgB;AAEzB,SAASC,sBAAsB,QAAQ,cAAc;;AAErD;AACA;AACA;AACA;AACA;;AAGA,SAASC,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,cAAc,QAAQ;AACtB,cAAc,SAAS;AAEvB,SAASD,OAAO,IAAIE,mBAAmB,QAAQ,uBAAuB;AACtE,cAAc,uBAAuB;AAErC,SAASF,OAAO,IAAIG,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,SAASH,OAAO,IAAII,GAAG,QAAQ,OAAO;AACtC,cAAc,OAAO;AAErB,SAASJ,OAAO,IAAIK,aAAa,QAAQ,iBAAiB;AAC1D,cAAc,iBAAiB;AAE/B,SAASL,OAAO,IAAIM,oBAAoB,QAAQ,wBAAwB;AACxE,cAAc,wBAAwB;AAEtC,SAASN,OAAO,IAAIO,QAAQ,QAAQ,YAAY;AAChD,cAAc,YAAY;AAE1B,SAASP,OAAO,IAAIQ,QAAQ,QAAQ,YAAY;AAChD,cAAc,YAAY;AAE1B,SAASR,OAAO,IAAIS,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,SAAST,OAAO,IAAIU,WAAW,QAAQ,eAAe;AACtD,cAAc,eAAe;AAE7B,SAASV,OAAO,IAAIW,KAAK,QAAQ,SAAS;AAC1C,cAAc,SAAS;AAEvB,SAASX,OAAO,IAAIY,KAAK,QAAQ,SAAS;AAC1C,cAAc,SAAS;AAEvB,SAASZ,OAAO,IAAIa,OAAO,QAAQ,WAAW;AAC9C,cAAc,WAAW;AAEzB,SAASb,OAAO,IAAIc,WAAW,QAAQ,eAAe;AACtD,cAAc,eAAe;AAE7B,SAASd,OAAO,IAAIe,MAAM,QAAQ,UAAU;AAC5C,cAAc,UAAU;AAExB,cAAc,aAAa;AAE3B,SAASf,OAAO,IAAIgB,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;;AAEtB;;AAEA;AACA,SAAShB,OAAO,IAAIiB,UAAU,QAAQ,cAAc;;AAEpD;AACA,cAAc,cAAc;;AAE5B;AACA,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,yBAAyB;;AAEvE;AACA,cAAc,oDAAoD;AAClE;AACA,cAAc,sDAAsD;AACpE;AACA,cAAc,oDAAoD;;AAElE;AACA,cAAc,WAAW;AAEzB,SAASnB,OAAO,IAAIoB,KAAK,QAAQ,mBAAmB;AACpD,cAAc,sCAAsC;AACpD,cAAc,kCAAkC;AAChD,cAAc,iCAAiC;AAC/C,cAAc,uCAAuC;AACrD,cAAc,yCAAyC;AACvD,cAAc,kCAAkC;AAChD,cAAc,oCAAoC;AAClD,cAAc,mCAAmC;AACjD,cAAc,kCAAkC;AAChD,cAAc,mCAAmC;AACjD,cAAc,yCAAyC;AACvD,cAAc,uCAAuC;AAErD,SAASpB,OAAO,IAAIqB,aAAa,QAAQ,yCAAyC"}
1
+ {"version":3,"file":"index.d.js","names":["PlotEventEmitter","makeDataHintsContainer","default","Plot","ResponsiveContainer","Line","Bar","HorizontalBar","CompactHorizontalBar","GroupBar","StackBar","Area","StackedArea","Radar","Donut","Tooltip","ScatterPlot","Bubble","Venn","RadialTree","ChartLegend","ChartLegendTable","Chart","StackGroupBar"],"sources":["../../../src/types/index.d.ts"],"sourcesContent":["// Utils\n// @ts-ignore\nimport type { interpolateValue as intValue } from './utils';\nimport { PlotEventEmitter } from './utils';\n\nexport declare const interpolateValue: typeof intValue;\nexport declare function minMax(data: any, key: string | number): any;\nexport declare function calculateBubbleDomain(\n data: Array<{ value: number; x: number; y: number }>,\n key: 'x' | 'y',\n range: [number, number],\n): [min: number, max: number];\nexport { PlotEventEmitter };\n\nexport { makeDataHintsContainer } from './a11y/hints';\n\n// Color\n/**\n * @deprecated\n * This export will be removed in the next major release.\n */\nexport declare const colors: { [key: string]: string };\n\nexport { default as Plot } from './Plot';\nexport * from './Plot';\n\nexport * from './Axis';\nexport * from './Hover';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport * from './ResponsiveContainer';\n\nexport { default as Line } from './Line';\nexport * from './Line';\n\nexport { default as Bar } from './Bar';\nexport * from './Bar';\n\nexport { default as HorizontalBar } from './HorizontalBar';\nexport * from './HorizontalBar';\n\nexport { default as CompactHorizontalBar } from './CompactHorizontalBar';\nexport * from './CompactHorizontalBar';\n\nexport { default as GroupBar } from './GroupBar';\nexport * from './GroupBar';\n\nexport { default as StackBar } from './StackBar';\nexport * from './StackBar';\n\nexport { default as Area } from './Area';\nexport * from './Area';\n\nexport { default as StackedArea } from './StackedArea';\nexport * from './StackedArea';\n\nexport { default as Radar } from './Radar';\nexport * from './Radar';\n\nexport { default as Donut } from './Donut';\nexport * from './Donut';\n\nexport { default as Tooltip } from './Tooltip';\nexport * from './Tooltip';\n\nexport { default as ScatterPlot } from './ScatterPlot';\nexport * from './ScatterPlot';\n\nexport { default as Bubble } from './Bubble';\nexport * from './Bubble';\n\nexport * from './Reference';\n\nexport { default as Venn } from './Venn';\nexport * from './Venn';\n\n/** It becomes resolvable after building and moving file to lib dir */\n\n// @ts-ignore\nexport { default as RadialTree } from './RadialTree';\n\n// @ts-ignore\nexport * from './RadialTree';\n\n// @ts-ignore\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\n\n// @ts-ignore\nexport * from './component/ChartLegend/LegendFlex/LegendFlex.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendTable/LegendTable.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendItem/LegendItem.type';\n\n// @ts-ignore\nexport * from './Pattern';\n\nexport { default as Chart } from './component/Chart';\nexport * from './component/Chart/AbstractChart.type';\nexport * from './component/Chart/LineChart.type';\nexport * from './component/Chart/BarChart.type';\nexport * from './component/Chart/HistogramChart.type';\nexport * from './component/Chart/CompactHorizontalBarChart.type';\nexport * from './component/Chart/ScatterPlotChart.type';\nexport * from './component/Chart/AreaChart.type';\nexport * from './component/Chart/BubbleChart.type';\nexport * from './component/Chart/DonutChart.type';\nexport * from './component/Chart/VennChart.type';\nexport * from './component/Chart/RadarChart.type';\nexport * from './component/Chart/ScatterPlotChart.type';\nexport * from './component/Chart/CigaretteChart.type';\n\nexport { default as StackGroupBar } from './component/StackGroupBar/StackGroupBar';\n"],"mappings":"AAAA;AACA;;AAEA,SAASA,gBAAgB,QAAQ,SAAS;AAS1C,SAASA,gBAAgB;AAEzB,SAASC,sBAAsB,QAAQ,cAAc;;AAErD;AACA;AACA;AACA;AACA;;AAGA,SAASC,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,cAAc,QAAQ;AACtB,cAAc,SAAS;AAEvB,SAASD,OAAO,IAAIE,mBAAmB,QAAQ,uBAAuB;AACtE,cAAc,uBAAuB;AAErC,SAASF,OAAO,IAAIG,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,SAASH,OAAO,IAAII,GAAG,QAAQ,OAAO;AACtC,cAAc,OAAO;AAErB,SAASJ,OAAO,IAAIK,aAAa,QAAQ,iBAAiB;AAC1D,cAAc,iBAAiB;AAE/B,SAASL,OAAO,IAAIM,oBAAoB,QAAQ,wBAAwB;AACxE,cAAc,wBAAwB;AAEtC,SAASN,OAAO,IAAIO,QAAQ,QAAQ,YAAY;AAChD,cAAc,YAAY;AAE1B,SAASP,OAAO,IAAIQ,QAAQ,QAAQ,YAAY;AAChD,cAAc,YAAY;AAE1B,SAASR,OAA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  import _createForOfIteratorHelper from "@babel/runtime/helpers/createForOfIteratorHelper";
4
4
  import _objectSpread from "@babel/runtime/helpers/objectSpread2";
5
5
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
6
- import EventEmitter from '@semcore/utils/lib/eventEmitter';
6
+ import EventEmitter from '@semcore/core/lib/utils/eventEmitter';
7
7
  import { extent, bisector } from 'd3-array';
8
8
  import { scaleQuantize, scaleBand, scaleSqrt } from 'd3-scale';
9
9
  export var eventToPoint = function eventToPoint(event, svgRoot) {
@@ -78,18 +78,16 @@ export var getIndexFromData = function getIndexFromData(data, scale, key, value)
78
78
  return d[key];
79
79
  }).center;
80
80
  return bisect(data, value);
81
- }
82
- // detect bar chart
83
- else if ('step' in scale && typeof scale.step !== 'undefined' && Array.isArray(data)) {
81
+ } else if ('step' in scale && typeof scale.step !== 'undefined' && Array.isArray(data)) {
82
+ // detect bar chart
84
83
  var index = data.findIndex(function (d) {
85
84
  return d[key] === value;
86
85
  });
87
86
  return index >= 0 ? index : null;
88
- }
89
- // detect cigarette chart
90
- else if ('invert' in scale && typeof scale.invert === 'function' && !Array.isArray(data)) {
87
+ } else if ('invert' in scale && typeof scale.invert === 'function' && !Array.isArray(data)) {
88
+ // detect cigarette chart
91
89
  var keys = Object.keys(data);
92
- var domain = keys.map(function (key, index) {
90
+ var domain = keys.map(function (_key, index) {
93
91
  return keys.slice(0, index).reduce(function (acc, item) {
94
92
  if (data[item] !== interpolateValue) {
95
93
  acc = acc + data[item];
@@ -97,23 +95,24 @@ export var getIndexFromData = function getIndexFromData(data, scale, key, value)
97
95
  return acc;
98
96
  }, 0);
99
97
  });
100
- var _key = null;
98
+ var _key2 = null;
101
99
  var lastKeyIndex = keys.length - 1;
102
100
  if (value > domain[lastKeyIndex]) {
103
- _key = keys[lastKeyIndex];
101
+ _key2 = keys[lastKeyIndex];
104
102
  } else {
105
103
  for (var i = 0; i < lastKeyIndex; i++) {
106
104
  if (i === 0 && value < domain[i]) {
107
105
  break;
108
106
  }
109
107
  if (value > domain[i] && value < domain[i + 1]) {
110
- _key = keys[i];
108
+ _key2 = keys[i];
111
109
  break;
112
110
  }
113
111
  }
114
112
  }
115
- return _key;
113
+ return _key2;
116
114
  } else {
115
+ // eslint-disable-next-line no-console
117
116
  console.warn('[d3-chart/utils/getIndexFromData] encountered incompatible scale type');
118
117
  return null;
119
118
  }
@@ -165,8 +164,8 @@ export var scaleToBand = function scaleToBand(scale) {
165
164
  export var memoize = function memoize(func) {
166
165
  var results = {};
167
166
  return function () {
168
- for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
169
- args[_key2] = arguments[_key2];
167
+ for (var _len = arguments.length, args = new Array(_len), _key3 = 0; _key3 < _len; _key3++) {
168
+ args[_key3] = arguments[_key3];
170
169
  }
171
170
  var argsKey = args.join(',');
172
171
  if (!results[argsKey]) {
@@ -216,7 +215,8 @@ export var getChartDefaultColorName = function getChartDefaultColorName(index) {
216
215
  export var getBubbleChartValueScale = function getBubbleChartValueScale(data, key) {
217
216
  var z = scaleSqrt().domain([0, Math.max.apply(Math, _toConsumableArray(data.map(function (el) {
218
217
  return el[key];
219
- })))]).range([5.5, 50.5]);
218
+ })))]).range([5.5, 50.5]); // min/max radius
219
+
220
220
  return z;
221
221
  };
222
222
  export var getScatterPlotRadius = function getScatterPlotRadius(valueKey) {
@@ -253,7 +253,7 @@ export var calculateBubbleDomain = function calculateBubbleDomain(data, key, ran
253
253
  var maxValueShift = valueScale(maxestValue) * pixelRatio;
254
254
  min -= minValueShift * 2;
255
255
  max += maxValueShift * 2;
256
- return [min, max];
256
+ return [Math.floor(min), Math.floor(max)];
257
257
  };
258
258
  export var PlotEventEmitter = EventEmitter;
259
259
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["EventEmitter","extent","bisector","scaleQuantize","scaleBand","scaleSqrt","eventToPoint","event","svgRoot","node","currentTarget","target","rect","getBoundingClientRect","clientX","left","clientLeft","clientY","top","clientTop","invert","scale","value","range","domain","paddingOuter","step","slice","reverse","definedNullData","x","y","plot","definedData","undefined","scaleOfBandwidth","bandwidth","minMax","data","key","d","getNullData","defined","name","reduce","acc","i","push","_defineProperty","prev","next","defNext","find","_objectSpread","length","defPrev","getIndexFromData","Array","isArray","bisect","center","index","findIndex","keys","Object","map","item","interpolateValue","lastKeyIndex","console","warn","roundedPath","w","h","r","tl","arguments","tr","bl","br","result","concat","scaleToBand","band","memoize","func","results","_len","args","_key2","argsKey","join","apply","measureText","text","fontSize","span","document","createElement","style","_iterator","_createForOfIteratorHelper","split","_step","s","n","done","line","append","createTextNode","err","e","f","display","body","textWidth","offsetWidth","textHeight","offsetHeight","remove","Math","max","idCounter","uniqueId","prefix","Symbol","getChartDefaultColorName","getBubbleChartValueScale","z","_toConsumableArray","el","getScatterPlotRadius","valueKey","calculateBubbleDomain","miniestValue","min","maxestValue","_minMax","_minMax2","_slicedToArray","pixelRatio","abs","valueScale","minValueShift","maxValueShift","PlotEventEmitter"],"sources":["../../src/utils.ts"],"sourcesContent":["import EventEmitter from '@semcore/utils/lib/eventEmitter';\nimport { extent, bisector, Numeric } from 'd3-array';\nimport {\n scaleQuantize,\n ScaleIdentity,\n ScaleTime,\n ScaleContinuousNumeric,\n ScaleBand,\n ScalePoint,\n NumberValue,\n scaleBand,\n scaleSqrt,\n} from 'd3-scale';\nimport React from 'react';\n\nexport const eventToPoint = (event: React.MouseEvent<HTMLElement>, svgRoot: SVGElement) => {\n const node = (event.currentTarget || event.target) as HTMLElement;\n const rect = svgRoot.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n};\n\ntype InvertableScale =\n | ScaleIdentity\n | ScaleBand<{}>\n | ScaleTime<unknown, unknown>\n | ScaleContinuousNumeric<unknown, unknown>;\nexport const invert = <Scale extends InvertableScale = InvertableScale>(\n scale: Scale,\n value: number,\n) => {\n if ('invert' in scale && scale.invert) return scale.invert(value);\n\n const range = scale.range() as [number, number];\n const domain = scale.domain();\n if ('paddingOuter' in scale) {\n range[0] += scale.paddingOuter() * scale.step();\n range[1] -= scale.paddingOuter() * scale.step();\n }\n\n return scaleQuantize()\n .domain((range[0] <= range[1] ? range : range.slice().reverse()) as NumberValue[])\n .range((range[0] <= range[1] ? domain : domain.slice().reverse()) as number[])(value);\n};\n\nexport const definedNullData = (x: number, y: number) => (plot: { [xOrY: number]: unknown }) =>\n plot[x] !== null && plot[y] !== null;\n\nexport const definedData = (x: number, y: number) => (plot: { [xOrY: number]: unknown }) =>\n plot[x] !== null && plot[x] !== undefined && plot[y] !== null && plot[y] !== undefined;\n\nexport const scaleOfBandwidth = <Scale extends ScaleBand<{}>>(scale: Scale, value: number) =>\n scale.bandwidth ? scale(value)! + scale.bandwidth() / 2 : scale(value);\n\nexport const minMax = <\n Key extends string = string,\n Data extends { [key: string]: Numeric | null | undefined }[] = {\n [key: string]: Numeric | null | undefined;\n }[],\n>(\n data: Data,\n key: Key,\n): [min: Data[0][Key], max: Data[0][Key]] => {\n if (typeof key === 'string') {\n return extent(data, (d) => d[key]) as any;\n }\n return extent(data, key) as any;\n};\n\nexport const getNullData = <\n Name extends string = string,\n Data extends { [name in Name]?: unknown | null } = {},\n>(\n data: Data[],\n defined: (data: Data) => boolean,\n name: Name,\n) =>\n data.reduce((acc, d, i, data) => {\n if (defined(d)) {\n acc.push({\n [name]: null,\n } as Data);\n } else {\n const prev = data[i - 1];\n const next = data[i + 1];\n\n if (i === 0) {\n const defNext = data.find(defined);\n acc.push({\n ...d,\n [name]: defNext ? defNext[name] : null,\n });\n }\n\n // prev\n if (prev && defined(prev)) {\n acc.push(prev);\n }\n\n // next\n if (next && defined(next)) {\n acc.push(next);\n }\n\n if (data.length - 1 === i) {\n const defPrev = data.slice().reverse().find(defined);\n acc.push({\n ...d,\n [name]: defPrev ? defPrev[name] : null,\n });\n }\n }\n return acc;\n }, [] as Data[]);\n\ntype IndexFromDataScale =\n | ScaleIdentity\n | ScaleTime<unknown, unknown>\n | ScaleContinuousNumeric<unknown, unknown>\n | ScaleBand<{}>\n | ScalePoint<{}>;\nexport const getIndexFromData = <\n Key extends string,\n Data extends {\n [key in Key]: number;\n } = { [key in Key]: number },\n Scale extends IndexFromDataScale = IndexFromDataScale,\n>(\n data: Data[],\n scale: Scale,\n key: Key,\n value: number,\n) => {\n // detect line chart\n if ('invert' in scale && typeof scale.invert === 'function' && Array.isArray(data)) {\n const bisect = bisector((d: { [key: string]: number }) => d[key]).center;\n return bisect(data, value);\n }\n // detect bar chart\n else if ('step' in scale && typeof scale.step !== 'undefined' && Array.isArray(data)) {\n const index = data.findIndex((d) => d[key] === value);\n return index >= 0 ? index : null;\n }\n // detect cigarette chart\n else if ('invert' in scale && typeof scale.invert === 'function' && !Array.isArray(data)) {\n const keys = Object.keys(data);\n const domain = keys.map((key, index) => {\n return keys.slice(0, index).reduce((acc, item) => {\n if (data[item] !== interpolateValue) {\n acc = acc + data[item];\n }\n\n return acc;\n }, 0);\n });\n\n let key = null;\n\n const lastKeyIndex = keys.length - 1;\n\n if (value > domain[lastKeyIndex]) {\n key = keys[lastKeyIndex];\n } else {\n for (let i = 0; i < lastKeyIndex; i++) {\n if (i === 0 && value < domain[i]) {\n break;\n }\n\n if (value > domain[i] && value < domain[i + 1]) {\n key = keys[i];\n break;\n }\n }\n }\n\n return key;\n } else {\n console.warn('[d3-chart/utils/getIndexFromData] encountered incompatible scale type');\n return null;\n }\n};\n\nexport const roundedPath = (\n x: number,\n y: number,\n w: number,\n h: number,\n r: number,\n tl = false,\n tr = false,\n bl = false,\n br = false,\n) => {\n let result = `M${x + r},${y}`;\n result += `h${w - 2 * r}`;\n if (tr) {\n result += `a${r},${r} 0 0 1 ${r},${r}`;\n } else {\n result += `h${r}`;\n result += `v${r}`;\n }\n result += `v${h - 2 * r}`;\n if (br) {\n result += `a${r},${r} 0 0 1 ${-r},${r}`;\n } else {\n result += `v${r}`;\n result += `h${-r}`;\n }\n result += `h${2 * r - w}`;\n if (bl) {\n result += `a${r},${r} 0 0 1 ${-r},${-r}`;\n } else {\n result += `h${-r}`;\n result += `v${-r}`;\n }\n result += `v${2 * r - h}`;\n if (tl) {\n result += `a${r},${r} 0 0 1 ${r},${-r}`;\n } else {\n result += `v${-r}`;\n result += `h${r}`;\n }\n result += 'z';\n return result;\n};\n\nexport const scaleToBand = (scale: ScaleBand<{}>) => {\n if ('bandwidth' in scale) {\n return scale;\n }\n\n const band = scaleBand()\n .range((scale as any).range())\n .domain((scale as any).domain());\n\n return band;\n};\n\nexport const memoize = <Func extends (...args: any[]) => any>(func: Func): Func => {\n const results: { [cacheKey: string]: any } = {};\n return ((...args: any[]) => {\n const argsKey = args.join(',');\n if (!results[argsKey]) {\n results[argsKey] = func(...args);\n }\n return results[argsKey];\n }) as Func;\n};\n\nexport const measureText = memoize((text: string, fontSize?: number) => {\n if (!text) return 0;\n\n const span = document.createElement('span');\n if (fontSize) {\n span.style.fontSize = `${fontSize}px`;\n }\n for (const line of text.split('\\n')) {\n span.append(document.createTextNode(line));\n span.append(document.createElement('br'));\n }\n span.style.display = 'inline-block';\n document.body.append(span);\n const textWidth = span.offsetWidth;\n const textHeight = span.offsetHeight;\n span.remove();\n return Math.max(textWidth, textHeight);\n});\n\nlet idCounter = 0;\nexport const uniqueId = (prefix = 'id-') => `${prefix}${idCounter++}`;\n\nexport const interpolateValue = Symbol('intergalactic-d3-chart-line-interpolate');\n\nexport const getChartDefaultColorName = (index: number) => {\n index++;\n if (index < 1) index = 1;\n if (index > 24) index %= 24;\n\n return `chart-palette-order-${index}`;\n};\n\nexport const getBubbleChartValueScale = (data: any[], key: string) => {\n const z = scaleSqrt()\n .domain([0, Math.max(...data.map((el) => el[key]))])\n .range([5.5, 50.5]);\n\n return z;\n};\n\nexport const getScatterPlotRadius = (valueKey?: string): number => {\n return valueKey !== undefined ? 12 : 5.5;\n};\n\ntype BubbleChartDataItem = {\n value: number;\n x: number;\n y: number;\n};\n\nexport const calculateBubbleDomain = (\n data: Array<BubbleChartDataItem>,\n key: 'x' | 'y',\n range: [number, number],\n): [min: number, max: number] => {\n const miniestValue = data.reduce(\n (acc, item) => {\n if (item[key] - item.value < acc.min) {\n acc.min = item[key] - item.value;\n acc.value = item.value;\n }\n return acc;\n },\n { value: data[0].value, min: data[0][key] - data[0].value },\n ).value;\n const maxestValue = data.reduce(\n (acc, item) => {\n if (item.value + item[key] > acc.max) {\n acc.max = item.value + item.x;\n acc.value = item.value;\n }\n return acc;\n },\n { value: data[0].value, max: data[0].value + data[0][key] },\n ).value;\n\n let [min, max] = minMax(data, key);\n\n const pixelRatio = Math.abs(max - min) / Math.abs(range[0] - range[1]);\n const valueScale = getBubbleChartValueScale(data, 'value');\n const minValueShift = valueScale(miniestValue) * pixelRatio;\n const maxValueShift = valueScale(maxestValue) * pixelRatio;\n min -= minValueShift * 2;\n max += maxValueShift * 2;\n\n return [min, max];\n};\n\ninterface PlotEventEmitterEmit {\n (event: 'setTooltipVisible', visible: boolean): void;\n (event: 'setTooltipPosition', x: number, y: number): void;\n}\ntype Unsubscribe = () => void;\ninterface PlotEventEmitterSubscribe {\n (event: 'setTooltipVisible', callback: (visible: boolean) => void): Unsubscribe;\n (event: 'setTooltipPosition', callback: (x: number, y: number) => void): Unsubscribe;\n}\nexport const PlotEventEmitter = EventEmitter as typeof EventEmitter<\n PlotEventEmitterEmit,\n PlotEventEmitterSubscribe\n>;\n"],"mappings":";;;;;AAAA,OAAOA,YAAY,MAAM,iCAAiC;AAC1D,SAASC,MAAM,EAAEC,QAAQ,QAAiB,UAAU;AACpD,SACEC,aAAa,EAObC,SAAS,EACTC,SAAS,QACJ,UAAU;AAGjB,OAAO,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,KAAoC,EAAEC,OAAmB,EAAK;EACzF,IAAMC,IAAI,GAAIF,KAAK,CAACG,aAAa,IAAIH,KAAK,CAACI,MAAsB;EACjE,IAAMC,IAAI,GAAGJ,OAAO,CAACK,qBAAqB,EAAE;EAC5C,OAAO,CAACN,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AAGM,UAAU;EAC3D,IAAMI,aAAa,GAAGF,UAAU,CAACN,WAAW,CAAC,GAAGI,UAAU;EAC1DL,GAAG,IAAIQ,aAAa,GAAG,CAAC;EACxBtB,GAAG,IAAIuB,aAAa,GAAG,CAAC;EAExB,OAAO,CAACT,GAAG,EAAEd,GAAG,CAAC;AACnB,CAAC;AAWD,OAAO,IAAMwB,gBAAgB,GAAGjJ,YAG/B"}
1
+ {"version":3,"file":"utils.js","names":["EventEmitter","extent","bisector","scaleQuantize","scaleBand","scaleSqrt","eventToPoint","event","svgRoot","node","currentTarget","target","rect","getBoundingClientRect","clientX","left","clientLeft","clientY","top","clientTop","invert","scale","value","range","domain","paddingOuter","step","slice","reverse","definedNullData","x","y","plot","definedData","undefined","scaleOfBandwidth","bandwidth","minMax","data","key","d","getNullData","defined","name","reduce","acc","i","push","_defineProperty","prev","next","defNext","find","_objectSpread","length","defPrev","getIndexFromData","Array","isArray","bisect","center","index","findIndex","keys","Object","map","_key","item","interpolateValue","lastKeyIndex","console","warn","roundedPath","w","h","r","tl","arguments","tr","bl","br","result","concat","scaleToBand","band","memoize","func","results","_len","args","_key3","argsKey","join","apply","measureText","text","fontSize","span","document","createElement","style","_iterator","_createForOfIteratorHelper","split","_step","s","n","done","line","append","createTextNode","err","e","f","display","body","textWidth","offsetWidth","textHeight","offsetHeight","remove","Math","max","idCounter","uniqueId","prefix","Symbol","getChartDefaultColorName","getBubbleChartValueScale","z","_toConsumableArray","el","getScatterPlotRadius","valueKey","calculateBubbleDomain","miniestValue","min","maxestValue","_minMax","_minMax2","_slicedToArray","pixelRatio","abs","valueScale","minValueShift","maxValueShift","floor","PlotEventEmitter"],"sources":["../../src/utils.ts"],"sourcesContent":["import EventEmitter from '@semcore/core/lib/utils/eventEmitter';\nimport { extent, bisector, type Numeric } from 'd3-array';\nimport {\n scaleQuantize,\n type ScaleIdentity,\n type ScaleTime,\n type ScaleContinuousNumeric,\n type ScaleBand,\n type ScalePoint,\n type NumberValue,\n scaleBand,\n scaleSqrt,\n} from 'd3-scale';\nimport type React from 'react';\n\nexport const eventToPoint = (event: React.MouseEvent<HTMLElement>, svgRoot: SVGElement) => {\n const node = (event.currentTarget || event.target) as HTMLElement;\n const rect = svgRoot.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n};\n\ntype InvertableScale =\n | ScaleIdentity\n | ScaleBand<{}>\n | ScaleTime<unknown, unknown>\n | ScaleContinuousNumeric<unknown, unknown>;\nexport const invert = <Scale extends InvertableScale = InvertableScale>(\n scale: Scale,\n value: number,\n) => {\n if ('invert' in scale && scale.invert) return scale.invert(value);\n\n const range = scale.range() as [number, number];\n const domain = scale.domain();\n if ('paddingOuter' in scale) {\n range[0] += scale.paddingOuter() * scale.step();\n range[1] -= scale.paddingOuter() * scale.step();\n }\n\n return scaleQuantize()\n .domain((range[0] <= range[1] ? range : range.slice().reverse()) as NumberValue[])\n .range((range[0] <= range[1] ? domain : domain.slice().reverse()) as number[])(value);\n};\n\nexport const definedNullData = (x: number, y: number) => (plot: { [xOrY: number]: unknown }) =>\n plot[x] !== null && plot[y] !== null;\n\nexport const definedData = (x: number, y: number) => (plot: { [xOrY: number]: unknown }) =>\n plot[x] !== null && plot[x] !== undefined && plot[y] !== null && plot[y] !== undefined;\n\nexport const scaleOfBandwidth = <Scale extends ScaleBand<{}>>(scale: Scale, value: number) =>\n scale.bandwidth ? scale(value)! + scale.bandwidth() / 2 : scale(value);\n\nexport const minMax = <\n Key extends string = string,\n Data extends { [key: string]: Numeric | null | undefined }[] = {\n [key: string]: Numeric | null | undefined;\n }[],\n>(\n data: Data,\n key: Key,\n): [min: Data[0][Key], max: Data[0][Key]] => {\n if (typeof key === 'string') {\n return extent(data, (d) => d[key]) as any;\n }\n return extent(data, key) as any;\n};\n\nexport const getNullData = <\n Name extends string = string,\n Data extends { [name in Name]?: unknown | null } = {},\n>(\n data: Data[],\n defined: (data: Data) => boolean,\n name: Name,\n) =>\n data.reduce((acc, d, i, data) => {\n if (defined(d)) {\n acc.push({\n [name]: null,\n } as Data);\n } else {\n const prev = data[i - 1];\n const next = data[i + 1];\n\n if (i === 0) {\n const defNext = data.find(defined);\n acc.push({\n ...d,\n [name]: defNext ? defNext[name] : null,\n });\n }\n\n // prev\n if (prev && defined(prev)) {\n acc.push(prev);\n }\n\n // next\n if (next && defined(next)) {\n acc.push(next);\n }\n\n if (data.length - 1 === i) {\n const defPrev = data.slice().reverse().find(defined);\n acc.push({\n ...d,\n [name]: defPrev ? defPrev[name] : null,\n });\n }\n }\n return acc;\n }, [] as Data[]);\n\ntype IndexFromDataScale =\n | ScaleIdentity\n | ScaleTime<unknown, unknown>\n | ScaleContinuousNumeric<unknown, unknown>\n | ScaleBand<{}>\n | ScalePoint<{}>;\nexport const getIndexFromData = <\n Key extends string,\n Data extends {\n [key in Key]: number;\n } = { [key in Key]: number },\n Scale extends IndexFromDataScale = IndexFromDataScale,\n>(\n data: Data[],\n scale: Scale,\n key: Key,\n value: number,\n) => {\n // detect line chart\n if ('invert' in scale && typeof scale.invert === 'function' && Array.isArray(data)) {\n const bisect = bisector((d: { [key: string]: number }) => d[key]).center;\n return bisect(data, value);\n } else if ('step' in scale && typeof scale.step !== 'undefined' && Array.isArray(data)) { // detect bar chart\n const index = data.findIndex((d) => d[key] === value);\n return index >= 0 ? index : null;\n } else if ('invert' in scale && typeof scale.invert === 'function' && !Array.isArray(data)) { // detect cigarette chart\n const keys = Object.keys(data);\n const domain = keys.map((_key, index) => {\n return keys.slice(0, index).reduce((acc, item) => {\n if (data[item] !== interpolateValue) {\n acc = acc + data[item];\n }\n\n return acc;\n }, 0);\n });\n\n let key = null;\n\n const lastKeyIndex = keys.length - 1;\n\n if (value > domain[lastKeyIndex]) {\n key = keys[lastKeyIndex];\n } else {\n for (let i = 0; i < lastKeyIndex; i++) {\n if (i === 0 && value < domain[i]) {\n break;\n }\n\n if (value > domain[i] && value < domain[i + 1]) {\n key = keys[i];\n break;\n }\n }\n }\n\n return key;\n } else {\n // eslint-disable-next-line no-console\n console.warn('[d3-chart/utils/getIndexFromData] encountered incompatible scale type');\n return null;\n }\n};\n\nexport const roundedPath = (\n x: number,\n y: number,\n w: number,\n h: number,\n r: number,\n tl = false,\n tr = false,\n bl = false,\n br = false,\n) => {\n let result = `M${x + r},${y}`;\n result += `h${w - 2 * r}`;\n if (tr) {\n result += `a${r},${r} 0 0 1 ${r},${r}`;\n } else {\n result += `h${r}`;\n result += `v${r}`;\n }\n result += `v${h - 2 * r}`;\n if (br) {\n result += `a${r},${r} 0 0 1 ${-r},${r}`;\n } else {\n result += `v${r}`;\n result += `h${-r}`;\n }\n result += `h${2 * r - w}`;\n if (bl) {\n result += `a${r},${r} 0 0 1 ${-r},${-r}`;\n } else {\n result += `h${-r}`;\n result += `v${-r}`;\n }\n result += `v${2 * r - h}`;\n if (tl) {\n result += `a${r},${r} 0 0 1 ${r},${-r}`;\n } else {\n result += `v${-r}`;\n result += `h${r}`;\n }\n result += 'z';\n return result;\n};\n\nexport const scaleToBand = (scale: ScaleBand<{}>) => {\n if ('bandwidth' in scale) {\n return scale;\n }\n\n const band = scaleBand()\n .range((scale as any).range())\n .domain((scale as any).domain());\n\n return band;\n};\n\nexport const memoize = <Func extends (...args: any[]) => any>(func: Func): Func => {\n const results: { [cacheKey: string]: any } = {};\n return ((...args: any[]) => {\n const argsKey = args.join(',');\n if (!results[argsKey]) {\n results[argsKey] = func(...args);\n }\n return results[argsKey];\n }) as Func;\n};\n\nexport const measureText = memoize((text: string, fontSize?: number) => {\n if (!text) return 0;\n\n const span = document.createElement('span');\n if (fontSize) {\n span.style.fontSize = `${fontSize}px`;\n }\n for (const line of text.split('\\n')) {\n span.append(document.createTextNode(line));\n span.append(document.createElement('br'));\n }\n span.style.display = 'inline-block';\n document.body.append(span);\n const textWidth = span.offsetWidth;\n const textHeight = span.offsetHeight;\n span.remove();\n return Math.max(textWidth, textHeight);\n});\n\nlet idCounter = 0;\nexport const uniqueId = (prefix = 'id-') => `${prefix}${idCounter++}`;\n\nexport const interpolateValue = Symbol('intergalactic-d3-chart-line-interpolate');\n\nexport const getChartDefaultColorName = (index: number) => {\n index++;\n if (index < 1) index = 1;\n if (index > 24) index %= 24;\n\n return `chart-palette-order-${index}`;\n};\n\nexport const getBubbleChartValueScale = (data: any[], key: string) => {\n const z = scaleSqrt()\n .domain([0, Math.max(...data.map((el) => el[key]))])\n .range([5.5, 50.5]); // min/max radius\n\n return z;\n};\n\nexport const getScatterPlotRadius = (valueKey?: string): number => {\n return valueKey !== undefined ? 12 : 5.5;\n};\n\ntype BubbleChartDataItem = {\n value: number;\n x: number;\n y: number;\n};\n\nexport const calculateBubbleDomain = (\n data: Array<BubbleChartDataItem>,\n key: 'x' | 'y',\n range: [number, number],\n): [min: number, max: number] => {\n const miniestValue = data.reduce(\n (acc, item) => {\n if (item[key] - item.value < acc.min) {\n acc.min = item[key] - item.value;\n acc.value = item.value;\n }\n return acc;\n },\n { value: data[0].value, min: data[0][key] - data[0].value },\n ).value;\n const maxestValue = data.reduce(\n (acc, item) => {\n if (item.value + item[key] > acc.max) {\n acc.max = item.value + item.x;\n acc.value = item.value;\n }\n return acc;\n },\n { value: data[0].value, max: data[0].value + data[0][key] },\n ).value;\n\n let [min, max] = minMax(data, key);\n\n const pixelRatio = Math.abs(max - min) / Math.abs(range[0] - range[1]);\n const valueScale = getBubbleChartValueScale(data, 'value');\n const minValueShift = valueScale(miniestValue) * pixelRatio;\n const maxValueShift = valueScale(maxestValue) * pixelRatio;\n min -= minValueShift * 2;\n max += maxValueShift * 2;\n\n return [Math.floor(min), Math.floor(max)];\n};\n\ntype CommonEvents = {\n setTooltipVisible: (visible: boolean) => void;\n setTooltipPosition: (x: number, y: number) => void;\n};\n\ntype Events = {\n [K in keyof CommonEvents as `${K}_${string}`]: CommonEvents[K];\n};\n\nexport const PlotEventEmitter = EventEmitter<Events>;\n"],"mappings":";;;;;AAAA,OAAOA,YAAY,MAAM,sCAAsC;AAC/D,SAASC,MAA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,KAAK;EAEP,IAAAoH,OAAA,GAAiBrG,MAAM,CAACC,IAAI,EAAEC,GAAG,CAAC;IAAAoG,QAAA,GAAAC,cAAA,CAAAF,OAAA;IAA7BF,GAAG,GAAAG,QAAA;IAAEjB,GAAG,GAAAiB,QAAA;EAEb,IAAME,UAAU,GAAGpB,IAAI,CAACqB,GAAG,CAACpB,GAAG,GAAGc,GAAG,CAAC,GAAGf,IAAI,CAACqB,GAAG,CAACvH,KAAK,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC,CAAC;EACtE,IAAMwH,UAAU,GAAGf,wBAAwB,CAAC1F,IAAI,EAAE,OAAO,CAAC;EAC1D,IAAM0G,aAAa,GAAGD,UAAU,CAACR,YAAY,CAAC,GAAGM,UAAU;EAC3D,IAAMI,aAAa,GAAGF,UAAU,CAACN,WAAW,CAAC,GAAGI,UAAU;EAC1DL,GAAG,IAAIQ,aAAa,GAAG,CAAC;EACxBtB,GAAG,IAAIuB,aAAa,GAAG,CAAC;EAExB,OAAO,CAACxB,IAAI,CAACyB,KAAK,CAACV,GAAG,CAAC,EAAEf,IAAI,CAACyB,KAAK,CAACxB,GAAG,CAAC,CAAC;AAC3C,CAAC;AAWD,OAAO,IAAMyB,gBAAgB,GAAGnJ,YAAoB","ignoreList":[]}
@@ -2,29 +2,23 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/esm/createClass";
5
+ import _callSuper from "@babel/runtime/helpers/esm/callSuper";
5
6
  import _inherits from "@babel/runtime/helpers/esm/inherits";
6
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
7
7
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
+ import { Component, createComponent } from "@semcore/core";
9
+ import propsForElement from "@semcore/core/lib/utils/propsForElement";
8
10
  import React from "react";
9
- import createComponent, { Component } from "@semcore/core";
10
- import propsForElement from "@semcore/utils/lib/propsForElement";
11
11
  var _excluded = ["id", "transition", "tag", "style", "className"];
12
- var AnimatedClipPath = /* @__PURE__ */ function(_Component) {
13
- _inherits(AnimatedClipPath2, _Component);
14
- var _super = _createSuper(AnimatedClipPath2);
12
+ var AnimatedClipPath = /* @__PURE__ */ (function(_Component) {
15
13
  function AnimatedClipPath2() {
16
14
  _classCallCheck(this, AnimatedClipPath2);
17
- return _super.apply(this, arguments);
15
+ return _callSuper(this, AnimatedClipPath2, arguments);
18
16
  }
19
- _createClass(AnimatedClipPath2, [{
17
+ _inherits(AnimatedClipPath2, _Component);
18
+ return _createClass(AnimatedClipPath2, [{
20
19
  key: "render",
21
20
  value: function render() {
22
- var _this$asProps = this.asProps, id = _this$asProps.id;
23
- _this$asProps.transition;
24
- var Tag = _this$asProps.tag;
25
- _this$asProps.style;
26
- _this$asProps.className;
27
- var other = _objectWithoutProperties(_this$asProps, _excluded);
21
+ var _this$asProps = this.asProps, id = _this$asProps.id, _transition = _this$asProps.transition, Tag = _this$asProps.tag, _style = _this$asProps.style, _className = _this$asProps.className, other = _objectWithoutProperties(_this$asProps, _excluded);
28
22
  var duration = typeof this.asProps.duration === "number" ? "".concat(this.asProps.duration, "ms") : this.asProps.duration;
29
23
  return /* @__PURE__ */ React.createElement("clipPath", {
30
24
  "aria-hidden": true,
@@ -40,8 +34,7 @@ var AnimatedClipPath = /* @__PURE__ */ function(_Component) {
40
34
  }, propsForElement(other, Tag)))));
41
35
  }
42
36
  }]);
43
- return AnimatedClipPath2;
44
- }(Component);
37
+ })(Component);
45
38
  _defineProperty(AnimatedClipPath, "defaultProps", {
46
39
  tag: "rect",
47
40
  duration: 500,
package/lib/esm/Area.mjs CHANGED
@@ -1,53 +1,53 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _callSuper from "@babel/runtime/helpers/esm/callSuper";
4
5
  import _inherits from "@babel/runtime/helpers/esm/inherits";
5
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
6
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
- import { sstyled } from "@semcore/utils/lib/core/index";
7
+ import { sstyled, Component } from "@semcore/core";
8
+ import findComponent from "@semcore/core/lib/utils/findComponent";
9
+ import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
10
+ import { bisector } from "d3-array";
11
+ import { curveLinear, line, area } from "d3-shape";
8
12
  import React from "react";
9
- import { area, line, curveLinear } from "d3-shape";
10
- import { sstyled as sstyled$1, Component } from "@semcore/core";
11
- import uniqueIDEnhancement from "@semcore/utils/lib/uniqueID";
12
- import findComponent from "@semcore/utils/lib/findComponent";
13
- import Dots from "./Dots.mjs";
14
- import createElement from "./createElement.mjs";
15
- import { definedData, scaleOfBandwidth, interpolateValue, getNullData, definedNullData } from "./utils.mjs";
16
13
  import AnimatedClipPath from "./AnimatedClipPath.mjs";
14
+ import { SvgElement } from "./component/SvgElement.mjs";
15
+ import createElement from "./createElement.mjs";
16
+ import Dots from "./Dots.mjs";
17
17
  import { PatternFill } from "./Pattern.mjs";
18
+ import { interpolateValue, getNullData, definedNullData, eventToPoint, invert, definedData, scaleOfBandwidth } from "./utils.mjs";
18
19
  /*!__reshadow-styles__:"./style/area.shadow.css"*/
19
20
  var style = (
20
21
  /*__reshadow_css_start__*/
21
22
  (sstyled.insert(
22
23
  /*__inner_css_start__*/
23
- ".___SArea_1auoc_gg_{fill:var(--intergalactic-chart-palette-order-1, rgb(104, 109, 210));fill-opacity:.2}.___SArea_1auoc_gg_.__color_1auoc_gg_{fill:var(--color_1auoc)}.___SArea_1auoc_gg_.__pattern_1auoc_gg_{fill:var(--pattern_1auoc);fill-opacity:.7}.___SArea_1auoc_gg_.__transparent_1auoc_gg_{opacity:.3}.___SAreaLine_1auoc_gg_{stroke:var(--intergalactic-chart-palette-order-1, rgb(104, 109, 210));stroke-width:3;fill:transparent}.___SAreaLine_1auoc_gg_.__color_1auoc_gg_{stroke:var(--color_1auoc)}.___SAreaLine_1auoc_gg_.__transparent_1auoc_gg_{opacity:.3}.___SAreaLine_1auoc_gg_,.___SArea_1auoc_gg_{transition-property:d;transition-duration:var(--duration_1auoc);transition-timing-function:ease-in-out}.___SNull_1auoc_gg_{fill:transparent;stroke:var(--intergalactic-chart-grid-x-axis, rgb(214, 216, 215));stroke-dasharray:4}.___SNull_1auoc_gg_.__hide_1auoc_gg_{display:none}",
24
+ ".___SArea_19yvv_gg_{fill:var(--intergalactic-chart-palette-order-1, rgb(102, 107, 219));fill-opacity:.2}.___SArea_19yvv_gg_.__color_19yvv_gg_{fill:var(--color_19yvv)}.___SArea_19yvv_gg_.__pattern_19yvv_gg_{fill:var(--pattern_19yvv);fill-opacity:.7}.___SArea_19yvv_gg_.__transparent_19yvv_gg_{opacity:.3}.___SAreaLine_19yvv_gg_{stroke:var(--intergalactic-chart-palette-order-1, rgb(102, 107, 219));stroke-width:3;fill:transparent}.___SAreaLine_19yvv_gg_.__color_19yvv_gg_{stroke:var(--color_19yvv)}.___SAreaLine_19yvv_gg_.__transparent_19yvv_gg_{opacity:.3}.___SAreaLine_19yvv_gg_,.___SArea_19yvv_gg_{transition-property:d;transition-duration:var(--duration_19yvv);transition-timing-function:ease-in-out}.___SNull_19yvv_gg_{fill:transparent;stroke:var(--intergalactic-chart-grid-x-axis, rgb(214, 216, 215));stroke-dasharray:4}.___SNull_19yvv_gg_.__hide_19yvv_gg_{display:none}",
24
25
  /*__inner_css_end__*/
25
- "1auoc_gg_"
26
+ "19yvv_gg_"
26
27
  ), /*__reshadow_css_end__*/
27
28
  {
28
- "__SArea": "___SArea_1auoc_gg_",
29
- "_color": "__color_1auoc_gg_",
30
- "--color": "--color_1auoc",
31
- "_pattern": "__pattern_1auoc_gg_",
32
- "--pattern": "--pattern_1auoc",
33
- "_transparent": "__transparent_1auoc_gg_",
34
- "__SAreaLine": "___SAreaLine_1auoc_gg_",
35
- "--duration": "--duration_1auoc",
36
- "__SNull": "___SNull_1auoc_gg_",
37
- "_hide": "__hide_1auoc_gg_"
29
+ "__SArea": "___SArea_19yvv_gg_",
30
+ "_color": "__color_19yvv_gg_",
31
+ "--color": "--color_19yvv",
32
+ "_pattern": "__pattern_19yvv_gg_",
33
+ "--pattern": "--pattern_19yvv",
34
+ "_transparent": "__transparent_19yvv_gg_",
35
+ "__SAreaLine": "___SAreaLine_19yvv_gg_",
36
+ "--duration": "--duration_19yvv",
37
+ "__SNull": "___SNull_19yvv_gg_",
38
+ "_hide": "__hide_19yvv_gg_"
38
39
  })
39
40
  );
40
- var AreaRoot = /* @__PURE__ */ function(_Component) {
41
- _inherits(AreaRoot2, _Component);
42
- var _super = _createSuper(AreaRoot2);
41
+ var AreaRoot = /* @__PURE__ */ (function(_Component) {
43
42
  function AreaRoot2() {
44
43
  _classCallCheck(this, AreaRoot2);
45
- return _super.apply(this, arguments);
44
+ return _callSuper(this, AreaRoot2, arguments);
46
45
  }
47
- _createClass(AreaRoot2, [{
46
+ _inherits(AreaRoot2, _Component);
47
+ return _createClass(AreaRoot2, [{
48
48
  key: "getDotsProps",
49
49
  value: function getDotsProps() {
50
- var _this$asProps = this.asProps, x = _this$asProps.x, y = _this$asProps.y, color = _this$asProps.color, d3Line = _this$asProps.d3Line, transparent = _this$asProps.transparent, resolveColor = _this$asProps.resolveColor, patterns = _this$asProps.patterns;
50
+ var _this$asProps = this.asProps, x = _this$asProps.x, y = _this$asProps.y, color = _this$asProps.color, d3Line = _this$asProps.d3Line, transparent = _this$asProps.transparent, resolveColor = _this$asProps.resolveColor, patterns = _this$asProps.patterns, onClick = _this$asProps.onClick;
51
51
  var data = this.asProps.data.filter(function(item) {
52
52
  return item[y] !== interpolateValue;
53
53
  });
@@ -59,7 +59,8 @@ var AreaRoot = /* @__PURE__ */ function(_Component) {
59
59
  color,
60
60
  resolveColor,
61
61
  transparent,
62
- patterns
62
+ patterns,
63
+ onClick
63
64
  };
64
65
  }
65
66
  }, {
@@ -89,20 +90,34 @@ var AreaRoot = /* @__PURE__ */ function(_Component) {
89
90
  duration
90
91
  };
91
92
  }
93
+ }, {
94
+ key: "handlerOnClick",
95
+ value: function handlerOnClick(e) {
96
+ e.stopPropagation();
97
+ var _this$asProps4 = this.asProps, rootRef = _this$asProps4.rootRef, _this$asProps4$scale = _slicedToArray(_this$asProps4.scale, 1), xScale = _this$asProps4$scale[0], data = _this$asProps4.data, x = _this$asProps4.x, onClick = _this$asProps4.onClick;
98
+ if (!onClick) return;
99
+ var _eventToPoint = eventToPoint(e, rootRef.current), _eventToPoint2 = _slicedToArray(_eventToPoint, 1), pX = _eventToPoint2[0];
100
+ var vX = invert(xScale, pX);
101
+ var index = bisector(function(d) {
102
+ return d[x];
103
+ }).center(data, vX);
104
+ onClick(index, e);
105
+ }
92
106
  }, {
93
107
  key: "render",
94
108
  value: function render() {
95
109
  var _ref;
96
110
  var SArea = this.Element;
97
- var SAreaLine = "path";
98
- var _this$asProps4 = this.asProps, styles = _this$asProps4.styles, hide = _this$asProps4.hide, d3 = _this$asProps4.d3, d3Line = _this$asProps4.d3Line, color = _this$asProps4.color, uid = _this$asProps4.uid, size = _this$asProps4.size, duration = _this$asProps4.duration, x = _this$asProps4.x, y = _this$asProps4.y, Children = _this$asProps4.Children, transparent = _this$asProps4.transparent, forcedAdvancedMode = _this$asProps4.forcedAdvancedMode, resolveColor = _this$asProps4.resolveColor, patterns = _this$asProps4.patterns;
111
+ var SAreaLine = SvgElement;
112
+ var _this$asProps5 = this.asProps, styles = _this$asProps5.styles, hide = _this$asProps5.hide, d3 = _this$asProps5.d3, d3Line = _this$asProps5.d3Line, color = _this$asProps5.color, uid = _this$asProps5.uid, size = _this$asProps5.size, duration = _this$asProps5.duration, x = _this$asProps5.x, y = _this$asProps5.y, Children = _this$asProps5.Children, transparent = _this$asProps5.transparent, forcedAdvancedMode = _this$asProps5.forcedAdvancedMode, resolveColor = _this$asProps5.resolveColor, patterns = _this$asProps5.patterns;
99
113
  var advancedMode = forcedAdvancedMode || !!findComponent(Children, [Area.Line.displayName]);
100
114
  var data = this.asProps.data.filter(function(item) {
101
115
  return item[y] !== interpolateValue;
102
116
  });
103
117
  this.asProps.dataHintsHandler.specifyDataRowFields(x, y);
104
118
  this.asProps.dataHintsHandler.establishDataType("time-series");
105
- return _ref = sstyled$1(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, !advancedMode && /* @__PURE__ */ React.createElement(SAreaLine, _ref.cn("SAreaLine", {
119
+ return _ref = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, !advancedMode && /* @__PURE__ */ React.createElement(SAreaLine, _ref.cn("SAreaLine", {
120
+ "tag": "path",
106
121
  "aria-hidden": true,
107
122
  "clipPath": "url(#".concat(uid, "-animation)"),
108
123
  "d": d3Line(data),
@@ -118,7 +133,8 @@ var AreaRoot = /* @__PURE__ */ function(_Component) {
118
133
  "pattern": patterns ? "url(#".concat(uid, "-pattern)") : void 0,
119
134
  "color": resolveColor(color),
120
135
  "use:duration": "".concat(duration, "ms"),
121
- "transparent": transparent
136
+ "transparent": transparent,
137
+ "onClickCapture": this.handlerOnClick.bind(this)
122
138
  })), duration && /* @__PURE__ */ React.createElement(AnimatedClipPath, _ref.cn("AnimatedClipPath", {
123
139
  "duration": duration,
124
140
  "id": uid,
@@ -132,8 +148,7 @@ var AreaRoot = /* @__PURE__ */ function(_Component) {
132
148
  })));
133
149
  }
134
150
  }]);
135
- return AreaRoot2;
136
- }(Component);
151
+ })(Component);
137
152
  _defineProperty(AreaRoot, "displayName", "Area");
138
153
  _defineProperty(AreaRoot, "style", style);
139
154
  _defineProperty(AreaRoot, "enhance", [uniqueIDEnhancement()]);
@@ -160,7 +175,7 @@ _defineProperty(AreaRoot, "defaultProps", function(_ref4) {
160
175
  function Line(props) {
161
176
  var _ref2;
162
177
  var SAreaLine = props.Element, styles = props.styles, d3 = props.d3, data = props.data, color = props.color, resolveColor = props.resolveColor, duration = props.duration, uid = props.uid, transparent = props.transparent;
163
- return _ref2 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SAreaLine, _ref2.cn("SAreaLine", {
178
+ return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SAreaLine, _ref2.cn("SAreaLine", {
164
179
  "render": "path",
165
180
  "clipPath": "url(#".concat(uid, ")"),
166
181
  "d": d3(data),
@@ -172,7 +187,7 @@ function Line(props) {
172
187
  function Null(props) {
173
188
  var _ref3;
174
189
  var SNull = props.Element, styles = props.styles, d3 = props.d3, data = props.data, hide = props.hide, color = props.color, resolveColor = props.resolveColor;
175
- return _ref3 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SNull, _ref3.cn("SNull", {
190
+ return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SNull, _ref3.cn("SNull", {
176
191
  "render": "path",
177
192
  "d": d3(data),
178
193
  "hide": hide,