@semcore/d3-chart 16.0.2-prerelease.4 → 16.0.3-prerelease.0

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 (453) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -50
  3. package/lib/cjs/AnimatedClipPath.js +13 -13
  4. package/lib/cjs/AnimatedClipPath.js.map +1 -1
  5. package/lib/cjs/Area.js +29 -27
  6. package/lib/cjs/Area.js.map +1 -1
  7. package/lib/cjs/Axis.js +97 -101
  8. package/lib/cjs/Axis.js.map +1 -1
  9. package/lib/cjs/Bar.js +31 -32
  10. package/lib/cjs/Bar.js.map +1 -1
  11. package/lib/cjs/Bubble.js +26 -27
  12. package/lib/cjs/Bubble.js.map +1 -1
  13. package/lib/cjs/CompactHorizontalBar.js +65 -68
  14. package/lib/cjs/CompactHorizontalBar.js.map +1 -1
  15. package/lib/cjs/Donut.js +94 -95
  16. package/lib/cjs/Donut.js.map +1 -1
  17. package/lib/cjs/Dots.js +36 -34
  18. package/lib/cjs/Dots.js.map +1 -1
  19. package/lib/cjs/GroupBar.js +16 -16
  20. package/lib/cjs/GroupBar.js.map +1 -1
  21. package/lib/cjs/HorizontalBar.js +30 -31
  22. package/lib/cjs/HorizontalBar.js.map +1 -1
  23. package/lib/cjs/Hover.js +27 -33
  24. package/lib/cjs/Hover.js.map +1 -1
  25. package/lib/cjs/Line.js +23 -23
  26. package/lib/cjs/Line.js.map +1 -1
  27. package/lib/cjs/Pattern.js +13 -11
  28. package/lib/cjs/Pattern.js.map +1 -1
  29. package/lib/cjs/Plot.js +26 -27
  30. package/lib/cjs/Plot.js.map +1 -1
  31. package/lib/cjs/Radar.js +125 -132
  32. package/lib/cjs/Radar.js.map +1 -1
  33. package/lib/cjs/RadialTree.js +164 -145
  34. package/lib/cjs/RadialTree.js.map +1 -1
  35. package/lib/cjs/Reference.js +47 -49
  36. package/lib/cjs/Reference.js.map +1 -1
  37. package/lib/cjs/ResponsiveContainer.js +19 -20
  38. package/lib/cjs/ResponsiveContainer.js.map +1 -1
  39. package/lib/cjs/ScatterPlot.js +24 -25
  40. package/lib/cjs/ScatterPlot.js.map +1 -1
  41. package/lib/cjs/StackBar.js +20 -23
  42. package/lib/cjs/StackBar.js.map +1 -1
  43. package/lib/cjs/StackedArea.js +14 -15
  44. package/lib/cjs/StackedArea.js.map +1 -1
  45. package/lib/cjs/Tooltip.js +34 -35
  46. package/lib/cjs/Tooltip.js.map +1 -1
  47. package/lib/cjs/Venn.js +28 -29
  48. package/lib/cjs/Venn.js.map +1 -1
  49. package/lib/cjs/a11y/DataAccessibilityTable.js +2 -3
  50. package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
  51. package/lib/cjs/a11y/PlotA11yModule.js +11 -12
  52. package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
  53. package/lib/cjs/a11y/PlotA11yView.js +10 -11
  54. package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
  55. package/lib/cjs/a11y/bezier.js +1 -2
  56. package/lib/cjs/a11y/bezier.js.map +1 -1
  57. package/lib/cjs/a11y/focus.js +4 -5
  58. package/lib/cjs/a11y/focus.js.map +1 -1
  59. package/lib/cjs/a11y/hints.js +5 -8
  60. package/lib/cjs/a11y/hints.js.map +1 -1
  61. package/lib/cjs/a11y/insights.js +63 -64
  62. package/lib/cjs/a11y/insights.js.map +1 -1
  63. package/lib/cjs/a11y/intl.js +1 -2
  64. package/lib/cjs/a11y/intl.js.map +1 -1
  65. package/lib/cjs/a11y/locale.js +4 -5
  66. package/lib/cjs/a11y/locale.js.map +1 -1
  67. package/lib/cjs/a11y/serialize.js +15 -17
  68. package/lib/cjs/a11y/serialize.js.map +1 -1
  69. package/lib/cjs/a11y/summarize.js +1 -2
  70. package/lib/cjs/a11y/summarize.js.map +1 -1
  71. package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js +4 -5
  72. package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
  73. package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js +4 -5
  74. package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
  75. package/lib/cjs/color.js +2 -3
  76. package/lib/cjs/color.js.map +1 -1
  77. package/lib/cjs/component/Chart/AbstractChart.js +43 -46
  78. package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
  79. package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
  80. package/lib/cjs/component/Chart/AreaChart.js +17 -20
  81. package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
  82. package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
  83. package/lib/cjs/component/Chart/BarChart.js +17 -21
  84. package/lib/cjs/component/Chart/BarChart.js.map +1 -1
  85. package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
  86. package/lib/cjs/component/Chart/BubbleChart.js +18 -19
  87. package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
  88. package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
  89. package/lib/cjs/component/Chart/CigaretteChart.js +19 -23
  90. package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
  91. package/lib/cjs/component/Chart/CigaretteChart.type.js.map +1 -1
  92. package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +13 -14
  93. package/lib/cjs/component/Chart/CompactHorizontalBarChart.js.map +1 -1
  94. package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  95. package/lib/cjs/component/Chart/DonutChart.js +13 -14
  96. package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
  97. package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
  98. package/lib/cjs/component/Chart/HistogramChart.js +15 -16
  99. package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
  100. package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
  101. package/lib/cjs/component/Chart/LineChart.js +17 -18
  102. package/lib/cjs/component/Chart/LineChart.js.map +1 -1
  103. package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
  104. package/lib/cjs/component/Chart/RadarChart.js +14 -17
  105. package/lib/cjs/component/Chart/RadarChart.js.map +1 -1
  106. package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
  107. package/lib/cjs/component/Chart/ScatterPlotChart.js +14 -15
  108. package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
  109. package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
  110. package/lib/cjs/component/Chart/VennChart.js +12 -13
  111. package/lib/cjs/component/Chart/VennChart.js.map +1 -1
  112. package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
  113. package/lib/cjs/component/Chart/index.js +7 -8
  114. package/lib/cjs/component/Chart/index.js.map +1 -1
  115. package/lib/cjs/component/ChartLegend/BaseLegend.js +42 -20
  116. package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
  117. package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
  118. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +20 -20
  119. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  120. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
  121. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +79 -67
  122. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  123. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -2
  124. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  125. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +18 -18
  126. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  127. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  128. package/lib/cjs/component/ChartLegend/index.js +1 -2
  129. package/lib/cjs/component/ChartLegend/index.js.map +1 -1
  130. package/lib/cjs/component/Cigarette/Cigarette.js +18 -19
  131. package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
  132. package/lib/cjs/component/StackGroupBar/StackGroupBar.js +22 -26
  133. package/lib/cjs/component/StackGroupBar/StackGroupBar.js.map +1 -1
  134. package/lib/cjs/component/StackGroupBar/StackGroupBar.type.js.map +1 -1
  135. package/lib/cjs/component/SvgElement.js +21 -0
  136. package/lib/cjs/component/SvgElement.js.map +1 -0
  137. package/lib/cjs/createElement.d.js.map +1 -1
  138. package/lib/cjs/createElement.js +7 -8
  139. package/lib/cjs/createElement.js.map +1 -1
  140. package/lib/cjs/index.js +9 -2
  141. package/lib/cjs/index.js.map +1 -1
  142. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
  143. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
  144. package/lib/cjs/types/Area.d.js.map +1 -1
  145. package/lib/cjs/types/Axis.d.js.map +1 -1
  146. package/lib/cjs/types/Bar.d.js.map +1 -1
  147. package/lib/cjs/types/Bubble.d.js.map +1 -1
  148. package/lib/cjs/types/ClipPath.d.js.map +1 -1
  149. package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
  150. package/lib/cjs/types/Donut.d.js.map +1 -1
  151. package/lib/cjs/types/GroupBar.d.js.map +1 -1
  152. package/lib/cjs/types/HorizontalBar.d.js.map +1 -1
  153. package/lib/cjs/types/Hover.d.js.map +1 -1
  154. package/lib/cjs/types/Line.d.js.map +1 -1
  155. package/lib/cjs/types/Plot.d.js.map +1 -1
  156. package/lib/cjs/types/Radar.d.js.map +1 -1
  157. package/lib/cjs/types/Reference.d.js.map +1 -1
  158. package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
  159. package/lib/cjs/types/ScatterPlot.d.js.map +1 -1
  160. package/lib/cjs/types/StackBar.d.js.map +1 -1
  161. package/lib/cjs/types/StackedArea.d.js.map +1 -1
  162. package/lib/cjs/types/Tooltip.d.js.map +1 -1
  163. package/lib/cjs/types/Venn.d.js.map +1 -1
  164. package/lib/cjs/types/context.d.js.map +1 -1
  165. package/lib/cjs/types/index.d.js +2 -2
  166. package/lib/cjs/types/index.d.js.map +1 -1
  167. package/lib/cjs/utils.js +31 -52
  168. package/lib/cjs/utils.js.map +1 -1
  169. package/lib/es6/AnimatedClipPath.js +11 -10
  170. package/lib/es6/AnimatedClipPath.js.map +1 -1
  171. package/lib/es6/Area.js +27 -24
  172. package/lib/es6/Area.js.map +1 -1
  173. package/lib/es6/Axis.js +96 -98
  174. package/lib/es6/Axis.js.map +1 -1
  175. package/lib/es6/Bar.js +28 -27
  176. package/lib/es6/Bar.js.map +1 -1
  177. package/lib/es6/Bubble.js +24 -24
  178. package/lib/es6/Bubble.js.map +1 -1
  179. package/lib/es6/CompactHorizontalBar.js +63 -65
  180. package/lib/es6/CompactHorizontalBar.js.map +1 -1
  181. package/lib/es6/Donut.js +92 -92
  182. package/lib/es6/Donut.js.map +1 -1
  183. package/lib/es6/Dots.js +36 -33
  184. package/lib/es6/Dots.js.map +1 -1
  185. package/lib/es6/GroupBar.js +14 -13
  186. package/lib/es6/GroupBar.js.map +1 -1
  187. package/lib/es6/HorizontalBar.js +27 -26
  188. package/lib/es6/HorizontalBar.js.map +1 -1
  189. package/lib/es6/Hover.js +24 -28
  190. package/lib/es6/Hover.js.map +1 -1
  191. package/lib/es6/Line.js +20 -19
  192. package/lib/es6/Line.js.map +1 -1
  193. package/lib/es6/Pattern.js +4 -2
  194. package/lib/es6/Pattern.js.map +1 -1
  195. package/lib/es6/Plot.js +25 -25
  196. package/lib/es6/Plot.js.map +1 -1
  197. package/lib/es6/Radar.js +122 -128
  198. package/lib/es6/Radar.js.map +1 -1
  199. package/lib/es6/RadialTree.js +162 -142
  200. package/lib/es6/RadialTree.js.map +1 -1
  201. package/lib/es6/Reference.js +44 -43
  202. package/lib/es6/Reference.js.map +1 -1
  203. package/lib/es6/ResponsiveContainer.js +17 -17
  204. package/lib/es6/ResponsiveContainer.js.map +1 -1
  205. package/lib/es6/ScatterPlot.js +22 -22
  206. package/lib/es6/ScatterPlot.js.map +1 -1
  207. package/lib/es6/StackBar.js +17 -19
  208. package/lib/es6/StackBar.js.map +1 -1
  209. package/lib/es6/StackedArea.js +12 -12
  210. package/lib/es6/StackedArea.js.map +1 -1
  211. package/lib/es6/Tooltip.js +33 -33
  212. package/lib/es6/Tooltip.js.map +1 -1
  213. package/lib/es6/Venn.js +26 -26
  214. package/lib/es6/Venn.js.map +1 -1
  215. package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
  216. package/lib/es6/a11y/PlotA11yModule.js +11 -11
  217. package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
  218. package/lib/es6/a11y/PlotA11yView.js +9 -9
  219. package/lib/es6/a11y/PlotA11yView.js.map +1 -1
  220. package/lib/es6/a11y/bezier.js.map +1 -1
  221. package/lib/es6/a11y/focus.js +3 -3
  222. package/lib/es6/a11y/focus.js.map +1 -1
  223. package/lib/es6/a11y/hints.js +1 -1
  224. package/lib/es6/a11y/hints.js.map +1 -1
  225. package/lib/es6/a11y/insights.js +61 -61
  226. package/lib/es6/a11y/insights.js.map +1 -1
  227. package/lib/es6/a11y/intl.js.map +1 -1
  228. package/lib/es6/a11y/locale.js +2 -2
  229. package/lib/es6/a11y/locale.js.map +1 -1
  230. package/lib/es6/a11y/serialize.js +14 -13
  231. package/lib/es6/a11y/serialize.js.map +1 -1
  232. package/lib/es6/a11y/summarize.js.map +1 -1
  233. package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js +2 -2
  234. package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
  235. package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js +2 -2
  236. package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
  237. package/lib/es6/color.js +1 -1
  238. package/lib/es6/color.js.map +1 -1
  239. package/lib/es6/component/Chart/AbstractChart.js +40 -41
  240. package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
  241. package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
  242. package/lib/es6/component/Chart/AreaChart.js +16 -16
  243. package/lib/es6/component/Chart/AreaChart.js.map +1 -1
  244. package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
  245. package/lib/es6/component/Chart/BarChart.js +15 -17
  246. package/lib/es6/component/Chart/BarChart.js.map +1 -1
  247. package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
  248. package/lib/es6/component/Chart/BubbleChart.js +17 -15
  249. package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
  250. package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
  251. package/lib/es6/component/Chart/CigaretteChart.js +17 -17
  252. package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
  253. package/lib/es6/component/Chart/CigaretteChart.type.js.map +1 -1
  254. package/lib/es6/component/Chart/CompactHorizontalBarChart.js +11 -10
  255. package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -1
  256. package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  257. package/lib/es6/component/Chart/DonutChart.js +12 -10
  258. package/lib/es6/component/Chart/DonutChart.js.map +1 -1
  259. package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
  260. package/lib/es6/component/Chart/HistogramChart.js +14 -12
  261. package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
  262. package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
  263. package/lib/es6/component/Chart/LineChart.js +15 -14
  264. package/lib/es6/component/Chart/LineChart.js.map +1 -1
  265. package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
  266. package/lib/es6/component/Chart/RadarChart.js +12 -13
  267. package/lib/es6/component/Chart/RadarChart.js.map +1 -1
  268. package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
  269. package/lib/es6/component/Chart/ScatterPlotChart.js +13 -11
  270. package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
  271. package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
  272. package/lib/es6/component/Chart/VennChart.js +10 -9
  273. package/lib/es6/component/Chart/VennChart.js.map +1 -1
  274. package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
  275. package/lib/es6/component/Chart/index.js +6 -6
  276. package/lib/es6/component/Chart/index.js.map +1 -1
  277. package/lib/es6/component/ChartLegend/BaseLegend.js +40 -17
  278. package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
  279. package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
  280. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +18 -17
  281. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  282. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
  283. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +77 -64
  284. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  285. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  286. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +16 -15
  287. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  288. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  289. package/lib/es6/component/ChartLegend/index.js.map +1 -1
  290. package/lib/es6/component/Cigarette/Cigarette.js +16 -16
  291. package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
  292. package/lib/es6/component/StackGroupBar/StackGroupBar.js +20 -21
  293. package/lib/es6/component/StackGroupBar/StackGroupBar.js.map +1 -1
  294. package/lib/es6/component/StackGroupBar/StackGroupBar.type.js.map +1 -1
  295. package/lib/es6/component/SvgElement.js +14 -0
  296. package/lib/es6/component/SvgElement.js.map +1 -0
  297. package/lib/es6/createElement.d.js.map +1 -1
  298. package/lib/es6/createElement.js +5 -5
  299. package/lib/es6/createElement.js.map +1 -1
  300. package/lib/es6/index.js +1 -0
  301. package/lib/es6/index.js.map +1 -1
  302. package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
  303. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
  304. package/lib/es6/types/Area.d.js.map +1 -1
  305. package/lib/es6/types/Axis.d.js.map +1 -1
  306. package/lib/es6/types/Bar.d.js.map +1 -1
  307. package/lib/es6/types/Bubble.d.js.map +1 -1
  308. package/lib/es6/types/ClipPath.d.js.map +1 -1
  309. package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
  310. package/lib/es6/types/Donut.d.js.map +1 -1
  311. package/lib/es6/types/GroupBar.d.js.map +1 -1
  312. package/lib/es6/types/HorizontalBar.d.js.map +1 -1
  313. package/lib/es6/types/Hover.d.js.map +1 -1
  314. package/lib/es6/types/Line.d.js.map +1 -1
  315. package/lib/es6/types/Plot.d.js.map +1 -1
  316. package/lib/es6/types/Radar.d.js.map +1 -1
  317. package/lib/es6/types/Reference.d.js.map +1 -1
  318. package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
  319. package/lib/es6/types/ScatterPlot.d.js.map +1 -1
  320. package/lib/es6/types/StackBar.d.js.map +1 -1
  321. package/lib/es6/types/StackedArea.d.js.map +1 -1
  322. package/lib/es6/types/Tooltip.d.js.map +1 -1
  323. package/lib/es6/types/Venn.d.js.map +1 -1
  324. package/lib/es6/types/context.d.js.map +1 -1
  325. package/lib/es6/types/index.d.js +1 -0
  326. package/lib/es6/types/index.d.js.map +1 -1
  327. package/lib/es6/utils.js +11 -13
  328. package/lib/es6/utils.js.map +1 -1
  329. package/lib/esm/AnimatedClipPath.mjs +10 -7
  330. package/lib/esm/Area.mjs +30 -25
  331. package/lib/esm/Axis.mjs +67 -67
  332. package/lib/esm/Bar.mjs +31 -28
  333. package/lib/esm/Bubble.mjs +28 -26
  334. package/lib/esm/CompactHorizontalBar.mjs +61 -60
  335. package/lib/esm/Donut.mjs +50 -49
  336. package/lib/esm/Dots.mjs +32 -27
  337. package/lib/esm/GroupBar.mjs +14 -11
  338. package/lib/esm/HorizontalBar.mjs +30 -27
  339. package/lib/esm/Hover.mjs +28 -30
  340. package/lib/esm/Line.mjs +23 -20
  341. package/lib/esm/Pattern.mjs +1 -1
  342. package/lib/esm/Plot.mjs +27 -25
  343. package/lib/esm/Radar.mjs +90 -94
  344. package/lib/esm/RadialTree.mjs +86 -86
  345. package/lib/esm/Reference.mjs +34 -31
  346. package/lib/esm/ResponsiveContainer.mjs +19 -17
  347. package/lib/esm/ScatterPlot.mjs +26 -24
  348. package/lib/esm/StackBar.mjs +17 -17
  349. package/lib/esm/StackedArea.mjs +13 -11
  350. package/lib/esm/Tooltip.mjs +35 -33
  351. package/lib/esm/Venn.mjs +29 -27
  352. package/lib/esm/a11y/DataAccessibilityTable.mjs +2 -2
  353. package/lib/esm/a11y/PlotA11yModule.mjs +8 -8
  354. package/lib/esm/a11y/PlotA11yView.mjs +9 -9
  355. package/lib/esm/a11y/focus.mjs +3 -3
  356. package/lib/esm/a11y/hints.mjs +1 -1
  357. package/lib/esm/a11y/insights.mjs +77 -78
  358. package/lib/esm/a11y/intl.mjs +1 -1
  359. package/lib/esm/a11y/locale.mjs +2 -2
  360. package/lib/esm/a11y/serialize.mjs +12 -12
  361. package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +2 -2
  362. package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +2 -2
  363. package/lib/esm/component/Chart/AbstractChart.mjs +38 -37
  364. package/lib/esm/component/Chart/AreaChart.mjs +19 -15
  365. package/lib/esm/component/Chart/BarChart.mjs +20 -17
  366. package/lib/esm/component/Chart/BubbleChart.mjs +16 -13
  367. package/lib/esm/component/Chart/CigaretteChart.mjs +24 -17
  368. package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +18 -10
  369. package/lib/esm/component/Chart/DonutChart.mjs +13 -10
  370. package/lib/esm/component/Chart/HistogramChart.mjs +18 -12
  371. package/lib/esm/component/Chart/LineChart.mjs +18 -12
  372. package/lib/esm/component/Chart/RadarChart.mjs +19 -12
  373. package/lib/esm/component/Chart/ScatterPlotChart.mjs +14 -11
  374. package/lib/esm/component/Chart/VennChart.mjs +12 -9
  375. package/lib/esm/component/Chart/index.mjs +6 -6
  376. package/lib/esm/component/ChartLegend/BaseLegend.mjs +42 -17
  377. package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +21 -18
  378. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +67 -56
  379. package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +23 -20
  380. package/lib/esm/component/Cigarette/Cigarette.mjs +18 -16
  381. package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +20 -19
  382. package/lib/esm/component/SvgElement.mjs +14 -0
  383. package/lib/esm/createElement.mjs +5 -5
  384. package/lib/esm/index.mjs +2 -0
  385. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
  386. package/lib/esm/utils.mjs +8 -8
  387. package/lib/types/Area.d.ts +7 -6
  388. package/lib/types/Axis.d.ts +4 -3
  389. package/lib/types/Bar.d.ts +7 -6
  390. package/lib/types/Bubble.d.ts +6 -5
  391. package/lib/types/ClipPath.d.ts +4 -3
  392. package/lib/types/CompactHorizontalBar.d.ts +7 -8
  393. package/lib/types/Donut.d.ts +6 -5
  394. package/lib/types/GroupBar.d.ts +6 -6
  395. package/lib/types/HorizontalBar.d.ts +7 -6
  396. package/lib/types/Hover.d.ts +8 -8
  397. package/lib/types/Line.d.ts +7 -6
  398. package/lib/types/Pattern.d.ts +51 -51
  399. package/lib/types/Plot.d.ts +10 -9
  400. package/lib/types/Radar.d.ts +8 -7
  401. package/lib/types/RadialTree.d.ts +9 -54
  402. package/lib/types/Reference.d.ts +5 -4
  403. package/lib/types/ResponsiveContainer.d.ts +5 -4
  404. package/lib/types/ScatterPlot.d.ts +6 -5
  405. package/lib/types/StackBar.d.ts +7 -6
  406. package/lib/types/StackedArea.d.ts +6 -5
  407. package/lib/types/Tooltip.d.ts +14 -12
  408. package/lib/types/Venn.d.ts +7 -6
  409. package/lib/types/a11y/DataAccessibilityTable.d.ts +2 -2
  410. package/lib/types/a11y/PlotA11yModule.d.ts +1 -1
  411. package/lib/types/a11y/hints.d.ts +5 -5
  412. package/lib/types/a11y/insights.d.ts +1 -1
  413. package/lib/types/a11y/intl.d.ts +1 -1
  414. package/lib/types/a11y/serialize.d.ts +7 -7
  415. package/lib/types/a11y/summarize.d.ts +2 -2
  416. package/lib/types/component/Chart/AbstractChart.d.ts +6 -6
  417. package/lib/types/component/Chart/AbstractChart.type.d.ts +27 -27
  418. package/lib/types/component/Chart/AreaChart.d.ts +1 -1
  419. package/lib/types/component/Chart/AreaChart.type.d.ts +6 -6
  420. package/lib/types/component/Chart/BarChart.d.ts +1 -1
  421. package/lib/types/component/Chart/BarChart.type.d.ts +6 -6
  422. package/lib/types/component/Chart/BubbleChart.d.ts +1 -1
  423. package/lib/types/component/Chart/BubbleChart.type.d.ts +4 -4
  424. package/lib/types/component/Chart/CigaretteChart.d.ts +1 -1
  425. package/lib/types/component/Chart/CigaretteChart.type.d.ts +4 -4
  426. package/lib/types/component/Chart/CompactHorizontalBarChart.d.ts +1 -1
  427. package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +5 -5
  428. package/lib/types/component/Chart/DonutChart.d.ts +1 -1
  429. package/lib/types/component/Chart/DonutChart.type.d.ts +5 -5
  430. package/lib/types/component/Chart/HistogramChart.d.ts +1 -1
  431. package/lib/types/component/Chart/HistogramChart.type.d.ts +4 -4
  432. package/lib/types/component/Chart/LineChart.d.ts +1 -1
  433. package/lib/types/component/Chart/LineChart.type.d.ts +7 -7
  434. package/lib/types/component/Chart/RadarChart.d.ts +1 -1
  435. package/lib/types/component/Chart/RadarChart.type.d.ts +4 -4
  436. package/lib/types/component/Chart/ScatterPlotChart.d.ts +1 -1
  437. package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +5 -5
  438. package/lib/types/component/Chart/VennChart.d.ts +1 -1
  439. package/lib/types/component/Chart/VennChart.type.d.ts +4 -4
  440. package/lib/types/component/ChartLegend/BaseLegend.d.ts +6 -4
  441. package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +4 -5
  442. package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.d.ts +1 -1
  443. package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +4 -5
  444. package/lib/types/component/ChartLegend/LegendItem/LegendItem.d.ts +1 -1
  445. package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +17 -10
  446. package/lib/types/component/ChartLegend/LegendTable/LegendTable.d.ts +1 -1
  447. package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +5 -5
  448. package/lib/types/component/StackGroupBar/StackGroupBar.d.ts +1 -1
  449. package/lib/types/component/StackGroupBar/StackGroupBar.type.d.ts +3 -4
  450. package/lib/types/component/SvgElement.d.ts +10 -0
  451. package/lib/types/index.d.ts +2 -1
  452. package/lib/types/utils.d.ts +6 -6
  453. package/package.json +22 -23
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
@@ -8,36 +8,35 @@ exports.RadarChart = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
11
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
+ var _isNativeReflectConstruct2 = _interopRequireDefault(require("@babel/runtime/helpers/isNativeReflectConstruct"));
12
13
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
+ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
13
15
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
15
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
- var _react = _interopRequireDefault(require("react"));
17
17
  var _core = require("@semcore/core");
18
+ var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
18
19
  var _d3Scale = require("d3-scale");
20
+ var _react = _interopRequireDefault(require("react"));
19
21
  var _AbstractChart2 = require("./AbstractChart");
20
22
  var _ = require("../..");
21
23
  var _intergalacticDynamicLocales = require("../../translations/__intergalactic-dynamic-locales");
22
- var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
23
- // @ts-ignore
24
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
25
+ function _superPropGet(t, o, e, r) { var p = (0, _get2["default"])((0, _getPrototypeOf2["default"])(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } // @ts-ignore
24
26
  var RadarChartComponent = /*#__PURE__*/function (_AbstractChart) {
25
- (0, _inherits2["default"])(RadarChartComponent, _AbstractChart);
26
- var _super = (0, _createSuper2["default"])(RadarChartComponent);
27
27
  function RadarChartComponent() {
28
28
  (0, _classCallCheck2["default"])(this, RadarChartComponent);
29
- return _super.apply(this, arguments);
29
+ return _callSuper(this, RadarChartComponent, arguments);
30
30
  }
31
- (0, _createClass2["default"])(RadarChartComponent, [{
31
+ (0, _inherits2["default"])(RadarChartComponent, _AbstractChart);
32
+ return (0, _createClass2["default"])(RadarChartComponent, [{
32
33
  key: "renderChart",
33
34
  value: function renderChart() {
34
35
  var _this$asProps = this.asProps,
35
36
  groupKey = _this$asProps.groupKey,
36
37
  showDots = _this$asProps.showDots,
37
38
  circle = _this$asProps.circle;
38
- var _this$state = this.state,
39
- dataDefinitions = _this$state.dataDefinitions,
40
- highlightedLine = _this$state.highlightedLine;
39
+ var dataDefinitions = this.state.dataDefinitions;
41
40
  return /*#__PURE__*/_react["default"].createElement(_.Radar, {
42
41
  scale: this.xScale,
43
42
  type: circle ? 'circle' : undefined
@@ -121,12 +120,10 @@ var RadarChartComponent = /*#__PURE__*/function (_AbstractChart) {
121
120
  }, {
122
121
  key: "domain",
123
122
  get: function get() {
124
- return [Math.min.apply(Math, (0, _toConsumableArray2["default"])((0, _get2["default"])((0, _getPrototypeOf2["default"])(RadarChartComponent.prototype), "flatValues", this))), Math.max.apply(Math, (0, _toConsumableArray2["default"])((0, _get2["default"])((0, _getPrototypeOf2["default"])(RadarChartComponent.prototype), "flatValues", this)))];
123
+ return [Math.min.apply(Math, (0, _toConsumableArray2["default"])(_superPropGet(RadarChartComponent, "flatValues", this, 1))), Math.max.apply(Math, (0, _toConsumableArray2["default"])(_superPropGet(RadarChartComponent, "flatValues", this, 1)))];
125
124
  }
126
125
  }]);
127
- return RadarChartComponent;
128
126
  }(_AbstractChart2.AbstractChart);
129
127
  (0, _defineProperty2["default"])(RadarChartComponent, "enhance", [(0, _i18nEnhance["default"])(_intergalacticDynamicLocales.localizedMessages)]);
130
- var RadarChart = (0, _core.createComponent)(RadarChartComponent);
131
- exports.RadarChart = RadarChart;
128
+ var RadarChart = exports.RadarChart = (0, _core.createComponent)(RadarChartComponent);
132
129
  //# sourceMappingURL=RadarChart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadarChart.js","names":["_react","_interopRequireDefault","require","_core","_d3Scale","_AbstractChart2","_","_intergalacticDynamicLocales","_i18nEnhance","RadarChartComponent","_AbstractChart","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","renderChart","_this$asProps","asProps","groupKey","showDots","circle","_this$state","state","dataDefinitions","highlightedLine","createElement","Radar","scale","xScale","type","undefined","Axis","dataKey","Ticks","Labels","renderRadarTooltip","map","item","checked","Polygon","id","color","Line","Dots","_this","_this$asProps2","data","showTooltip","Tooltip","wMin","_ref","_data$groupKey","index","children","Fragment","Title","_data$item$id","Dot","tooltipValueFormatter","renderTooltip","get","_this$props","props","legendKeys","Object","keys","filter","_this$asProps$scale","scaleLinear","domain","_this$asProps$scale2","getLegendAriaLabel","getI18nText","chartType","Math","min","_toConsumableArray2","_get2","_getPrototypeOf2","prototype","max","AbstractChart","_defineProperty2","i18nEnhance","localizedMessages","RadarChart","createComponent","exports"],"sources":["../../../../src/component/Chart/RadarChart.tsx"],"sourcesContent":["import React from 'react';\nimport { createComponent } from '@semcore/core';\nimport { scaleLinear, ScaleLinear } from 'd3-scale';\nimport { AbstractChart } from './AbstractChart';\nimport { RadarChartData, RadarChartProps, RadarChartType } from './RadarChart.type';\n// @ts-ignore\nimport { Radar } from '../..';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\n\nclass RadarChartComponent extends AbstractChart<\n RadarChartData,\n RadarChartProps,\n typeof RadarChartComponent.enhance\n> {\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected renderChart(): React.ReactNode {\n const { groupKey, showDots, circle } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n return (\n <Radar scale={this.xScale} type={circle ? 'circle' : undefined}>\n <Radar.Axis dataKey={groupKey}>\n <Radar.Axis.Ticks />\n <Radar.Axis.Labels />\n </Radar.Axis>\n {this.renderRadarTooltip()}\n {dataDefinitions.map((item) => {\n return (\n item.checked && (\n <Radar.Polygon dataKey={item.id} key={item.id} color={item.color}>\n <Radar.Polygon.Line />\n {showDots && <Radar.Polygon.Dots />}\n </Radar.Polygon>\n )\n );\n })}\n </Radar>\n );\n }\n\n protected renderRadarTooltip(): React.ReactNode {\n const { data, groupKey, showTooltip } = this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <Radar.Tooltip wMin={100}>\n {({ index }: any) => {\n return {\n children: (\n <>\n <Radar.Tooltip.Title>{data[groupKey]?.[index]}</Radar.Tooltip.Title>\n\n {dataDefinitions.map((item) => {\n const value = data[item.id]?.[index];\n\n return (\n item.checked && (\n <Radar.Tooltip.Dot color={item.color} key={item.id}>\n {this.tooltipValueFormatter(value)}\n </Radar.Tooltip.Dot>\n )\n );\n })}\n </>\n ),\n };\n }}\n </Radar.Tooltip>\n );\n }\n\n // By default, tooltip will render in Plot component.\n // In RadarChart, we need to render it in Radar component, so we use renderRadarTooltip method\n protected renderTooltip(): React.ReactNode {\n return null;\n }\n\n protected get dataKeys(): string[] {\n const { data, groupKey } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((key) => key !== groupKey);\n\n return legendKeys;\n }\n\n protected get xScale(): ScaleLinear<any, any> {\n return this.asProps.scale ?? scaleLinear().domain(this.domain);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n return this.asProps.scale ?? scaleLinear().domain(this.domain);\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Radar' });\n }\n\n private get domain(): [number, number] {\n return [Math.min(...super.flatValues), Math.max(...super.flatValues)];\n }\n}\n\nexport const RadarChart: RadarChartType = createComponent(RadarChartComponent);\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAGA,IAAAI,CAAA,GAAAJ,OAAA;AACA,IAAAK,4BAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAP,sBAAA,CAAAC,OAAA;AAHA;AAAA,IAKMO,mBAAmB,0BAAAC,cAAA;EAAA,IAAAC,UAAA,aAA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AA2C,oBAAA,cAAAA,oBAAA,GAAI,IAAAF,oBAAW,GAAE,CAACC,MAAM,CAAC,IAAI,CAACA,MAAM,CAAC;IAChE;EAAC;IAAAxD,GAAA;IAAAC,KAAA,EAED,SAAAyD,mBAAA,EAAuC;MACrC,OAAO,IAAI,CAACtD,OAAO,CAACuD,WAAW,CAAC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;MAAQ,CAAC,CAAC;IAC3E;EAAC;IAAA5D,GAAA;IAAA+C,GAAA,EAED,SAAAA,IAAA,EAAuC;MACrC,OAAO,CAACc,IAAI,CAACC,GAAG,CAAAjE,KAAA,CAARgE,IAAI,MAAAE,mBAAA,iBAAAC,KAAA,iBAAAC,gBAAA,aAAA1E,mBAAA,CAAA2E,SAAA,wBAAyB,EAAEL,IAAI,CAACM,GAAG,CAAAtE,KAAA,CAARgE,IAAI,MAAAE,mBAAA,iBAAAC,KAAA,iBAAAC,gBAAA,aAAA1E,mBAAA,CAAA2E,SAAA,wBAAyB,CAAC;IACvE;EAAC;EAAA,OAAA3E,mBAAA;AAAA,EA/F+B6E,6BAAa;AAAA,IAAAC,gBAAA,aAAzC9E,mBAAmB,aAKN,CAAC,IAAA+E,uBAAW,EAACC,8CAAiB,CAAC,CAAC;AA6F5C,IAAMC,UAA0B,GAAG,IAAAC,qBAAe,EAAClF,mBAAmB,CAAC;AAACmF,OAAA,CAAAF,UAAA,GAAAA,UAAA"}
1
+ {"version":3,"file":"RadarChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_d3Scale","_react","_AbstractChart2","_","_intergalacticDynamicLocales","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","_superPropGet","r","p","_get2","prototype","RadarChartComponent","_AbstractChart","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","renderChart","_this$asProps","asProps","groupKey","showDots","circle","dataDefinitions","state","createElement","Radar","scale","xScale","type","undefined","Axis","dataKey","Ticks","Labels","renderRadarTooltip","map","item","checked","Polygon","id","color","Line","Dots","_this","_this$asProps2","data","showTooltip","Tooltip","wMin","_ref","_data$groupKey","index","children","Fragment","Title","_data$item$id","Dot","tooltipValueFormatter","renderTooltip","get","_this$props","props","legendKeys","Object","keys","filter","_this$asProps$scale","scaleLinear","domain","_this$asProps$scale2","getLegendAriaLabel","getI18nText","chartType","Math","min","_toConsumableArray2","max","AbstractChart","_defineProperty2","i18nEnhance","localizedMessages","RadarChart","exports","createComponent"],"sources":["../../../../src/component/Chart/RadarChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { scaleLinear, type ScaleLinear } from 'd3-scale';\nimport React from 'react';\n\nimport { AbstractChart } from './AbstractChart';\nimport type { RadarChartData, RadarChartProps, RadarChartType } from './RadarChart.type';\n// @ts-ignore\nimport { Radar } from '../..';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass RadarChartComponent extends AbstractChart<\n RadarChartData,\n RadarChartProps,\n typeof RadarChartComponent.enhance\n> {\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected renderChart(): React.ReactNode {\n const { groupKey, showDots, circle } = this.asProps;\n const { dataDefinitions } = this.state;\n\n return (\n <Radar scale={this.xScale} type={circle ? 'circle' : undefined}>\n <Radar.Axis dataKey={groupKey}>\n <Radar.Axis.Ticks />\n <Radar.Axis.Labels />\n </Radar.Axis>\n {this.renderRadarTooltip()}\n {dataDefinitions.map((item) => {\n return (\n item.checked && (\n <Radar.Polygon dataKey={item.id} key={item.id} color={item.color}>\n <Radar.Polygon.Line />\n {showDots && <Radar.Polygon.Dots />}\n </Radar.Polygon>\n )\n );\n })}\n </Radar>\n );\n }\n\n protected renderRadarTooltip(): React.ReactNode {\n const { data, groupKey, showTooltip } = this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <Radar.Tooltip wMin={100}>\n {({ index }: any) => {\n return {\n children: (\n <>\n <Radar.Tooltip.Title>{data[groupKey]?.[index]}</Radar.Tooltip.Title>\n\n {dataDefinitions.map((item) => {\n const value = data[item.id]?.[index];\n\n return (\n item.checked && (\n <Radar.Tooltip.Dot color={item.color} key={item.id}>\n {this.tooltipValueFormatter(value)}\n </Radar.Tooltip.Dot>\n )\n );\n })}\n </>\n ),\n };\n }}\n </Radar.Tooltip>\n );\n }\n\n // By default, tooltip will render in Plot component.\n // In RadarChart, we need to render it in Radar component, so we use renderRadarTooltip method\n protected renderTooltip(): React.ReactNode {\n return null;\n }\n\n protected get dataKeys(): string[] {\n const { data, groupKey } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((key) => key !== groupKey);\n\n return legendKeys;\n }\n\n protected get xScale(): ScaleLinear<any, any> {\n return this.asProps.scale ?? scaleLinear().domain(this.domain);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n return this.asProps.scale ?? scaleLinear().domain(this.domain);\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Radar' });\n }\n\n private get domain(): [number, number] {\n return [Math.min(...super.flatValues), Math.max(...super.flatValues)];\n }\n}\n\nexport const RadarChart: RadarChartType = createComponent(RadarChartComponent);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,eAAA,GAAAL,OAAA;AAGA,IAAAM,CAAA,GAAAN,OAAA;AACA,IAAAO,4BAAA,GAAAP,OAAA;AAAuF,SAAAQ,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,MAAAK,0BAAA,iBAAAC,OAAA,CAAAC,SAAA,CAAAN,C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AC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"RadarChart.type.js","names":[],"sources":["../../../../src/component/Chart/RadarChart.type.ts"],"sourcesContent":["import { Intergalactic } from '@semcore/core';\nimport { Flex } from '@semcore/flex-box';\nimport { ScaleLinear } from 'd3-scale';\nimport { BaseChartProps } from './AbstractChart.type';\n\nexport type RadarChartData = Record<string, string[] | number[]>;\n\nexport type RadarChartProps = BaseChartProps<RadarChartData> & {\n groupKey: string;\n scale?: ScaleLinear<any, any>;\n xScale?: never;\n yScale?: never;\n showDots?: boolean;\n circle?: boolean;\n};\n\nexport type RadarChartType = Intergalactic.Component<typeof Flex, RadarChartProps>;\n"],"mappings":""}
1
+ {"version":3,"file":"RadarChart.type.js","names":[],"sources":["../../../../src/component/Chart/RadarChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n\nexport type RadarChartData = Record<string, string[] | number[]>;\n\nexport type RadarChartProps = BaseChartProps<RadarChartData> & {\n groupKey: string;\n scale?: ScaleLinear<any, any>;\n xScale?: never;\n yScale?: never;\n showDots?: boolean;\n circle?: boolean;\n};\n\nexport type RadarChartType = Intergalactic.Component<typeof Flex, RadarChartProps>;\n"],"mappings":"","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
@@ -9,26 +9,27 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
9
9
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
11
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
+ var _isNativeReflectConstruct2 = _interopRequireDefault(require("@babel/runtime/helpers/isNativeReflectConstruct"));
14
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
15
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
14
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
- var _react = _interopRequireDefault(require("react"));
16
17
  var _core = require("@semcore/core");
18
+ var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
19
+ var _typography = require("@semcore/typography");
17
20
  var _d3Scale = require("d3-scale");
21
+ var _react = _interopRequireDefault(require("react"));
18
22
  var _ = require("../..");
19
23
  var _AbstractChart2 = require("./AbstractChart");
20
- var _typography = require("@semcore/typography");
21
- var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
22
24
  var _intergalacticDynamicLocales = require("../../translations/__intergalactic-dynamic-locales");
23
- // @ts-ignore
25
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); } // @ts-ignore
24
26
  var ScatterPlotChartComponent = /*#__PURE__*/function (_AbstractChart) {
25
- (0, _inherits2["default"])(ScatterPlotChartComponent, _AbstractChart);
26
- var _super = (0, _createSuper2["default"])(ScatterPlotChartComponent);
27
27
  function ScatterPlotChartComponent() {
28
28
  (0, _classCallCheck2["default"])(this, ScatterPlotChartComponent);
29
- return _super.apply(this, arguments);
29
+ return _callSuper(this, ScatterPlotChartComponent, arguments);
30
30
  }
31
- (0, _createClass2["default"])(ScatterPlotChartComponent, [{
31
+ (0, _inherits2["default"])(ScatterPlotChartComponent, _AbstractChart);
32
+ return (0, _createClass2["default"])(ScatterPlotChartComponent, [{
32
33
  key: "dataKeys",
33
34
  get: function get() {
34
35
  var _this$props = this.props,
@@ -146,9 +147,9 @@ var ScatterPlotChartComponent = /*#__PURE__*/function (_AbstractChart) {
146
147
  color: item.color
147
148
  }, "Data"), /*#__PURE__*/_react["default"].createElement(_typography.Text, {
148
149
  tag: "div"
149
- }, "X axis ", _this.tooltipValueFormatter(data[index][x])), /*#__PURE__*/_react["default"].createElement(_typography.Text, {
150
+ }, "X axis", _this.tooltipValueFormatter(data[index][x])), /*#__PURE__*/_react["default"].createElement(_typography.Text, {
150
151
  tag: "div"
151
- }, "Y axis ", _this.tooltipValueFormatter(data[index][y])))
152
+ }, "Y axis", _this.tooltipValueFormatter(data[index][y])))
152
153
  };
153
154
  });
154
155
  });
@@ -161,7 +162,6 @@ var ScatterPlotChartComponent = /*#__PURE__*/function (_AbstractChart) {
161
162
  });
162
163
  }
163
164
  }]);
164
- return ScatterPlotChartComponent;
165
165
  }(_AbstractChart2.AbstractChart);
166
166
  (0, _defineProperty2["default"])(ScatterPlotChartComponent, "displayName", 'Chart.ScatterPlot');
167
167
  (0, _defineProperty2["default"])(ScatterPlotChartComponent, "defaultProps", {
@@ -172,6 +172,5 @@ var ScatterPlotChartComponent = /*#__PURE__*/function (_AbstractChart) {
172
172
  showLegend: false
173
173
  });
174
174
  (0, _defineProperty2["default"])(ScatterPlotChartComponent, "enhance", [(0, _i18nEnhance["default"])(_intergalacticDynamicLocales.localizedMessages)]);
175
- var ScatterPlotChart = (0, _core.createComponent)(ScatterPlotChartComponent);
176
- exports.ScatterPlotChart = ScatterPlotChart;
175
+ var ScatterPlotChart = exports.ScatterPlotChart = (0, _core.createComponent)(ScatterPlotChartComponent);
177
176
  //# sourceMappingURL=ScatterPlotChart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScatterPlotChart.js","names":["_react","_interopRequireDefault","require","_core","_d3Scale","_","_AbstractChart2","_typography","_i18nEnhance","_intergalacticDynamicLocales","ScatterPlotChartComponent","_AbstractChart","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","get","_this$props","props","data","groupKey","valueKey","Object","keys","filter","_this$asProps","asProps","xScale","_this$asProps$marginY","marginY","plotWidth","radius","getScatterPlotRadius","getValueScale","_toConsumableArray2","flatValues","testItem","range","plotPadding","domain","minMax","Date","Number","isNaN","getMilliseconds","scaleTime","scaleLinear","_this$asProps2","yScale","_this$asProps2$margin","marginX","plotHeight","max","Math","min","_this$asProps3","reduce","result","item","entries","forEach","_ref","_ref2","_slicedToArray2","value","add","Set","renderChart","_this$asProps4","dataDefinitions","state","map","checked","createElement","ScatterPlot","x","y","id","color","renderTooltip","_this","_this$asProps5","showTooltip","Tooltip","wMin","_ref3","index","children","Fragment","Dot","Text","tag","tooltipValueFormatter","getLegendAriaLabel","getI18nText","chartType","AbstractChart","_defineProperty2","direction","showXAxis","showYAxis","showLegend","i18nEnhance","localizedMessages","ScatterPlotChart","createComponent","exports"],"sources":["../../../../src/component/Chart/ScatterPlotChart.tsx"],"sourcesContent":["import React from 'react';\nimport { createComponent } from '@semcore/core';\nimport { ScaleLinear, scaleLinear, scaleTime } from 'd3-scale';\n// @ts-ignore\nimport { minMax, ScatterPlot, getScatterPlotRadius } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport {\n ScatterPlotChartData,\n ScatterPlotChartProps,\n ScatterPlotChartType,\n} from './ScatterPlotChart.type';\nimport { Text } from '@semcore/typography';\nimport { BaseChartProps, ListData } from './AbstractChart.type';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass ScatterPlotChartComponent extends AbstractChart<\n ScatterPlotChartData,\n ScatterPlotChartProps,\n typeof ScatterPlotChartComponent.enhance\n> {\n static displayName = 'Chart.ScatterPlot';\n public static defaultProps: Partial<BaseChartProps<ListData>> = {\n direction: 'column',\n showXAxis: true,\n showYAxis: true,\n showTooltip: true,\n showLegend: false,\n };\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected get dataKeys(): string[] {\n const { data, groupKey, valueKey } = this.props;\n\n return Object.keys(data[0]).filter((key) => key !== groupKey && key !== valueKey);\n }\n\n protected get xScale() {\n const { xScale, marginY = 30, plotWidth, data, groupKey, valueKey } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...this.flatValues]);\n const testItem = data[0][groupKey];\n const range = [marginY, plotWidth - this.plotPadding];\n const domain = minMax(data, groupKey);\n\n if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {\n return scaleTime([domain[0] - radius, domain[1] + radius], range);\n }\n\n return scaleLinear([domain[0] - radius, domain[1] + radius], range);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 30, plotHeight, valueKey } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const flatValues = this.flatValues;\n const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...flatValues]);\n\n const max = Math.max(...flatValues) + radius;\n const min = Math.min(...flatValues) - radius;\n\n return scaleLinear()\n .range([plotHeight - marginX, this.plotPadding])\n .domain([min, max]);\n }\n\n protected get flatValues(): Set<number> {\n const { data, groupKey, valueKey } = this.asProps;\n\n const flatValues = data.reduce<Set<number>>((result, item) => {\n Object.entries(item).forEach(([key, value]) => {\n if (key !== groupKey && key !== valueKey && typeof value === 'number') {\n result.add(value);\n }\n });\n\n return result;\n }, new Set());\n\n return flatValues;\n }\n\n protected renderChart() {\n const { groupKey, valueKey } = this.asProps;\n const { dataDefinitions } = this.state;\n\n return dataDefinitions.map((item) => {\n return (\n item.checked && (\n <ScatterPlot x={groupKey} y={item.id} key={item.id} color={item.color} value={valueKey} />\n )\n );\n });\n }\n\n protected renderTooltip() {\n const { data, groupKey, showTooltip } = this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return dataDefinitions\n .filter((item) => item.checked)\n .map((item) => {\n return (\n <ScatterPlot.Tooltip key={item.id} x={groupKey} y={item.id} wMin={100}>\n {({ index, x, y }: any) => {\n return {\n children: (\n <>\n <ScatterPlot.Tooltip.Dot color={item.color}>Data</ScatterPlot.Tooltip.Dot>\n <Text tag='div'>X axis {this.tooltipValueFormatter(data[index][x])}</Text>\n <Text tag='div'>Y axis {this.tooltipValueFormatter(data[index][y])}</Text>\n </>\n ),\n };\n }}\n </ScatterPlot.Tooltip>\n );\n });\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'ScatterPlot' });\n }\n}\n\nexport const ScatterPlotChart: ScatterPlotChartType = createComponent(ScatterPlotChartComponent);\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,CAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AAMA,IAAAK,WAAA,GAAAL,OAAA;AAEA,IAAAM,YAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,4BAAA,GAAAP,OAAA;AAXA;AAAA,IAaMQ,yBAAyB,0BAAAC,cAAA;EAAA,IAAAC,UAAA,aAAAF,yBAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAAJ,yBAAA;EAAA,SAAAA,0BAAA;IAAA,IAAAK,gBAAA,mBAAAL,yBAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAA,IAAAC,aAAA,aAAAR,yBAAA;IAAAS,GAAA;IAAAC,GAAA,EAgB7B,SAAAA,IAAA,EAAmC;MACjC,IAAAC,WAAA,GAAqC,IAAI,CAACC,K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AI,CAA0B,eAC1ElF,MAAA,YAAA6E,aAAA,CAACtE,WAAA,CAAAuF,IAAI;cAACC,GAAG,EAAC;YAAK,GAAC,SAAO,EAACX,KAAI,CAACY,qBAAqB,CAACzE,IAAI,CAACmE,KAAK,CAAC,CAACX,CAAC,CAAC,CAAC,CAAQ,eAC1E/E,MAAA,YAAA6E,aAAA,CAACtE,WAAA,CAAAuF,IAAI;cAACC,GAAG,EAAC;YAAK,GAAC,SAAO,EAACX,KAAI,CAACY,qBAAqB,CAACzE,IAAI,CAACmE,KAAK,CAAC,CAACV,CAAC,CAAC,CAAC,CAAQ;UAGhF,CAAC;QACH,CAAC,CACmB;MAE1B,CAAC,CAAC;IACN;EAAC;IAAA7D,GAAA;IAAAiD,KAAA,EAED,SAAA6B,mBAAA,EAAuC;MACrC,OAAO,IAAI,CAACnE,OAAO,CAACoE,WAAW,CAAC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;MAAc,CAAC,CAAC;IACjF;EAAC;EAAA,OAAAzF,yBAAA;AAAA,EAvHqC0F,6BAAa;AAAA,IAAAC,gBAAA,aAA/C3F,yBAAyB,iBAKR,mBAAmB;AAAA,IAAA2F,gBAAA,aALpC3F,yBAAyB,kBAMmC;EAC9D4F,SAAS,EAAE,QAAQ;EACnBC,SAAS,EAAE,IAAI;EACfC,SAAS,EAAE,IAAI;EACflB,WAAW,EAAE,IAAI;EACjBmB,UAAU,EAAE;AACd,CAAC;AAAA,IAAAJ,gBAAA,aAZG3F,yBAAyB,aAcZ,CAAC,IAAAgG,uBAAW,EAACC,8CAAiB,CAAC,CAAC;AA4G5C,IAAMC,gBAAsC,GAAG,IAAAC,qBAAe,EAACnG,yBAAyB,CAAC;AAACoG,OAAA,CAAAF,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"file":"ScatterPlotChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_typography","_d3Scale","_react","_","_AbstractChart2","_intergalacticDynamicLocales","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","ScatterPlotChartComponent","_AbstractChart","_classCallCheck2","arguments","_inherits2","_createClass2","key","get","_this$props","props","data","groupKey","valueKey","Object","keys","filter","_this$asProps","asProps","xScale","_this$asProps$marginY","marginY","plotWidth","radius","getScatterPlotRadius","getValueScale","_toConsumableArray2","flatValues","testItem","range","plotPadding","domain","minMax","Date","Number","isNaN","getMilliseconds","scaleTime","scaleLinear","_this$asProps2","yScale","_this$asProps2$margin","marginX","plotHeight","max","Math","min","_this$asProps3","reduce","result","item","entries","forEach","_ref","_ref2","_slicedToArray2","value","add","Set","renderChart","_this$asProps4","dataDefinitions","state","map","checked","createElement","ScatterPlot","x","y","id","color","renderTooltip","_this","_this$asProps5","showTooltip","Tooltip","wMin","_ref3","index","children","Fragment","Dot","Text","tag","tooltipValueFormatter","getLegendAriaLabel","getI18nText","chartType","AbstractChart","_defineProperty2","direction","showXAxis","showYAxis","showLegend","i18nEnhance","localizedMessages","ScatterPlotChart","exports","createComponent"],"sources":["../../../../src/component/Chart/ScatterPlotChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Text } from '@semcore/typography';\nimport { type ScaleLinear, scaleLinear, scaleTime } from 'd3-scale';\nimport React from 'react';\n\n// @ts-ignore\nimport { minMax, ScatterPlot, getScatterPlotRadius } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport type { BaseChartProps, ListData } from './AbstractChart.type';\nimport type {\n ScatterPlotChartData,\n ScatterPlotChartProps,\n ScatterPlotChartType,\n} from './ScatterPlotChart.type';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass ScatterPlotChartComponent extends AbstractChart<\n ScatterPlotChartData,\n ScatterPlotChartProps,\n typeof ScatterPlotChartComponent.enhance\n> {\n static displayName = 'Chart.ScatterPlot';\n public static defaultProps: Partial<BaseChartProps<ListData>> = {\n direction: 'column',\n showXAxis: true,\n showYAxis: true,\n showTooltip: true,\n showLegend: false,\n };\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected get dataKeys(): string[] {\n const { data, groupKey, valueKey } = this.props;\n\n return Object.keys(data[0]).filter((key) => key !== groupKey && key !== valueKey);\n }\n\n protected get xScale() {\n const { xScale, marginY = 30, plotWidth, data, groupKey, valueKey } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...this.flatValues]);\n const testItem = data[0][groupKey];\n const range = [marginY, plotWidth - this.plotPadding];\n const domain = minMax(data, groupKey);\n\n if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {\n return scaleTime([domain[0] - radius, domain[1] + radius], range);\n }\n\n return scaleLinear([domain[0] - radius, domain[1] + radius], range);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 30, plotHeight, valueKey } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const flatValues = this.flatValues;\n const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...flatValues]);\n\n const max = Math.max(...flatValues) + radius;\n const min = Math.min(...flatValues) - radius;\n\n return scaleLinear()\n .range([plotHeight - marginX, this.plotPadding])\n .domain([min, max]);\n }\n\n protected get flatValues(): Set<number> {\n const { data, groupKey, valueKey } = this.asProps;\n\n const flatValues = data.reduce<Set<number>>((result, item) => {\n Object.entries(item).forEach(([key, value]) => {\n if (key !== groupKey && key !== valueKey && typeof value === 'number') {\n result.add(value);\n }\n });\n\n return result;\n }, new Set());\n\n return flatValues;\n }\n\n protected renderChart() {\n const { groupKey, valueKey } = this.asProps;\n const { dataDefinitions } = this.state;\n\n return dataDefinitions.map((item) => {\n return (\n item.checked && (\n <ScatterPlot x={groupKey} y={item.id} key={item.id} color={item.color} value={valueKey} />\n )\n );\n });\n }\n\n protected renderTooltip() {\n const { data, groupKey, showTooltip } = this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return dataDefinitions\n .filter((item) => item.checked)\n .map((item) => {\n return (\n <ScatterPlot.Tooltip key={item.id} x={groupKey} y={item.id} wMin={100}>\n {({ index, x, y }: any) => {\n return {\n children: (\n <>\n <ScatterPlot.Tooltip.Dot color={item.color}>Data</ScatterPlot.Tooltip.Dot>\n <Text tag='div'>\n X axis\n {this.tooltipValueFormatter(data[index][x])}\n </Text>\n <Text tag='div'>\n Y axis\n {this.tooltipValueFormatter(data[index][y])}\n </Text>\n </>\n ),\n };\n }}\n </ScatterPlot.Tooltip>\n );\n });\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'ScatterPlot' });\n }\n}\n\nexport const ScatterPlotChart: ScatterPlotChartType = createComponent(ScatterPlotChartComponent);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AAGA,IAAAM,CAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AAOA,IAAAQ,4BAAA,GAAAR,OAAA;AAAuF,SAAAS,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,MAAAK,0BAAA,iBAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA,MATvF;AAAA,IAWMQ,yBAAyB,0BAAAC,cAAA;EAAA,SAAAD,0BAAA;IAAA,IAAAE,gBAAA,mBAAAF,yBAAA;IAAA,OAAAX,UAAA,OAAAW,yBAAA,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AsC,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAAE,qBAAe,EAACjG,yBAAyB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ScatterPlotChart.type.js","names":[],"sources":["../../../../src/component/Chart/ScatterPlotChart.type.ts"],"sourcesContent":["import { Intergalactic } from '@semcore/core';\nimport { Flex } from '@semcore/flex-box';\nimport { interpolateValue } from '../../utils';\nimport { ScaleLinear, ScaleTime } from 'd3-scale';\nimport { BaseChartProps } from './AbstractChart.type';\n\nexport type ScatterPlotChartData = Array<Record<string, number | typeof interpolateValue | Date>>;\n\nexport type ScatterPlotChartProps = BaseChartProps<ScatterPlotChartData> & {\n groupKey: string;\n xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;\n yScale?: ScaleLinear<any, any>;\n valueKey?: string;\n};\n\nexport type ScatterPlotChartType = Intergalactic.Component<typeof Flex, ScatterPlotChartProps>;\n"],"mappings":""}
1
+ {"version":3,"file":"ScatterPlotChart.type.js","names":[],"sources":["../../../../src/component/Chart/ScatterPlotChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear, ScaleTime } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\nimport type { interpolateValue } from '../../utils';\n\nexport type ScatterPlotChartData = Array<Record<string, number | typeof interpolateValue | Date>>;\n\nexport type ScatterPlotChartProps = BaseChartProps<ScatterPlotChartData> & {\n groupKey: string;\n xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;\n yScale?: ScaleLinear<any, any>;\n valueKey?: string;\n};\n\nexport type ScatterPlotChartType = Intergalactic.Component<typeof Flex, ScatterPlotChartProps>;\n"],"mappings":"","ignoreList":[]}
@@ -1,32 +1,33 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.VennChart = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
11
+ var _isNativeReflectConstruct2 = _interopRequireDefault(require("@babel/runtime/helpers/isNativeReflectConstruct"));
12
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
10
13
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
12
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
- var _react = _interopRequireDefault(require("react"));
14
15
  var _core = require("@semcore/core");
16
+ var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
17
+ var _typography = require("@semcore/typography");
15
18
  var _d3Scale = require("d3-scale");
19
+ var _react = _interopRequireDefault(require("react"));
16
20
  var _ = require("../..");
17
21
  var _AbstractChart2 = require("./AbstractChart");
18
- var _typography = require("@semcore/typography");
19
- var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
20
22
  var _intergalacticDynamicLocales = require("../../translations/__intergalactic-dynamic-locales");
21
- // @ts-ignore
23
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); } // @ts-ignore
22
24
  var VennChartComponent = /*#__PURE__*/function (_AbstractChart) {
23
- (0, _inherits2["default"])(VennChartComponent, _AbstractChart);
24
- var _super = (0, _createSuper2["default"])(VennChartComponent);
25
25
  function VennChartComponent() {
26
26
  (0, _classCallCheck2["default"])(this, VennChartComponent);
27
- return _super.apply(this, arguments);
27
+ return _callSuper(this, VennChartComponent, arguments);
28
28
  }
29
- (0, _createClass2["default"])(VennChartComponent, [{
29
+ (0, _inherits2["default"])(VennChartComponent, _AbstractChart);
30
+ return (0, _createClass2["default"])(VennChartComponent, [{
30
31
  key: "xScale",
31
32
  get: function get() {
32
33
  var xScale = this.asProps.xScale;
@@ -137,7 +138,6 @@ var VennChartComponent = /*#__PURE__*/function (_AbstractChart) {
137
138
  });
138
139
  }
139
140
  }]);
140
- return VennChartComponent;
141
141
  }(_AbstractChart2.AbstractChart);
142
142
  (0, _defineProperty2["default"])(VennChartComponent, "displayName", 'Chart.Venn');
143
143
  (0, _defineProperty2["default"])(VennChartComponent, "defaultProps", {
@@ -147,6 +147,5 @@ var VennChartComponent = /*#__PURE__*/function (_AbstractChart) {
147
147
  marginX: 0
148
148
  });
149
149
  (0, _defineProperty2["default"])(VennChartComponent, "enhance", [(0, _i18nEnhance["default"])(_intergalacticDynamicLocales.localizedMessages)]);
150
- var VennChart = (0, _core.createComponent)(VennChartComponent);
151
- exports.VennChart = VennChart;
150
+ var VennChart = exports.VennChart = (0, _core.createComponent)(VennChartComponent);
152
151
  //# sourceMappingURL=VennChart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VennChart.js","names":["_react","_interopRequireDefault","require","_core","_d3Scale","_","_AbstractChart2","_typography","_i18nEnhance","_intergalacticDynamicLocales","VennChartComponent","_AbstractChart","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","get","xScale","asProps","scaleLinear","yScale","data","props","legendKeys","Object","keys","filter","item","isIntersection","test","value","defaultLegendProps","legendType","renderChart","_this$state","state","dataDefinitions","highlightedLine","checkedLegendItems","checked","checkedLegendItemsMap","reduce","result","id","intersections","dataKey","push","createElement","Venn","map","index","Circle","name","label","color","transparent","intersectionKey","intersectionKeys","split","hasDisabledItems","some","undefined","_dataDefinitions$find","find","legendItem","join","Intersection","renderTooltip","showTooltip","Tooltip","_ref","children","Fragment","Title","Text","bold","getLegendAriaLabel","getI18nText","chartType","AbstractChart","_defineProperty2","direction","alignItems","marginY","marginX","i18nEnhance","localizedMessages","VennChart","createComponent","exports"],"sources":["../../../../src/component/Chart/VennChart.tsx"],"sourcesContent":["import React from 'react';\nimport { createComponent } from '@semcore/core';\nimport { BaseChartProps } from './AbstractChart.type';\nimport { scaleLinear } from 'd3-scale';\n// @ts-ignore\nimport { Venn } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport { Text } from '@semcore/typography';\nimport { VennChartData, VennChartProps, VennChartType } from './VennChart.type';\nimport { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass VennChartComponent extends AbstractChart<\n VennChartData,\n VennChartProps,\n typeof VennChartComponent.enhance\n> {\n static displayName = 'Chart.Venn';\n\n static defaultProps: Partial<BaseChartProps<VennChartData>> = {\n direction: 'row-reverse',\n alignItems: 'flex-start',\n marginY: 0,\n marginX: 0,\n };\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n get xScale() {\n const { xScale } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n return scaleLinear();\n }\n\n get yScale() {\n const { yScale } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n return scaleLinear();\n }\n\n protected get dataKeys(): string[] {\n const { data } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((item) => {\n const isIntersection = /\\//.test(item);\n\n return !isIntersection;\n });\n\n return legendKeys;\n }\n\n defaultLegendProps() {\n return {\n legendType: 'Table' as const,\n };\n }\n\n renderChart() {\n const { data } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n const checkedLegendItems = dataDefinitions.filter((item) => item.checked);\n const checkedLegendItemsMap = checkedLegendItems.reduce<Record<string, LegendItem>>(\n (result, item) => {\n result[item.id] = item;\n\n return result;\n },\n {},\n );\n\n const intersections = Object.keys(data).reduce<string[]>((result, dataKey) => {\n const isIntersection = /\\//.test(dataKey);\n\n if (isIntersection) {\n result.push(dataKey);\n }\n\n return result;\n }, []);\n\n return (\n <Venn>\n {checkedLegendItems.map((item, index) => {\n return (\n <Venn.Circle\n key={item.id}\n dataKey={item.id}\n name={item.label}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n />\n );\n })}\n\n {intersections.map((intersectionKey) => {\n const intersectionKeys = intersectionKey.split('/');\n\n const hasDisabledItems = intersectionKeys.some((key) => {\n return checkedLegendItemsMap[key] === undefined;\n });\n\n if (hasDisabledItems) {\n return null;\n }\n\n const name = intersectionKeys\n .map((id) => {\n return dataDefinitions.find((legendItem) => legendItem.id === id)?.label || '';\n })\n .join(' & ');\n\n return <Venn.Intersection key={intersectionKey} dataKey={intersectionKey} name={name} />;\n })}\n </Venn>\n );\n }\n\n renderTooltip() {\n const { showTooltip } = this.asProps;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <Venn.Tooltip>\n {({ name, dataKey, data }: any) => {\n return {\n children: (\n <>\n <Venn.Tooltip.Title>{name}</Venn.Tooltip.Title>\n <Text bold>{data[dataKey]}</Text>\n </>\n ),\n };\n }}\n </Venn.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Venn' });\n }\n}\n\nexport const VennChart: VennChartType = createComponent(VennChartComponent);\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,CAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAGA,IAAAM,YAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,4BAAA,GAAAP,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,IAAI;QACrB,OAAO;UACLkD,QAAQ,eACN3E,MAAA,YAAAmD,aAAA,CAAAnD,MAAA,YAAA4E,QAAA,qBACE5E,MAAA,YAAAmD,aAAA,CAAC9C,CAAA,CAAA+C,IAAI,CAACqB,OAAO,CAACI,KAAK,QAAErB,IAAI,CAAsB,eAC/CxD,MAAA,YAAAmD,aAAA,CAAC5C,WAAA,CAAAuE,IAAI;YAACC,IAAI;UAAA,GAAEtD,IAAI,CAACwB,OAAO,CAAC,CAAQ;QAGvC,CAAC;MACH,CAAC,CACY;IAEnB;EAAC;IAAA9B,GAAA;IAAAe,KAAA,EAED,SAAA8C,mBAAA,EAAuC;MACrC,OAAO,IAAI,CAAC1D,OAAO,CAAC2D,WAAW,CAAC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;MAAO,CAAC,CAAC;IAC1E;EAAC;EAAA,OAAAxE,kBAAA;AAAA,EA5I8ByE,6BAAa;AAAA,IAAAC,gBAAA,aAAxC1E,kBAAkB,iBAKD,YAAY;AAAA,IAAA0E,gBAAA,aAL7B1E,kBAAkB,kBAOwC;EAC5D2E,SAAS,EAAE,aAAa;EACxBC,UAAU,EAAE,YAAY;EACxBC,OAAO,EAAE,CAAC;EACVC,OAAO,EAAE;AACX,CAAC;AAAA,IAAAJ,gBAAA,aAZG1E,kBAAkB,aAcL,CAAC,IAAA+E,uBAAW,EAACC,8CAAiB,CAAC,CAAC;AAiI5C,IAAMC,SAAwB,GAAG,IAAAC,qBAAe,EAAClF,kBAAkB,CAAC;AAACmF,OAAA,CAAAF,SAAA,GAAAA,SAAA"}
1
+ {"version":3,"file":"VennChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_typography","_d3Scale","_react","_","_AbstractChart2","_intergalacticDynamicLocales","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","VennChartComponent","_AbstractChart","_classCallCheck2","arguments","_inherits2","_createClass2","key","get","xScale","asProps","scaleLinear","yScale","data","props","legendKeys","Object","keys","filter","item","isIntersection","test","value","defaultLegendProps","legendType","renderChart","_this$state","state","dataDefinitions","highlightedLine","checkedLegendItems","checked","checkedLegendItemsMap","reduce","result","id","intersections","dataKey","push","createElement","Venn","map","index","Circle","name","label","color","transparent","intersectionKey","intersectionKeys","split","hasDisabledItems","some","undefined","_dataDefinitions$find","find","legendItem","join","Intersection","renderTooltip","showTooltip","Tooltip","_ref","children","Fragment","Title","Text","bold","getLegendAriaLabel","getI18nText","chartType","AbstractChart","_defineProperty2","direction","alignItems","marginY","marginX","i18nEnhance","localizedMessages","VennChart","exports","createComponent"],"sources":["../../../../src/component/Chart/VennChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Text } from '@semcore/typography';\nimport { scaleLinear } from 'd3-scale';\nimport React from 'react';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n// @ts-ignore\nimport { Venn } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport type { VennChartData, VennChartProps, VennChartType } from './VennChart.type';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport type { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\n\nclass VennChartComponent extends AbstractChart<\n VennChartData,\n VennChartProps,\n typeof VennChartComponent.enhance\n> {\n static displayName = 'Chart.Venn';\n\n static defaultProps: Partial<BaseChartProps<VennChartData>> = {\n direction: 'row-reverse',\n alignItems: 'flex-start',\n marginY: 0,\n marginX: 0,\n };\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n get xScale() {\n const { xScale } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n return scaleLinear();\n }\n\n get yScale() {\n const { yScale } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n return scaleLinear();\n }\n\n protected get dataKeys(): string[] {\n const { data } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((item) => {\n const isIntersection = /\\//.test(item);\n\n return !isIntersection;\n });\n\n return legendKeys;\n }\n\n defaultLegendProps() {\n return {\n legendType: 'Table' as const,\n };\n }\n\n renderChart() {\n const { data } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n const checkedLegendItems = dataDefinitions.filter((item) => item.checked);\n const checkedLegendItemsMap = checkedLegendItems.reduce<Record<string, LegendItem>>(\n (result, item) => {\n result[item.id] = item;\n\n return result;\n },\n {},\n );\n\n const intersections = Object.keys(data).reduce<string[]>((result, dataKey) => {\n const isIntersection = /\\//.test(dataKey);\n\n if (isIntersection) {\n result.push(dataKey);\n }\n\n return result;\n }, []);\n\n return (\n <Venn>\n {checkedLegendItems.map((item, index) => {\n return (\n <Venn.Circle\n key={item.id}\n dataKey={item.id}\n name={item.label}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n />\n );\n })}\n\n {intersections.map((intersectionKey) => {\n const intersectionKeys = intersectionKey.split('/');\n\n const hasDisabledItems = intersectionKeys.some((key) => {\n return checkedLegendItemsMap[key] === undefined;\n });\n\n if (hasDisabledItems) {\n return null;\n }\n\n const name = intersectionKeys\n .map((id) => {\n return dataDefinitions.find((legendItem) => legendItem.id === id)?.label || '';\n })\n .join(' & ');\n\n return <Venn.Intersection key={intersectionKey} dataKey={intersectionKey} name={name} />;\n })}\n </Venn>\n );\n }\n\n renderTooltip() {\n const { showTooltip } = this.asProps;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <Venn.Tooltip>\n {({ name, dataKey, data }: any) => {\n return {\n children: (\n <>\n <Venn.Tooltip.Title>{name}</Venn.Tooltip.Title>\n <Text bold>{data[dataKey]}</Text>\n </>\n ),\n };\n }}\n </Venn.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Venn' });\n }\n}\n\nexport const VennChart: VennChartType = createComponent(VennChartComponent);\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC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C,OAAO,EAAE,CAAC;EACVC,OAAO,EAAE;AACX,CAAC;AAAA,IAAAJ,gBAAA,aAZGvE,kBAAkB,aAcL,CAAC,IAAA4E,uBAAW,EAACC,8CAAiB,CAAC,CAAC;AAiI5C,IAAMC,SAAwB,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,qBAAe,EAAChF,kBAAkB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"VennChart.type.js","names":[],"sources":["../../../../src/component/Chart/VennChart.type.ts"],"sourcesContent":["import { Intergalactic } from '@semcore/core';\nimport { Flex } from '@semcore/flex-box';\nimport { ScaleLinear } from 'd3-scale';\nimport { BaseChartProps } from './AbstractChart.type';\n\nexport type VennChartData = Record<string, number>;\n\nexport type VennChartProps = BaseChartProps<VennChartData> & {\n groupKey?: never;\n xScale?: ScaleLinear<any, any>;\n yScale?: ScaleLinear<any, any>;\n};\n\nexport type VennChartType = Intergalactic.Component<typeof Flex, VennChartProps>;\n"],"mappings":""}
1
+ {"version":3,"file":"VennChart.type.js","names":[],"sources":["../../../../src/component/Chart/VennChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n\nexport type VennChartData = Record<string, number>;\n\nexport type VennChartProps = BaseChartProps<VennChartData> & {\n groupKey?: never;\n xScale?: ScaleLinear<any, any>;\n yScale?: ScaleLinear<any, any>;\n};\n\nexport type VennChartType = Intergalactic.Component<typeof Flex, VennChartProps>;\n"],"mappings":"","ignoreList":[]}
@@ -4,18 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
- var _LineChart = require("./LineChart");
7
+ var _AreaChart = require("./AreaChart");
8
8
  var _BarChart = require("./BarChart");
9
+ var _BubbleChart = require("./BubbleChart");
10
+ var _CigaretteChart = require("./CigaretteChart");
9
11
  var _CompactHorizontalBarChart = require("./CompactHorizontalBarChart");
12
+ var _DonutChart = require("./DonutChart");
10
13
  var _HistogramChart = require("./HistogramChart");
14
+ var _LineChart = require("./LineChart");
15
+ var _RadarChart = require("./RadarChart");
11
16
  var _ScatterPlotChart = require("./ScatterPlotChart");
12
- var _AreaChart = require("./AreaChart");
13
- var _BubbleChart = require("./BubbleChart");
14
- var _DonutChart = require("./DonutChart");
15
17
  var _VennChart = require("./VennChart");
16
- var _RadarChart = require("./RadarChart");
17
- var _CigaretteChart = require("./CigaretteChart");
18
- var _default = {
18
+ var _default = exports["default"] = {
19
19
  Line: _LineChart.LineChart,
20
20
  Bar: _BarChart.BarChart,
21
21
  Histogram: _HistogramChart.HistogramChart,
@@ -28,5 +28,4 @@ var _default = {
28
28
  Cigarette: _CigaretteChart.CigaretteChart,
29
29
  CompactHorizontalBar: _CompactHorizontalBarChart.CompactHorizontalBarChart
30
30
  };
31
- exports["default"] = _default;
32
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_LineChart","require","_BarChart","_CompactHorizontalBarChart","_HistogramChart","_ScatterPlotChart","_AreaChart","_BubbleChart","_DonutChart","_VennChart","_RadarChart","_CigaretteChart","_default","Line","LineChart","Bar","BarChart","Histogram","HistogramChart","ScatterPlot","ScatterPlotChart","Area","AreaChart","Bubble","BubbleChart","Donut","DonutChart","Venn","VennChart","Radar","RadarChart","Cigarette","CigaretteChart","CompactHorizontalBar","CompactHorizontalBarChart","exports"],"sources":["../../../../src/component/Chart/index.ts"],"sourcesContent":["import { LineChart } from './LineChart';\nimport { BarChart } from './BarChart';\nimport { CompactHorizontalBarChart } from './CompactHorizontalBarChart';\nimport { HistogramChart } from './HistogramChart';\nimport { ScatterPlotChart } from './ScatterPlotChart';\nimport { AreaChart } from './AreaChart';\nimport { BubbleChart } from './BubbleChart';\nimport { DonutChart } from './DonutChart';\nimport { VennChart } from './VennChart';\nimport { RadarChart } from './RadarChart';\nimport { CigaretteChart } from './CigaretteChart';\n\nexport default {\n Line: LineChart,\n Bar: BarChart,\n Histogram: HistogramChart,\n ScatterPlot: ScatterPlotChart,\n Area: AreaChart,\n Bubble: BubbleChart,\n Donut: DonutChart,\n Venn: VennChart,\n Radar: RadarChart,\n Cigarette: CigaretteChart,\n CompactHorizontalBar: CompactHorizontalBarChart,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,eAAA,GAAAV,OAAA;AAAkD,IAAAW,QAAA,GAEnC;EACbC,IAAI,EAAEC,oBAAS;EACfC,GAAG,EAAEC,kBAAQ;EACbC,SAAS,EAAEC,8BAAc;EACzBC,WAAW,EAAEC,kCAAgB;EAC7BC,IAAI,EAAEC,oBAAS;EACfC,MAAM,EAAEC,wBAAW;EACnBC,KAAK,EAAEC,sBAAU;EACjBC,IAAI,EAAEC,oBAAS;EACfC,KAAK,EAAEC,sBAAU;EACjBC,SAAS,EAAEC,8BAAc;EACzBC,oBAAoB,EAAEC;AACxB,CAAC;AAAAC,OAAA,cAAAvB,QAAA"}
1
+ {"version":3,"file":"index.js","names":["_AreaChart","require","_BarChart","_BubbleChart","_CigaretteChart","_CompactHorizontalBarChart","_DonutChart","_HistogramChart","_LineChart","_RadarChart","_ScatterPlotChart","_VennChart","_default","exports","Line","LineChart","Bar","BarChart","Histogram","HistogramChart","ScatterPlot","ScatterPlotChart","Area","AreaChart","Bubble","BubbleChart","Donut","DonutChart","Venn","VennChart","Radar","RadarChart","Cigarette","CigaretteChart","CompactHorizontalBar","CompactHorizontalBarChart"],"sources":["../../../../src/component/Chart/index.ts"],"sourcesContent":["import { AreaChart } from './AreaChart';\nimport { BarChart } from './BarChart';\nimport { BubbleChart } from './BubbleChart';\nimport { CigaretteChart } from './CigaretteChart';\nimport { CompactHorizontalBarChart } from './CompactHorizontalBarChart';\nimport { DonutChart } from './DonutChart';\nimport { HistogramChart } from './HistogramChart';\nimport { LineChart } from './LineChart';\nimport { RadarChart } from './RadarChart';\nimport { ScatterPlotChart } from './ScatterPlotChart';\nimport { VennChart } from './VennChart';\n\nexport default {\n Line: LineChart,\n Bar: BarChart,\n Histogram: HistogramChart,\n ScatterPlot: ScatterPlotChart,\n Area: AreaChart,\n Bubble: BubbleChart,\n Donut: DonutChart,\n Venn: VennChart,\n Radar: RadarChart,\n Cigarette: CigaretteChart,\n CompactHorizontalBar: CompactHorizontalBarChart,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,0BAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAAwC,IAAAW,QAAA,GAAAC,OAAA,cAEzB;EACbC,IAAI,EAAEC,oBAAS;EACfC,GAAG,EAAEC,kBAAQ;EACbC,SAAS,EAAEC,8BAAc;EACzBC,WAAW,EAAEC,kCAAgB;EAC7BC,IAAI,EAAEC,oBAAS;EACfC,MAAM,EAAEC,wBAAW;EACnBC,KAAK,EAAEC,sBAAU;EACjBC,IAAI,EAAEC,oBAAS;EACfC,KAAK,EAAEC,sBAAU;EACjBC,SAAS,EAAEC,8BAAc;EACzBC,oBAAoB,EAAEC;AACxB,CAAC","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
@@ -8,41 +8,63 @@ exports.BaseLegend = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
+ var _isNativeReflectConstruct2 = _interopRequireDefault(require("@babel/runtime/helpers/isNativeReflectConstruct"));
13
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
14
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
14
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
16
  var _core = require("@semcore/core");
16
17
  var _hints = require("../../a11y/hints");
17
- var BaseLegend = /*#__PURE__*/function (_Component) {
18
- (0, _inherits2["default"])(BaseLegend, _Component);
19
- var _super = (0, _createSuper2["default"])(BaseLegend);
18
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
19
+ var BaseLegend = exports.BaseLegend = /*#__PURE__*/function (_Component) {
20
20
  function BaseLegend() {
21
21
  var _this;
22
22
  (0, _classCallCheck2["default"])(this, BaseLegend);
23
23
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
24
24
  args[_key] = arguments[_key];
25
25
  }
26
- _this = _super.call.apply(_super, [this].concat(args));
27
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChangeLegendItem", function (id, checked) {
26
+ _this = _callSuper(this, BaseLegend, [].concat(args));
27
+ (0, _defineProperty2["default"])(_this, "onChangeLegendItem", function (id, checked) {
28
28
  var _this$props$onChangeV, _this$props;
29
- (_this$props$onChangeV = (_this$props = _this.props).onChangeVisibleItem) === null || _this$props$onChangeV === void 0 ? void 0 : _this$props$onChangeV.call(_this$props, id, checked);
29
+ (_this$props$onChangeV = (_this$props = _this.props).onChangeVisibleItem) === null || _this$props$onChangeV === void 0 || _this$props$onChangeV.call(_this$props, id, checked);
30
+ if (checked) {
31
+ var _this$props$onMouseEn, _this$props2;
32
+ (_this$props$onMouseEn = (_this$props2 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn === void 0 || _this$props$onMouseEn.call(_this$props2, id);
33
+ } else {
34
+ var _this$props$onMouseLe, _this$props3;
35
+ (_this$props$onMouseLe = (_this$props3 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe === void 0 || _this$props$onMouseLe.call(_this$props3, id);
36
+ }
37
+ });
38
+ (0, _defineProperty2["default"])(_this, "onFocusLegendItem", function (checked) {
39
+ return function (id) {
40
+ var _this$props$onMouseEn2, _this$props5;
41
+ if (!checked) {
42
+ var _this$props$onMouseLe2, _this$props4;
43
+ return (_this$props$onMouseLe2 = (_this$props4 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe2 === void 0 ? void 0 : _this$props$onMouseLe2.call(_this$props4, id);
44
+ }
45
+ (_this$props$onMouseEn2 = (_this$props5 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn2 === void 0 || _this$props$onMouseEn2.call(_this$props5, id);
46
+ };
47
+ });
48
+ (0, _defineProperty2["default"])(_this, "onBlurLegendItem", function (id) {
49
+ var _this$props$onMouseLe3, _this$props6;
50
+ (_this$props$onMouseLe3 = (_this$props6 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe3 === void 0 || _this$props$onMouseLe3.call(_this$props6, id);
30
51
  });
31
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "bindOnMouseEnterItem", function (id) {
52
+ (0, _defineProperty2["default"])(_this, "bindOnMouseEnterItem", function (id) {
32
53
  return function (e) {
33
- var _this$props$onMouseEn, _this$props2;
34
- (_this$props$onMouseEn = (_this$props2 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn === void 0 ? void 0 : _this$props$onMouseEn.call(_this$props2, id, e);
54
+ var _this$props$onMouseEn3, _this$props7;
55
+ (_this$props$onMouseEn3 = (_this$props7 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn3 === void 0 || _this$props$onMouseEn3.call(_this$props7, id, e);
35
56
  };
36
57
  });
37
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "bindOnMouseLeaveItem", function (id) {
58
+ (0, _defineProperty2["default"])(_this, "bindOnMouseLeaveItem", function (id) {
38
59
  return function (e) {
39
- var _this$props$onMouseLe, _this$props3;
40
- (_this$props$onMouseLe = (_this$props3 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe === void 0 ? void 0 : _this$props$onMouseLe.call(_this$props3, id, e);
60
+ var _this$props$onMouseLe4, _this$props8;
61
+ (_this$props$onMouseLe4 = (_this$props8 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe4 === void 0 || _this$props$onMouseLe4.call(_this$props8, id, e);
41
62
  };
42
63
  });
43
64
  return _this;
44
65
  }
45
- (0, _createClass2["default"])(BaseLegend, [{
66
+ (0, _inherits2["default"])(BaseLegend, _Component);
67
+ return (0, _createClass2["default"])(BaseLegend, [{
46
68
  key: "componentDidMount",
47
69
  value: function componentDidMount() {
48
70
  this.setHints();
@@ -62,7 +84,7 @@ var BaseLegend = /*#__PURE__*/function (_Component) {
62
84
  dataHints = _this$asProps.dataHints;
63
85
  var dataHintsHandler = dataHints ? (0, _hints.makeDataHintsHandlers)(dataHints) : undefined;
64
86
  items.forEach(function (legendItem) {
65
- dataHintsHandler === null || dataHintsHandler === void 0 ? void 0 : dataHintsHandler.labelKey('value', legendItem.id, legendItem.label);
87
+ dataHintsHandler === null || dataHintsHandler === void 0 || dataHintsHandler.labelKey('value', legendItem.id, legendItem.label);
66
88
  });
67
89
  }
68
90
  }, {
@@ -87,8 +109,10 @@ var BaseLegend = /*#__PURE__*/function (_Component) {
87
109
  return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, line), {}, {
88
110
  shape: shape,
89
111
  size: size,
112
+ onFocusLegendItem: this.onFocusLegendItem(line.checked),
113
+ onBlurLegendItem: this.onBlurLegendItem,
90
114
  onChangeLegendItem: this.onChangeLegendItem,
91
- onMouseEnter: this.bindOnMouseEnterItem(line.id),
115
+ onMouseEnter: line.checked ? this.bindOnMouseEnterItem(line.id) : undefined,
92
116
  onMouseLeave: this.bindOnMouseLeaveItem(line.id),
93
117
  style: {
94
118
  gridRowStart: "".concat(index + 1),
@@ -98,7 +122,5 @@ var BaseLegend = /*#__PURE__*/function (_Component) {
98
122
  });
99
123
  }
100
124
  }]);
101
- return BaseLegend;
102
125
  }(_core.Component);
103
- exports.BaseLegend = BaseLegend;
104
126
  //# sourceMappingURL=BaseLegend.js.map