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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (439) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/lib/cjs/AnimatedClipPath.js +28 -41
  3. package/lib/cjs/AnimatedClipPath.js.map +1 -1
  4. package/lib/cjs/Area.js +187 -223
  5. package/lib/cjs/Area.js.map +1 -1
  6. package/lib/cjs/Axis.js +248 -327
  7. package/lib/cjs/Axis.js.map +1 -1
  8. package/lib/cjs/Bar.js +162 -185
  9. package/lib/cjs/Bar.js.map +1 -1
  10. package/lib/cjs/Bubble.js +219 -248
  11. package/lib/cjs/Bubble.js.map +1 -1
  12. package/lib/cjs/CompactHorizontalBar.js +448 -482
  13. package/lib/cjs/CompactHorizontalBar.js.map +1 -1
  14. package/lib/cjs/Donut.js +349 -396
  15. package/lib/cjs/Donut.js.map +1 -1
  16. package/lib/cjs/Dots.js +67 -86
  17. package/lib/cjs/Dots.js.map +1 -1
  18. package/lib/cjs/GroupBar.js +78 -93
  19. package/lib/cjs/GroupBar.js.map +1 -1
  20. package/lib/cjs/HorizontalBar.js +149 -167
  21. package/lib/cjs/HorizontalBar.js.map +1 -1
  22. package/lib/cjs/Hover.js +178 -207
  23. package/lib/cjs/Hover.js.map +1 -1
  24. package/lib/cjs/Line.js +182 -222
  25. package/lib/cjs/Line.js.map +1 -1
  26. package/lib/cjs/Pattern.js +124 -126
  27. package/lib/cjs/Pattern.js.map +1 -1
  28. package/lib/cjs/Plot.js +100 -126
  29. package/lib/cjs/Plot.js.map +1 -1
  30. package/lib/cjs/Radar.js +576 -681
  31. package/lib/cjs/Radar.js.map +1 -1
  32. package/lib/cjs/RadialTree.js +518 -571
  33. package/lib/cjs/RadialTree.js.map +1 -1
  34. package/lib/cjs/Reference.js +147 -178
  35. package/lib/cjs/Reference.js.map +1 -1
  36. package/lib/cjs/ResponsiveContainer.js +64 -82
  37. package/lib/cjs/ResponsiveContainer.js.map +1 -1
  38. package/lib/cjs/ScatterPlot.js +169 -199
  39. package/lib/cjs/ScatterPlot.js.map +1 -1
  40. package/lib/cjs/StackBar.js +135 -177
  41. package/lib/cjs/StackBar.js.map +1 -1
  42. package/lib/cjs/StackedArea.js +60 -73
  43. package/lib/cjs/StackedArea.js.map +1 -1
  44. package/lib/cjs/Tooltip.js +193 -208
  45. package/lib/cjs/Tooltip.js.map +1 -1
  46. package/lib/cjs/Venn.js +182 -217
  47. package/lib/cjs/Venn.js.map +1 -1
  48. package/lib/cjs/a11y/DataAccessibilityTable.js +45 -83
  49. package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
  50. package/lib/cjs/a11y/PlotA11yModule.js +37 -97
  51. package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
  52. package/lib/cjs/a11y/PlotA11yView.js +97 -91
  53. package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
  54. package/lib/cjs/a11y/bezier.js +17 -23
  55. package/lib/cjs/a11y/bezier.js.map +1 -1
  56. package/lib/cjs/a11y/focus.js +16 -16
  57. package/lib/cjs/a11y/focus.js.map +1 -1
  58. package/lib/cjs/a11y/hints.js +72 -75
  59. package/lib/cjs/a11y/hints.js.map +1 -1
  60. package/lib/cjs/a11y/insights.js +354 -525
  61. package/lib/cjs/a11y/insights.js.map +1 -1
  62. package/lib/cjs/a11y/intl.js +5 -5
  63. package/lib/cjs/a11y/intl.js.map +1 -1
  64. package/lib/cjs/a11y/locale.js +12 -19
  65. package/lib/cjs/a11y/locale.js.map +1 -1
  66. package/lib/cjs/a11y/serialize.js +164 -203
  67. package/lib/cjs/a11y/serialize.js.map +1 -1
  68. package/lib/cjs/a11y/summarize.js +7 -6
  69. package/lib/cjs/a11y/summarize.js.map +1 -1
  70. package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js +16 -16
  71. package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
  72. package/lib/cjs/a11y/translations/module/de.json +2 -2
  73. package/lib/cjs/a11y/translations/module/en.json +2 -2
  74. package/lib/cjs/a11y/translations/module/es.json +2 -2
  75. package/lib/cjs/a11y/translations/module/fr.json +2 -2
  76. package/lib/cjs/a11y/translations/module/it.json +2 -2
  77. package/lib/cjs/a11y/translations/module/ja.json +2 -2
  78. package/lib/cjs/a11y/translations/module/ko.json +2 -2
  79. package/lib/cjs/a11y/translations/module/nl.json +2 -2
  80. package/lib/cjs/a11y/translations/module/pl.json +2 -2
  81. package/lib/cjs/a11y/translations/module/pt.json +2 -2
  82. package/lib/cjs/a11y/translations/module/sv.json +2 -2
  83. package/lib/cjs/a11y/translations/module/tr.json +2 -2
  84. package/lib/cjs/a11y/translations/module/vi.json +2 -2
  85. package/lib/cjs/a11y/translations/module/zh.json +2 -2
  86. package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js +16 -16
  87. package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
  88. package/lib/cjs/color.js +1 -1
  89. package/lib/cjs/color.js.map +1 -1
  90. package/lib/cjs/component/Chart/AbstractChart.js +421 -466
  91. package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
  92. package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
  93. package/lib/cjs/component/Chart/AreaChart.js +97 -115
  94. package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
  95. package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
  96. package/lib/cjs/component/Chart/BarChart.js +229 -216
  97. package/lib/cjs/component/Chart/BarChart.js.map +1 -1
  98. package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
  99. package/lib/cjs/component/Chart/BubbleChart.js +114 -136
  100. package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
  101. package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
  102. package/lib/cjs/component/Chart/CigaretteChart.js +280 -305
  103. package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
  104. package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +76 -108
  105. package/lib/cjs/component/Chart/CompactHorizontalBarChart.js.map +1 -1
  106. package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  107. package/lib/cjs/component/Chart/DonutChart.js +80 -95
  108. package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
  109. package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
  110. package/lib/cjs/component/Chart/HistogramChart.js +126 -148
  111. package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
  112. package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
  113. package/lib/cjs/component/Chart/LineChart.js +95 -113
  114. package/lib/cjs/component/Chart/LineChart.js.map +1 -1
  115. package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
  116. package/lib/cjs/component/Chart/RadarChart.js +84 -110
  117. package/lib/cjs/component/Chart/RadarChart.js.map +1 -1
  118. package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
  119. package/lib/cjs/component/Chart/ScatterPlotChart.js +119 -143
  120. package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
  121. package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
  122. package/lib/cjs/component/Chart/VennChart.js +103 -122
  123. package/lib/cjs/component/Chart/VennChart.js.map +1 -1
  124. package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
  125. package/lib/cjs/component/Chart/index.js +2 -2
  126. package/lib/cjs/component/Chart/index.js.map +1 -1
  127. package/lib/cjs/component/ChartLegend/BaseLegend.js +72 -105
  128. package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
  129. package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
  130. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +58 -70
  131. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  132. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
  133. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +208 -221
  134. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  135. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
  136. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  137. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +63 -73
  138. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  139. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  140. package/lib/cjs/component/ChartLegend/index.js +4 -4
  141. package/lib/cjs/component/ChartLegend/index.js.map +1 -1
  142. package/lib/cjs/component/Cigarette/Cigarette.js +115 -129
  143. package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
  144. package/lib/cjs/component/StackGroupBar/StackGroupBar.js +107 -137
  145. package/lib/cjs/component/StackGroupBar/StackGroupBar.js.map +1 -1
  146. package/lib/cjs/component/SvgElement.js +7 -7
  147. package/lib/cjs/component/SvgElement.js.map +1 -1
  148. package/lib/cjs/createElement.js +66 -65
  149. package/lib/cjs/createElement.js.map +1 -1
  150. package/lib/cjs/index.js +62 -62
  151. package/lib/cjs/style/axis.shadow.css +3 -0
  152. package/lib/cjs/style/plot.shadow.css +1 -3
  153. package/lib/cjs/style/plotA11yModule.shadow.css +10 -11
  154. package/lib/cjs/style/plotA11yView.shadow.css +13 -26
  155. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +15 -15
  156. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
  157. package/lib/cjs/types/Axis.d.js.map +1 -1
  158. package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
  159. package/lib/cjs/types/Hover.d.js.map +1 -1
  160. package/lib/cjs/types/Line.d.js.map +1 -1
  161. package/lib/cjs/types/Plot.d.js.map +1 -1
  162. package/lib/cjs/types/Radar.d.js.map +1 -1
  163. package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
  164. package/lib/cjs/types/Tooltip.d.js.map +1 -1
  165. package/lib/cjs/types/Venn.d.js.map +1 -1
  166. package/lib/cjs/types/index.d.js +80 -80
  167. package/lib/cjs/types/index.d.js.map +1 -1
  168. package/lib/cjs/utils.js +122 -145
  169. package/lib/cjs/utils.js.map +1 -1
  170. package/lib/es6/AnimatedClipPath.js +24 -37
  171. package/lib/es6/AnimatedClipPath.js.map +1 -1
  172. package/lib/es6/Area.js +179 -215
  173. package/lib/es6/Area.js.map +1 -1
  174. package/lib/es6/Axis.js +242 -321
  175. package/lib/es6/Axis.js.map +1 -1
  176. package/lib/es6/Bar.js +154 -177
  177. package/lib/es6/Bar.js.map +1 -1
  178. package/lib/es6/Bubble.js +206 -235
  179. package/lib/es6/Bubble.js.map +1 -1
  180. package/lib/es6/CompactHorizontalBar.js +433 -467
  181. package/lib/es6/CompactHorizontalBar.js.map +1 -1
  182. package/lib/es6/Donut.js +337 -384
  183. package/lib/es6/Donut.js.map +1 -1
  184. package/lib/es6/Dots.js +60 -79
  185. package/lib/es6/Dots.js.map +1 -1
  186. package/lib/es6/GroupBar.js +74 -89
  187. package/lib/es6/GroupBar.js.map +1 -1
  188. package/lib/es6/HorizontalBar.js +141 -159
  189. package/lib/es6/HorizontalBar.js.map +1 -1
  190. package/lib/es6/Hover.js +174 -203
  191. package/lib/es6/Hover.js.map +1 -1
  192. package/lib/es6/Line.js +173 -213
  193. package/lib/es6/Line.js.map +1 -1
  194. package/lib/es6/Pattern.js +68 -74
  195. package/lib/es6/Pattern.js.map +1 -1
  196. package/lib/es6/Plot.js +95 -121
  197. package/lib/es6/Plot.js.map +1 -1
  198. package/lib/es6/Radar.js +554 -659
  199. package/lib/es6/Radar.js.map +1 -1
  200. package/lib/es6/RadialTree.js +500 -553
  201. package/lib/es6/RadialTree.js.map +1 -1
  202. package/lib/es6/Reference.js +140 -171
  203. package/lib/es6/Reference.js.map +1 -1
  204. package/lib/es6/ResponsiveContainer.js +58 -76
  205. package/lib/es6/ResponsiveContainer.js.map +1 -1
  206. package/lib/es6/ScatterPlot.js +161 -191
  207. package/lib/es6/ScatterPlot.js.map +1 -1
  208. package/lib/es6/StackBar.js +130 -172
  209. package/lib/es6/StackBar.js.map +1 -1
  210. package/lib/es6/StackedArea.js +56 -69
  211. package/lib/es6/StackedArea.js.map +1 -1
  212. package/lib/es6/Tooltip.js +183 -198
  213. package/lib/es6/Tooltip.js.map +1 -1
  214. package/lib/es6/Venn.js +169 -204
  215. package/lib/es6/Venn.js.map +1 -1
  216. package/lib/es6/a11y/DataAccessibilityTable.js +41 -80
  217. package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
  218. package/lib/es6/a11y/PlotA11yModule.js +35 -95
  219. package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
  220. package/lib/es6/a11y/PlotA11yView.js +89 -84
  221. package/lib/es6/a11y/PlotA11yView.js.map +1 -1
  222. package/lib/es6/a11y/bezier.js +16 -23
  223. package/lib/es6/a11y/bezier.js.map +1 -1
  224. package/lib/es6/a11y/focus.js +15 -16
  225. package/lib/es6/a11y/focus.js.map +1 -1
  226. package/lib/es6/a11y/hints.js +67 -73
  227. package/lib/es6/a11y/hints.js.map +1 -1
  228. package/lib/es6/a11y/insights.js +353 -524
  229. package/lib/es6/a11y/insights.js.map +1 -1
  230. package/lib/es6/a11y/intl.js +4 -5
  231. package/lib/es6/a11y/intl.js.map +1 -1
  232. package/lib/es6/a11y/locale.js +11 -18
  233. package/lib/es6/a11y/locale.js.map +1 -1
  234. package/lib/es6/a11y/serialize.js +162 -203
  235. package/lib/es6/a11y/serialize.js.map +1 -1
  236. package/lib/es6/a11y/summarize.js +6 -6
  237. package/lib/es6/a11y/summarize.js.map +1 -1
  238. package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js +15 -15
  239. package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
  240. package/lib/es6/a11y/translations/module/de.json +2 -2
  241. package/lib/es6/a11y/translations/module/en.json +2 -2
  242. package/lib/es6/a11y/translations/module/es.json +2 -2
  243. package/lib/es6/a11y/translations/module/fr.json +2 -2
  244. package/lib/es6/a11y/translations/module/it.json +2 -2
  245. package/lib/es6/a11y/translations/module/ja.json +2 -2
  246. package/lib/es6/a11y/translations/module/ko.json +2 -2
  247. package/lib/es6/a11y/translations/module/nl.json +2 -2
  248. package/lib/es6/a11y/translations/module/pl.json +2 -2
  249. package/lib/es6/a11y/translations/module/pt.json +2 -2
  250. package/lib/es6/a11y/translations/module/sv.json +2 -2
  251. package/lib/es6/a11y/translations/module/tr.json +2 -2
  252. package/lib/es6/a11y/translations/module/vi.json +2 -2
  253. package/lib/es6/a11y/translations/module/zh.json +2 -2
  254. package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js +15 -15
  255. package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
  256. package/lib/es6/color.js +1 -1
  257. package/lib/es6/color.js.map +1 -1
  258. package/lib/es6/component/Chart/AbstractChart.js +416 -462
  259. package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
  260. package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
  261. package/lib/es6/component/Chart/AreaChart.js +92 -111
  262. package/lib/es6/component/Chart/AreaChart.js.map +1 -1
  263. package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
  264. package/lib/es6/component/Chart/BarChart.js +225 -213
  265. package/lib/es6/component/Chart/BarChart.js.map +1 -1
  266. package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
  267. package/lib/es6/component/Chart/BubbleChart.js +109 -132
  268. package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
  269. package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
  270. package/lib/es6/component/Chart/CigaretteChart.js +276 -301
  271. package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
  272. package/lib/es6/component/Chart/CompactHorizontalBarChart.js +70 -103
  273. package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -1
  274. package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  275. package/lib/es6/component/Chart/DonutChart.js +74 -90
  276. package/lib/es6/component/Chart/DonutChart.js.map +1 -1
  277. package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
  278. package/lib/es6/component/Chart/HistogramChart.js +121 -144
  279. package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
  280. package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
  281. package/lib/es6/component/Chart/LineChart.js +90 -109
  282. package/lib/es6/component/Chart/LineChart.js.map +1 -1
  283. package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
  284. package/lib/es6/component/Chart/RadarChart.js +80 -107
  285. package/lib/es6/component/Chart/RadarChart.js.map +1 -1
  286. package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
  287. package/lib/es6/component/Chart/ScatterPlotChart.js +113 -138
  288. package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
  289. package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
  290. package/lib/es6/component/Chart/VennChart.js +97 -117
  291. package/lib/es6/component/Chart/VennChart.js.map +1 -1
  292. package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
  293. package/lib/es6/component/ChartLegend/BaseLegend.js +70 -104
  294. package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
  295. package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
  296. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +53 -65
  297. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  298. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
  299. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +198 -211
  300. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  301. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
  302. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  303. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +58 -68
  304. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  305. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  306. package/lib/es6/component/Cigarette/Cigarette.js +108 -122
  307. package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
  308. package/lib/es6/component/StackGroupBar/StackGroupBar.js +100 -130
  309. package/lib/es6/component/StackGroupBar/StackGroupBar.js.map +1 -1
  310. package/lib/es6/component/SvgElement.js +4 -5
  311. package/lib/es6/component/SvgElement.js.map +1 -1
  312. package/lib/es6/createElement.js +55 -54
  313. package/lib/es6/createElement.js.map +1 -1
  314. package/lib/es6/style/axis.shadow.css +3 -0
  315. package/lib/es6/style/plot.shadow.css +1 -3
  316. package/lib/es6/style/plotA11yModule.shadow.css +10 -11
  317. package/lib/es6/style/plotA11yView.shadow.css +13 -26
  318. package/lib/es6/translations/__intergalactic-dynamic-locales.js +14 -14
  319. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
  320. package/lib/es6/types/Axis.d.js.map +1 -1
  321. package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
  322. package/lib/es6/types/Hover.d.js.map +1 -1
  323. package/lib/es6/types/Line.d.js.map +1 -1
  324. package/lib/es6/types/Plot.d.js.map +1 -1
  325. package/lib/es6/types/Radar.d.js.map +1 -1
  326. package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
  327. package/lib/es6/types/Tooltip.d.js.map +1 -1
  328. package/lib/es6/types/Venn.d.js.map +1 -1
  329. package/lib/es6/utils.js +105 -144
  330. package/lib/es6/utils.js.map +1 -1
  331. package/lib/esm/AnimatedClipPath.mjs +24 -36
  332. package/lib/esm/Area.mjs +178 -149
  333. package/lib/esm/Axis.mjs +241 -242
  334. package/lib/esm/Bar.mjs +155 -137
  335. package/lib/esm/Bubble.mjs +205 -171
  336. package/lib/esm/CompactHorizontalBar.mjs +428 -383
  337. package/lib/esm/Donut.mjs +315 -266
  338. package/lib/esm/Dots.mjs +60 -49
  339. package/lib/esm/GroupBar.mjs +71 -75
  340. package/lib/esm/HorizontalBar.mjs +142 -120
  341. package/lib/esm/Hover.mjs +173 -163
  342. package/lib/esm/Line.mjs +174 -145
  343. package/lib/esm/Pattern.mjs +67 -63
  344. package/lib/esm/Plot.mjs +98 -95
  345. package/lib/esm/Radar.mjs +550 -498
  346. package/lib/esm/RadialTree.mjs +512 -416
  347. package/lib/esm/Reference.mjs +137 -122
  348. package/lib/esm/ResponsiveContainer.mjs +58 -69
  349. package/lib/esm/ScatterPlot.mjs +163 -162
  350. package/lib/esm/StackBar.mjs +126 -147
  351. package/lib/esm/StackedArea.mjs +53 -61
  352. package/lib/esm/Tooltip.mjs +185 -175
  353. package/lib/esm/Venn.mjs +170 -170
  354. package/lib/esm/a11y/DataAccessibilityTable.mjs +46 -73
  355. package/lib/esm/a11y/PlotA11yModule.mjs +37 -80
  356. package/lib/esm/a11y/PlotA11yView.mjs +99 -74
  357. package/lib/esm/a11y/bezier.mjs +16 -23
  358. package/lib/esm/a11y/focus.mjs +15 -16
  359. package/lib/esm/a11y/hints.mjs +65 -71
  360. package/lib/esm/a11y/insights.mjs +347 -495
  361. package/lib/esm/a11y/intl.mjs +4 -5
  362. package/lib/esm/a11y/locale.mjs +12 -14
  363. package/lib/esm/a11y/serialize.mjs +139 -152
  364. package/lib/esm/a11y/summarize.mjs +3 -3
  365. package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +1 -1
  366. package/lib/esm/a11y/translations/module/de.json.mjs +2 -4
  367. package/lib/esm/a11y/translations/module/en.json.mjs +2 -4
  368. package/lib/esm/a11y/translations/module/es.json.mjs +2 -4
  369. package/lib/esm/a11y/translations/module/fr.json.mjs +2 -4
  370. package/lib/esm/a11y/translations/module/it.json.mjs +2 -4
  371. package/lib/esm/a11y/translations/module/ja.json.mjs +2 -4
  372. package/lib/esm/a11y/translations/module/ko.json.mjs +2 -4
  373. package/lib/esm/a11y/translations/module/nl.json.mjs +2 -4
  374. package/lib/esm/a11y/translations/module/pl.json.mjs +2 -4
  375. package/lib/esm/a11y/translations/module/pt.json.mjs +2 -4
  376. package/lib/esm/a11y/translations/module/sv.json.mjs +2 -4
  377. package/lib/esm/a11y/translations/module/tr.json.mjs +2 -4
  378. package/lib/esm/a11y/translations/module/vi.json.mjs +2 -4
  379. package/lib/esm/a11y/translations/module/zh.json.mjs +2 -4
  380. package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +1 -1
  381. package/lib/esm/color.mjs +1 -1
  382. package/lib/esm/component/Chart/AbstractChart.mjs +422 -415
  383. package/lib/esm/component/Chart/AreaChart.mjs +92 -91
  384. package/lib/esm/component/Chart/BarChart.mjs +225 -177
  385. package/lib/esm/component/Chart/BubbleChart.mjs +110 -118
  386. package/lib/esm/component/Chart/CigaretteChart.mjs +277 -268
  387. package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +70 -87
  388. package/lib/esm/component/Chart/DonutChart.mjs +74 -84
  389. package/lib/esm/component/Chart/HistogramChart.mjs +121 -117
  390. package/lib/esm/component/Chart/LineChart.mjs +90 -89
  391. package/lib/esm/component/Chart/RadarChart.mjs +81 -97
  392. package/lib/esm/component/Chart/ScatterPlotChart.mjs +113 -111
  393. package/lib/esm/component/Chart/VennChart.mjs +98 -111
  394. package/lib/esm/component/ChartLegend/BaseLegend.mjs +75 -97
  395. package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +54 -55
  396. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +194 -165
  397. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +1 -1
  398. package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +60 -58
  399. package/lib/esm/component/Cigarette/Cigarette.mjs +109 -99
  400. package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +97 -111
  401. package/lib/esm/component/SvgElement.mjs +4 -4
  402. package/lib/esm/createElement.mjs +54 -37
  403. package/lib/esm/style/axis.shadow.css +3 -0
  404. package/lib/esm/style/plot.shadow.css +1 -3
  405. package/lib/esm/style/plotA11yModule.shadow.css +10 -11
  406. package/lib/esm/style/plotA11yView.shadow.css +13 -26
  407. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
  408. package/lib/esm/utils.mjs +103 -138
  409. package/lib/types/Axis.d.ts +4 -0
  410. package/lib/types/CompactHorizontalBar.d.ts +1 -1
  411. package/lib/types/Hover.d.ts +1 -1
  412. package/lib/types/Line.d.ts +1 -1
  413. package/lib/types/Plot.d.ts +1 -1
  414. package/lib/types/Radar.d.ts +1 -1
  415. package/lib/types/ResponsiveContainer.d.ts +1 -1
  416. package/lib/types/Tooltip.d.ts +1 -3
  417. package/lib/types/Venn.d.ts +1 -1
  418. package/lib/types/a11y/PlotA11yModule.d.ts +4 -11
  419. package/lib/types/a11y/PlotA11yView.d.ts +12 -1
  420. package/lib/types/a11y/translations/module/__intergalactic-dynamic-locales.d.ts +14 -14
  421. package/lib/types/component/Chart/AbstractChart.d.ts +1 -1
  422. package/lib/types/component/Chart/AbstractChart.type.d.ts +1 -1
  423. package/lib/types/component/Chart/AreaChart.type.d.ts +1 -1
  424. package/lib/types/component/Chart/BarChart.type.d.ts +1 -1
  425. package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
  426. package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
  427. package/lib/types/component/Chart/DonutChart.type.d.ts +1 -1
  428. package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -1
  429. package/lib/types/component/Chart/LineChart.type.d.ts +1 -1
  430. package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
  431. package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
  432. package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
  433. package/lib/types/component/ChartLegend/BaseLegend.d.ts +1 -1
  434. package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -1
  435. package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +1 -1
  436. package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +1 -1
  437. package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +1 -1
  438. package/lib/types/utils.d.ts +10 -10
  439. package/package.json +11 -14
@@ -1 +1 @@
1
- {"version":3,"file":"LineChart.js","names":["createComponent","i18nEnhance","scaleLinear","scaleTime","React","Line","minMax","HoverLine","AbstractChart","localizedMessages","LineChartComponent","_AbstractChart","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","get","_this$asProps","asProps","xScale","_this$asProps$marginY","marginY","plotWidth","data","groupKey","testItem","range","plotPadding","domain","Date","Number","isNaN","getMilliseconds","_this$asProps2","yScale","_this$asProps2$margin","marginX","plotHeight","flatValues","_superPropGet","max","Math","apply","_toConsumableArray","min","value","renderChart","_this$asProps3","curve","showDots","area","areaCurve","onClickLine","_this$state","state","dataDefinitions","highlightedLine","map","item","index","checked","createElement","x","toString","y","id","color","transparent","onClick","Dots","display","Area","y0","y1","renderTooltip","_this","_this$asProps4","Tooltip","wMin","_ref","xIndex","dataItem","children","getTooltipChildren","getLegendAriaLabel","getI18nText","chartType","_defineProperty","LineChart"],"sources":["../../../../src/component/Chart/LineChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { type ScaleLinear, scaleLinear, scaleTime } from 'd3-scale';\nimport React from 'react';\n\nimport type { LineChartData, LineChartProps, LineChartType } from './LineChart.type';\n// @ts-ignore\nimport { Line, minMax, HoverLine } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass LineChartComponent extends AbstractChart<\n LineChartData,\n LineChartProps,\n typeof LineChartComponent.enhance\n> {\n static displayName = 'Chart.Line';\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected get xScale() {\n const { xScale, marginY = 30, plotWidth, data, groupKey } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\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, range);\n }\n\n return scaleLinear(domain, range);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 30, plotHeight } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const flatValues = super.flatValues;\n\n const max = Math.max(...flatValues);\n const min = Math.min(...flatValues);\n\n return scaleLinear()\n .range([plotHeight - marginX, this.plotPadding])\n .domain([min, max]);\n }\n\n protected renderChart() {\n const { groupKey, curve, showDots, area, areaCurve, onClickLine } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n return dataDefinitions.map((item, index) => {\n return (\n item.checked && (\n <Line\n x={groupKey.toString()}\n y={item.id}\n key={item.id}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n curve={curve}\n onClick={onClickLine}\n >\n {showDots && <Line.Dots display />}\n {area?.[item.id] && (\n <Line.Area area={area[item.id]} y0='y0' y1='y1' curve={areaCurve} />\n )}\n </Line>\n )\n );\n });\n }\n\n protected renderTooltip() {\n const { data, groupKey } = this.asProps;\n\n return (\n <HoverLine.Tooltip x={groupKey} wMin={100}>\n {({ xIndex }: any) => {\n const dataItem = data[xIndex];\n\n return {\n children: this.getTooltipChildren({\n Tooltip: HoverLine.Tooltip,\n dataItem,\n }),\n };\n }}\n </HoverLine.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Line' });\n }\n}\n\nexport const LineChart: LineChartType = createComponent(LineChartComponent);\n"],"mappings":";;;;;;;AAAA,SAASA,eAAe,QAAQ,eAAe;AAC/C,OAAOC,WAAW,MAAM,8CAA8C;AACtE,SAA2BC,WAAW,EAAEC,SAAS,QAAQ,UAAU;AACnE,OAAOC,KAAK,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C,MAAM,GAAAD,IAAA,CAANC,MAAM;QACR,IAAMC,QAAQ,GAAG1D,IAAI,CAACyD,MAAM,CAAC;QAE7B,OAAO;UACLE,QAAQ,EAAEP,KAAI,CAACQ,kBAAkB,CAAC;YAChCN,OAAO,EAAExE,SAAS,CAACwE,OAAO;YAC1BI,QAAQ,EAARA;UACF,CAAC;QACH,CAAC;MACH,CACiB,CAAC;IAExB;EAAC;IAAAlE,GAAA;IAAA8B,KAAA,EAED,SAAUuC,kBAAkBA,CAAA,EAAW;MACrC,OAAO,IAAI,CAAClE,OAAO,CAACmE,WAAW,CAAC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;MAAO,CAAC,CAAC;IAC1E;EAAC;AAAA,EA3F8BhF,aAAa;AAAAiF,eAAA,CAAxC/E,kBAAkB,iBAKD,YAAY;AAAA+E,eAAA,CAL7B/E,kBAAkB,aAOL,CAACT,WAAW,CAACQ,iBAAiB,CAAC,CAAC;AAuFnD,OAAO,IAAMiF,SAAwB,GAAG1F,eAAe,CAACU,kBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"LineChart.js","names":["createComponent","i18nEnhance","scaleLinear","scaleTime","React","Line","minMax","HoverLine","AbstractChart","localizedMessages","LineChartComponent","xScale","marginY","plotWidth","data","groupKey","asProps","testItem","range","plotPadding","domain","Date","Number","isNaN","getMilliseconds","yScale","marginX","plotHeight","flatValues","max","Math","min","renderChart","curve","showDots","area","areaCurve","onClickLine","dataDefinitions","highlightedLine","state","map","item","index","checked","createElement","x","toString","y","id","key","color","transparent","onClick","Dots","display","Area","y0","y1","renderTooltip","Tooltip","wMin","xIndex","dataItem","children","getTooltipChildren","getLegendAriaLabel","getI18nText","chartType","_defineProperty","LineChart"],"sources":["../../../../src/component/Chart/LineChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { type ScaleLinear, scaleLinear, scaleTime } from 'd3-scale';\nimport React from 'react';\n\nimport type { LineChartData, LineChartProps, LineChartType } from './LineChart.type';\n// @ts-ignore\nimport { Line, minMax, HoverLine } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass LineChartComponent extends AbstractChart<\n LineChartData,\n LineChartProps,\n typeof LineChartComponent.enhance\n> {\n static displayName = 'Chart.Line';\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected get xScale() {\n const { xScale, marginY = 30, plotWidth, data, groupKey } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\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, range);\n }\n\n return scaleLinear(domain, range);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 30, plotHeight } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const flatValues = super.flatValues;\n\n const max = Math.max(...flatValues);\n const min = Math.min(...flatValues);\n\n return scaleLinear()\n .range([plotHeight - marginX, this.plotPadding])\n .domain([min, max]);\n }\n\n protected renderChart() {\n const { groupKey, curve, showDots, area, areaCurve, onClickLine } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n return dataDefinitions.map((item, index) => {\n return (\n item.checked && (\n <Line\n x={groupKey.toString()}\n y={item.id}\n key={item.id}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n curve={curve}\n onClick={onClickLine}\n >\n {showDots && <Line.Dots display />}\n {area?.[item.id] && (\n <Line.Area area={area[item.id]} y0='y0' y1='y1' curve={areaCurve} />\n )}\n </Line>\n )\n );\n });\n }\n\n protected renderTooltip() {\n const { data, groupKey } = this.asProps;\n\n return (\n <HoverLine.Tooltip x={groupKey} wMin={100}>\n {({ xIndex }: any) => {\n const dataItem = data[xIndex];\n\n return {\n children: this.getTooltipChildren({\n Tooltip: HoverLine.Tooltip,\n dataItem,\n }),\n };\n }}\n </HoverLine.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Line' });\n }\n}\n\nexport const LineChart: LineChartType = createComponent(LineChartComponent);\n"],"mappings":";AAAA,SAASA,eAAe,QAAQ,eAAe;AAC/C,OAAOC,WAAW,MAAM,8CAA8C;AACtE,SAA2BC,WAAW,EAAEC,SAAS,QAAQ,UAAU;AACnE,OAAOC,KAAK,MAAM,OAAO;AAGzB;AACA,SAASC,IAAI,EAAEC,MAAM,EAAEC,SAAS,QAAQ,OAAO;AAC/C,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,iBAAiB,QAAQ,oDAAoD;AAEtF,MAAMC,kBAAkB,SAASF,aAAa,CAI5C;EAKA,IAAcG,MAAMA,CAAA,EAAG;IACrB,MAAM;MAAEA,MAAM;MAAEC,OAAO,GAAG,EAAE;MAAEC,SAAS;MAAEC,IAAI;MAAEC;IAAS,CAAC,GAAG,IAAI,CAACC,OAAO;IAExE,IAAIL,MAAM,EAAE;MACV,OAAOA,MAAM;IACf;IAEA,MAAMM,QAAQ,GAAGH,IAAI,CAAC,CAAC,CAAC,CAACC,QAAQ,CAAC;IAClC,MAAMG,KAAK,GAAG,CAACN,OAAO,EAAEC,SAAS,GAAG,IAAI,CAACM,WAAW,CAAC;IACrD,MAAMC,MAAM,GAAGd,MAAM,CAACQ,IAAI,EAAEC,QAAQ,CAAC;IAErC,IAAIE,QAAQ,YAAYI,IAAI,IAAI,CAACC,MAAM,CAACC,KAAK,CAACN,QAAQ,CAACO,eAAe,CAAC,CAAC,CAAC,EAAE;MACzE,OAAOrB,SAAS,CAACiB,MAAM,EAAEF,KAAK,CAAC;IACjC;IAEA,OAAOhB,WAAW,CAACkB,MAAM,EAAEF,KAAK,CAAC;EACnC;EAEA,IAAcO,MAAMA,CAAA,EAA0B;IAC5C,MAAM;MAAEA,MAAM;MAAEC,OAAO,GAAG,EAAE;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AGO,IAAI,CAACO,EAAE,CAAC,iBACd7C,KAAA,CAAAyC,aAAA,CAACxC,IAAI,CAACmD,IAAI;QAACrB,IAAI,EAAEA,IAAI,CAACO,IAAI,CAACO,EAAE,CAAE;QAACQ,EAAE,EAAC,IAAI;QAACC,EAAE,EAAC,IAAI;QAACzB,KAAK,EAAEG;MAAU,CAAE,CAEjE,CACP;IAEL,CAAC,CAAC;EACJ;EAEUuB,aAAaA,CAAA,EAAG;IACxB,MAAM;MAAE7C,IAAI;MAAEC;IAAS,CAAC,GAAG,IAAI,CAACC,OAAO;IAEvC,oBACEZ,KAAA,CAAAyC,aAAA,CAACtC,SAAS,CAACqD,OAAO;MAACd,CAAC,EAAE/B,QAAS;MAAC8C,IAAI,EAAE;IAAI,GACvC,CAAC;MAAEC;IAAY,CAAC,KAAK;MACpB,MAAMC,QAAQ,GAAGjD,IAAI,CAACgD,MAAM,CAAC;MAE7B,OAAO;QACLE,QAAQ,EAAE,IAAI,CAACC,kBAAkB,CAAC;UAChCL,OAAO,EAAErD,SAAS,CAACqD,OAAO;UAC1BG;QACF,CAAC;MACH,CAAC;IACH,CACiB,CAAC;EAExB;EAEUG,kBAAkBA,CAAA,EAAW;IACrC,OAAO,IAAI,CAAClD,OAAO,CAACmD,WAAW,CAAC,gBAAgB,EAAE;MAAEC,SAAS,EAAE;IAAO,CAAC,CAAC;EAC1E;AACF;AAACC,eAAA,CA5FK3D,kBAAkB,iBAKD,YAAY;AAAA2D,eAAA,CAL7B3D,kBAAkB,aAOL,CAACT,WAAW,CAACQ,iBAAiB,CAAC,CAAC;AAuFnD,OAAO,MAAM6D,SAAwB,GAAGtE,eAAe,CAACU,kBAAkB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"LineChart.type.js","names":[],"sources":["../../../../src/component/Chart/LineChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear, ScaleTime } from 'd3-scale';\nimport type { CurveFactory } from 'd3-shape';\n\nimport type { BaseChartProps } from './AbstractChart.type';\nimport type { interpolateValue } from '../../utils';\nimport type { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';\n\ntype AreaItem = {\n x: number;\n y0: number;\n y1: number;\n};\n\nexport type LineChartData = Array<Record<string, string | number | typeof interpolateValue | Date>>;\n\nexport type LineChartProps = BaseChartProps<LineChartData> & {\n /** Field name that groups the data points */\n groupKey: string;\n /** Optional area data for rendering filled areas under lines */\n area?: Record<LegendItemKey, AreaItem[]>;\n /** Custom x-axis scale */\n xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;\n /** Custom y-axis scale */\n yScale?: ScaleLinear<any, any>;\n /** Controls whether to display dots on the line chart */\n showDots?: boolean;\n /** D3 curve factory for line interpolation */\n curve?: CurveFactory;\n /** Curve factory specifically for area rendering */\n areaCurve?: CurveFactory;\n /** Callback triggered when a user clicks on a line */\n onClickLine?: (index: number, event: React.SyntheticEvent) => void;\n};\n\nexport type LineChartType = Intergalactic.Component<typeof Flex, LineChartProps>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"LineChart.type.js","names":[],"sources":["../../../../src/component/Chart/LineChart.type.ts"],"sourcesContent":["import type { Flex } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type { ScaleLinear, ScaleTime } from 'd3-scale';\nimport type { CurveFactory } from 'd3-shape';\n\nimport type { BaseChartProps } from './AbstractChart.type';\nimport type { interpolateValue } from '../../utils';\nimport type { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';\n\ntype AreaItem = {\n x: number;\n y0: number;\n y1: number;\n};\n\nexport type LineChartData = Array<Record<string, string | number | typeof interpolateValue | Date>>;\n\nexport type LineChartProps = BaseChartProps<LineChartData> & {\n /** Field name that groups the data points */\n groupKey: string;\n /** Optional area data for rendering filled areas under lines */\n area?: Record<LegendItemKey, AreaItem[]>;\n /** Custom x-axis scale */\n xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;\n /** Custom y-axis scale */\n yScale?: ScaleLinear<any, any>;\n /** Controls whether to display dots on the line chart */\n showDots?: boolean;\n /** D3 curve factory for line interpolation */\n curve?: CurveFactory;\n /** Curve factory specifically for area rendering */\n areaCurve?: CurveFactory;\n /** Callback triggered when a user clicks on a line */\n onClickLine?: (index: number, event: React.SyntheticEvent) => void;\n};\n\nexport type LineChartType = Intergalactic.Component<typeof Flex, LineChartProps>;\n"],"mappings":"","ignoreList":[]}
@@ -1,9 +1,3 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _callSuper from "@babel/runtime/helpers/callSuper";
5
- import _superPropGet from "@babel/runtime/helpers/superPropGet";
6
- import _inherits from "@babel/runtime/helpers/inherits";
7
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
2
  import { createComponent } from '@semcore/core';
9
3
  import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
@@ -13,109 +7,88 @@ import { AbstractChart } from './AbstractChart';
13
7
  // @ts-ignore
14
8
  import { Radar } from '../..';
15
9
  import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
16
- var RadarChartComponent = /*#__PURE__*/function (_AbstractChart) {
17
- function RadarChartComponent() {
18
- _classCallCheck(this, RadarChartComponent);
19
- return _callSuper(this, RadarChartComponent, arguments);
10
+ class RadarChartComponent extends AbstractChart {
11
+ renderChart() {
12
+ const {
13
+ groupKey,
14
+ showDots,
15
+ circle,
16
+ onClickRadar
17
+ } = this.asProps;
18
+ const {
19
+ dataDefinitions
20
+ } = this.state;
21
+ return /*#__PURE__*/React.createElement(Radar, {
22
+ onClick: onClickRadar,
23
+ scale: this.xScale,
24
+ type: circle ? 'circle' : undefined
25
+ }, /*#__PURE__*/React.createElement(Radar.Axis, {
26
+ dataKey: groupKey
27
+ }, /*#__PURE__*/React.createElement(Radar.Axis.Ticks, null), /*#__PURE__*/React.createElement(Radar.Axis.Labels, null)), this.renderRadarTooltip(), dataDefinitions.map(item => {
28
+ return item.checked && /*#__PURE__*/React.createElement(Radar.Polygon, {
29
+ dataKey: item.id,
30
+ key: item.id,
31
+ color: item.color
32
+ }, /*#__PURE__*/React.createElement(Radar.Polygon.Line, null), showDots && /*#__PURE__*/React.createElement(Radar.Polygon.Dots, null));
33
+ }));
20
34
  }
21
- _inherits(RadarChartComponent, _AbstractChart);
22
- return _createClass(RadarChartComponent, [{
23
- key: "renderChart",
24
- value: function renderChart() {
25
- var _this$asProps = this.asProps,
26
- groupKey = _this$asProps.groupKey,
27
- showDots = _this$asProps.showDots,
28
- circle = _this$asProps.circle,
29
- onClickRadar = _this$asProps.onClickRadar;
30
- var dataDefinitions = this.state.dataDefinitions;
31
- return /*#__PURE__*/React.createElement(Radar, {
32
- onClick: onClickRadar,
33
- scale: this.xScale,
34
- type: circle ? 'circle' : undefined
35
- }, /*#__PURE__*/React.createElement(Radar.Axis, {
36
- dataKey: groupKey
37
- }, /*#__PURE__*/React.createElement(Radar.Axis.Ticks, null), /*#__PURE__*/React.createElement(Radar.Axis.Labels, null)), this.renderRadarTooltip(), dataDefinitions.map(function (item) {
38
- return item.checked && /*#__PURE__*/React.createElement(Radar.Polygon, {
39
- dataKey: item.id,
40
- key: item.id,
41
- color: item.color
42
- }, /*#__PURE__*/React.createElement(Radar.Polygon.Line, null), showDots && /*#__PURE__*/React.createElement(Radar.Polygon.Dots, null));
43
- }));
44
- }
45
- }, {
46
- key: "renderRadarTooltip",
47
- value: function renderRadarTooltip() {
48
- var _this = this;
49
- var _this$asProps2 = this.asProps,
50
- data = _this$asProps2.data,
51
- groupKey = _this$asProps2.groupKey,
52
- showTooltip = _this$asProps2.showTooltip;
53
- var dataDefinitions = this.state.dataDefinitions;
54
- if (!showTooltip) {
55
- return null;
56
- }
57
- return /*#__PURE__*/React.createElement(Radar.Tooltip, {
58
- wMin: 100
59
- }, function (_ref) {
60
- var _data$groupKey;
61
- var index = _ref.index;
62
- return {
63
- children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Radar.Tooltip.Title, null, (_data$groupKey = data[groupKey]) === null || _data$groupKey === void 0 ? void 0 : _data$groupKey[index]), dataDefinitions.map(function (item) {
64
- var _data$item$id;
65
- var value = (_data$item$id = data[item.id]) === null || _data$item$id === void 0 ? void 0 : _data$item$id[index];
66
- return item.checked && /*#__PURE__*/React.createElement(Radar.Tooltip.Dot, {
67
- color: item.color,
68
- key: item.id
69
- }, _this.tooltipValueFormatter(value));
70
- }))
71
- };
72
- });
73
- }
74
-
75
- // By default, tooltip will render in Plot component.
76
- // In RadarChart, we need to render it in Radar component, so we use renderRadarTooltip method
77
- }, {
78
- key: "renderTooltip",
79
- value: function renderTooltip() {
35
+ renderRadarTooltip() {
36
+ const {
37
+ data,
38
+ groupKey,
39
+ showTooltip
40
+ } = this.asProps;
41
+ const {
42
+ dataDefinitions
43
+ } = this.state;
44
+ if (!showTooltip) {
80
45
  return null;
81
46
  }
82
- }, {
83
- key: "dataKeys",
84
- get: function get() {
85
- var _this$props = this.props,
86
- data = _this$props.data,
87
- groupKey = _this$props.groupKey;
88
- var legendKeys = Object.keys(data).filter(function (key) {
89
- return key !== groupKey;
90
- });
91
- return legendKeys;
92
- }
93
- }, {
94
- key: "xScale",
95
- get: function get() {
96
- var _this$asProps$scale;
97
- return (_this$asProps$scale = this.asProps.scale) !== null && _this$asProps$scale !== void 0 ? _this$asProps$scale : scaleLinear().domain(this.domain);
98
- }
99
- }, {
100
- key: "yScale",
101
- get: function get() {
102
- var _this$asProps$scale2;
103
- return (_this$asProps$scale2 = this.asProps.scale) !== null && _this$asProps$scale2 !== void 0 ? _this$asProps$scale2 : scaleLinear().domain(this.domain);
104
- }
105
- }, {
106
- key: "getLegendAriaLabel",
107
- value: function getLegendAriaLabel() {
108
- return this.asProps.getI18nText('legendForChart', {
109
- chartType: 'Radar'
110
- });
111
- }
112
- }, {
113
- key: "domain",
114
- get: function get() {
115
- return [Math.min.apply(Math, _toConsumableArray(_superPropGet(RadarChartComponent, "flatValues", this, 1))), Math.max.apply(Math, _toConsumableArray(_superPropGet(RadarChartComponent, "flatValues", this, 1)))];
116
- }
117
- }]);
118
- }(AbstractChart);
47
+ return /*#__PURE__*/React.createElement(Radar.Tooltip, {
48
+ wMin: 100
49
+ }, ({
50
+ index
51
+ }) => {
52
+ return {
53
+ children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Radar.Tooltip.Title, null, data[groupKey]?.[index]), dataDefinitions.map(item => {
54
+ const value = data[item.id]?.[index];
55
+ return item.checked && /*#__PURE__*/React.createElement(Radar.Tooltip.Dot, {
56
+ color: item.color,
57
+ key: item.id
58
+ }, this.tooltipValueFormatter(value));
59
+ }))
60
+ };
61
+ });
62
+ }
63
+
64
+ // By default, tooltip will render in Plot component.
65
+ // In RadarChart, we need to render it in Radar component, so we use renderRadarTooltip method
66
+ renderTooltip() {
67
+ return null;
68
+ }
69
+ get dataKeys() {
70
+ const {
71
+ data,
72
+ groupKey
73
+ } = this.props;
74
+ const legendKeys = Object.keys(data).filter(key => key !== groupKey);
75
+ return legendKeys;
76
+ }
77
+ get xScale() {
78
+ return this.asProps.scale ?? scaleLinear().domain(this.domain);
79
+ }
80
+ get yScale() {
81
+ return this.asProps.scale ?? scaleLinear().domain(this.domain);
82
+ }
83
+ getLegendAriaLabel() {
84
+ return this.asProps.getI18nText('legendForChart', {
85
+ chartType: 'Radar'
86
+ });
87
+ }
88
+ get domain() {
89
+ return [Math.min(...super.flatValues), Math.max(...super.flatValues)];
90
+ }
91
+ }
119
92
  _defineProperty(RadarChartComponent, "enhance", [i18nEnhance(localizedMessages)]);
120
- export var RadarChart = createComponent(RadarChartComponent);
93
+ export const RadarChart = createComponent(RadarChartComponent);
121
94
  //# sourceMappingURL=RadarChart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadarChart.js","names":["createComponent","i18nEnhance","scaleLinear","React","AbstractChart","Radar","localizedMessages","RadarChartComponent","_AbstractChart","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","renderChart","_this$asProps","asProps","groupKey","showDots","circle","onClickRadar","dataDefinitions","state","createElement","onClick","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","domain","_this$asProps$scale2","getLegendAriaLabel","getI18nText","chartType","Math","min","apply","_toConsumableArray","_superPropGet","max","_defineProperty","RadarChart"],"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, onClickRadar } = this.asProps;\n const { dataDefinitions } = this.state;\n\n return (\n <Radar onClick={onClickRadar} 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,SAASA,eAAe,QAAQ,eAAe;AAC/C,OAAOC,WAAW,MAAM,8CAA8C;AACtE,SAASC,WAAW,QAA0B,UAAU;AACxD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,aAAa,QAAQ,iBAAiB;AAE/C;AACA,SAASC,KAAK,QAAQ,OAAO;AAC7B,SAASC,iBAAiB,QAAQ,oDAAoD;AAAC,IAEjFC,mBAAmB,0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AAC;IAAAtD,GAAA;IAAAC,KAAA,EAED,SAAUuD,kBAAkBA,CAAA,EAAW;MACrC,OAAO,IAAI,CAACpD,OAAO,CAACqD,WAAW,CAAC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;MAAQ,CAAC,CAAC;IAC3E;EAAC;IAAA1D,GAAA;IAAA8C,GAAA,EAED,SAAAA,IAAA,EAAuC;MACrC,OAAO,CAACa,IAAI,CAACC,GAAG,CAAAC,KAAA,CAARF,IAAI,EAAAG,kBAAA,CAAAC,aAAA,CAAAtE,mBAAA,yBAAwB,CAAC,EAAEkE,IAAI,CAACK,GAAG,CAAAH,KAAA,CAARF,IAAI,EAAAG,kBAAA,CAAAC,aAAA,CAAAtE,mBAAA,yBAAwB,CAAC,CAAC;IACvE;EAAC;AAAA,EA/F+BH,aAAa;AAAA2E,eAAA,CAAzCxE,mBAAmB,aAKN,CAACN,WAAW,CAACK,iBAAiB,CAAC,CAAC;AA6FnD,OAAO,IAAM0E,UAA0B,GAAGhF,eAAe,CAACO,mBAAmB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"RadarChart.js","names":["createComponent","i18nEnhance","scaleLinear","React","AbstractChart","Radar","localizedMessages","RadarChartComponent","renderChart","groupKey","showDots","circle","onClickRadar","asProps","dataDefinitions","state","createElement","onClick","scale","xScale","type","undefined","Axis","dataKey","Ticks","Labels","renderRadarTooltip","map","item","checked","Polygon","id","key","color","Line","Dots","data","showTooltip","Tooltip","wMin","index","children","Fragment","Title","value","Dot","tooltipValueFormatter","renderTooltip","dataKeys","props","legendKeys","Object","keys","filter","domain","yScale","getLegendAriaLabel","getI18nText","chartType","Math","min","flatValues","max","_defineProperty","RadarChart"],"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, onClickRadar } = this.asProps;\n const { dataDefinitions } = this.state;\n\n return (\n <Radar onClick={onClickRadar} 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,SAASA,eAAe,QAAQ,eAAe;AAC/C,OAAOC,WAAW,MAAM,8CAA8C;AACtE,SAASC,WAAW,QAA0B,UAAU;AACxD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,aAAa,QAAQ,iBAAiB;AAE/C;AACA,SAASC,KAAK,QAAQ,OAAO;AAC7B,SAASC,iBAAiB,QAAQ,oDAAoD;AAEtF,MAAMC,mBAAmB,SAASH,aAAa,CAI7C;EAGUI,WAAWA,CAAA,EAAoB;IACvC,MAAM;MAAEC,QAAQ;MAAEC,QAAQ;MAAEC,MAAM;MAAEC;IAAa,CAAC,GAAG,IAAI,CAACC,OAAO;IACjE,MAAM;MAAEC;IAAgB,CAAC,GAAG,IAAI,CAACC,KAAK;IAEtC,oBACEZ,KAAA,CAAAa,aAAA,CAACX,KAAK;MAACY,OAAO,EAAEL,YAAa;MAACM,KAAK,EAAE,IAAI,CAACC,MAAO;MAACC,IAAI,EAAET,MAAM,GAAG,QAAQ,GAAGU;IAAU,gBACpFlB,KAAA,CAAAa,aAAA,CAACX,KAAK,CAACiB,IAAI;MAACC,OAAO,EAAEd;IAAS,gBAC5BN,KAAA,CAAAa,aAAA,CAACX,KAAK,CAACiB,IAAI,CAACE,KAAK,MAAE,CAAC,eACpBrB,KAAA,CAAAa,aAAA,CAACX,KAAK,CAACiB,IAAI,CAACG,MAAM,MAAE,CACV,CAAC,EACZ,IAAI,CAACC,kBAAkB,CAAC,CAAC,EACzBZ,eAAe,CAACa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,eAAe,CAACO,mBAAmB,CAAC","ignoreList":[]}
@@ -1 +1 @@
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 = Intergalactic.InternalTypings.EfficientOmit<\n BaseChartProps<RadarChartData>,\n 'showTotalInTooltip' | 'showPercentValueInTooltip'\n> & {\n groupKey: string;\n scale?: ScaleLinear<any, any>;\n xScale?: never;\n yScale?: never;\n showDots?: boolean;\n circle?: boolean;\n /** Callback triggered when a user clicks on a chart at a position corresponding to a category */\n onClickRadar?: (index: number, e: React.SyntheticEvent) => void;\n};\n\nexport type RadarChartType = Intergalactic.Component<typeof Flex, RadarChartProps>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"RadarChart.type.js","names":[],"sources":["../../../../src/component/Chart/RadarChart.type.ts"],"sourcesContent":["import type { Flex } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\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 = Intergalactic.InternalTypings.EfficientOmit<\n BaseChartProps<RadarChartData>,\n 'showTotalInTooltip' | 'showPercentValueInTooltip'\n> & {\n groupKey: string;\n scale?: ScaleLinear<any, any>;\n xScale?: never;\n yScale?: never;\n showDots?: boolean;\n circle?: boolean;\n /** Callback triggered when a user clicks on a chart at a position corresponding to a category */\n onClickRadar?: (index: number, e: React.SyntheticEvent) => void;\n};\n\nexport type RadarChartType = Intergalactic.Component<typeof Flex, RadarChartProps>;\n"],"mappings":"","ignoreList":[]}
@@ -1,9 +1,3 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/createClass";
5
- import _callSuper from "@babel/runtime/helpers/callSuper";
6
- import _inherits from "@babel/runtime/helpers/inherits";
7
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
2
  import { createComponent } from '@semcore/core';
9
3
  import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
@@ -15,144 +9,125 @@ import React from 'react';
15
9
  import { minMax, ScatterPlot, getScatterPlotRadius } from '../..';
16
10
  import { AbstractChart } from './AbstractChart';
17
11
  import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
18
- var ScatterPlotChartComponent = /*#__PURE__*/function (_AbstractChart) {
19
- function ScatterPlotChartComponent() {
20
- _classCallCheck(this, ScatterPlotChartComponent);
21
- return _callSuper(this, ScatterPlotChartComponent, arguments);
12
+ class ScatterPlotChartComponent extends AbstractChart {
13
+ get dataKeys() {
14
+ const {
15
+ data,
16
+ groupKey,
17
+ valueKey
18
+ } = this.props;
19
+ return Object.keys(data[0]).filter(key => key !== groupKey && key !== valueKey);
22
20
  }
23
- _inherits(ScatterPlotChartComponent, _AbstractChart);
24
- return _createClass(ScatterPlotChartComponent, [{
25
- key: "dataKeys",
26
- get: function get() {
27
- var _this$props = this.props,
28
- data = _this$props.data,
29
- groupKey = _this$props.groupKey,
30
- valueKey = _this$props.valueKey;
31
- return Object.keys(data[0]).filter(function (key) {
32
- return key !== groupKey && key !== valueKey;
33
- });
34
- }
35
- }, {
36
- key: "xScale",
37
- get: function get() {
38
- var _this$asProps = this.asProps,
39
- xScale = _this$asProps.xScale,
40
- _this$asProps$marginY = _this$asProps.marginY,
41
- marginY = _this$asProps$marginY === void 0 ? 30 : _this$asProps$marginY,
42
- plotWidth = _this$asProps.plotWidth,
43
- data = _this$asProps.data,
44
- groupKey = _this$asProps.groupKey,
45
- valueKey = _this$asProps.valueKey;
46
- if (xScale) {
47
- return xScale;
48
- }
49
- var radius = getScatterPlotRadius(valueKey) / this.getValueScale(_toConsumableArray(this.flatValues));
50
- var testItem = data[0][groupKey];
51
- var range = [marginY, plotWidth - this.plotPadding];
52
- var domain = minMax(data, groupKey);
53
- if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {
54
- return scaleTime([domain[0] - radius, domain[1] + radius], range);
55
- }
56
- return scaleLinear([domain[0] - radius, domain[1] + radius], range);
21
+ get xScale() {
22
+ const {
23
+ xScale,
24
+ marginY = 30,
25
+ plotWidth,
26
+ data,
27
+ groupKey,
28
+ valueKey
29
+ } = this.asProps;
30
+ if (xScale) {
31
+ return xScale;
57
32
  }
58
- }, {
59
- key: "yScale",
60
- get: function get() {
61
- var _this$asProps2 = this.asProps,
62
- yScale = _this$asProps2.yScale,
63
- _this$asProps2$margin = _this$asProps2.marginX,
64
- marginX = _this$asProps2$margin === void 0 ? 30 : _this$asProps2$margin,
65
- plotHeight = _this$asProps2.plotHeight,
66
- valueKey = _this$asProps2.valueKey;
67
- if (yScale) {
68
- return yScale;
69
- }
70
- var flatValues = this.flatValues;
71
- var radius = getScatterPlotRadius(valueKey) / this.getValueScale(_toConsumableArray(flatValues));
72
- var max = Math.max.apply(Math, _toConsumableArray(flatValues)) + radius;
73
- var min = Math.min.apply(Math, _toConsumableArray(flatValues)) - radius;
74
- return scaleLinear().range([plotHeight - marginX, this.plotPadding]).domain([min, max]);
33
+ const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...this.flatValues]);
34
+ const testItem = data[0][groupKey];
35
+ const range = [marginY, plotWidth - this.plotPadding];
36
+ const domain = minMax(data, groupKey);
37
+ if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {
38
+ return scaleTime([domain[0] - radius, domain[1] + radius], range);
75
39
  }
76
- }, {
77
- key: "flatValues",
78
- get: function get() {
79
- var _this$asProps3 = this.asProps,
80
- data = _this$asProps3.data,
81
- groupKey = _this$asProps3.groupKey,
82
- valueKey = _this$asProps3.valueKey;
83
- var flatValues = data.reduce(function (result, item) {
84
- Object.entries(item).forEach(function (_ref) {
85
- var _ref2 = _slicedToArray(_ref, 2),
86
- key = _ref2[0],
87
- value = _ref2[1];
88
- if (key !== groupKey && key !== valueKey && typeof value === 'number') {
89
- result.add(value);
90
- }
91
- });
92
- return result;
93
- }, new Set());
94
- return flatValues;
40
+ return scaleLinear([domain[0] - radius, domain[1] + radius], range);
41
+ }
42
+ get yScale() {
43
+ const {
44
+ yScale,
45
+ marginX = 30,
46
+ plotHeight,
47
+ valueKey
48
+ } = this.asProps;
49
+ if (yScale) {
50
+ return yScale;
95
51
  }
96
- }, {
97
- key: "renderChart",
98
- value: function renderChart() {
99
- var _this$asProps4 = this.asProps,
100
- groupKey = _this$asProps4.groupKey,
101
- valueKey = _this$asProps4.valueKey,
102
- onClickScatterItem = _this$asProps4.onClickScatterItem;
103
- var dataDefinitions = this.state.dataDefinitions;
104
- return dataDefinitions.map(function (item) {
105
- return item.checked && /*#__PURE__*/React.createElement(ScatterPlot, {
106
- onClick: onClickScatterItem,
107
- x: groupKey,
108
- y: item.id,
109
- key: item.id,
110
- color: item.color,
111
- value: valueKey
112
- });
52
+ const flatValues = this.flatValues;
53
+ const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...flatValues]);
54
+ const max = Math.max(...flatValues) + radius;
55
+ const min = Math.min(...flatValues) - radius;
56
+ return scaleLinear().range([plotHeight - marginX, this.plotPadding]).domain([min, max]);
57
+ }
58
+ get flatValues() {
59
+ const {
60
+ data,
61
+ groupKey,
62
+ valueKey
63
+ } = this.asProps;
64
+ const flatValues = data.reduce((result, item) => {
65
+ Object.entries(item).forEach(([key, value]) => {
66
+ if (key !== groupKey && key !== valueKey && typeof value === 'number') {
67
+ result.add(value);
68
+ }
113
69
  });
114
- }
115
- }, {
116
- key: "renderTooltip",
117
- value: function renderTooltip() {
118
- var _this = this;
119
- var _this$asProps5 = this.asProps,
120
- data = _this$asProps5.data,
121
- groupKey = _this$asProps5.groupKey;
122
- var dataDefinitions = this.state.dataDefinitions;
123
- return dataDefinitions.filter(function (item) {
124
- return item.checked;
125
- }).map(function (item) {
126
- return /*#__PURE__*/React.createElement(ScatterPlot.Tooltip, {
127
- key: item.id,
128
- x: groupKey,
129
- y: item.id,
130
- wMin: 100
131
- }, function (_ref3) {
132
- var index = _ref3.index,
133
- x = _ref3.x,
134
- y = _ref3.y;
135
- return {
136
- children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ScatterPlot.Tooltip.Dot, {
137
- color: item.color
138
- }, "Data"), /*#__PURE__*/React.createElement(Text, {
139
- tag: "div"
140
- }, "X axis", _this.tooltipValueFormatter(data[index][x])), /*#__PURE__*/React.createElement(Text, {
141
- tag: "div"
142
- }, "Y axis", _this.tooltipValueFormatter(data[index][y])))
143
- };
144
- });
70
+ return result;
71
+ }, new Set());
72
+ return flatValues;
73
+ }
74
+ renderChart() {
75
+ const {
76
+ groupKey,
77
+ valueKey,
78
+ onClickScatterItem
79
+ } = this.asProps;
80
+ const {
81
+ dataDefinitions
82
+ } = this.state;
83
+ return dataDefinitions.map(item => {
84
+ return item.checked && /*#__PURE__*/React.createElement(ScatterPlot, {
85
+ onClick: onClickScatterItem,
86
+ x: groupKey,
87
+ y: item.id,
88
+ key: item.id,
89
+ color: item.color,
90
+ value: valueKey
145
91
  });
146
- }
147
- }, {
148
- key: "getLegendAriaLabel",
149
- value: function getLegendAriaLabel() {
150
- return this.asProps.getI18nText('legendForChart', {
151
- chartType: 'ScatterPlot'
92
+ });
93
+ }
94
+ renderTooltip() {
95
+ const {
96
+ data,
97
+ groupKey
98
+ } = this.asProps;
99
+ const {
100
+ dataDefinitions
101
+ } = this.state;
102
+ return dataDefinitions.filter(item => item.checked).map(item => {
103
+ return /*#__PURE__*/React.createElement(ScatterPlot.Tooltip, {
104
+ key: item.id,
105
+ x: groupKey,
106
+ y: item.id,
107
+ wMin: 100
108
+ }, ({
109
+ index,
110
+ x,
111
+ y
112
+ }) => {
113
+ return {
114
+ children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ScatterPlot.Tooltip.Dot, {
115
+ color: item.color
116
+ }, "Data"), /*#__PURE__*/React.createElement(Text, {
117
+ tag: "div"
118
+ }, "X axis", this.tooltipValueFormatter(data[index][x])), /*#__PURE__*/React.createElement(Text, {
119
+ tag: "div"
120
+ }, "Y axis", this.tooltipValueFormatter(data[index][y])))
121
+ };
152
122
  });
153
- }
154
- }]);
155
- }(AbstractChart);
123
+ });
124
+ }
125
+ getLegendAriaLabel() {
126
+ return this.asProps.getI18nText('legendForChart', {
127
+ chartType: 'ScatterPlot'
128
+ });
129
+ }
130
+ }
156
131
  _defineProperty(ScatterPlotChartComponent, "displayName", 'Chart.ScatterPlot');
157
132
  _defineProperty(ScatterPlotChartComponent, "defaultProps", {
158
133
  direction: 'column',
@@ -162,5 +137,5 @@ _defineProperty(ScatterPlotChartComponent, "defaultProps", {
162
137
  showLegend: false
163
138
  });
164
139
  _defineProperty(ScatterPlotChartComponent, "enhance", [i18nEnhance(localizedMessages)]);
165
- export var ScatterPlotChart = createComponent(ScatterPlotChartComponent);
140
+ export const ScatterPlotChart = createComponent(ScatterPlotChartComponent);
166
141
  //# sourceMappingURL=ScatterPlotChart.js.map