@semcore/d3-chart 18.0.0-prerelease.1 → 18.0.0-prerelease.2

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 (273) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/lib/cjs/Area.js +123 -23
  3. package/lib/cjs/Area.js.map +1 -1
  4. package/lib/cjs/Axis.js +109 -97
  5. package/lib/cjs/Axis.js.map +1 -1
  6. package/lib/cjs/Bar.js +16 -16
  7. package/lib/cjs/Bubble.js +14 -14
  8. package/lib/cjs/ChartMetaData.js +44 -0
  9. package/lib/cjs/ChartMetaData.js.map +1 -0
  10. package/lib/cjs/CompactHorizontalBar.js +16 -16
  11. package/lib/cjs/Donut.js +18 -19
  12. package/lib/cjs/Donut.js.map +1 -1
  13. package/lib/cjs/Dots.js +67 -13
  14. package/lib/cjs/Dots.js.map +1 -1
  15. package/lib/cjs/HorizontalBar.js +16 -16
  16. package/lib/cjs/Hover.js +66 -52
  17. package/lib/cjs/Hover.js.map +1 -1
  18. package/lib/cjs/Line.js +82 -17
  19. package/lib/cjs/Line.js.map +1 -1
  20. package/lib/cjs/Pattern.js +113 -2
  21. package/lib/cjs/Pattern.js.map +1 -1
  22. package/lib/cjs/Plot.js +5 -2
  23. package/lib/cjs/Plot.js.map +1 -1
  24. package/lib/cjs/Radar.js +19 -19
  25. package/lib/cjs/RadialTree.js +12 -12
  26. package/lib/cjs/Reference.js +55 -18
  27. package/lib/cjs/Reference.js.map +1 -1
  28. package/lib/cjs/ScatterPlot.js +9 -9
  29. package/lib/cjs/Tooltip.js +16 -14
  30. package/lib/cjs/Tooltip.js.map +1 -1
  31. package/lib/cjs/a11y/PlotA11yView.js +2 -2
  32. package/lib/cjs/component/Chart/AbstractChart.js +21 -18
  33. package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
  34. package/lib/cjs/component/Chart/AbstractChart.type.js +19 -0
  35. package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
  36. package/lib/cjs/component/Chart/AreaChart.js +21 -7
  37. package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
  38. package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
  39. package/lib/cjs/component/Chart/BarChart.js +6 -3
  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 +4 -0
  43. package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
  44. package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
  45. package/lib/cjs/component/Chart/CigaretteChart.type.js.map +1 -1
  46. package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  47. package/lib/cjs/component/Chart/DonutChart.js +0 -1
  48. package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
  49. package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
  50. package/lib/cjs/component/Chart/HistogramChart.js +6 -3
  51. package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
  52. package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
  53. package/lib/cjs/component/Chart/LineChart.js +16 -6
  54. package/lib/cjs/component/Chart/LineChart.js.map +1 -1
  55. package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
  56. package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
  57. package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
  58. package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
  59. package/lib/cjs/component/Chart/index.js +43 -0
  60. package/lib/cjs/component/Chart/index.js.map +1 -1
  61. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  62. package/lib/cjs/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
  63. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +16 -16
  64. package/lib/cjs/component/ChartLegend/LegendItem/legend-item.shadow.css +11 -11
  65. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +7 -7
  66. package/lib/cjs/component/ChartLegend/LegendTable/legend-table.shadow.css +2 -2
  67. package/lib/cjs/index.js +55 -1
  68. package/lib/cjs/index.js.map +1 -1
  69. package/lib/cjs/style/abstract-chart.shadow.css +13 -3
  70. package/lib/cjs/style/area.shadow.css +8 -5
  71. package/lib/cjs/style/axis.shadow.css +51 -60
  72. package/lib/cjs/style/bar.shadow.css +6 -6
  73. package/lib/cjs/style/bubble.shadow.css +3 -3
  74. package/lib/cjs/style/donut.shadow.css +2 -2
  75. package/lib/cjs/style/dot.shadow.css +37 -2
  76. package/lib/cjs/style/hover.shadow.css +30 -13
  77. package/lib/cjs/style/line.shadow.css +3 -3
  78. package/lib/cjs/style/pattern.shadow.css +10 -0
  79. package/lib/cjs/style/plotA11yView.shadow.css +3 -3
  80. package/lib/cjs/style/radar.shadow.css +7 -7
  81. package/lib/cjs/style/radial-tree.shadow.css +2 -2
  82. package/lib/cjs/style/reference.shadow.css +4 -4
  83. package/lib/cjs/style/scatterplot.shadow.css +1 -1
  84. package/lib/cjs/style/tooltip.shadow.css +12 -12
  85. package/lib/cjs/types/Axis.d.js.map +1 -1
  86. package/lib/cjs/types/Donut.d.js.map +1 -1
  87. package/lib/cjs/types/Hover.d.js.map +1 -1
  88. package/lib/cjs/utils.js +21 -1
  89. package/lib/cjs/utils.js.map +1 -1
  90. package/lib/es6/Area.js +125 -25
  91. package/lib/es6/Area.js.map +1 -1
  92. package/lib/es6/Axis.js +109 -97
  93. package/lib/es6/Axis.js.map +1 -1
  94. package/lib/es6/Bar.js +16 -16
  95. package/lib/es6/Bubble.js +14 -14
  96. package/lib/es6/ChartMetaData.js +36 -0
  97. package/lib/es6/ChartMetaData.js.map +1 -0
  98. package/lib/es6/CompactHorizontalBar.js +16 -16
  99. package/lib/es6/Donut.js +18 -19
  100. package/lib/es6/Donut.js.map +1 -1
  101. package/lib/es6/Dots.js +68 -14
  102. package/lib/es6/Dots.js.map +1 -1
  103. package/lib/es6/HorizontalBar.js +16 -16
  104. package/lib/es6/Hover.js +66 -52
  105. package/lib/es6/Hover.js.map +1 -1
  106. package/lib/es6/Line.js +84 -19
  107. package/lib/es6/Line.js.map +1 -1
  108. package/lib/es6/Pattern.js +108 -2
  109. package/lib/es6/Pattern.js.map +1 -1
  110. package/lib/es6/Plot.js +5 -2
  111. package/lib/es6/Plot.js.map +1 -1
  112. package/lib/es6/Radar.js +19 -19
  113. package/lib/es6/RadialTree.js +12 -12
  114. package/lib/es6/Reference.js +55 -18
  115. package/lib/es6/Reference.js.map +1 -1
  116. package/lib/es6/ScatterPlot.js +9 -9
  117. package/lib/es6/Tooltip.js +16 -14
  118. package/lib/es6/Tooltip.js.map +1 -1
  119. package/lib/es6/a11y/PlotA11yView.js +2 -2
  120. package/lib/es6/component/Chart/AbstractChart.js +21 -18
  121. package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
  122. package/lib/es6/component/Chart/AbstractChart.type.js +14 -1
  123. package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
  124. package/lib/es6/component/Chart/AreaChart.js +21 -7
  125. package/lib/es6/component/Chart/AreaChart.js.map +1 -1
  126. package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
  127. package/lib/es6/component/Chart/BarChart.js +6 -3
  128. package/lib/es6/component/Chart/BarChart.js.map +1 -1
  129. package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
  130. package/lib/es6/component/Chart/BubbleChart.js +4 -0
  131. package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
  132. package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
  133. package/lib/es6/component/Chart/CigaretteChart.type.js.map +1 -1
  134. package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  135. package/lib/es6/component/Chart/DonutChart.js +0 -1
  136. package/lib/es6/component/Chart/DonutChart.js.map +1 -1
  137. package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
  138. package/lib/es6/component/Chart/HistogramChart.js +6 -3
  139. package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
  140. package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
  141. package/lib/es6/component/Chart/LineChart.js +14 -4
  142. package/lib/es6/component/Chart/LineChart.js.map +1 -1
  143. package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
  144. package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
  145. package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
  146. package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
  147. package/lib/es6/component/Chart/index.js +2 -0
  148. package/lib/es6/component/Chart/index.js.map +1 -1
  149. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  150. package/lib/es6/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
  151. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +16 -16
  152. package/lib/es6/component/ChartLegend/LegendItem/legend-item.shadow.css +11 -11
  153. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +7 -7
  154. package/lib/es6/component/ChartLegend/LegendTable/legend-table.shadow.css +2 -2
  155. package/lib/es6/index.js +1 -0
  156. package/lib/es6/index.js.map +1 -1
  157. package/lib/es6/style/abstract-chart.shadow.css +13 -3
  158. package/lib/es6/style/area.shadow.css +8 -5
  159. package/lib/es6/style/axis.shadow.css +51 -60
  160. package/lib/es6/style/bar.shadow.css +6 -6
  161. package/lib/es6/style/bubble.shadow.css +3 -3
  162. package/lib/es6/style/donut.shadow.css +2 -2
  163. package/lib/es6/style/dot.shadow.css +37 -2
  164. package/lib/es6/style/hover.shadow.css +30 -13
  165. package/lib/es6/style/line.shadow.css +3 -3
  166. package/lib/es6/style/pattern.shadow.css +10 -0
  167. package/lib/es6/style/plotA11yView.shadow.css +3 -3
  168. package/lib/es6/style/radar.shadow.css +7 -7
  169. package/lib/es6/style/radial-tree.shadow.css +2 -2
  170. package/lib/es6/style/reference.shadow.css +4 -4
  171. package/lib/es6/style/scatterplot.shadow.css +1 -1
  172. package/lib/es6/style/tooltip.shadow.css +12 -12
  173. package/lib/es6/types/Axis.d.js.map +1 -1
  174. package/lib/es6/types/Donut.d.js.map +1 -1
  175. package/lib/es6/types/Hover.d.js.map +1 -1
  176. package/lib/es6/utils.js +18 -0
  177. package/lib/es6/utils.js.map +1 -1
  178. package/lib/esm/Area.mjs +127 -26
  179. package/lib/esm/Axis.mjs +110 -98
  180. package/lib/esm/Bar.mjs +17 -17
  181. package/lib/esm/Bubble.mjs +15 -15
  182. package/lib/esm/ChartMetaData.mjs +38 -0
  183. package/lib/esm/CompactHorizontalBar.mjs +17 -17
  184. package/lib/esm/Donut.mjs +19 -20
  185. package/lib/esm/Dots.mjs +66 -15
  186. package/lib/esm/HorizontalBar.mjs +17 -17
  187. package/lib/esm/Hover.mjs +67 -53
  188. package/lib/esm/Line.mjs +86 -20
  189. package/lib/esm/Pattern.mjs +119 -0
  190. package/lib/esm/Plot.mjs +6 -3
  191. package/lib/esm/Radar.mjs +20 -20
  192. package/lib/esm/RadialTree.mjs +13 -13
  193. package/lib/esm/Reference.mjs +56 -19
  194. package/lib/esm/ScatterPlot.mjs +10 -10
  195. package/lib/esm/Tooltip.mjs +17 -15
  196. package/lib/esm/a11y/PlotA11yView.mjs +3 -3
  197. package/lib/esm/component/Chart/AbstractChart.mjs +22 -19
  198. package/lib/esm/component/Chart/AbstractChart.type.mjs +16 -0
  199. package/lib/esm/component/Chart/AreaChart.mjs +21 -7
  200. package/lib/esm/component/Chart/BarChart.mjs +6 -3
  201. package/lib/esm/component/Chart/BubbleChart.mjs +4 -0
  202. package/lib/esm/component/Chart/DonutChart.mjs +0 -1
  203. package/lib/esm/component/Chart/HistogramChart.mjs +6 -3
  204. package/lib/esm/component/Chart/LineChart.mjs +14 -4
  205. package/lib/esm/component/Chart/index.mjs +8 -0
  206. package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +5 -5
  207. package/lib/esm/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
  208. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +17 -17
  209. package/lib/esm/component/ChartLegend/LegendItem/legend-item.shadow.css +11 -11
  210. package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +8 -8
  211. package/lib/esm/component/ChartLegend/LegendTable/legend-table.shadow.css +2 -2
  212. package/lib/esm/index.mjs +8 -0
  213. package/lib/esm/style/abstract-chart.shadow.css +13 -3
  214. package/lib/esm/style/area.shadow.css +8 -5
  215. package/lib/esm/style/axis.shadow.css +51 -60
  216. package/lib/esm/style/bar.shadow.css +6 -6
  217. package/lib/esm/style/bubble.shadow.css +3 -3
  218. package/lib/esm/style/donut.shadow.css +2 -2
  219. package/lib/esm/style/dot.shadow.css +37 -2
  220. package/lib/esm/style/hover.shadow.css +30 -13
  221. package/lib/esm/style/line.shadow.css +3 -3
  222. package/lib/esm/style/pattern.shadow.css +10 -0
  223. package/lib/esm/style/plotA11yView.shadow.css +3 -3
  224. package/lib/esm/style/radar.shadow.css +7 -7
  225. package/lib/esm/style/radial-tree.shadow.css +2 -2
  226. package/lib/esm/style/reference.shadow.css +4 -4
  227. package/lib/esm/style/scatterplot.shadow.css +1 -1
  228. package/lib/esm/style/tooltip.shadow.css +12 -12
  229. package/lib/esm/utils.mjs +20 -0
  230. package/lib/types/Axis.d.ts +3 -2
  231. package/lib/types/ChartMetaData.d.ts +17 -0
  232. package/lib/types/ChartMetaData.d.ts.map +1 -0
  233. package/lib/types/Donut.d.ts +1 -1
  234. package/lib/types/Hover.d.ts +2 -0
  235. package/lib/types/Pattern.d.ts +18 -0
  236. package/lib/types/Pattern.d.ts.map +1 -1
  237. package/lib/types/component/Chart/AbstractChart.d.ts.map +1 -1
  238. package/lib/types/component/Chart/AbstractChart.type.d.ts +22 -4
  239. package/lib/types/component/Chart/AbstractChart.type.d.ts.map +1 -1
  240. package/lib/types/component/Chart/AreaChart.d.ts.map +1 -1
  241. package/lib/types/component/Chart/AreaChart.type.d.ts +8 -4
  242. package/lib/types/component/Chart/AreaChart.type.d.ts.map +1 -1
  243. package/lib/types/component/Chart/BarChart.d.ts.map +1 -1
  244. package/lib/types/component/Chart/BarChart.type.d.ts +1 -0
  245. package/lib/types/component/Chart/BarChart.type.d.ts.map +1 -1
  246. package/lib/types/component/Chart/BubbleChart.d.ts.map +1 -1
  247. package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
  248. package/lib/types/component/Chart/BubbleChart.type.d.ts.map +1 -1
  249. package/lib/types/component/Chart/CigaretteChart.type.d.ts +1 -1
  250. package/lib/types/component/Chart/CigaretteChart.type.d.ts.map +1 -1
  251. package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
  252. package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts.map +1 -1
  253. package/lib/types/component/Chart/DonutChart.d.ts.map +1 -1
  254. package/lib/types/component/Chart/DonutChart.type.d.ts +1 -2
  255. package/lib/types/component/Chart/DonutChart.type.d.ts.map +1 -1
  256. package/lib/types/component/Chart/HistogramChart.d.ts.map +1 -1
  257. package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -0
  258. package/lib/types/component/Chart/HistogramChart.type.d.ts.map +1 -1
  259. package/lib/types/component/Chart/LineChart.d.ts.map +1 -1
  260. package/lib/types/component/Chart/LineChart.type.d.ts +1 -0
  261. package/lib/types/component/Chart/LineChart.type.d.ts.map +1 -1
  262. package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
  263. package/lib/types/component/Chart/RadarChart.type.d.ts.map +1 -1
  264. package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
  265. package/lib/types/component/Chart/ScatterPlotChart.type.d.ts.map +1 -1
  266. package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
  267. package/lib/types/component/Chart/VennChart.type.d.ts.map +1 -1
  268. package/lib/types/component/Chart/index.d.ts +2 -0
  269. package/lib/types/component/Chart/index.d.ts.map +1 -1
  270. package/lib/types/utils.d.ts +4 -1
  271. package/lib/types/utils.d.ts.map +1 -1
  272. package/package.json +15 -15
  273. package/lib/esm/utils/TextMeasurer.mjs +0 -27
package/lib/esm/Axis.mjs CHANGED
@@ -1,37 +1,40 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
3
  import { sstyled, Component } from "@semcore/core";
4
+ import { getFocusableIn } from "@semcore/core/lib/utils/focus-lock/getFocusableIn";
5
+ import propsForElement from "@semcore/core/lib/utils/propsForElement";
6
+ import useEnhancedEffect from "@semcore/core/lib/utils/use/useEnhancedEffect";
4
7
  import React from "react";
5
8
  import createElement from "./createElement.mjs";
6
9
  import { scaleOfBandwidth } from "./utils.mjs";
7
- import { TextMeasurer } from "./utils/TextMeasurer.mjs";
8
10
  /*!__reshadow-styles__:"./style/axis.shadow.css"*/
9
11
  const style = (
10
12
  /*__reshadow_css_start__*/
11
13
  (sstyled.insert(
12
14
  /*__inner_css_start__*/
13
- ".___SAxis_17qfg_gg_{stroke:var(--intergalactic-chart-grid-x-axis,oklch(.88 .002 175.6))}.___SAxis_17qfg_gg_.__hide_17qfg_gg_{display:none}.___STick_17qfg_gg_{font-size:var(--intergalactic-fs-100,12px);fill:var(--intergalactic-chart-grid-text-label,oklch(.097 .023 156.5/.468))}.___STick_17qfg_gg_.__primaryText_17qfg_gg_{fill:var(--intergalactic-text-primary,oklch(.1 .03 137/.899))}.___STick_17qfg_gg_.__hide_17qfg_gg_{display:none}.___SGrid_17qfg_gg_{fill:#0000;stroke:var(--intergalactic-border-secondary,#00151012)}@media (color-gamut:p3){.___SGrid_17qfg_gg_{stroke:var(--intergalactic-border-secondary,oklch(.176 .033 175.7/.07))}}.___STitle_17qfg_gg_{font-size:var(--intergalactic-fs-100,12px);fill:var(--intergalactic-text-hint,oklch(.097 .023 156.5/.468));transform-origin:var(--transform-origin_17qfg)}.___STitle_17qfg_gg_._position_top_17qfg_gg_{text-anchor:middle}.___STitle_17qfg_gg_._position_bottom_17qfg_gg_{text-anchor:middle;dominant-baseline:hanging}.___STitle_17qfg_gg_._position_left_17qfg_gg_,.___STitle_17qfg_gg_._position_right_17qfg_gg_{transform:rotate(-90deg);dominant-baseline:middle;text-anchor:middle}.___STitle_17qfg_gg_._position_left_17qfg_gg_.__verticalWritingMode_17qfg_gg_,.___STitle_17qfg_gg_._position_right_17qfg_gg_.__verticalWritingMode_17qfg_gg_{writing-mode:vertical-rl;transform:none}.___STick_17qfg_gg_._position_top_17qfg_gg_{transform:translateY(-12px);text-anchor:middle}.___STick_17qfg_gg_._position_bottom_17qfg_gg_{transform:translateY(12px);text-anchor:middle;dominant-baseline:hanging}.___STick_17qfg_gg_._position_bottom_17qfg_gg_ tspan{dominant-baseline:hanging}.___STick_17qfg_gg_._position_right_17qfg_gg_{transform:translateX(16px);dominant-baseline:middle}.___STick_17qfg_gg_._position_right_17qfg_gg_ tspan{dominant-baseline:middle}.___STick_17qfg_gg_._position_right_17qfg_gg_.__multiline_17qfg_gg_,.___STick_17qfg_gg_._position_right_17qfg_gg_.__multiline_17qfg_gg_ tspan{dominant-baseline:auto}.___STick_17qfg_gg_._position_left_17qfg_gg_{transform:translateX(-16px);text-anchor:end;dominant-baseline:middle}.___STick_17qfg_gg_._position_left_17qfg_gg_ tspan{dominant-baseline:middle}.___STick_17qfg_gg_._position_left_17qfg_gg_.__multiline_17qfg_gg_,.___STick_17qfg_gg_._position_left_17qfg_gg_.__multiline_17qfg_gg_ tspan{dominant-baseline:auto}.___STick_17qfg_gg_._position_custom_0_17qfg_gg_{transform:translateY(12px);text-anchor:middle;dominant-baseline:hanging}.___STick_17qfg_gg_._position_custom_0_17qfg_gg_ tspan{dominant-baseline:hanging}.___STick_17qfg_gg_._position_custom_1_17qfg_gg_{transform:translateX(-16px);text-anchor:end;dominant-baseline:middle}.___STick_17qfg_gg_._position_custom_1_17qfg_gg_ tspan{dominant-baseline:middle}",
15
+ '.___SAxis_ae62s_gg_{stroke:var(--intergalactic-chart-grid-x-axis,oklch(.88 .011 234.9))}.___SAxis_ae62s_gg_.__hide_ae62s_gg_{display:none}.___STick_ae62s_gg_{display:block;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);overflow:visible}.___STick_ae62s_gg_ [data-tick-content]{height:100%}.___STick_ae62s_gg_._position_bottom_ae62s_gg_{text-align:center}.___STick_ae62s_gg_._position_left_ae62s_gg_{text-align:right;dominant-baseline:central}.___STick_ae62s_gg_._position_left_ae62s_gg_ [data-tick-content]{align-content:center}.___STick_ae62s_gg_._position_top_ae62s_gg_{text-align:center}.___STick_ae62s_gg_._position_top_ae62s_gg_ [data-tick-content]{align-content:end}.___STick_ae62s_gg_._position_right_ae62s_gg_{dominant-baseline:central}.___STick_ae62s_gg_._position_right_ae62s_gg_ [data-tick-content]{align-content:center}.___STick_ae62s_gg_.__hide_ae62s_gg_{display:none}.___STick_ae62s_gg_.__primaryText_ae62s_gg_{color:var(--intergalactic-text-primary,oklch(.23 .009 245))}.___SGrid_ae62s_gg_{fill:#0000;stroke:var(--intergalactic-chart-grid-line,oklch(.7 .021 242));stroke-dasharray:0 6;stroke-linecap:round}.___STitle_ae62s_gg_{font-size:var(--intergalactic-fs-100,12px);fill:var(--intergalactic-chart-grid-text-label,#00132466);transform-origin:var(--transform-origin_ae62s)}.___STitle_ae62s_gg_._position_top_ae62s_gg_{text-anchor:middle}.___STitle_ae62s_gg_._position_bottom_ae62s_gg_{text-anchor:middle;dominant-baseline:hanging}.___STitle_ae62s_gg_._position_left_ae62s_gg_,.___STitle_ae62s_gg_._position_right_ae62s_gg_{transform:rotate(-90deg);dominant-baseline:middle;text-anchor:middle}.___STitle_ae62s_gg_._position_left_ae62s_gg_.__verticalWritingMode_ae62s_gg_,.___STitle_ae62s_gg_._position_right_ae62s_gg_.__verticalWritingMode_ae62s_gg_{writing-mode:vertical-rl;transform:none}.___STick_ae62s_gg_._position_custom_0_ae62s_gg_{transform:translateY(12px);text-anchor:middle;dominant-baseline:hanging}.___STick_ae62s_gg_._position_custom_0_ae62s_gg_ tspan{dominant-baseline:hanging}.___STick_ae62s_gg_._position_custom_1_ae62s_gg_{transform:translateX(-16px);text-anchor:end;dominant-baseline:middle}.___STick_ae62s_gg_._position_custom_1_ae62s_gg_ tspan{dominant-baseline:middle}',
14
16
  /*__inner_css_end__*/
15
- "17qfg_gg_"
17
+ "ae62s_gg_"
16
18
  ), /*__reshadow_css_end__*/
17
19
  {
18
- "__SAxis": "___SAxis_17qfg_gg_",
19
- "_hide": "__hide_17qfg_gg_",
20
- "__STick": "___STick_17qfg_gg_",
21
- "_primaryText": "__primaryText_17qfg_gg_",
22
- "__SGrid": "___SGrid_17qfg_gg_",
23
- "__STitle": "___STitle_17qfg_gg_",
24
- "--transform-origin": "--transform-origin_17qfg",
25
- "_position_top": "_position_top_17qfg_gg_",
26
- "_position_bottom": "_position_bottom_17qfg_gg_",
27
- "_position_right": "_position_right_17qfg_gg_",
28
- "_position_left": "_position_left_17qfg_gg_",
29
- "_verticalWritingMode": "__verticalWritingMode_17qfg_gg_",
30
- "_multiline": "__multiline_17qfg_gg_",
31
- "_position_custom_0": "_position_custom_0_17qfg_gg_",
32
- "_position_custom_1": "_position_custom_1_17qfg_gg_"
20
+ "__SAxis": "___SAxis_ae62s_gg_",
21
+ "_hide": "__hide_ae62s_gg_",
22
+ "__SGrid": "___SGrid_ae62s_gg_",
23
+ "__STitle": "___STitle_ae62s_gg_",
24
+ "--transform-origin": "--transform-origin_ae62s",
25
+ "_position_top": "_position_top_ae62s_gg_",
26
+ "_position_bottom": "_position_bottom_ae62s_gg_",
27
+ "_position_right": "_position_right_ae62s_gg_",
28
+ "_position_left": "_position_left_ae62s_gg_",
29
+ "_verticalWritingMode": "__verticalWritingMode_ae62s_gg_",
30
+ "__STick": "___STick_ae62s_gg_",
31
+ "_primaryText": "__primaryText_ae62s_gg_",
32
+ "_position_custom_0": "_position_custom_0_ae62s_gg_",
33
+ "_position_custom_1": "_position_custom_1_ae62s_gg_"
33
34
  })
34
35
  );
36
+ const TICK_MARGIN_X = 16;
37
+ const TICK_MARGIN_Y = 8;
35
38
  const CUSTOM_0 = /* @__PURE__ */ Symbol("custom_0");
36
39
  const CUSTOM_1 = /* @__PURE__ */ Symbol("custom_1");
37
40
  const MAP_INDEX_SCALE_SYMBOL = {
@@ -105,32 +108,46 @@ const MAP_POSITION_AXIS = {
105
108
  }
106
109
  };
107
110
  const MAP_POSITION_TICK = {
108
- top: ([xScale, yScale], value) => {
111
+ top: ([xScale, yScale], value, _, {
112
+ width,
113
+ height
114
+ }) => {
109
115
  const yRange = yScale.range();
116
+ const [translateX, translateY] = [-width / 2, -height - TICK_MARGIN_Y];
110
117
  return {
111
- x: scaleOfBandwidth(xScale, value),
112
- y: yRange[1]
118
+ x: scaleOfBandwidth(xScale, value) + translateX,
119
+ y: yRange[1] + translateY
113
120
  };
114
121
  },
115
- bottom: ([xScale, yScale], value) => {
122
+ bottom: ([xScale, yScale], value, _, {
123
+ width
124
+ }) => {
116
125
  const yRange = yScale.range();
126
+ const [translateX, translateY] = [-width / 2, TICK_MARGIN_Y];
117
127
  return {
118
- x: scaleOfBandwidth(xScale, value),
119
- y: yRange[0]
128
+ x: scaleOfBandwidth(xScale, value) + translateX,
129
+ y: yRange[0] + translateY
120
130
  };
121
131
  },
122
- right: ([xScale, yScale], value) => {
132
+ right: ([xScale, yScale], value, _, {
133
+ height
134
+ }) => {
123
135
  const xRange = xScale.range();
136
+ const [translateX, translateY] = [TICK_MARGIN_X, -height / 2];
124
137
  return {
125
- x: xRange[1],
126
- y: scaleOfBandwidth(yScale, value)
138
+ x: xRange[1] + translateX,
139
+ y: scaleOfBandwidth(yScale, value) + translateY
127
140
  };
128
141
  },
129
- left: ([xScale, yScale], value) => {
142
+ left: ([xScale, yScale], value, _, {
143
+ width,
144
+ height
145
+ }) => {
130
146
  const xRange = xScale.range();
147
+ const [translateX, translateY] = [-width - TICK_MARGIN_X, -height / 2];
131
148
  return {
132
- x: xRange[0],
133
- y: scaleOfBandwidth(yScale, value)
149
+ x: xRange[0] + translateX,
150
+ y: scaleOfBandwidth(yScale, value) + translateY
134
151
  };
135
152
  },
136
153
  [CUSTOM_0]: ([xScale, yScale], value, pos) => {
@@ -199,49 +216,35 @@ const MAP_POSITION_TITlE = {
199
216
  };
200
217
  }
201
218
  };
202
- function renderValue(value) {
219
+ function renderValue(value, locale = "en") {
203
220
  if (value instanceof Date) {
204
- return value.toLocaleDateString();
221
+ return new Intl.DateTimeFormat(locale, {
222
+ day: "numeric",
223
+ month: "short"
224
+ }).format(value);
205
225
  }
206
226
  return value;
207
227
  }
208
- function splitTextByWidth(measurer2) {
209
- return (text, maxWidth) => {
210
- {
211
- if (!text || !maxWidth || maxWidth <= 0) return [];
212
- const words = text.split(/\s+/).filter((word) => word.length > 0);
213
- if (words.length === 0) return [];
214
- const lines = [];
215
- let currentLine = words[0];
216
- for (let i = 1; i < words.length; i++) {
217
- const testLine = `${currentLine} ${words[i]}`.trim();
218
- const {
219
- width: testWidth
220
- } = measurer2.measure(testLine);
221
- if (testWidth <= maxWidth) {
222
- currentLine = testLine;
223
- } else {
224
- if (currentLine) {
225
- lines.push(currentLine);
226
- }
227
- currentLine = words[i];
228
- const {
229
- width: currentLineWidth
230
- } = measurer2.measure(currentLine);
231
- if (currentLineWidth > maxWidth) {
232
- lines.push(currentLine);
233
- currentLine = "";
234
- }
235
- }
236
- }
237
- if (currentLine) {
238
- lines.push(currentLine);
239
- }
240
- return lines;
241
- }
242
- };
243
- }
244
- const measurer = new TextMeasurer();
228
+ const TickForeignObject = /* @__PURE__ */ React.forwardRef(function({
229
+ children,
230
+ isRenderProp,
231
+ "aria-hidden": ariaHidden,
232
+ ...props
233
+ }, ref) {
234
+ const contentRef = React.useRef(null);
235
+ const [interactive, setInteractive] = React.useState(false);
236
+ useEnhancedEffect(() => {
237
+ if (!isRenderProp || !contentRef.current) return;
238
+ setInteractive(getFocusableIn(contentRef.current).length > 0);
239
+ }, []);
240
+ return /* @__PURE__ */ React.createElement("foreignObject", _extends({
241
+ ref,
242
+ "aria-hidden": interactive ? void 0 : true
243
+ }, propsForElement(props, "foreignObject")), /* @__PURE__ */ React.createElement("div", {
244
+ ref: contentRef,
245
+ "data-tick-content": true
246
+ }, children));
247
+ });
245
248
  class AxisRoot extends Component {
246
249
  get ticks() {
247
250
  const {
@@ -270,8 +273,7 @@ class AxisRoot extends Component {
270
273
  return {
271
274
  ticks: this.ticks,
272
275
  indexScale,
273
- position,
274
- splitTextByWidth: splitTextByWidth(measurer)
276
+ position
275
277
  };
276
278
  }
277
279
  getGridProps() {
@@ -316,17 +318,24 @@ function Ticks(props) {
316
318
  dataHintsHandler,
317
319
  children,
318
320
  childrenPosition = "inside",
319
- multiline,
320
- splitTextByWidth: splitTextByWidth2
321
+ locale,
322
+ primaryText,
323
+ size,
324
+ meta
321
325
  } = props;
322
- const tickBandwidth = scale[indexScale]?.bandwidth?.();
323
- const ticksWithLines = ticks.map((tick) => ({
324
- tick,
325
- lines: typeof tick === "string" && multiline ? splitTextByWidth2(tick, tickBandwidth) : []
326
- }));
326
+ const isRenderProp = typeof children === "function";
327
+ const isXScale = indexScale === 0;
328
+ const axis = isXScale ? "horizontal" : "vertical";
329
+ const [_, plotHeight] = size;
330
+ const currentScale = scale[indexScale];
331
+ const secondaryScale = scale[isXScale ? 1 : 0];
332
+ const [startPointCurrentScale, endPointCurrentScale] = currentScale.range();
333
+ const [startPointSecondaryScale, endPointSecondaryScale] = secondaryScale.range();
334
+ const tickStepSize = currentScale?.step?.() ?? Math.abs(startPointCurrentScale - endPointCurrentScale) / ticks.length;
335
+ const [tickWidth, tickHeight] = isXScale ? [tickStepSize, Math.max(Math.abs(plotHeight - startPointSecondaryScale), endPointSecondaryScale)] : [startPointSecondaryScale, tickStepSize];
327
336
  const pos = MAP_POSITION_TICK[position] ?? MAP_POSITION_TICK[MAP_INDEX_SCALE_SYMBOL[indexScale]];
328
337
  const positionClass = MAP_POSITION_TICK[position] ? position : `custom_${indexScale}`;
329
- if (typeof children === "function") {
338
+ if (isRenderProp) {
330
339
  const labelGetter = (value) => {
331
340
  const result = children({
332
341
  value
@@ -339,30 +348,33 @@ function Ticks(props) {
339
348
  dataHintsHandler.addKeyLabelGetter("horizontal", labelGetter);
340
349
  }
341
350
  }
342
- return ticksWithLines.map(({
343
- tick: value,
344
- lines
345
- }, i) => {
351
+ meta.setTicksSize(axis, {
352
+ width: tickWidth,
353
+ height: tickHeight
354
+ });
355
+ meta.setTicksVisibility(axis, !hide);
356
+ meta.setTicksPosition(axis, position);
357
+ return ticks.map((value, i) => {
346
358
  var _ref2;
347
- const displayValue = typeof children === "function" ? void 0 : renderValue(value);
359
+ const displayValue = isRenderProp ? void 0 : renderValue(value, locale);
348
360
  return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(STick, _ref2.cn("STick", {
349
- "aria-hidden": true,
350
361
  "key": i,
351
- "render": "text",
352
- "childrenPosition": childrenPosition,
353
- "__excludeProps": ["data", "scale", "format", "value"],
354
- "value": value,
355
362
  "index": i,
363
+ "render": TickForeignObject,
364
+ "childrenPosition": childrenPosition,
365
+ "width": tickWidth,
366
+ "height": tickHeight,
356
367
  "position": positionClass,
357
368
  "hide": hide,
358
- "multiline": multiline,
359
- "primaryText": props.primaryText,
360
- ...pos(scale, value, position)
361
- }), lines.length > 1 ? lines.map((line, lineIndex) => /* @__PURE__ */ React.createElement("tspan", _extends({
362
- key: line
363
- }, pos(scale, value, position), {
364
- dy: lineIndex * 15
365
- }), line)) : displayValue);
369
+ "primaryText": primaryText,
370
+ "value": value,
371
+ "isRenderProp": isRenderProp,
372
+ "__excludeProps": ["data", "scale", "format", "value"],
373
+ ...pos(scale, value, position, {
374
+ width: tickWidth,
375
+ height: tickHeight
376
+ })
377
+ }), displayValue);
366
378
  });
367
379
  }
368
380
  function Grid(props) {
package/lib/esm/Bar.mjs CHANGED
@@ -12,26 +12,26 @@ const style = (
12
12
  /*__reshadow_css_start__*/
13
13
  (sstyled.insert(
14
14
  /*__inner_css_start__*/
15
- ".___SBar_1yabt_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140));transition-property:height,width,y;transition-duration:var(--duration_1yabt);transition-timing-function:ease-in-out}.___SBar_1yabt_gg_.__color_1yabt_gg_{fill:var(--color_1yabt)}.___SBar_1yabt_gg_.__pattern_1yabt_gg_.__color_1yabt_gg_{fill:var(--pattern_1yabt);stroke:var(--color_1yabt);stroke-width:1px}.___SBar_1yabt_gg_.__hide_1yabt_gg_{display:none}.___SBar_1yabt_gg_.__transparent_1yabt_gg_{opacity:.3}.___SBar_1yabt_gg_.__onClick_1yabt_gg_{cursor:pointer}.___SBackground_1yabt_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg,oklch(.96 .001 180));opacity:.4}.___SBackground_1yabt_gg_.__onClick_1yabt_gg_{cursor:pointer}.___SBarAnnotation_1yabt_gg_{display:flex;justify-content:space-between}.___SBarLabel_1yabt_gg_{color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));margin-right:auto}.___SBarLabel_1yabt_gg_,.___SBarPercent_1yabt_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}.___SBarPercent_1yabt_gg_{color:var(--intergalactic-text-secondary,oklch(.097 .023 156.5/.468));margin-right:var(--intergalactic-spacing-2x,8px)}.___SBarValue_1yabt_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286);text-align:right}.___SCompactHorizontalBarHoverRect_1yabt_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover,oklch(.177 .033 175.6/.042))}",
15
+ ".___SBar_avucd_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition-property:height,width,y;transition-duration:var(--duration_avucd);transition-timing-function:ease-in-out}.___SBar_avucd_gg_.__color_avucd_gg_{fill:var(--color_avucd)}.___SBar_avucd_gg_.__pattern_avucd_gg_.__color_avucd_gg_{fill:var(--pattern_avucd);stroke:var(--color_avucd);stroke-width:1px}.___SBar_avucd_gg_.__hide_avucd_gg_{display:none}.___SBar_avucd_gg_.__transparent_avucd_gg_{opacity:.3}.___SBar_avucd_gg_.__onClick_avucd_gg_{cursor:pointer}.___SBackground_avucd_gg_{fill:var(--intergalactic-chart-grid-bar-base-bg,oklch(.92 .008 233.5));opacity:.4}.___SBackground_avucd_gg_.__onClick_avucd_gg_{cursor:pointer}.___SBarAnnotation_avucd_gg_{display:flex;justify-content:space-between}.___SBarLabel_avucd_gg_{color:var(--intergalactic-text-primary,oklch(.23 .009 245));margin-right:auto}.___SBarLabel_avucd_gg_,.___SBarPercent_avucd_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}.___SBarPercent_avucd_gg_{color:var(--intergalactic-text-secondary,oklch(.182 .045 244.8/.593));margin-right:var(--intergalactic-spacing-2x,8px)}.___SBarValue_avucd_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary,oklch(.23 .009 245));font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286);text-align:right}.___SCompactHorizontalBarHoverRect_avucd_gg_{fill:var(--intergalactic-chart-grid-bar-hover,oklch(.375 .09 242.7/.05))}",
16
16
  /*__inner_css_end__*/
17
- "1yabt_gg_"
17
+ "avucd_gg_"
18
18
  ), /*__reshadow_css_end__*/
19
19
  {
20
- "__SBar": "___SBar_1yabt_gg_",
21
- "--duration": "--duration_1yabt",
22
- "_color": "__color_1yabt_gg_",
23
- "--color": "--color_1yabt",
24
- "_pattern": "__pattern_1yabt_gg_",
25
- "--pattern": "--pattern_1yabt",
26
- "_hide": "__hide_1yabt_gg_",
27
- "_transparent": "__transparent_1yabt_gg_",
28
- "_onClick": "__onClick_1yabt_gg_",
29
- "__SBackground": "___SBackground_1yabt_gg_",
30
- "__SBarAnnotation": "___SBarAnnotation_1yabt_gg_",
31
- "__SBarLabel": "___SBarLabel_1yabt_gg_",
32
- "__SBarPercent": "___SBarPercent_1yabt_gg_",
33
- "__SBarValue": "___SBarValue_1yabt_gg_",
34
- "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1yabt_gg_"
20
+ "__SBar": "___SBar_avucd_gg_",
21
+ "--duration": "--duration_avucd",
22
+ "_color": "__color_avucd_gg_",
23
+ "--color": "--color_avucd",
24
+ "_pattern": "__pattern_avucd_gg_",
25
+ "--pattern": "--pattern_avucd",
26
+ "_hide": "__hide_avucd_gg_",
27
+ "_transparent": "__transparent_avucd_gg_",
28
+ "_onClick": "__onClick_avucd_gg_",
29
+ "__SBackground": "___SBackground_avucd_gg_",
30
+ "__SBarAnnotation": "___SBarAnnotation_avucd_gg_",
31
+ "__SBarLabel": "___SBarLabel_avucd_gg_",
32
+ "__SBarPercent": "___SBarPercent_avucd_gg_",
33
+ "__SBarValue": "___SBarValue_avucd_gg_",
34
+ "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_avucd_gg_"
35
35
  })
36
36
  );
37
37
  const MIN_HEIGHT = 2;
@@ -15,24 +15,24 @@ const style = (
15
15
  /*__reshadow_css_start__*/
16
16
  (sstyled.insert(
17
17
  /*__inner_css_start__*/
18
- ".___SBubble_7qqxu_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140));stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;transition-property:cx,cy;transition-duration:var(--duration_7qqxu);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SBubble_7qqxu_gg_:hover{opacity:.8}}g._visible_false_7qqxu_gg_{display:none}.___SBubble_7qqxu_gg_.__clickable_7qqxu_gg_{cursor:pointer}.___SBubble_7qqxu_gg_.__color_7qqxu_gg_{fill:var(--color_7qqxu)}.___SBubble_7qqxu_gg_.__pattern_7qqxu_gg_.__color_7qqxu_gg_{fill:var(--pattern_7qqxu);stroke:var(--color_7qqxu);stroke-width:1px}.___SBubble_7qqxu_gg_.__transparent_7qqxu_gg_{opacity:.3}.___SCenter_7qqxu_gg_{text-anchor:middle;font-size:calc(var(--intergalactic-fs-100, 12px) - 1px);stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140))}.___SCenter_7qqxu_gg_.__color_7qqxu_gg_{stroke:var(--color_7qqxu)}.___SCenter_7qqxu_gg_.__transparent_7qqxu_gg_{opacity:.3}.___SLabel_7qqxu_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140))}.___SLabel_7qqxu_gg_._position_right_7qqxu_gg_{text-anchor:end}.___SLabel_7qqxu_gg_._position_left_7qqxu_gg_{text-anchor:start}.___SLabel_7qqxu_gg_.__color_7qqxu_gg_{fill:var(--color_7qqxu)}.___SLabel_7qqxu_gg_.__transparent_7qqxu_gg_{opacity:.3}",
18
+ ".___SBubble_1tr0w_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;transition-property:cx,cy;transition-duration:var(--duration_1tr0w);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SBubble_1tr0w_gg_:hover{opacity:.8}}g._visible_false_1tr0w_gg_{display:none}.___SBubble_1tr0w_gg_.__clickable_1tr0w_gg_{cursor:pointer}.___SBubble_1tr0w_gg_.__color_1tr0w_gg_{fill:var(--color_1tr0w)}.___SBubble_1tr0w_gg_.__pattern_1tr0w_gg_.__color_1tr0w_gg_{fill:var(--pattern_1tr0w);stroke:var(--color_1tr0w);stroke-width:1px}.___SBubble_1tr0w_gg_.__transparent_1tr0w_gg_{opacity:.3}.___SCenter_1tr0w_gg_{text-anchor:middle;font-size:calc(var(--intergalactic-fs-100, 12px) - 1px);stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SCenter_1tr0w_gg_.__color_1tr0w_gg_{stroke:var(--color_1tr0w)}.___SCenter_1tr0w_gg_.__transparent_1tr0w_gg_{opacity:.3}.___SLabel_1tr0w_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SLabel_1tr0w_gg_._position_right_1tr0w_gg_{text-anchor:end}.___SLabel_1tr0w_gg_._position_left_1tr0w_gg_{text-anchor:start}.___SLabel_1tr0w_gg_.__color_1tr0w_gg_{fill:var(--color_1tr0w)}.___SLabel_1tr0w_gg_.__transparent_1tr0w_gg_{opacity:.3}",
19
19
  /*__inner_css_end__*/
20
- "7qqxu_gg_"
20
+ "1tr0w_gg_"
21
21
  ), /*__reshadow_css_end__*/
22
22
  {
23
- "_visible_false": "_visible_false_7qqxu_gg_",
24
- "__SBubble": "___SBubble_7qqxu_gg_",
25
- "_clickable": "__clickable_7qqxu_gg_",
26
- "_color": "__color_7qqxu_gg_",
27
- "--color": "--color_7qqxu",
28
- "_pattern": "__pattern_7qqxu_gg_",
29
- "--pattern": "--pattern_7qqxu",
30
- "_transparent": "__transparent_7qqxu_gg_",
31
- "__SCenter": "___SCenter_7qqxu_gg_",
32
- "__SLabel": "___SLabel_7qqxu_gg_",
33
- "_position_right": "_position_right_7qqxu_gg_",
34
- "_position_left": "_position_left_7qqxu_gg_",
35
- "--duration": "--duration_7qqxu"
23
+ "_visible_false": "_visible_false_1tr0w_gg_",
24
+ "__SBubble": "___SBubble_1tr0w_gg_",
25
+ "_clickable": "__clickable_1tr0w_gg_",
26
+ "_color": "__color_1tr0w_gg_",
27
+ "--color": "--color_1tr0w",
28
+ "_pattern": "__pattern_1tr0w_gg_",
29
+ "--pattern": "--pattern_1tr0w",
30
+ "_transparent": "__transparent_1tr0w_gg_",
31
+ "__SCenter": "___SCenter_1tr0w_gg_",
32
+ "__SLabel": "___SLabel_1tr0w_gg_",
33
+ "_position_right": "_position_right_1tr0w_gg_",
34
+ "_position_left": "_position_left_1tr0w_gg_",
35
+ "--duration": "--duration_1tr0w"
36
36
  })
37
37
  );
38
38
  class BubbleRoot extends Component {
@@ -0,0 +1,38 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ class ChartMetaData {
3
+ constructor() {
4
+ _defineProperty(this, "ticks", {
5
+ horizontal: {
6
+ size: null,
7
+ isVisible: null,
8
+ position: null
9
+ },
10
+ vertical: {
11
+ size: null,
12
+ isVisible: null,
13
+ position: null
14
+ }
15
+ });
16
+ }
17
+ getTicksSize(axis) {
18
+ return this.ticks[axis].size;
19
+ }
20
+ setTicksSize(axis, payload) {
21
+ this.ticks[axis].size = payload;
22
+ }
23
+ getTicksVisibility(axis) {
24
+ return this.ticks[axis].isVisible;
25
+ }
26
+ setTicksVisibility(axis, isVisible) {
27
+ this.ticks[axis].isVisible = isVisible;
28
+ }
29
+ getTicksPosition(axis) {
30
+ return this.ticks[axis].position;
31
+ }
32
+ setTicksPosition(axis, position) {
33
+ this.ticks[axis].position = position;
34
+ }
35
+ }
36
+ export {
37
+ ChartMetaData
38
+ };
@@ -16,26 +16,26 @@ const style = (
16
16
  /*__reshadow_css_start__*/
17
17
  (sstyled.insert(
18
18
  /*__inner_css_start__*/
19
- ".___SBar_1yabt_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140));transition-property:height,width,y;transition-duration:var(--duration_1yabt);transition-timing-function:ease-in-out}.___SBar_1yabt_gg_.__color_1yabt_gg_{fill:var(--color_1yabt)}.___SBar_1yabt_gg_.__pattern_1yabt_gg_.__color_1yabt_gg_{fill:var(--pattern_1yabt);stroke:var(--color_1yabt);stroke-width:1px}.___SBar_1yabt_gg_.__hide_1yabt_gg_{display:none}.___SBar_1yabt_gg_.__transparent_1yabt_gg_{opacity:.3}.___SBar_1yabt_gg_.__onClick_1yabt_gg_{cursor:pointer}.___SBackground_1yabt_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg,oklch(.96 .001 180));opacity:.4}.___SBackground_1yabt_gg_.__onClick_1yabt_gg_{cursor:pointer}.___SBarAnnotation_1yabt_gg_{display:flex;justify-content:space-between}.___SBarLabel_1yabt_gg_{color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));margin-right:auto}.___SBarLabel_1yabt_gg_,.___SBarPercent_1yabt_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}.___SBarPercent_1yabt_gg_{color:var(--intergalactic-text-secondary,oklch(.097 .023 156.5/.468));margin-right:var(--intergalactic-spacing-2x,8px)}.___SBarValue_1yabt_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286);text-align:right}.___SCompactHorizontalBarHoverRect_1yabt_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover,oklch(.177 .033 175.6/.042))}",
19
+ ".___SBar_avucd_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition-property:height,width,y;transition-duration:var(--duration_avucd);transition-timing-function:ease-in-out}.___SBar_avucd_gg_.__color_avucd_gg_{fill:var(--color_avucd)}.___SBar_avucd_gg_.__pattern_avucd_gg_.__color_avucd_gg_{fill:var(--pattern_avucd);stroke:var(--color_avucd);stroke-width:1px}.___SBar_avucd_gg_.__hide_avucd_gg_{display:none}.___SBar_avucd_gg_.__transparent_avucd_gg_{opacity:.3}.___SBar_avucd_gg_.__onClick_avucd_gg_{cursor:pointer}.___SBackground_avucd_gg_{fill:var(--intergalactic-chart-grid-bar-base-bg,oklch(.92 .008 233.5));opacity:.4}.___SBackground_avucd_gg_.__onClick_avucd_gg_{cursor:pointer}.___SBarAnnotation_avucd_gg_{display:flex;justify-content:space-between}.___SBarLabel_avucd_gg_{color:var(--intergalactic-text-primary,oklch(.23 .009 245));margin-right:auto}.___SBarLabel_avucd_gg_,.___SBarPercent_avucd_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}.___SBarPercent_avucd_gg_{color:var(--intergalactic-text-secondary,oklch(.182 .045 244.8/.593));margin-right:var(--intergalactic-spacing-2x,8px)}.___SBarValue_avucd_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary,oklch(.23 .009 245));font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286);text-align:right}.___SCompactHorizontalBarHoverRect_avucd_gg_{fill:var(--intergalactic-chart-grid-bar-hover,oklch(.375 .09 242.7/.05))}",
20
20
  /*__inner_css_end__*/
21
- "1yabt_gg_"
21
+ "avucd_gg_"
22
22
  ), /*__reshadow_css_end__*/
23
23
  {
24
- "__SBar": "___SBar_1yabt_gg_",
25
- "--duration": "--duration_1yabt",
26
- "_color": "__color_1yabt_gg_",
27
- "--color": "--color_1yabt",
28
- "_pattern": "__pattern_1yabt_gg_",
29
- "--pattern": "--pattern_1yabt",
30
- "_hide": "__hide_1yabt_gg_",
31
- "_transparent": "__transparent_1yabt_gg_",
32
- "_onClick": "__onClick_1yabt_gg_",
33
- "__SBackground": "___SBackground_1yabt_gg_",
34
- "__SBarAnnotation": "___SBarAnnotation_1yabt_gg_",
35
- "__SBarLabel": "___SBarLabel_1yabt_gg_",
36
- "__SBarPercent": "___SBarPercent_1yabt_gg_",
37
- "__SBarValue": "___SBarValue_1yabt_gg_",
38
- "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1yabt_gg_"
24
+ "__SBar": "___SBar_avucd_gg_",
25
+ "--duration": "--duration_avucd",
26
+ "_color": "__color_avucd_gg_",
27
+ "--color": "--color_avucd",
28
+ "_pattern": "__pattern_avucd_gg_",
29
+ "--pattern": "--pattern_avucd",
30
+ "_hide": "__hide_avucd_gg_",
31
+ "_transparent": "__transparent_avucd_gg_",
32
+ "_onClick": "__onClick_avucd_gg_",
33
+ "__SBackground": "___SBackground_avucd_gg_",
34
+ "__SBarAnnotation": "___SBarAnnotation_avucd_gg_",
35
+ "__SBarLabel": "___SBarLabel_avucd_gg_",
36
+ "__SBarPercent": "___SBarPercent_avucd_gg_",
37
+ "__SBarValue": "___SBarValue_avucd_gg_",
38
+ "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_avucd_gg_"
39
39
  })
40
40
  );
41
41
  const MIN_WIDTH = 4;
package/lib/esm/Donut.mjs CHANGED
@@ -17,19 +17,19 @@ const style = (
17
17
  /*__reshadow_css_start__*/
18
18
  (sstyled.insert(
19
19
  /*__inner_css_start__*/
20
- ".___SPie_92f82_gg_{stroke:var(--intergalactic-chart-grid-border,#fff);fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140))}.___SPie_92f82_gg_.__color_92f82_gg_{fill:var(--color_92f82)}.___SPie_92f82_gg_.__pattern_92f82_gg_.__color_92f82_gg_{fill:var(--pattern_92f82);stroke:var(--color_92f82);stroke-width:1px}.___SPie_92f82_gg_.__transparent_92f82_gg_{opacity:.3}.___SEmptyData_92f82_gg_{fill:var(--intergalactic-chart-palette-order-null,oklch(.9 .002 177))}.___SEmptyData_92f82_gg_.__color_92f82_gg_{fill:var(--color_92f82)}.___SLabel_92f82_gg_{text-anchor:middle;vertical-anchor:middle;font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}",
20
+ ".___SPie_1s8f1_gg_{stroke:var(--intergalactic-chart-grid-border,#fff);fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SPie_1s8f1_gg_.__color_1s8f1_gg_{fill:var(--color_1s8f1)}.___SPie_1s8f1_gg_.__pattern_1s8f1_gg_.__color_1s8f1_gg_{fill:var(--pattern_1s8f1);stroke:var(--color_1s8f1);stroke-width:1px}.___SPie_1s8f1_gg_.__transparent_1s8f1_gg_{opacity:.3}.___SEmptyData_1s8f1_gg_{fill:var(--intergalactic-chart-palette-order-null,oklch(.9 .009 234))}.___SEmptyData_1s8f1_gg_.__color_1s8f1_gg_{fill:var(--color_1s8f1)}.___SLabel_1s8f1_gg_{text-anchor:middle;vertical-anchor:middle;font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}",
21
21
  /*__inner_css_end__*/
22
- "92f82_gg_"
22
+ "1s8f1_gg_"
23
23
  ), /*__reshadow_css_end__*/
24
24
  {
25
- "__SPie": "___SPie_92f82_gg_",
26
- "_color": "__color_92f82_gg_",
27
- "--color": "--color_92f82",
28
- "_pattern": "__pattern_92f82_gg_",
29
- "--pattern": "--pattern_92f82",
30
- "_transparent": "__transparent_92f82_gg_",
31
- "__SEmptyData": "___SEmptyData_92f82_gg_",
32
- "__SLabel": "___SLabel_92f82_gg_"
25
+ "__SPie": "___SPie_1s8f1_gg_",
26
+ "_color": "__color_1s8f1_gg_",
27
+ "--color": "--color_1s8f1",
28
+ "_pattern": "__pattern_1s8f1_gg_",
29
+ "--pattern": "--pattern_1s8f1",
30
+ "_transparent": "__transparent_1s8f1_gg_",
31
+ "__SEmptyData": "___SEmptyData_1s8f1_gg_",
32
+ "__SLabel": "___SLabel_1s8f1_gg_"
33
33
  })
34
34
  );
35
35
  const DEFAULT_INSTANCE = /* @__PURE__ */ Symbol("DEFAULT_INSTANCE");
@@ -83,7 +83,8 @@ function transitionRadiusPie({
83
83
  };
84
84
  });
85
85
  }
86
- const increaseFactor = 8;
86
+ const increaseFactor = 4;
87
+ const donutThickness = 16;
87
88
  function getOuterRadius({
88
89
  size,
89
90
  halfsize
@@ -118,11 +119,11 @@ class DonutRoot extends Component {
118
119
  }) => {
119
120
  const {
120
121
  duration,
121
- innerRadius,
122
122
  d3Arc,
123
123
  paddingAngle
124
124
  } = this.asProps;
125
125
  const outerRadius = d3Arc.outerRadius()();
126
+ const innerRadius = d3Arc.innerRadius()();
126
127
  const outerRadiusStartEnd = active ? [+element.dataset["currentRadius"] || outerRadius, outerRadius + increaseFactor] : [+element.dataset["currentRadius"] || outerRadius, outerRadius];
127
128
  if (this.canAnimatedHover && duration > 0) {
128
129
  transitionRadiusPie({
@@ -324,7 +325,7 @@ _defineProperty(DonutRoot, "displayName", "Donut");
324
325
  _defineProperty(DonutRoot, "style", style);
325
326
  _defineProperty(DonutRoot, "enhance", [uniqueIDEnhancement()]);
326
327
  _defineProperty(DonutRoot, "defaultProps", ({
327
- innerRadius = 0,
328
+ innerRadius: innerRadiusProp,
328
329
  paddingAngle = 0,
329
330
  outerRadius,
330
331
  halfsize = false,
@@ -332,15 +333,13 @@ _defineProperty(DonutRoot, "defaultProps", ({
332
333
  size
333
334
  }
334
335
  }) => {
335
- const d3Arc = arc().outerRadius(outerRadius || getOuterRadius({
336
- size,
337
- halfsize,
338
- outerRadius
339
- })).innerRadius(innerRadius).padAngle(paddingAngle);
340
- const d3ArcOut = arc().outerRadius((outerRadius || getOuterRadius({
336
+ const radius = outerRadius || getOuterRadius({
341
337
  size,
342
338
  halfsize
343
- })) + increaseFactor).innerRadius(innerRadius).padAngle(paddingAngle);
339
+ });
340
+ const innerRadius = innerRadiusProp ?? Math.max(radius - donutThickness, 0);
341
+ const d3Arc = arc().outerRadius(radius).innerRadius(innerRadius).padAngle(paddingAngle);
342
+ const d3ArcOut = arc().outerRadius(radius + increaseFactor).innerRadius(innerRadius).padAngle(paddingAngle);
344
343
  let d3Pie = pie().sort(null).value(([, value]) => value);
345
344
  d3Pie[DEFAULT_INSTANCE] = true;
346
345
  if (halfsize) {