@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
package/lib/esm/Hover.mjs CHANGED
@@ -1,44 +1,27 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { sstyled, Component, assignProps } from "@semcore/core";
3
3
  import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
4
- import { getFocusableIn } from "@semcore/core/lib/utils/focus-lock/getFocusableIn";
5
4
  import { hasParent } from "@semcore/core/lib/utils/hasParent";
6
5
  import trottle from "@semcore/core/lib/utils/rafTrottle";
7
- import useEnhancedEffect from "@semcore/core/lib/utils/use/useEnhancedEffect";
8
6
  import React from "react";
7
+ import { HoveredTick } from "./component/Hover/HoveredTick.mjs";
8
+ import { HoverLine as HoverLine$1 } from "./component/Hover/HoverLine.mjs";
9
9
  import createElement from "./createElement.mjs";
10
10
  import Tooltip from "./Tooltip.mjs";
11
- import { eventToPoint, invert, getIndexFromData, scaleOfBandwidth, scaleToBand } from "./utils.mjs";
11
+ import { eventToPoint, invert, getIndexFromData, formatValue, scaleToBand, getVerticalPathFromRect, getHorizontalPathFromRect } from "./utils.mjs";
12
12
  /*!__reshadow-styles__:"./style/hover.shadow.css"*/
13
13
  const style = (
14
14
  /*__reshadow_css_start__*/
15
15
  (sstyled.insert(
16
16
  /*__inner_css_start__*/
17
- '.___SHoverLine_1tzev_gg_,.___SHoverLine_1tzev_gg_:focus-visible{outline:none;stroke:var(--intergalactic-chart-grid-x-axis,oklch(.88 .011 234.9))}.___SHoverRect_1tzev_gg_,.___SHoverRect_1tzev_gg_:focus-visible{outline:none;fill:var(--intergalactic-chart-grid-bar-hover,oklch(.375 .09 242.7/.05))}.___SHoveredTickWrapper_1tzev_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_1tzev_gg_[data-is-first=true]{text-align:left}.___SHoveredTickWrapper_1tzev_gg_[data-is-last=true]{text-align:right}.___SHoveredTickWrapper_1tzev_gg_._position_top_1tzev_gg_ .___SHoveredTickContent_1tzev_gg_{align-content:end}.___SHoveredTickWrapper_1tzev_gg_ .___SHoveredTickContent_1tzev_gg_{height:100%}.___SHoveredTickWrapper_1tzev_gg_ .___SHoveredTick_1tzev_gg_{display:inline-block;padding:3px 12px;border-radius:6px;background-color:var(--intergalactic-chart-x-axis-accent-tick,oklch(.96 .005 232.5))}',
17
+ ".___SHoverRect_ynpdg_gg_,.___SHoverRect_ynpdg_gg_:focus-visible{outline:none;fill:var(--intergalactic-chart-grid-bar-hover,oklch(.375 .09 242.7/.05))}",
18
18
  /*__inner_css_end__*/
19
- "1tzev_gg_"
19
+ "ynpdg_gg_"
20
20
  ), /*__reshadow_css_end__*/
21
21
  {
22
- "__SHoverLine": "___SHoverLine_1tzev_gg_",
23
- "__SHoverRect": "___SHoverRect_1tzev_gg_",
24
- "__SHoveredTickWrapper": "___SHoveredTickWrapper_1tzev_gg_",
25
- "_position_top": "_position_top_1tzev_gg_",
26
- "__SHoveredTickContent": "___SHoveredTickContent_1tzev_gg_",
27
- "__SHoveredTick": "___SHoveredTick_1tzev_gg_"
22
+ "__SHoverRect": "___SHoverRect_ynpdg_gg_"
28
23
  })
29
24
  );
30
- const STROKE_WIDTH = 1;
31
- const NOTCH_WIDTH = 9;
32
- const NOTCH_DELTA = NOTCH_WIDTH / 2 - STROKE_WIDTH / 4;
33
- function formatValue(locale, value) {
34
- if (value instanceof Date) {
35
- return new Intl.DateTimeFormat(locale ?? "en", {
36
- day: "numeric",
37
- month: "short"
38
- }).format(value);
39
- }
40
- return value;
41
- }
42
25
  class Hover extends Component {
43
26
  constructor(...args) {
44
27
  super(...args);
@@ -133,7 +116,6 @@ class Hover extends Component {
133
116
  _defineProperty(Hover, "style", style);
134
117
  class HoverLineRoot extends Hover {
135
118
  render() {
136
- var _ref3;
137
119
  const {
138
120
  hideHoverLine,
139
121
  meta,
@@ -147,9 +129,7 @@ class HoverLineRoot extends Hover {
147
129
  if (isHide) {
148
130
  return null;
149
131
  }
150
- const SHoverLine = this.Element;
151
132
  const {
152
- styles,
153
133
  x,
154
134
  y,
155
135
  data,
@@ -157,68 +137,59 @@ class HoverLineRoot extends Hover {
157
137
  dataHints,
158
138
  hideTickHover
159
139
  } = this.asProps;
160
- const [xScale, yScale] = scale;
161
- const xRange = xScale.range();
162
- const yRange = yScale.range();
163
- const x1 = xIndex !== null ? scaleOfBandwidth(xScale, data[xIndex][x]) : void 0;
164
- const y1 = yIndex !== null ? scaleOfBandwidth(yScale, data[yIndex][y]) : void 0;
165
- return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, xIndex !== null ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SHoverLine, _ref3.cn("SHoverLine", {
166
- "render": "g",
167
- "index": xIndex,
168
- "stroke-width": STROKE_WIDTH,
169
- "aria-hidden": true
170
- }), /* @__PURE__ */ React.createElement("line", _ref3.cn("line", {
171
- "x1": x1 - NOTCH_DELTA,
172
- "x2": x1 + NOTCH_DELTA,
173
- "y1": yRange[0],
174
- "y2": yRange[0]
175
- })), /* @__PURE__ */ React.createElement("line", _ref3.cn("line", {
176
- "x1": x1,
177
- "y1": yRange[0],
178
- "x2": x1,
179
- "y2": yRange[1]
180
- })), /* @__PURE__ */ React.createElement("line", _ref3.cn("line", {
181
- "x1": x1 - NOTCH_DELTA,
182
- "x2": x1 + NOTCH_DELTA,
183
- "y1": yRange[1],
184
- "y2": yRange[1]
185
- }))), !hideTickHover && /* @__PURE__ */ React.createElement(HoveredTick, _ref3.cn("HoveredTick", {
186
- "size": meta.getTicksSize("horizontal"),
187
- "position": meta.getTicksPosition("horizontal"),
188
- "tickFormatter": dataHints.titles.getHorizontalAxesTitle ?? formatValue.bind(null, locale),
189
- "value": data[xIndex]?.[x],
190
- "isFirstTick": xIndex === 0,
191
- "isLastTick": xIndex === data.length - 1,
192
- "styles": styles,
193
- "x": x1,
194
- "yRange": yRange
195
- }))) : null, yIndex !== null ? /* @__PURE__ */ React.createElement(SHoverLine, _ref3.cn("SHoverLine", {
196
- "render": "g",
197
- "index": yIndex,
198
- "stroke-width": STROKE_WIDTH,
199
- "aria-hidden": true
200
- }), /* @__PURE__ */ React.createElement("line", _ref3.cn("line", {
201
- "x1": xRange[0],
202
- "y1": y1 - NOTCH_DELTA,
203
- "x2": xRange[0],
204
- "y2": y1 + NOTCH_DELTA
205
- })), /* @__PURE__ */ React.createElement("line", _ref3.cn("line", {
206
- "x1": xRange[0],
207
- "y1": y1,
208
- "x2": xRange[1],
209
- "y2": y1
210
- })), /* @__PURE__ */ React.createElement("line", _ref3.cn("line", {
211
- "x1": xRange[1],
212
- "y1": y1 - NOTCH_DELTA,
213
- "x2": xRange[1],
214
- "y2": y1 + NOTCH_DELTA
215
- }))) : null);
140
+ return /* @__PURE__ */ React.createElement(HoverLine$1, {
141
+ data,
142
+ x,
143
+ y,
144
+ dataHints,
145
+ hideTickHover,
146
+ meta,
147
+ scale,
148
+ xIndex,
149
+ yIndex,
150
+ formatValue: formatValue.bind(null, locale)
151
+ });
216
152
  }
217
153
  }
218
154
  _defineProperty(HoverLineRoot, "displayName", "HoverLine");
219
155
  class HoverRectRoot extends Hover {
156
+ getRectPath(orientation) {
157
+ const {
158
+ x,
159
+ y,
160
+ data,
161
+ scale
162
+ } = this.asProps;
163
+ const {
164
+ xIndex,
165
+ yIndex
166
+ } = this.state;
167
+ const [xScale, yScale] = scale;
168
+ const xRange = xScale.range();
169
+ const yRange = yScale.range();
170
+ const xBand = scaleToBand(xScale);
171
+ const yBand = scaleToBand(yScale);
172
+ const xStep = xBand.step();
173
+ const xPaddingInner = xBand.paddingInner();
174
+ const yStep = yBand.step();
175
+ const yPaddingInner = yBand.paddingInner();
176
+ if (orientation === "vertical") {
177
+ return getVerticalPathFromRect({
178
+ x: xScale(data[xIndex][x]) - xStep * xPaddingInner / 2,
179
+ y: yRange[1],
180
+ width: xStep - xPaddingInner / 2,
181
+ height: yRange[0] - yRange[1]
182
+ });
183
+ }
184
+ return getHorizontalPathFromRect({
185
+ x: xRange[0],
186
+ y: yScale(data[yIndex][y]) - yStep * yPaddingInner / 2,
187
+ width: xRange[1] - xRange[0],
188
+ height: yStep - yPaddingInner / 2
189
+ });
190
+ }
220
191
  render() {
221
- var _ref4;
192
+ var _ref3;
222
193
  const {
223
194
  hideHoverLine,
224
195
  meta
@@ -242,95 +213,35 @@ class HoverRectRoot extends Hover {
242
213
  yIndex
243
214
  } = this.state;
244
215
  const [xScale, yScale] = scale;
245
- const xRange = xScale.range();
246
216
  const yRange = yScale.range();
247
217
  const xBand = scaleToBand(xScale);
248
- const yBand = scaleToBand(yScale);
249
218
  const xStep = xBand.step();
250
219
  const xPaddingInner = xBand.paddingInner();
251
- const yStep = yBand.step();
252
- const yPaddingInner = yBand.paddingInner();
253
- return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, xIndex !== null && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SHoverRect, _ref4.cn("SHoverRect", {
220
+ return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, xIndex !== null && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SHoverRect, _ref3.cn("SHoverRect", {
254
221
  "aria-hidden": true,
255
- "render": "rect",
222
+ "render": "path",
256
223
  "index": xIndex,
257
- "width": xStep - xPaddingInner / 2,
258
- "height": yRange[0] - yRange[1],
259
- "x": xScale(data[xIndex][x]) - xStep * xPaddingInner / 2,
260
- "y": yRange[1]
261
- })), !hideTickHover && /* @__PURE__ */ React.createElement(HoveredTick, _ref4.cn("HoveredTick", {
224
+ "d": this.getRectPath("vertical")
225
+ })), !hideTickHover && /* @__PURE__ */ React.createElement(HoveredTick, _ref3.cn("HoveredTick", {
262
226
  "size": meta.getTicksSize("horizontal"),
263
227
  "position": meta.getTicksPosition("horizontal"),
264
228
  "tickFormatter": dataHints.titles.getHorizontalAxesTitle ?? formatValue.bind(null, locale),
265
229
  "value": data[xIndex]?.[x],
266
- "styles": styles,
267
230
  "x": xScale(data[xIndex][x]) + xStep * (1 - xPaddingInner) / 2,
268
231
  "yRange": yRange
269
- }))), yIndex !== null && /* @__PURE__ */ React.createElement(SHoverRect, _ref4.cn("SHoverRect", {
232
+ }))), yIndex !== null && /* @__PURE__ */ React.createElement(SHoverRect, _ref3.cn("SHoverRect", {
270
233
  "aria-hidden": true,
271
- "render": "rect",
234
+ "render": "path",
272
235
  "index": yIndex,
273
- "width": xRange[1] - xRange[0],
274
- "height": yStep - yPaddingInner / 2,
275
- "x": xRange[0],
276
- "y": yScale(data[yIndex][y]) - yStep * yPaddingInner / 2
236
+ "d": this.getRectPath("horizontal")
277
237
  })));
278
238
  }
279
239
  }
280
240
  _defineProperty(HoverRectRoot, "displayName", "HoverRect");
281
- const HOVERED_TICK_MARGIN_Y = 8;
282
- const HOVERED_TICK_PADDING_Y = 3;
283
- const HOVERED_TICK_PADDING_X = 12;
284
- function HoveredTick(props) {
285
- var _ref5;
286
- const {
287
- tickFormatter,
288
- value,
289
- isFirstTick = false,
290
- isLastTick = false,
291
- styles,
292
- x,
293
- yRange,
294
- size,
295
- position
296
- } = props;
297
- const formattedValue = tickFormatter(value);
298
- const contentRef = React.useRef(null);
299
- const isRendered = size?.width !== void 0 && size?.height !== void 0 && position !== null;
300
- const isMightBeInteractive = formattedValue !== null && typeof formattedValue === "object";
301
- useEnhancedEffect(() => {
302
- if (!isRendered || !isMightBeInteractive || !contentRef.current) return;
303
- getFocusableIn(contentRef.current).forEach((node) => node.setAttribute("tabindex", "-1"));
304
- }, [value, isRendered, isMightBeInteractive]);
305
- if (!isRendered) return null;
306
- const {
307
- width,
308
- height
309
- } = size;
310
- const SHoveredTickWrapper = "foreignObject";
311
- const SHoveredTickContent = "div";
312
- const SHoveredTick = "span";
313
- const w = width + HOVERED_TICK_PADDING_X * 2;
314
- const tickX = isFirstTick ? x : isLastTick ? x - w : x - w / 2;
315
- const tickY = position === "top" ? yRange[1] - height - HOVERED_TICK_MARGIN_Y + HOVERED_TICK_PADDING_Y : yRange[0] + HOVERED_TICK_MARGIN_Y - HOVERED_TICK_PADDING_Y;
316
- return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SHoveredTickWrapper, _ref5.cn("SHoveredTickWrapper", {
317
- "x": tickX,
318
- "y": tickY,
319
- "width": w,
320
- "height": height,
321
- "data-is-first": isFirstTick,
322
- "data-is-last": isLastTick,
323
- "position": position,
324
- "data-hovered-tick": true,
325
- "aria-hidden": "true"
326
- }), /* @__PURE__ */ React.createElement(SHoveredTickContent, _ref5.cn("SHoveredTickContent", {
327
- "ref": contentRef
328
- }), /* @__PURE__ */ React.createElement(SHoveredTick, _ref5.cn("SHoveredTick", {}), formattedValue)));
329
- }
330
241
  function HoverLineTooltip(props) {
331
- var _ref = arguments[0], _ref6;
242
+ var _ref = arguments[0], _ref4;
332
243
  const SHoverLineTooltip = Tooltip;
333
- return _ref6 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SHoverLineTooltip, _ref6.cn("SHoverLineTooltip", {
244
+ return _ref4 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SHoverLineTooltip, _ref4.cn("SHoverLineTooltip", {
334
245
  ...assignProps({
335
246
  "tag": HoverLine,
336
247
  "excludeAnchorProps": true
@@ -338,9 +249,9 @@ function HoverLineTooltip(props) {
338
249
  }));
339
250
  }
340
251
  function HoverRectTooltip(props) {
341
- var _ref2 = arguments[0], _ref7;
252
+ var _ref2 = arguments[0], _ref5;
342
253
  const SHoverRectTooltip = Tooltip;
343
- return _ref7 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SHoverRectTooltip, _ref7.cn("SHoverRectTooltip", {
254
+ return _ref5 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SHoverRectTooltip, _ref5.cn("SHoverRectTooltip", {
344
255
  ...assignProps({
345
256
  "tag": HoverRect,
346
257
  "excludeAnchorProps": true
package/lib/esm/Line.mjs CHANGED
@@ -17,19 +17,19 @@ const style = (
17
17
  /*__reshadow_css_start__*/
18
18
  (sstyled.insert(
19
19
  /*__inner_css_start__*/
20
- ".___SLine_tx3eh_gg_{fill:#0000;stroke-width:2;stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition-property:d;transition-duration:var(--duration_tx3eh);transition-timing-function:ease-in-out}.___SLine_tx3eh_gg_.__color_tx3eh_gg_{stroke:var(--color_tx3eh)}.___SLine_tx3eh_gg_.__hide_tx3eh_gg_{display:none}.___SLine_tx3eh_gg_.__transparent_tx3eh_gg_{opacity:.3}.___SNull_tx3eh_gg_{fill:#0000;stroke:var(--intergalactic-chart-data-null,oklch(.9 .009 234));stroke-dasharray:4}.___SNull_tx3eh_gg_.__hide_tx3eh_gg_{display:none}.___SLineArea_tx3eh_gg_{transition-property:d;transition-duration:var(--duration_tx3eh);transition-timing-function:ease-in-out;opacity:.1;fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SLineArea_tx3eh_gg_.__color_tx3eh_gg_{fill:var(--color_tx3eh)}",
20
+ ".___SLine_1pfll_gg_{fill:#0000;stroke-width:2;stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition-property:d;transition-duration:var(--duration_1pfll);transition-timing-function:ease-in-out}.___SLine_1pfll_gg_.__color_1pfll_gg_{stroke:var(--color_1pfll)}.___SLine_1pfll_gg_.__hide_1pfll_gg_{display:none}.___SLine_1pfll_gg_.__transparent_1pfll_gg_{opacity:var(--intergalactic-chart-transparent-opacity,.3)}.___SNull_1pfll_gg_{fill:#0000;stroke:var(--intergalactic-chart-data-null,oklch(.9 .009 234));stroke-dasharray:4}.___SNull_1pfll_gg_.__hide_1pfll_gg_{display:none}.___SLineArea_1pfll_gg_{transition-property:d;transition-duration:var(--duration_1pfll);transition-timing-function:ease-in-out;opacity:.1;fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SLineArea_1pfll_gg_.__color_1pfll_gg_{fill:var(--color_1pfll)}",
21
21
  /*__inner_css_end__*/
22
- "tx3eh_gg_"
22
+ "1pfll_gg_"
23
23
  ), /*__reshadow_css_end__*/
24
24
  {
25
- "__SLine": "___SLine_tx3eh_gg_",
26
- "--duration": "--duration_tx3eh",
27
- "_color": "__color_tx3eh_gg_",
28
- "--color": "--color_tx3eh",
29
- "_hide": "__hide_tx3eh_gg_",
30
- "_transparent": "__transparent_tx3eh_gg_",
31
- "__SNull": "___SNull_tx3eh_gg_",
32
- "__SLineArea": "___SLineArea_tx3eh_gg_"
25
+ "__SLine": "___SLine_1pfll_gg_",
26
+ "--duration": "--duration_1pfll",
27
+ "_color": "__color_1pfll_gg_",
28
+ "--color": "--color_1pfll",
29
+ "_hide": "__hide_1pfll_gg_",
30
+ "_transparent": "__transparent_1pfll_gg_",
31
+ "__SNull": "___SNull_1pfll_gg_",
32
+ "__SLineArea": "___SLineArea_1pfll_gg_"
33
33
  })
34
34
  );
35
35
  class LineRoot extends Component {