@semcore/d3-chart 18.1.0 → 18.2.0-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 (292) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/lib/cjs/Area.js +12 -12
  3. package/lib/cjs/Axis.js +15 -15
  4. package/lib/cjs/Bar.js +206 -21
  5. package/lib/cjs/Bar.js.map +1 -1
  6. package/lib/cjs/Bubble.js +85 -38
  7. package/lib/cjs/Bubble.js.map +1 -1
  8. package/lib/cjs/CompactHorizontalBar.js +16 -16
  9. package/lib/cjs/Donut.js +65 -152
  10. package/lib/cjs/Donut.js.map +1 -1
  11. package/lib/cjs/Dots.js +13 -13
  12. package/lib/cjs/Dots.js.map +1 -1
  13. package/lib/cjs/HorizontalBar.js +32 -25
  14. package/lib/cjs/HorizontalBar.js.map +1 -1
  15. package/lib/cjs/Hover.js +64 -153
  16. package/lib/cjs/Hover.js.map +1 -1
  17. package/lib/cjs/Line.js +9 -9
  18. package/lib/cjs/Pattern.js +267 -273
  19. package/lib/cjs/Pattern.js.map +1 -1
  20. package/lib/cjs/Plot.js +4 -4
  21. package/lib/cjs/Plot.js.map +1 -1
  22. package/lib/cjs/Radar.js +19 -19
  23. package/lib/cjs/RadialTree.js +12 -12
  24. package/lib/cjs/Reference.js +31 -29
  25. package/lib/cjs/Reference.js.map +1 -1
  26. package/lib/cjs/ScatterPlot.js +9 -9
  27. package/lib/cjs/StackBar.js +7 -2
  28. package/lib/cjs/StackBar.js.map +1 -1
  29. package/lib/cjs/Tooltip.js +14 -13
  30. package/lib/cjs/Tooltip.js.map +1 -1
  31. package/lib/cjs/Venn.js +9 -9
  32. package/lib/cjs/a11y/DataAccessibilityTable.js +1 -1
  33. package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
  34. package/lib/cjs/a11y/PlotA11yModule.js +2 -2
  35. package/lib/cjs/a11y/PlotA11yView.js +2 -2
  36. package/lib/cjs/component/Chart/AbstractChart.js +28 -21
  37. package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
  38. package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
  39. package/lib/cjs/component/Chart/BarChart.js +51 -0
  40. package/lib/cjs/component/Chart/BarChart.js.map +1 -1
  41. package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
  42. package/lib/cjs/component/Chart/BubbleChart.js +104 -20
  43. package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
  44. package/lib/cjs/component/Chart/DonutChart.js +27 -3
  45. package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
  46. package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
  47. package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
  48. package/lib/cjs/component/Chart/ScoreBar/ScoreBarChart.js +165 -0
  49. package/lib/cjs/component/Chart/ScoreBar/ScoreBarChart.js.map +1 -0
  50. package/lib/cjs/component/Chart/ScoreBar/ScoreBarChart.type.js +2 -0
  51. package/lib/cjs/component/Chart/ScoreBar/ScoreBarChart.type.js.map +1 -0
  52. package/lib/cjs/component/Chart/ScoreBar/ScoreBarItem.js +147 -0
  53. package/lib/cjs/component/Chart/ScoreBar/ScoreBarItem.js.map +1 -0
  54. package/lib/cjs/component/Chart/ScoreBar/ScoreBarItem.type.js +2 -0
  55. package/lib/cjs/component/Chart/ScoreBar/ScoreBarItem.type.js.map +1 -0
  56. package/lib/cjs/component/Chart/ScoreBar/scoreBarChart.shadow.css +130 -0
  57. package/lib/cjs/component/Chart/ScoreDonutChart.js +196 -0
  58. package/lib/cjs/component/Chart/ScoreDonutChart.js.map +1 -0
  59. package/lib/cjs/component/Chart/ScoreDonutChart.type.js +2 -0
  60. package/lib/cjs/component/Chart/ScoreDonutChart.type.js.map +1 -0
  61. package/lib/cjs/component/Chart/index.js +8 -1
  62. package/lib/cjs/component/Chart/index.js.map +1 -1
  63. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +7 -7
  64. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +18 -21
  65. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  66. package/lib/cjs/component/ChartLegend/LegendItem/legend-item.shadow.css +7 -4
  67. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +11 -11
  68. package/lib/cjs/component/Hover/HoverLine.js +144 -0
  69. package/lib/cjs/component/Hover/HoverLine.js.map +1 -0
  70. package/lib/cjs/component/Hover/HoverLine.type.js +2 -0
  71. package/lib/cjs/component/Hover/HoverLine.type.js.map +1 -0
  72. package/lib/cjs/component/Hover/HoveredTick.js +77 -0
  73. package/lib/cjs/component/Hover/HoveredTick.js.map +1 -0
  74. package/lib/cjs/component/Hover/hover.shadow.css +4 -0
  75. package/lib/cjs/component/Hover/hoveredTick.shadow.css +34 -0
  76. package/lib/cjs/style/area.shadow.css +5 -4
  77. package/lib/cjs/style/bar.shadow.css +1 -1
  78. package/lib/cjs/style/bubble.shadow.css +29 -24
  79. package/lib/cjs/style/donut.shadow.css +7 -9
  80. package/lib/cjs/style/dot.shadow.css +1 -1
  81. package/lib/cjs/style/hover.shadow.css +0 -40
  82. package/lib/cjs/style/line.shadow.css +1 -1
  83. package/lib/cjs/style/radar.shadow.css +2 -2
  84. package/lib/cjs/style/radial-tree.shadow.css +4 -4
  85. package/lib/cjs/style/scatterplot.shadow.css +2 -2
  86. package/lib/cjs/style/venn.shadow.css +3 -3
  87. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +2 -0
  88. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
  89. package/lib/cjs/types/Bar.d.js.map +1 -1
  90. package/lib/cjs/types/Bubble.d.js.map +1 -1
  91. package/lib/cjs/types/Donut.d.js.map +1 -1
  92. package/lib/cjs/types/HorizontalBar.d.js.map +1 -1
  93. package/lib/cjs/types/Plot.d.js.map +1 -1
  94. package/lib/cjs/types/index.d.js +24 -0
  95. package/lib/cjs/types/index.d.js.map +1 -1
  96. package/lib/cjs/utils.js +78 -30
  97. package/lib/cjs/utils.js.map +1 -1
  98. package/lib/es6/Area.js +12 -12
  99. package/lib/es6/Axis.js +15 -15
  100. package/lib/es6/Bar.js +207 -22
  101. package/lib/es6/Bar.js.map +1 -1
  102. package/lib/es6/Bubble.js +86 -39
  103. package/lib/es6/Bubble.js.map +1 -1
  104. package/lib/es6/CompactHorizontalBar.js +16 -16
  105. package/lib/es6/Donut.js +65 -152
  106. package/lib/es6/Donut.js.map +1 -1
  107. package/lib/es6/Dots.js +13 -13
  108. package/lib/es6/Dots.js.map +1 -1
  109. package/lib/es6/HorizontalBar.js +32 -25
  110. package/lib/es6/HorizontalBar.js.map +1 -1
  111. package/lib/es6/Hover.js +64 -153
  112. package/lib/es6/Hover.js.map +1 -1
  113. package/lib/es6/Line.js +9 -9
  114. package/lib/es6/Pattern.js +266 -272
  115. package/lib/es6/Pattern.js.map +1 -1
  116. package/lib/es6/Plot.js +4 -4
  117. package/lib/es6/Plot.js.map +1 -1
  118. package/lib/es6/Radar.js +19 -19
  119. package/lib/es6/RadialTree.js +12 -12
  120. package/lib/es6/Reference.js +31 -29
  121. package/lib/es6/Reference.js.map +1 -1
  122. package/lib/es6/ScatterPlot.js +9 -9
  123. package/lib/es6/StackBar.js +7 -2
  124. package/lib/es6/StackBar.js.map +1 -1
  125. package/lib/es6/Tooltip.js +14 -13
  126. package/lib/es6/Tooltip.js.map +1 -1
  127. package/lib/es6/Venn.js +9 -9
  128. package/lib/es6/a11y/DataAccessibilityTable.js +1 -1
  129. package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
  130. package/lib/es6/a11y/PlotA11yModule.js +2 -2
  131. package/lib/es6/a11y/PlotA11yView.js +2 -2
  132. package/lib/es6/component/Chart/AbstractChart.js +29 -22
  133. package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
  134. package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
  135. package/lib/es6/component/Chart/BarChart.js +51 -1
  136. package/lib/es6/component/Chart/BarChart.js.map +1 -1
  137. package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
  138. package/lib/es6/component/Chart/BubbleChart.js +105 -21
  139. package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
  140. package/lib/es6/component/Chart/DonutChart.js +27 -3
  141. package/lib/es6/component/Chart/DonutChart.js.map +1 -1
  142. package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
  143. package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
  144. package/lib/es6/component/Chart/ScoreBar/ScoreBarChart.js +161 -0
  145. package/lib/es6/component/Chart/ScoreBar/ScoreBarChart.js.map +1 -0
  146. package/lib/es6/component/Chart/ScoreBar/ScoreBarChart.type.js +2 -0
  147. package/lib/es6/component/Chart/ScoreBar/ScoreBarChart.type.js.map +1 -0
  148. package/lib/es6/component/Chart/ScoreBar/ScoreBarItem.js +141 -0
  149. package/lib/es6/component/Chart/ScoreBar/ScoreBarItem.js.map +1 -0
  150. package/lib/es6/component/Chart/ScoreBar/ScoreBarItem.type.js +2 -0
  151. package/lib/es6/component/Chart/ScoreBar/ScoreBarItem.type.js.map +1 -0
  152. package/lib/es6/component/Chart/ScoreBar/scoreBarChart.shadow.css +130 -0
  153. package/lib/es6/component/Chart/ScoreDonutChart.js +189 -0
  154. package/lib/es6/component/Chart/ScoreDonutChart.js.map +1 -0
  155. package/lib/es6/component/Chart/ScoreDonutChart.type.js +2 -0
  156. package/lib/es6/component/Chart/ScoreDonutChart.type.js.map +1 -0
  157. package/lib/es6/component/Chart/index.js +8 -1
  158. package/lib/es6/component/Chart/index.js.map +1 -1
  159. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +7 -7
  160. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +24 -26
  161. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  162. package/lib/es6/component/ChartLegend/LegendItem/legend-item.shadow.css +7 -4
  163. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +11 -11
  164. package/lib/es6/component/Hover/HoverLine.js +138 -0
  165. package/lib/es6/component/Hover/HoverLine.js.map +1 -0
  166. package/lib/es6/component/Hover/HoverLine.type.js +2 -0
  167. package/lib/es6/component/Hover/HoverLine.type.js.map +1 -0
  168. package/lib/es6/component/Hover/HoveredTick.js +71 -0
  169. package/lib/es6/component/Hover/HoveredTick.js.map +1 -0
  170. package/lib/es6/component/Hover/hover.shadow.css +4 -0
  171. package/lib/es6/component/Hover/hoveredTick.shadow.css +34 -0
  172. package/lib/es6/style/area.shadow.css +5 -4
  173. package/lib/es6/style/bar.shadow.css +1 -1
  174. package/lib/es6/style/bubble.shadow.css +29 -24
  175. package/lib/es6/style/donut.shadow.css +7 -9
  176. package/lib/es6/style/dot.shadow.css +1 -1
  177. package/lib/es6/style/hover.shadow.css +0 -40
  178. package/lib/es6/style/line.shadow.css +1 -1
  179. package/lib/es6/style/radar.shadow.css +2 -2
  180. package/lib/es6/style/radial-tree.shadow.css +4 -4
  181. package/lib/es6/style/scatterplot.shadow.css +2 -2
  182. package/lib/es6/style/venn.shadow.css +3 -3
  183. package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -0
  184. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
  185. package/lib/es6/types/Bar.d.js.map +1 -1
  186. package/lib/es6/types/Bubble.d.js.map +1 -1
  187. package/lib/es6/types/Donut.d.js.map +1 -1
  188. package/lib/es6/types/HorizontalBar.d.js.map +1 -1
  189. package/lib/es6/types/Plot.d.js.map +1 -1
  190. package/lib/es6/types/index.d.js +2 -0
  191. package/lib/es6/types/index.d.js.map +1 -1
  192. package/lib/es6/utils.js +71 -28
  193. package/lib/es6/utils.js.map +1 -1
  194. package/lib/esm/Area.mjs +13 -13
  195. package/lib/esm/Axis.mjs +16 -16
  196. package/lib/esm/Bar.mjs +205 -22
  197. package/lib/esm/Bubble.mjs +87 -40
  198. package/lib/esm/CompactHorizontalBar.mjs +17 -17
  199. package/lib/esm/Donut.mjs +66 -151
  200. package/lib/esm/Dots.mjs +14 -14
  201. package/lib/esm/HorizontalBar.mjs +33 -26
  202. package/lib/esm/Hover.mjs +65 -154
  203. package/lib/esm/Line.mjs +10 -10
  204. package/lib/esm/Pattern.mjs +268 -273
  205. package/lib/esm/Plot.mjs +5 -5
  206. package/lib/esm/Radar.mjs +20 -20
  207. package/lib/esm/RadialTree.mjs +13 -13
  208. package/lib/esm/Reference.mjs +33 -30
  209. package/lib/esm/ScatterPlot.mjs +10 -10
  210. package/lib/esm/StackBar.mjs +7 -2
  211. package/lib/esm/Tooltip.mjs +15 -14
  212. package/lib/esm/Venn.mjs +10 -10
  213. package/lib/esm/a11y/DataAccessibilityTable.mjs +1 -1
  214. package/lib/esm/a11y/PlotA11yModule.mjs +3 -3
  215. package/lib/esm/a11y/PlotA11yView.mjs +3 -3
  216. package/lib/esm/component/Chart/AbstractChart.mjs +30 -23
  217. package/lib/esm/component/Chart/BarChart.mjs +49 -0
  218. package/lib/esm/component/Chart/BubbleChart.mjs +104 -20
  219. package/lib/esm/component/Chart/DonutChart.mjs +27 -3
  220. package/lib/esm/component/Chart/ScoreBar/ScoreBarChart.mjs +160 -0
  221. package/lib/esm/component/Chart/ScoreBar/ScoreBarItem.mjs +149 -0
  222. package/lib/esm/component/Chart/ScoreBar/scoreBarChart.shadow.css +130 -0
  223. package/lib/esm/component/Chart/ScoreDonutChart.mjs +186 -0
  224. package/lib/esm/component/Chart/index.mjs +8 -1
  225. package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +8 -8
  226. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +19 -22
  227. package/lib/esm/component/ChartLegend/LegendItem/legend-item.shadow.css +7 -4
  228. package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +12 -12
  229. package/lib/esm/component/Hover/HoverLine.mjs +146 -0
  230. package/lib/esm/component/Hover/HoveredTick.mjs +79 -0
  231. package/lib/esm/component/Hover/hover.shadow.css +4 -0
  232. package/lib/esm/component/Hover/hoveredTick.shadow.css +34 -0
  233. package/lib/esm/style/area.shadow.css +5 -4
  234. package/lib/esm/style/bar.shadow.css +1 -1
  235. package/lib/esm/style/bubble.shadow.css +29 -24
  236. package/lib/esm/style/donut.shadow.css +7 -9
  237. package/lib/esm/style/dot.shadow.css +1 -1
  238. package/lib/esm/style/hover.shadow.css +0 -40
  239. package/lib/esm/style/line.shadow.css +1 -1
  240. package/lib/esm/style/radar.shadow.css +2 -2
  241. package/lib/esm/style/radial-tree.shadow.css +4 -4
  242. package/lib/esm/style/scatterplot.shadow.css +2 -2
  243. package/lib/esm/style/venn.shadow.css +3 -3
  244. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -0
  245. package/lib/esm/translations/de.json.mjs +12 -0
  246. package/lib/esm/utils.mjs +75 -28
  247. package/lib/types/Bar.d.ts +3 -0
  248. package/lib/types/Bubble.d.ts +4 -1
  249. package/lib/types/Donut.d.ts +0 -4
  250. package/lib/types/HorizontalBar.d.ts +3 -0
  251. package/lib/types/Pattern.d.ts +10 -8
  252. package/lib/types/Pattern.d.ts.map +1 -1
  253. package/lib/types/Plot.d.ts +6 -1
  254. package/lib/types/component/Chart/AbstractChart.d.ts +15 -1
  255. package/lib/types/component/Chart/AbstractChart.d.ts.map +1 -1
  256. package/lib/types/component/Chart/AbstractChart.type.d.ts +28 -0
  257. package/lib/types/component/Chart/AbstractChart.type.d.ts.map +1 -1
  258. package/lib/types/component/Chart/BarChart.d.ts.map +1 -1
  259. package/lib/types/component/Chart/BarChart.type.d.ts +9 -1
  260. package/lib/types/component/Chart/BarChart.type.d.ts.map +1 -1
  261. package/lib/types/component/Chart/BubbleChart.d.ts.map +1 -1
  262. package/lib/types/component/Chart/DonutChart.d.ts.map +1 -1
  263. package/lib/types/component/Chart/DonutChart.type.d.ts +5 -2
  264. package/lib/types/component/Chart/DonutChart.type.d.ts.map +1 -1
  265. package/lib/types/component/Chart/LineChart.type.d.ts +2 -30
  266. package/lib/types/component/Chart/LineChart.type.d.ts.map +1 -1
  267. package/lib/types/component/Chart/ScoreBar/ScoreBarChart.d.ts +8 -0
  268. package/lib/types/component/Chart/ScoreBar/ScoreBarChart.d.ts.map +1 -0
  269. package/lib/types/component/Chart/ScoreBar/ScoreBarChart.type.d.ts +80 -0
  270. package/lib/types/component/Chart/ScoreBar/ScoreBarChart.type.d.ts.map +1 -0
  271. package/lib/types/component/Chart/ScoreBar/ScoreBarItem.d.ts +3 -0
  272. package/lib/types/component/Chart/ScoreBar/ScoreBarItem.d.ts.map +1 -0
  273. package/lib/types/component/Chart/ScoreBar/ScoreBarItem.type.d.ts +20 -0
  274. package/lib/types/component/Chart/ScoreBar/ScoreBarItem.type.d.ts.map +1 -0
  275. package/lib/types/component/Chart/ScoreDonutChart.d.ts +8 -0
  276. package/lib/types/component/Chart/ScoreDonutChart.d.ts.map +1 -0
  277. package/lib/types/component/Chart/ScoreDonutChart.type.d.ts +40 -0
  278. package/lib/types/component/Chart/ScoreDonutChart.type.d.ts.map +1 -0
  279. package/lib/types/component/Chart/index.d.ts +5 -0
  280. package/lib/types/component/Chart/index.d.ts.map +1 -1
  281. package/lib/types/component/Hover/HoverLine.d.ts +2 -0
  282. package/lib/types/component/Hover/HoverLine.d.ts.map +1 -0
  283. package/lib/types/component/Hover/HoverLine.type.d.ts +17 -0
  284. package/lib/types/component/Hover/HoverLine.type.d.ts.map +1 -0
  285. package/lib/types/component/Hover/HoveredTick.d.ts +21 -0
  286. package/lib/types/component/Hover/HoveredTick.d.ts.map +1 -0
  287. package/lib/types/index.d.ts +2 -0
  288. package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +5 -0
  289. package/lib/types/translations/__intergalactic-dynamic-locales.d.ts.map +1 -1
  290. package/lib/types/utils.d.ts +11 -2
  291. package/lib/types/utils.d.ts.map +1 -1
  292. package/package.json +9 -10
@@ -0,0 +1,79 @@
1
+ import { sstyled } from "@semcore/core";
2
+ import { getFocusableIn } from "@semcore/core/lib/utils/focus-lock/getFocusableIn";
3
+ import useEnhancedEffect from "@semcore/core/lib/utils/use/useEnhancedEffect";
4
+ import React from "react";
5
+ /*!__reshadow-styles__:"./hoveredTick.shadow.css"*/
6
+ const styles = (
7
+ /*__reshadow_css_start__*/
8
+ (sstyled.insert(
9
+ /*__inner_css_start__*/
10
+ '.___SHoveredTickWrapper_1xgb9_gg_{font-size:var(--intergalactic-fs-100,12px);font-feature-settings:"tnum";font-variant-numeric:tabular-nums;line-height:var(--intergalactic-lh-100,1.3334);color:var(--intergalactic-chart-grid-text-label,#00132466);text-align:center}.___SHoveredTickWrapper_1xgb9_gg_[data-is-first=true]{text-align:left}.___SHoveredTickWrapper_1xgb9_gg_[data-is-last=true]{text-align:right}.___SHoveredTickWrapper_1xgb9_gg_._position_top_1xgb9_gg_ .___SHoveredTickContent_1xgb9_gg_{align-content:end}.___SHoveredTickWrapper_1xgb9_gg_ .___SHoveredTickContent_1xgb9_gg_{height:100%}.___SHoveredTickWrapper_1xgb9_gg_ .___SHoveredTick_1xgb9_gg_{display:inline-block;padding:3px 12px;border-radius:6px;background-color:var(--intergalactic-chart-x-axis-accent-tick,oklch(.96 .005 232.5))}',
11
+ /*__inner_css_end__*/
12
+ "1xgb9_gg_"
13
+ ), /*__reshadow_css_end__*/
14
+ {
15
+ "__SHoveredTickWrapper": "___SHoveredTickWrapper_1xgb9_gg_",
16
+ "_position_top": "_position_top_1xgb9_gg_",
17
+ "__SHoveredTickContent": "___SHoveredTickContent_1xgb9_gg_",
18
+ "__SHoveredTick": "___SHoveredTick_1xgb9_gg_"
19
+ })
20
+ );
21
+ const HOVERED_TICK_MARGIN_Y = 8;
22
+ const HOVERED_TICK_PADDING_Y = 3;
23
+ const HOVERED_TICK_PADDING_X = 12;
24
+ function HoveredTick(props) {
25
+ var _ref;
26
+ const {
27
+ tickFormatter,
28
+ value,
29
+ isFirstTick = false,
30
+ isLastTick = false,
31
+ x,
32
+ yRange,
33
+ y,
34
+ size,
35
+ position
36
+ } = props;
37
+ const formattedValue = tickFormatter(value);
38
+ const contentRef = React.useRef(null);
39
+ const isRendered = size?.width !== void 0 && size?.height !== void 0 && position !== null;
40
+ const isMightBeInteractive = formattedValue !== null && typeof formattedValue === "object";
41
+ useEnhancedEffect(() => {
42
+ if (!isRendered || !isMightBeInteractive || !contentRef.current) return;
43
+ getFocusableIn(contentRef.current).forEach((node) => node.setAttribute("tabindex", "-1"));
44
+ }, [value, isRendered, isMightBeInteractive]);
45
+ if (!isRendered) return null;
46
+ const {
47
+ width,
48
+ height
49
+ } = size;
50
+ const SHoveredTickWrapper = "foreignObject";
51
+ const SHoveredTickContent = "div";
52
+ const SHoveredTick = "span";
53
+ const w = width + HOVERED_TICK_PADDING_X * 2;
54
+ let tickX;
55
+ let tickY;
56
+ if (x !== void 0) {
57
+ tickX = isFirstTick ? x : isLastTick ? x - w : x - w / 2;
58
+ tickY = position === "top" ? yRange[1] - height - HOVERED_TICK_MARGIN_Y + HOVERED_TICK_PADDING_Y : yRange[0] + HOVERED_TICK_MARGIN_Y - HOVERED_TICK_PADDING_Y;
59
+ } else {
60
+ tickX = 0 - HOVERED_TICK_PADDING_X;
61
+ tickY = isFirstTick ? y : isLastTick ? y - height : y - height / 2;
62
+ }
63
+ return _ref = sstyled(styles), /* @__PURE__ */ React.createElement(SHoveredTickWrapper, _ref.cn("SHoveredTickWrapper", {
64
+ "x": tickX,
65
+ "y": tickY,
66
+ "width": w,
67
+ "height": height,
68
+ "data-is-first": isFirstTick,
69
+ "data-is-last": isLastTick,
70
+ "data-hovered-tick": true,
71
+ "aria-hidden": "true",
72
+ "position": position
73
+ }), /* @__PURE__ */ React.createElement(SHoveredTickContent, _ref.cn("SHoveredTickContent", {
74
+ "ref": contentRef
75
+ }), /* @__PURE__ */ React.createElement(SHoveredTick, _ref.cn("SHoveredTick", {}), formattedValue)));
76
+ }
77
+ export {
78
+ HoveredTick
79
+ };
@@ -0,0 +1,4 @@
1
+ SHoverLine, SHoverLine:focus-visible {
2
+ outline: none;
3
+ stroke: var(--intergalactic-chart-grid-x-axis, oklch(0.88 0.011 234.9));
4
+ }
@@ -0,0 +1,34 @@
1
+ SHoveredTickWrapper {
2
+ font-size: var(--intergalactic-fs-100, 12px);
3
+ font-variant-numeric: tabular-nums;
4
+ line-height: var(--intergalactic-lh-100, 1.3334);
5
+ color: var(--intergalactic-chart-grid-text-label, oklch(from oklch(0.182 0.045 244.8 / 0.593) l c h / 0.4));
6
+
7
+ text-align: center;
8
+
9
+ &[data-is-first='true'] {
10
+ text-align: start;
11
+ }
12
+
13
+ &[data-is-last='true'] {
14
+ text-align: end;
15
+ }
16
+
17
+ &[position='top'] {
18
+ SHoveredTickContent {
19
+ align-content: end;
20
+ }
21
+ }
22
+
23
+ /* FF fix */
24
+ SHoveredTickContent {
25
+ height: 100%;
26
+ }
27
+
28
+ SHoveredTick {
29
+ display: inline-block;
30
+ padding: 3px 12px;
31
+ border-radius: 6px;
32
+ background-color: var(--intergalactic-chart-x-axis-accent-tick, oklch(0.96 0.005 232.5));
33
+ }
34
+ }
@@ -1,6 +1,7 @@
1
1
  SArea {
2
2
  fill: var(--intergalactic-chart-palette-order-1, oklch(0.23 0.009 245));
3
3
  fill-opacity: 0.1;
4
+ stroke: none;
4
5
  }
5
6
 
6
7
  SArea[withGradient] {
@@ -13,17 +14,17 @@ SArea[color] {
13
14
 
14
15
  SArea[pattern] {
15
16
  fill: var(--pattern);
16
- fill-opacity: 0.5;
17
+ fill-opacity: 0.8;
17
18
  }
18
19
 
19
20
  SArea[transparent] {
20
- opacity: 0.3;
21
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
21
22
  }
22
23
 
23
24
  SAreaLine {
24
25
  stroke: var(--intergalactic-chart-palette-order-1, oklch(0.23 0.009 245));
25
26
  stroke-width: 2;
26
- fill: transparent;
27
+ fill: none;
27
28
  }
28
29
 
29
30
  SAreaLine[color] {
@@ -31,7 +32,7 @@ SAreaLine[color] {
31
32
  }
32
33
 
33
34
  SAreaLine[transparent] {
34
- opacity: 0.3;
35
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
35
36
  }
36
37
 
37
38
  SArea,
@@ -20,7 +20,7 @@ SBar[hide] {
20
20
  }
21
21
 
22
22
  SBar[transparent] {
23
- opacity: 0.3;
23
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
24
24
  }
25
25
 
26
26
  SBar[onClick] {
@@ -1,52 +1,57 @@
1
1
  SBubble {
2
- fill: var(--intergalactic-chart-palette-order-1, oklch(0.23 0.009 245));
3
2
  stroke: var(--intergalactic-chart-grid-border, #ffffff);
4
3
  stroke-width: 2px;
5
4
  transition-property: cx, cy;
6
5
  transition-duration: var(--duration);
7
6
  transition-timing-function: ease-in-out;
8
- opacity: 0.5;
9
7
 
10
- &:hover {
11
- opacity: 0.8;
8
+ fill-opacity: 0.1;
9
+
10
+ &[withPatterns] {
11
+ fill-opacity: 0.5;
12
12
  }
13
13
  }
14
14
 
15
- g[visible='false'] {
15
+ SGroup[visible='false'] {
16
16
  display: none;
17
17
  }
18
18
 
19
+ SGroup[hovered], SGroup:hover {
20
+ & > SBubble {
21
+ fill-opacity: 0.3;
22
+
23
+ &[withPatterns] {
24
+ fill-opacity: 1;
25
+ }
26
+ }
27
+
28
+ & > SCenterHover {
29
+ opacity: 1;
30
+ filter: var(--intergalactic-box-shadow-chart-elevated, drop-shadow(0px 0px 2px oklch(from oklch(0.23 0.009 245) l c h / 0.165)) drop-shadow(0px 1px 2px oklch(from oklch(0.23 0.009 245) l c h / 0.165)));
31
+ }
32
+ }
33
+
19
34
  SBubble[clickable] {
20
35
  cursor: pointer;
21
36
  }
22
37
 
23
38
  SBubble[color] {
24
- fill: var(--color);
25
- }
26
-
27
- SBubble[pattern][color] {
28
- fill: var(--pattern);
29
39
  stroke: var(--color);
30
- stroke-width: 1px;
31
40
  }
32
41
 
33
- SBubble[transparent] {
34
- opacity: 0.3;
35
- }
36
-
37
- SCenter {
38
- text-anchor: middle;
39
- /* disable-tokens-validator */
40
- font-size: calc(var(--intergalactic-fs-100, 12px) - 1px);
41
- stroke: var(--intergalactic-chart-palette-order-1, oklch(0.23 0.009 245));
42
+ SBubble[pattern] {
43
+ fill: var(--pattern);
42
44
  }
43
45
 
44
46
  SCenter[color] {
45
47
  stroke: var(--color);
48
+ stroke-width: 1px;
46
49
  }
47
50
 
48
- SCenter[transparent] {
49
- opacity: 0.3;
51
+ SCenterHover {
52
+ opacity: 0;
53
+ stroke: var(--intergalactic-chart-grid-border, #ffffff);
54
+ stroke-width: 3px;
50
55
  }
51
56
 
52
57
  SLabel {
@@ -65,6 +70,6 @@ SLabel[color] {
65
70
  fill: var(--color);
66
71
  }
67
72
 
68
- SLabel[transparent] {
69
- opacity: 0.3;
73
+ SBubble[transparent], SCenter[transparent], SLabel[transparent] {
74
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
70
75
  }
@@ -1,6 +1,7 @@
1
1
  SPie {
2
2
  stroke: var(--intergalactic-chart-grid-border, #ffffff);
3
3
  fill: var(--intergalactic-chart-palette-order-1, oklch(0.23 0.009 245));
4
+ transition: opacity calc(var(--intergalactic-duration-extra-fast, 100) * 1ms) ease-out;
4
5
  }
5
6
 
6
7
  SPie[color] {
@@ -14,7 +15,12 @@ SPie[pattern][color] {
14
15
  }
15
16
 
16
17
  SPie[transparent] {
17
- opacity: 0.3;
18
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
19
+ }
20
+
21
+ SLabel {
22
+ overflow-wrap: anywhere;
23
+ pointer-events: none;
18
24
  }
19
25
 
20
26
  SEmptyData {
@@ -24,11 +30,3 @@ SEmptyData {
24
30
  SEmptyData[color] {
25
31
  fill: var(--color);
26
32
  }
27
-
28
- SLabel {
29
- text-anchor: middle;
30
- vertical-anchor: middle;
31
- font-size: var(--intergalactic-fs-200, 14px);
32
- line-height: var(--intergalactic-lh-200, 1.4286);
33
-
34
- }
@@ -49,7 +49,7 @@ SDotBorder {
49
49
  }
50
50
 
51
51
  SDot[transparent] {
52
- opacity: 0.3;
52
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
53
53
  }
54
54
 
55
55
  SDotBackdrop {
@@ -1,44 +1,4 @@
1
- SHoverLine, SHoverLine:focus-visible {
2
- outline: none;
3
- stroke: var(--intergalactic-chart-grid-x-axis, oklch(0.88 0.011 234.9));
4
- }
5
-
6
1
  SHoverRect, SHoverRect:focus-visible {
7
2
  outline: none;
8
3
  fill: var(--intergalactic-chart-grid-bar-hover, oklch(0.375 0.09 242.7 / 0.05));
9
4
  }
10
-
11
- SHoveredTickWrapper {
12
- font-size: var(--intergalactic-fs-100, 12px);
13
- font-variant-numeric: tabular-nums;
14
- line-height: var(--intergalactic-lh-100, 1.3334);
15
- color: var(--intergalactic-chart-grid-text-label, oklch(from oklch(0.182 0.045 244.8 / 0.593) l c h / 0.4));
16
-
17
- text-align: center;
18
-
19
- &[data-is-first='true'] {
20
- text-align: start;
21
- }
22
-
23
- &[data-is-last='true'] {
24
- text-align: end;
25
- }
26
-
27
- &[position='top'] {
28
- SHoveredTickContent {
29
- align-content: end;
30
- }
31
- }
32
-
33
- /* FF fix */
34
- SHoveredTickContent {
35
- height: 100%;
36
- }
37
-
38
- SHoveredTick {
39
- display: inline-block;
40
- padding: 3px 12px;
41
- border-radius: 6px;
42
- background-color: var(--intergalactic-chart-x-axis-accent-tick, oklch(0.96 0.005 232.5));
43
- }
44
- }
@@ -16,7 +16,7 @@ SLine[hide] {
16
16
  }
17
17
 
18
18
  SLine[transparent] {
19
- opacity: 0.3;
19
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
20
20
  }
21
21
 
22
22
  SNull {
@@ -53,7 +53,7 @@ SPolygonDot {
53
53
  }
54
54
 
55
55
  SPolygonDot[transparent] {
56
- opacity: 0.3;
56
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
57
57
  }
58
58
 
59
59
  SPolygonDot[color] {
@@ -67,7 +67,7 @@ SPolygonLine {
67
67
  }
68
68
 
69
69
  SPolygonLine[transparent] {
70
- opacity: 0.3;
70
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
71
71
  }
72
72
 
73
73
  SPolygonLine[color] {
@@ -12,7 +12,7 @@ SLine[stroke] {
12
12
  }
13
13
 
14
14
  SLine[transparent] {
15
- opacity: 0.3;
15
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
16
16
  }
17
17
 
18
18
  SCap {
@@ -25,11 +25,11 @@ SCap[pattern] {
25
25
  }
26
26
 
27
27
  SCap[transparent] {
28
- opacity: 0.3;
28
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
29
29
  }
30
30
 
31
31
  SIcon[transparent] {
32
- opacity: 0.3;
32
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
33
33
  }
34
34
 
35
35
  SLabel {
@@ -37,7 +37,7 @@ SLabel {
37
37
  }
38
38
 
39
39
  SLabel[transparent] {
40
- opacity: 0.3;
40
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
41
41
  }
42
42
 
43
43
  SRadian:hover SLabel {
@@ -21,7 +21,7 @@ SScatterPlot[pattern][color] {
21
21
  }
22
22
 
23
23
  SScatterPlot[transparent] {
24
- opacity: 0.3;
24
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
25
25
  }
26
26
 
27
27
  SValue {
@@ -35,5 +35,5 @@ SValue[color] {
35
35
  }
36
36
 
37
37
  SValue[transparent] {
38
- opacity: 0.3;
38
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
39
39
  }
@@ -28,7 +28,7 @@ SCircle[pattern][color] {
28
28
  }
29
29
 
30
30
  SCircle[transparent] {
31
- opacity: 0.3;
31
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
32
32
  }
33
33
 
34
34
  SIntersection {
@@ -42,5 +42,5 @@ SIntersection {
42
42
  }
43
43
 
44
44
  SIntersection[transparent] {
45
- opacity: 0.3;
46
- }
45
+ opacity: var(--intergalactic-chart-transparent-opacity, 0.3);
46
+ }
@@ -1,3 +1,4 @@
1
+ import de from "./de.json.mjs";
1
2
  import en from "./en.json.mjs";
2
3
  import es from "./es.json.mjs";
3
4
  import fr from "./fr.json.mjs";
@@ -12,6 +13,7 @@ import tr from "./tr.json.mjs";
12
13
  import vi from "./vi.json.mjs";
13
14
  import zh from "./zh.json.mjs";
14
15
  const localizedMessages = {
16
+ de,
15
17
  en,
16
18
  es,
17
19
  fr,
@@ -0,0 +1,12 @@
1
+ const trend = "Trend";
2
+ const legendForChart = "Legende zum Chart";
3
+ const de = {
4
+ "d3Chart.Plot:aria-label": "Chart",
5
+ trend,
6
+ legendForChart
7
+ };
8
+ export {
9
+ de as default,
10
+ legendForChart,
11
+ trend
12
+ };
package/lib/esm/utils.mjs CHANGED
@@ -20,7 +20,9 @@ const invert = (scale, value) => {
20
20
  };
21
21
  const definedNullData = (x, y) => (plot) => plot[x] !== null && plot[y] !== null;
22
22
  const definedData = (x, y) => (plot) => plot[x] !== null && plot[x] !== void 0 && plot[y] !== null && plot[y] !== void 0;
23
- const scaleOfBandwidth = (scale, value) => scale.bandwidth ? scale(value) + scale.bandwidth() / 2 : scale(value);
23
+ const scaleOfBandwidth = (scale, value) => {
24
+ return "bandwidth" in scale ? scale(value) + scale.bandwidth() / 2 : typeof value !== "string" ? scale(value) : 0;
25
+ };
24
26
  const minMax = (data, key) => {
25
27
  if (typeof key === "string") {
26
28
  return extent(data, (d) => d[key]);
@@ -180,34 +182,45 @@ const getScatterPlotRadius = (valueKey) => {
180
182
  return valueKey !== void 0 ? 12 : 5.5;
181
183
  };
182
184
  const calculateBubbleDomain = (data, key, range) => {
183
- const miniestValue = data.reduce((acc, item) => {
184
- if (item[key] - item.value < acc.min) {
185
- acc.min = item[key] - item.value;
186
- acc.value = item.value;
187
- }
188
- return acc;
189
- }, {
190
- value: data[0].value,
191
- min: data[0][key] - data[0].value
192
- }).value;
193
- const maxestValue = data.reduce((acc, item) => {
194
- if (item.value + item[key] > acc.max) {
195
- acc.max = item.value + item.x;
196
- acc.value = item.value;
197
- }
198
- return acc;
199
- }, {
200
- value: data[0].value,
201
- max: data[0].value + data[0][key]
202
- }).value;
203
- let [min, max] = minMax(data, key);
204
- const pixelRatio = Math.abs(max - min) / Math.abs(range[0] - range[1]);
185
+ if (!data.length) return [0, 1];
205
186
  const valueScale = getBubbleChartValueScale(data, "value");
206
- const minValueShift = valueScale(miniestValue) * pixelRatio;
207
- const maxValueShift = valueScale(maxestValue) * pixelRatio;
208
- min -= minValueShift * 2;
209
- max += maxValueShift * 2;
210
- return [Math.floor(min), Math.floor(max)];
187
+ const axisLengthPx = Math.abs(range[1] - range[0]);
188
+ const points = data.map((dataItem) => ({
189
+ x: dataItem[key],
190
+ r: valueScale(dataItem.value) + 1
191
+ // stroke-width/2
192
+ }));
193
+ if (points.length === 1) {
194
+ const x = points[0].x;
195
+ return [Math.floor(x - 1), Math.ceil(x + 1)];
196
+ }
197
+ let maxK = 0;
198
+ for (let i = 0; i < points.length; i++) {
199
+ for (let j = 0; j < points.length; j++) {
200
+ if (i === j) continue;
201
+ const dx = points[j].x - points[i].x;
202
+ if (dx <= 0) continue;
203
+ const availablePx = axisLengthPx - points[i].r - points[j].r;
204
+ if (availablePx <= 0) continue;
205
+ const k = dx / availablePx;
206
+ if (k > maxK) {
207
+ maxK = k;
208
+ }
209
+ }
210
+ }
211
+ if (maxK === 0) {
212
+ const x = points[0].x;
213
+ return [Math.floor(x - 1), Math.ceil(x + 1)];
214
+ }
215
+ let domainMin = Infinity;
216
+ let domainMax = -Infinity;
217
+ for (const point of points) {
218
+ const min = point.x - point.r * maxK;
219
+ const max = point.x + point.r * maxK;
220
+ if (min < domainMin) domainMin = min;
221
+ if (max > domainMax) domainMax = max;
222
+ }
223
+ return [Math.floor(domainMin), Math.ceil(domainMax)];
211
224
  };
212
225
  const PlotEventEmitter = EventEmitter;
213
226
  function getDataOfType(data, type, y) {
@@ -227,18 +240,52 @@ function getDataOfType(data, type, y) {
227
240
  });
228
241
  return result;
229
242
  }
243
+ function getVerticalPathFromRect(data, radius = 6) {
244
+ const {
245
+ x,
246
+ y,
247
+ width,
248
+ height
249
+ } = data;
250
+ const r = radius;
251
+ const path = `M ${x},${y + r} Q ${x},${y} ${x + r},${y} H ${x + width - r} Q ${x + width},${y} ${x + width},${y + r} V ${y + height} H ${x} Z`;
252
+ return path;
253
+ }
254
+ function getHorizontalPathFromRect(data, radius = 6) {
255
+ const {
256
+ x,
257
+ y,
258
+ width,
259
+ height
260
+ } = data;
261
+ const r = radius;
262
+ const path = `M ${x},${y + r} Q ${x},${y} ${x + r},${y} H ${x + width - r} Q ${x + width},${y} ${x + width},${y + r} V ${y + height - r} Q ${x + width},${y + height} ${x + width - r},${y + height} H ${x + r} Q ${x},${y + height} ${x},${y + height - 6} Z`;
263
+ return path;
264
+ }
265
+ function formatValue(locale, value) {
266
+ if (value instanceof Date) {
267
+ return new Intl.DateTimeFormat(locale ?? "en", {
268
+ day: "numeric",
269
+ month: "short"
270
+ }).format(value);
271
+ }
272
+ return value;
273
+ }
230
274
  export {
231
275
  PlotEventEmitter,
232
276
  calculateBubbleDomain,
233
277
  definedData,
234
278
  definedNullData,
235
279
  eventToPoint,
280
+ formatValue,
236
281
  getBubbleChartValueScale,
237
282
  getChartDefaultColorName,
238
283
  getDataOfType,
284
+ getHorizontalPathFromRect,
239
285
  getIndexFromData,
240
286
  getNullData,
241
287
  getScatterPlotRadius,
288
+ getVerticalPathFromRect,
242
289
  interpolateValue,
243
290
  invert,
244
291
  measureText,
@@ -88,6 +88,9 @@ type BackgroundContext = Context & {
88
88
  };
89
89
 
90
90
  declare const Bar: IntergalacticD3Component<'rect', BarProps, BarContext> & {
91
+ /**
92
+ * @deprecated. Since the new design was applied, you shouldn't use it anymore for Bar charts.
93
+ */
91
94
  Background: IntergalacticD3Component<'rect', BackgroundProps, BackgroundContext>;
92
95
  };
93
96
 
@@ -26,7 +26,10 @@ export type BubbleProps = Context & {
26
26
  * @default 500
27
27
  */
28
28
  duration?: number;
29
- /** Enables element transparency */
29
+ /**
30
+ * Enables element transparency
31
+ * @deprecated You shouldn't use it in the redesign.
32
+ */
30
33
  transparent?: boolean;
31
34
  /** Enables charts patterns that enhances charts accessibility */
32
35
  patterns?: PatternsConfig;
@@ -45,10 +45,6 @@ export type PieProps = Context & {
45
45
  name: string;
46
46
  /** Color pie **/
47
47
  color?: string;
48
- /**
49
- * Active sector
50
- * */
51
- active?: boolean;
52
48
  /** Enables element transparency */
53
49
  transparent?: boolean;
54
50
  };
@@ -43,6 +43,9 @@ export type HorizontalBarProps = Context & {
43
43
  };
44
44
 
45
45
  declare const HorizontalBar: IntergalacticD3Component<'path', HorizontalBarProps, BarContext> & {
46
+ /**
47
+ * @deprecated. Since the new design was applied, you shouldn't use it anymore for Bar charts.
48
+ */
46
49
  Background: IntergalacticD3Component<'rect', BackgroundProps, Context>;
47
50
  };
48
51