@semcore/d3-chart 17.3.1 → 18.0.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 (289) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/cjs/Area.js +11 -11
  3. package/lib/cjs/Axis.js +55 -58
  4. package/lib/cjs/Axis.js.map +1 -1
  5. package/lib/cjs/Bar.js +16 -16
  6. package/lib/cjs/Bubble.js +14 -14
  7. package/lib/cjs/CompactHorizontalBar.js +16 -16
  8. package/lib/cjs/Donut.js +9 -9
  9. package/lib/cjs/Dots.js +14 -11
  10. package/lib/cjs/Dots.js.map +1 -1
  11. package/lib/cjs/HorizontalBar.js +16 -16
  12. package/lib/cjs/Hover.js +158 -39
  13. package/lib/cjs/Hover.js.map +1 -1
  14. package/lib/cjs/Line.js +9 -9
  15. package/lib/cjs/Plot.js +6 -4
  16. package/lib/cjs/Plot.js.map +1 -1
  17. package/lib/cjs/Radar.js +19 -19
  18. package/lib/cjs/RadialTree.js +12 -12
  19. package/lib/cjs/Reference.js +12 -12
  20. package/lib/cjs/ScatterPlot.js +9 -9
  21. package/lib/cjs/Tooltip.js +20 -11
  22. package/lib/cjs/Tooltip.js.map +1 -1
  23. package/lib/cjs/Venn.js +9 -9
  24. package/lib/cjs/a11y/PlotA11yModule.js +2 -2
  25. package/lib/cjs/a11y/PlotA11yView.js +2 -2
  26. package/lib/cjs/component/Chart/AbstractChart.js +139 -50
  27. package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
  28. package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
  29. package/lib/cjs/component/Chart/AreaChart.js +12 -10
  30. package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
  31. package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
  32. package/lib/cjs/component/Chart/BarChart.js +9 -7
  33. package/lib/cjs/component/Chart/BarChart.js.map +1 -1
  34. package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
  35. package/lib/cjs/component/Chart/BubbleChart.js +21 -8
  36. package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
  37. package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
  38. package/lib/cjs/component/Chart/CigaretteChart.js +33 -30
  39. package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
  40. package/lib/cjs/component/Chart/CigaretteChart.type.js.map +1 -1
  41. package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +2 -1
  42. package/lib/cjs/component/Chart/CompactHorizontalBarChart.js.map +1 -1
  43. package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  44. package/lib/cjs/component/Chart/DonutChart.js +5 -4
  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/HistogramChart.js +6 -4
  48. package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
  49. package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
  50. package/lib/cjs/component/Chart/LineChart.js +9 -7
  51. package/lib/cjs/component/Chart/LineChart.js.map +1 -1
  52. package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
  53. package/lib/cjs/component/Chart/RadarChart.js +3 -2
  54. package/lib/cjs/component/Chart/RadarChart.js.map +1 -1
  55. package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
  56. package/lib/cjs/component/Chart/ScatterPlotChart.js +19 -7
  57. package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
  58. package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
  59. package/lib/cjs/component/Chart/VennChart.js +6 -5
  60. package/lib/cjs/component/Chart/VennChart.js.map +1 -1
  61. package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
  62. package/lib/cjs/component/ChartLegend/BaseLegend.js +4 -2
  63. package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
  64. package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
  65. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  66. package/lib/cjs/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
  67. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +23 -18
  68. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  69. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
  70. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  71. package/lib/cjs/component/ChartLegend/LegendItem/legend-item.shadow.css +16 -40
  72. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +12 -8
  73. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  74. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  75. package/lib/cjs/component/ChartLegend/LegendTable/legend-table.shadow.css +6 -2
  76. package/lib/cjs/style/abstract-chart.shadow.css +31 -1
  77. package/lib/cjs/style/area.shadow.css +6 -5
  78. package/lib/cjs/style/axis.shadow.css +2 -2
  79. package/lib/cjs/style/bar.shadow.css +7 -7
  80. package/lib/cjs/style/bubble.shadow.css +4 -4
  81. package/lib/cjs/style/donut.shadow.css +3 -3
  82. package/lib/cjs/style/dot.shadow.css +9 -3
  83. package/lib/cjs/style/hover.shadow.css +19 -1
  84. package/lib/cjs/style/line.shadow.css +4 -4
  85. package/lib/cjs/style/radar.shadow.css +5 -5
  86. package/lib/cjs/style/radial-tree.shadow.css +3 -3
  87. package/lib/cjs/style/reference.shadow.css +1 -1
  88. package/lib/cjs/style/scatterplot.shadow.css +1 -1
  89. package/lib/cjs/style/tooltip.shadow.css +23 -14
  90. package/lib/cjs/style/venn.shadow.css +3 -3
  91. package/lib/cjs/types/Hover.d.js.map +1 -1
  92. package/lib/cjs/utils/TextMeasurer.js +33 -0
  93. package/lib/cjs/utils/TextMeasurer.js.map +1 -0
  94. package/lib/es6/Area.js +11 -11
  95. package/lib/es6/Axis.js +55 -57
  96. package/lib/es6/Axis.js.map +1 -1
  97. package/lib/es6/Bar.js +16 -16
  98. package/lib/es6/Bubble.js +14 -14
  99. package/lib/es6/CompactHorizontalBar.js +16 -16
  100. package/lib/es6/Donut.js +9 -9
  101. package/lib/es6/Dots.js +14 -11
  102. package/lib/es6/Dots.js.map +1 -1
  103. package/lib/es6/HorizontalBar.js +16 -16
  104. package/lib/es6/Hover.js +158 -39
  105. package/lib/es6/Hover.js.map +1 -1
  106. package/lib/es6/Line.js +9 -9
  107. package/lib/es6/Plot.js +6 -4
  108. package/lib/es6/Plot.js.map +1 -1
  109. package/lib/es6/Radar.js +19 -19
  110. package/lib/es6/RadialTree.js +12 -12
  111. package/lib/es6/Reference.js +12 -12
  112. package/lib/es6/ScatterPlot.js +9 -9
  113. package/lib/es6/Tooltip.js +20 -11
  114. package/lib/es6/Tooltip.js.map +1 -1
  115. package/lib/es6/Venn.js +9 -9
  116. package/lib/es6/a11y/PlotA11yModule.js +2 -2
  117. package/lib/es6/a11y/PlotA11yView.js +2 -2
  118. package/lib/es6/component/Chart/AbstractChart.js +136 -48
  119. package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
  120. package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
  121. package/lib/es6/component/Chart/AreaChart.js +12 -10
  122. package/lib/es6/component/Chart/AreaChart.js.map +1 -1
  123. package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
  124. package/lib/es6/component/Chart/BarChart.js +9 -7
  125. package/lib/es6/component/Chart/BarChart.js.map +1 -1
  126. package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
  127. package/lib/es6/component/Chart/BubbleChart.js +22 -9
  128. package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
  129. package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
  130. package/lib/es6/component/Chart/CigaretteChart.js +33 -30
  131. package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
  132. package/lib/es6/component/Chart/CigaretteChart.type.js.map +1 -1
  133. package/lib/es6/component/Chart/CompactHorizontalBarChart.js +2 -1
  134. package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -1
  135. package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  136. package/lib/es6/component/Chart/DonutChart.js +5 -4
  137. package/lib/es6/component/Chart/DonutChart.js.map +1 -1
  138. package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
  139. package/lib/es6/component/Chart/HistogramChart.js +6 -4
  140. package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
  141. package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
  142. package/lib/es6/component/Chart/LineChart.js +9 -7
  143. package/lib/es6/component/Chart/LineChart.js.map +1 -1
  144. package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
  145. package/lib/es6/component/Chart/RadarChart.js +3 -2
  146. package/lib/es6/component/Chart/RadarChart.js.map +1 -1
  147. package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
  148. package/lib/es6/component/Chart/ScatterPlotChart.js +20 -8
  149. package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
  150. package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
  151. package/lib/es6/component/Chart/VennChart.js +6 -5
  152. package/lib/es6/component/Chart/VennChart.js.map +1 -1
  153. package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
  154. package/lib/es6/component/ChartLegend/BaseLegend.js +4 -2
  155. package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
  156. package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
  157. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  158. package/lib/es6/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
  159. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +23 -18
  160. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  161. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
  162. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  163. package/lib/es6/component/ChartLegend/LegendItem/legend-item.shadow.css +16 -40
  164. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +12 -8
  165. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  166. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  167. package/lib/es6/component/ChartLegend/LegendTable/legend-table.shadow.css +6 -2
  168. package/lib/es6/style/abstract-chart.shadow.css +31 -1
  169. package/lib/es6/style/area.shadow.css +6 -5
  170. package/lib/es6/style/axis.shadow.css +2 -2
  171. package/lib/es6/style/bar.shadow.css +7 -7
  172. package/lib/es6/style/bubble.shadow.css +4 -4
  173. package/lib/es6/style/donut.shadow.css +3 -3
  174. package/lib/es6/style/dot.shadow.css +9 -3
  175. package/lib/es6/style/hover.shadow.css +19 -1
  176. package/lib/es6/style/line.shadow.css +4 -4
  177. package/lib/es6/style/radar.shadow.css +5 -5
  178. package/lib/es6/style/radial-tree.shadow.css +3 -3
  179. package/lib/es6/style/reference.shadow.css +1 -1
  180. package/lib/es6/style/scatterplot.shadow.css +1 -1
  181. package/lib/es6/style/tooltip.shadow.css +23 -14
  182. package/lib/es6/style/venn.shadow.css +3 -3
  183. package/lib/es6/types/Hover.d.js.map +1 -1
  184. package/lib/es6/utils/TextMeasurer.js +25 -0
  185. package/lib/es6/utils/TextMeasurer.js.map +1 -0
  186. package/lib/esm/Area.mjs +12 -12
  187. package/lib/esm/Axis.mjs +56 -58
  188. package/lib/esm/Bar.mjs +17 -17
  189. package/lib/esm/Bubble.mjs +15 -15
  190. package/lib/esm/CompactHorizontalBar.mjs +17 -17
  191. package/lib/esm/Donut.mjs +10 -10
  192. package/lib/esm/Dots.mjs +15 -12
  193. package/lib/esm/HorizontalBar.mjs +17 -17
  194. package/lib/esm/Hover.mjs +157 -40
  195. package/lib/esm/Line.mjs +10 -10
  196. package/lib/esm/Plot.mjs +7 -5
  197. package/lib/esm/Radar.mjs +20 -20
  198. package/lib/esm/RadialTree.mjs +13 -13
  199. package/lib/esm/Reference.mjs +13 -13
  200. package/lib/esm/ScatterPlot.mjs +10 -10
  201. package/lib/esm/Tooltip.mjs +21 -12
  202. package/lib/esm/Venn.mjs +10 -10
  203. package/lib/esm/a11y/PlotA11yModule.mjs +3 -3
  204. package/lib/esm/a11y/PlotA11yView.mjs +3 -3
  205. package/lib/esm/component/Chart/AbstractChart.mjs +150 -54
  206. package/lib/esm/component/Chart/AreaChart.mjs +12 -10
  207. package/lib/esm/component/Chart/BarChart.mjs +9 -7
  208. package/lib/esm/component/Chart/BubbleChart.mjs +29 -9
  209. package/lib/esm/component/Chart/CigaretteChart.mjs +33 -30
  210. package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +2 -1
  211. package/lib/esm/component/Chart/DonutChart.mjs +5 -4
  212. package/lib/esm/component/Chart/HistogramChart.mjs +6 -4
  213. package/lib/esm/component/Chart/LineChart.mjs +9 -7
  214. package/lib/esm/component/Chart/RadarChart.mjs +3 -2
  215. package/lib/esm/component/Chart/ScatterPlotChart.mjs +25 -8
  216. package/lib/esm/component/Chart/VennChart.mjs +6 -5
  217. package/lib/esm/component/ChartLegend/BaseLegend.mjs +4 -2
  218. package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +5 -5
  219. package/lib/esm/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
  220. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +24 -19
  221. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +1 -1
  222. package/lib/esm/component/ChartLegend/LegendItem/legend-item.shadow.css +16 -40
  223. package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +13 -9
  224. package/lib/esm/component/ChartLegend/LegendTable/legend-table.shadow.css +6 -2
  225. package/lib/esm/style/abstract-chart.shadow.css +31 -1
  226. package/lib/esm/style/area.shadow.css +6 -5
  227. package/lib/esm/style/axis.shadow.css +2 -2
  228. package/lib/esm/style/bar.shadow.css +7 -7
  229. package/lib/esm/style/bubble.shadow.css +4 -4
  230. package/lib/esm/style/donut.shadow.css +3 -3
  231. package/lib/esm/style/dot.shadow.css +9 -3
  232. package/lib/esm/style/hover.shadow.css +19 -1
  233. package/lib/esm/style/line.shadow.css +4 -4
  234. package/lib/esm/style/radar.shadow.css +5 -5
  235. package/lib/esm/style/radial-tree.shadow.css +3 -3
  236. package/lib/esm/style/reference.shadow.css +1 -1
  237. package/lib/esm/style/scatterplot.shadow.css +1 -1
  238. package/lib/esm/style/tooltip.shadow.css +23 -14
  239. package/lib/esm/style/venn.shadow.css +3 -3
  240. package/lib/esm/utils/TextMeasurer.mjs +27 -0
  241. package/lib/types/Hover.d.ts +2 -0
  242. package/lib/types/component/Chart/AbstractChart.d.ts +11 -6
  243. package/lib/types/component/Chart/AbstractChart.d.ts.map +1 -1
  244. package/lib/types/component/Chart/AbstractChart.type.d.ts +20 -2
  245. package/lib/types/component/Chart/AbstractChart.type.d.ts.map +1 -1
  246. package/lib/types/component/Chart/AreaChart.d.ts.map +1 -1
  247. package/lib/types/component/Chart/AreaChart.type.d.ts +1 -0
  248. package/lib/types/component/Chart/AreaChart.type.d.ts.map +1 -1
  249. package/lib/types/component/Chart/BarChart.d.ts.map +1 -1
  250. package/lib/types/component/Chart/BarChart.type.d.ts +1 -0
  251. package/lib/types/component/Chart/BarChart.type.d.ts.map +1 -1
  252. package/lib/types/component/Chart/BubbleChart.d.ts.map +1 -1
  253. package/lib/types/component/Chart/BubbleChart.type.d.ts +2 -1
  254. package/lib/types/component/Chart/BubbleChart.type.d.ts.map +1 -1
  255. package/lib/types/component/Chart/CigaretteChart.type.d.ts +2 -1
  256. package/lib/types/component/Chart/CigaretteChart.type.d.ts.map +1 -1
  257. package/lib/types/component/Chart/CompactHorizontalBarChart.d.ts.map +1 -1
  258. package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +2 -1
  259. package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts.map +1 -1
  260. package/lib/types/component/Chart/DonutChart.d.ts.map +1 -1
  261. package/lib/types/component/Chart/DonutChart.type.d.ts +2 -1
  262. package/lib/types/component/Chart/DonutChart.type.d.ts.map +1 -1
  263. package/lib/types/component/Chart/HistogramChart.d.ts.map +1 -1
  264. package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -0
  265. package/lib/types/component/Chart/HistogramChart.type.d.ts.map +1 -1
  266. package/lib/types/component/Chart/LineChart.d.ts.map +1 -1
  267. package/lib/types/component/Chart/LineChart.type.d.ts +1 -0
  268. package/lib/types/component/Chart/LineChart.type.d.ts.map +1 -1
  269. package/lib/types/component/Chart/RadarChart.d.ts.map +1 -1
  270. package/lib/types/component/Chart/RadarChart.type.d.ts +2 -1
  271. package/lib/types/component/Chart/RadarChart.type.d.ts.map +1 -1
  272. package/lib/types/component/Chart/ScatterPlotChart.d.ts.map +1 -1
  273. package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +2 -1
  274. package/lib/types/component/Chart/ScatterPlotChart.type.d.ts.map +1 -1
  275. package/lib/types/component/Chart/VennChart.d.ts.map +1 -1
  276. package/lib/types/component/Chart/VennChart.type.d.ts +2 -1
  277. package/lib/types/component/Chart/VennChart.type.d.ts.map +1 -1
  278. package/lib/types/component/ChartLegend/BaseLegend.d.ts +5 -1
  279. package/lib/types/component/ChartLegend/BaseLegend.d.ts.map +1 -1
  280. package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -1
  281. package/lib/types/component/ChartLegend/LegendItem/LegendItem.d.ts.map +1 -1
  282. package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +3 -1
  283. package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts.map +1 -1
  284. package/lib/types/component/ChartLegend/LegendTable/LegendTable.d.ts.map +1 -1
  285. package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +2 -0
  286. package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts.map +1 -1
  287. package/lib/types/utils/TextMeasurer.d.ts +5 -0
  288. package/lib/types/utils/TextMeasurer.d.ts.map +1 -0
  289. package/package.json +15 -15
@@ -1,8 +1,8 @@
1
1
  @import './var.css';
2
2
 
3
3
  SCircle {
4
- fill: var(--intergalactic-chart-palette-order-2, oklch(0.82 0.15 170));
5
- stroke: var(--intergalactic-chart-grid-border, #fff);
4
+ fill: var(--intergalactic-chart-palette-order-2, oklch(0.58 0.168 278.2));
5
+ stroke: var(--intergalactic-chart-grid-border, #ffffff);
6
6
  stroke-width: 2px;
7
7
  fill-opacity: 0.5;
8
8
  transition-property: cx, cy;
@@ -34,7 +34,7 @@ SCircle[transparent] {
34
34
  }
35
35
 
36
36
  SIntersection {
37
- stroke: var(--intergalactic-chart-grid-border, #fff);
37
+ stroke: var(--intergalactic-chart-grid-border, #ffffff);
38
38
  stroke-width: 2px;
39
39
  fill-opacity: 0;
40
40
 
@@ -1 +1 @@
1
- {"version":3,"file":"Hover.d.js","names":[],"sources":["../../../src/types/Hover.d.ts"],"sourcesContent":["import type { NSBox } from '@semcore/base-components';\nimport type { UnknownProperties, ReturnEl } from '@semcore/core';\nimport type React from 'react';\n\nimport type { Context } from './context';\nimport type { IntergalacticD3Component } from './Plot';\nimport type { TooltipTypeBase } from './Tooltip';\n\n/** @deprecated */\nexport interface IHoverProps extends HoverProps, UnknownProperties {}\nexport type HoverProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n};\n\ntype HoverTooltip = (<X, Y>(\n props: {\n /** Field name from `data` array item for the XAxis */\n x?: X;\n /** Field name from `data` array item for the YAxis */\n y?: Y;\n /** Handle click by trigger has an index - it is an index of the data array. */\n onClick?: (index: number, e: React.SyntheticEvent) => void;\n children: (props: {\n /** Index in `data` array of the current item */\n xIndex: X extends string ? number : never;\n /** Index in `data` array of the current item */\n yIndex: Y extends string ? number : never;\n }) => { children: ReturnEl };\n /** Flag for hide line on hovered value */\n hideHoverLine?: boolean | ((xIndex: number | null, yIndex: number | null) => boolean);\n } & Omit<NSBox.Props, 'children'>,\n) => ReturnEl) &\nTooltipTypeBase;\n\ntype HoverContext = {\n /** Index in `data` array of the current item */\n index: number;\n};\n\ndeclare const HoverLine: IntergalacticD3Component<'g', HoverProps, HoverContext> & {\n Tooltip: HoverTooltip;\n};\n\ndeclare const HoverRect: IntergalacticD3Component<'g', HoverProps, HoverContext> & {\n Tooltip: HoverTooltip;\n};\nexport { HoverLine, HoverRect };\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"Hover.d.js","names":[],"sources":["../../../src/types/Hover.d.ts"],"sourcesContent":["import type { NSBox } from '@semcore/base-components';\nimport type { UnknownProperties, ReturnEl } from '@semcore/core';\nimport type React from 'react';\n\nimport type { Context } from './context';\nimport type { IntergalacticD3Component } from './Plot';\nimport type { TooltipTypeBase } from './Tooltip';\n\n/** @deprecated */\nexport interface IHoverProps extends HoverProps, UnknownProperties {}\nexport type HoverProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Hide tick hover */\n hideTickHover?: boolean;\n};\n\ntype HoverTooltip = (<X, Y>(\n props: {\n /** Field name from `data` array item for the XAxis */\n x?: X;\n /** Field name from `data` array item for the YAxis */\n y?: Y;\n /** Handle click by trigger has an index - it is an index of the data array. */\n onClick?: (index: number, e: React.SyntheticEvent) => void;\n children: (props: {\n /** Index in `data` array of the current item */\n xIndex: X extends string ? number : never;\n /** Index in `data` array of the current item */\n yIndex: Y extends string ? number : never;\n }) => { children: ReturnEl };\n /** Flag for hide line on hovered value */\n hideHoverLine?: boolean | ((xIndex: number | null, yIndex: number | null) => boolean);\n } & Omit<NSBox.Props, 'children'>,\n) => ReturnEl) &\nTooltipTypeBase;\n\ntype HoverContext = {\n /** Index in `data` array of the current item */\n index: number;\n};\n\ndeclare const HoverLine: IntergalacticD3Component<'g', HoverProps, HoverContext> & {\n Tooltip: HoverTooltip;\n};\n\ndeclare const HoverRect: IntergalacticD3Component<'g', HoverProps, HoverContext> & {\n Tooltip: HoverTooltip;\n};\nexport { HoverLine, HoverRect };\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ export class TextMeasurer {
3
+ constructor() {
4
+ _defineProperty(this, "store", new Map());
5
+ }
6
+ measure(text, fontSize = 12) {
7
+ const key = `${text};${fontSize}`;
8
+ const storedValue = this.store.get(key);
9
+ if (storedValue !== undefined) return storedValue;
10
+ const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
11
+ const textEl = document.createElementNS('http://www.w3.org/2000/svg', 'text');
12
+ svg.style.position = 'absolute';
13
+ svg.style.visibility = 'hidden';
14
+ svg.style.pointerEvents = 'none';
15
+ textEl.setAttribute('font-size', String(fontSize));
16
+ textEl.textContent = text;
17
+ svg.appendChild(textEl);
18
+ document.body.appendChild(svg);
19
+ const bbox = textEl.getBBox();
20
+ this.store.set(key, bbox);
21
+ svg.remove();
22
+ return bbox;
23
+ }
24
+ }
25
+ //# sourceMappingURL=TextMeasurer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextMeasurer.js","names":["TextMeasurer","constructor","_defineProperty","Map","measure","text","fontSize","key","storedValue","store","get","undefined","svg","document","createElementNS","textEl","style","position","visibility","pointerEvents","setAttribute","String","textContent","appendChild","body","bbox","getBBox","set","remove"],"sources":["../../../src/utils/TextMeasurer.ts"],"sourcesContent":["export class TextMeasurer {\n private store = new Map<string, DOMRect>();\n\n measure(text: string, fontSize = 12) {\n const key = `${text};${fontSize}`;\n const storedValue = this.store.get(key);\n\n if (storedValue !== undefined) return storedValue;\n\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n const textEl = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n\n svg.style.position = 'absolute';\n svg.style.visibility = 'hidden';\n svg.style.pointerEvents = 'none';\n\n textEl.setAttribute('font-size', String(fontSize));\n textEl.textContent = text;\n\n svg.appendChild(textEl);\n document.body.appendChild(svg);\n\n const bbox = textEl.getBBox();\n\n this.store.set(key, bbox);\n\n svg.remove();\n\n return bbox;\n }\n}\n"],"mappings":";AAAA,OAAO,MAAMA,YAAY,CAAC;EAAAC,YAAA;IAAAC,eAAA,gBACR,IAAIC,GAAG,CAAkB,CAAC;EAAA;EAE1CC,OAAOA,CAACC,IAAY,EAAEC,QAAQ,GAAG,EAAE,EAAE;IACnC,MAAMC,GAAG,GAAG,GAAGF,IAAI,IAAIC,QAAQ,EAAE;IACjC,MAAME,WAAW,GAAG,IAAI,CAACC,KAAK,CAACC,GAAG,CAACH,GAAG,CAAC;IAEvC,IAAIC,WAAW,KAAKG,SAAS,EAAE,OAAOH,WAAW;IAEjD,MAAMI,GAAG,GAAGC,QAAQ,CAACC,eAAe,CAAC,4BAA4B,EAAE,KAAK,CAAC;IACzE,MAAMC,MAAM,GAAGF,QAAQ,CAACC,eAAe,CAAC,4BAA4B,EAAE,MAAM,CAAC;IAE7EF,GAAG,CAACI,KAAK,CAACC,QAAQ,GAAG,UAAU;IAC/BL,GAAG,CAACI,KAAK,CAACE,UAAU,GAAG,QAAQ;IAC/BN,GAAG,CAACI,KAAK,CAACG,aAAa,GAAG,MAAM;IAEhCJ,MAAM,CAACK,YAAY,CAAC,WAAW,EAAEC,MAAM,CAACf,QAAQ,CAAC,CAAC;IAClDS,MAAM,CAACO,WAAW,GAAGjB,IAAI;IAEzBO,GAAG,CAACW,WAAW,CAACR,MAAM,CAAC;IACvBF,QAAQ,CAACW,IAAI,CAACD,WAAW,CAACX,GAAG,CAAC;IAE9B,MAAMa,IAAI,GAAGV,MAAM,CAACW,OAAO,CAAC,CAAC;IAE7B,IAAI,CAACjB,KAAK,CAACkB,GAAG,CAACpB,GAAG,EAAEkB,IAAI,CAAC;IAEzBb,GAAG,CAACgB,MAAM,CAAC,CAAC;IAEZ,OAAOH,IAAI;EACb;AACF","ignoreList":[]}
package/lib/esm/Area.mjs CHANGED
@@ -16,21 +16,21 @@ const style = (
16
16
  /*__reshadow_css_start__*/
17
17
  (sstyled.insert(
18
18
  /*__inner_css_start__*/
19
- ".___SArea_1kjuz_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.58 .168 278.2));fill-opacity:.2}.___SArea_1kjuz_gg_.__color_1kjuz_gg_{fill:var(--color_1kjuz)}.___SArea_1kjuz_gg_.__pattern_1kjuz_gg_{fill:var(--pattern_1kjuz);fill-opacity:.7}.___SArea_1kjuz_gg_.__transparent_1kjuz_gg_{opacity:.3}.___SAreaLine_1kjuz_gg_{stroke:var(--intergalactic-chart-palette-order-1,oklch(.58 .168 278.2));stroke-width:3;fill:#0000}.___SAreaLine_1kjuz_gg_.__color_1kjuz_gg_{stroke:var(--color_1kjuz)}.___SAreaLine_1kjuz_gg_.__transparent_1kjuz_gg_{opacity:.3}.___SAreaLine_1kjuz_gg_,.___SArea_1kjuz_gg_{transition-property:d;transition-duration:var(--duration_1kjuz);transition-timing-function:ease-in-out}.___SNull_1kjuz_gg_{fill:#0000;stroke:var(--intergalactic-chart-grid-x-axis,oklch(.88 .002 175.6));stroke-dasharray:4}.___SNull_1kjuz_gg_.__hide_1kjuz_gg_{display:none}",
19
+ ".___SArea_12fld_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140));fill-opacity:.1;-webkit-mask-image:linear-gradient(180deg,#000 0,#0000007a 60%,#0000);mask-image:linear-gradient(180deg,#000 0,#0000007a 60%,#0000)}.___SArea_12fld_gg_.__color_12fld_gg_{fill:var(--color_12fld)}.___SArea_12fld_gg_.__pattern_12fld_gg_{fill:var(--pattern_12fld);fill-opacity:.7}.___SArea_12fld_gg_.__transparent_12fld_gg_{opacity:.3}.___SAreaLine_12fld_gg_{stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140));stroke-width:2;fill:#0000}.___SAreaLine_12fld_gg_.__color_12fld_gg_{stroke:var(--color_12fld)}.___SAreaLine_12fld_gg_.__transparent_12fld_gg_{opacity:.3}.___SAreaLine_12fld_gg_,.___SArea_12fld_gg_{transition-property:d;transition-duration:var(--duration_12fld);transition-timing-function:ease-in-out}.___SNull_12fld_gg_{fill:#0000;stroke:var(--intergalactic-chart-palette-order-null,oklch(.9 .002 177));stroke-dasharray:4}.___SNull_12fld_gg_.__hide_12fld_gg_{display:none}",
20
20
  /*__inner_css_end__*/
21
- "1kjuz_gg_"
21
+ "12fld_gg_"
22
22
  ), /*__reshadow_css_end__*/
23
23
  {
24
- "__SArea": "___SArea_1kjuz_gg_",
25
- "_color": "__color_1kjuz_gg_",
26
- "--color": "--color_1kjuz",
27
- "_pattern": "__pattern_1kjuz_gg_",
28
- "--pattern": "--pattern_1kjuz",
29
- "_transparent": "__transparent_1kjuz_gg_",
30
- "__SAreaLine": "___SAreaLine_1kjuz_gg_",
31
- "--duration": "--duration_1kjuz",
32
- "__SNull": "___SNull_1kjuz_gg_",
33
- "_hide": "__hide_1kjuz_gg_"
24
+ "__SArea": "___SArea_12fld_gg_",
25
+ "_color": "__color_12fld_gg_",
26
+ "--color": "--color_12fld",
27
+ "_pattern": "__pattern_12fld_gg_",
28
+ "--pattern": "--pattern_12fld",
29
+ "_transparent": "__transparent_12fld_gg_",
30
+ "__SAreaLine": "___SAreaLine_12fld_gg_",
31
+ "--duration": "--duration_12fld",
32
+ "__SNull": "___SNull_12fld_gg_",
33
+ "_hide": "__hide_12fld_gg_"
34
34
  })
35
35
  );
36
36
  class AreaRoot extends Component {
package/lib/esm/Axis.mjs CHANGED
@@ -1,34 +1,35 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import { sstyled, Component } from "@semcore/core";
4
- import React, { useState, useEffect } from "react";
4
+ import React from "react";
5
5
  import createElement from "./createElement.mjs";
6
6
  import { scaleOfBandwidth } from "./utils.mjs";
7
+ import { TextMeasurer } from "./utils/TextMeasurer.mjs";
7
8
  /*!__reshadow-styles__:"./style/axis.shadow.css"*/
8
9
  const style = (
9
10
  /*__reshadow_css_start__*/
10
11
  (sstyled.insert(
11
12
  /*__inner_css_start__*/
12
- ".___SAxis_1d6qr_gg_{stroke:var(--intergalactic-chart-grid-x-axis,oklch(.88 .002 175.6))}.___SAxis_1d6qr_gg_.__hide_1d6qr_gg_{display:none}.___STick_1d6qr_gg_{font-size:var(--intergalactic-fs-100,12px);fill:var(--intergalactic-chart-grid-text-label,#00030095)}@media (color-gamut:p3){.___STick_1d6qr_gg_{fill:var(--intergalactic-chart-grid-text-label,oklch(.088 .026 147.7/.583))}}.___STick_1d6qr_gg_.__primaryText_1d6qr_gg_{fill:var(--intergalactic-text-primary,oklch(.1 .03 137/.899))}.___STick_1d6qr_gg_.__hide_1d6qr_gg_{display:none}.___SGrid_1d6qr_gg_{fill:#0000;stroke:var(--intergalactic-border-secondary,#00151012)}@media (color-gamut:p3){.___SGrid_1d6qr_gg_{stroke:var(--intergalactic-border-secondary,oklch(.176 .033 175.7/.07))}}.___STitle_1d6qr_gg_{font-size:var(--intergalactic-fs-100,12px);fill:var(--intergalactic-text-hint,#00030095);transform-origin:var(--transform-origin_1d6qr)}@media (color-gamut:p3){.___STitle_1d6qr_gg_{fill:var(--intergalactic-text-hint,oklch(.088 .026 147.7/.583))}}.___STitle_1d6qr_gg_._position_top_1d6qr_gg_{text-anchor:middle}.___STitle_1d6qr_gg_._position_bottom_1d6qr_gg_{text-anchor:middle;dominant-baseline:hanging}.___STitle_1d6qr_gg_._position_left_1d6qr_gg_,.___STitle_1d6qr_gg_._position_right_1d6qr_gg_{transform:rotate(-90deg);dominant-baseline:middle;text-anchor:middle}.___STitle_1d6qr_gg_._position_left_1d6qr_gg_.__verticalWritingMode_1d6qr_gg_,.___STitle_1d6qr_gg_._position_right_1d6qr_gg_.__verticalWritingMode_1d6qr_gg_{writing-mode:vertical-rl;transform:none}.___STick_1d6qr_gg_._position_top_1d6qr_gg_{transform:translateY(-12px);text-anchor:middle}.___STick_1d6qr_gg_._position_bottom_1d6qr_gg_{transform:translateY(12px);text-anchor:middle;dominant-baseline:hanging}.___STick_1d6qr_gg_._position_bottom_1d6qr_gg_ tspan{dominant-baseline:hanging}.___STick_1d6qr_gg_._position_right_1d6qr_gg_{transform:translateX(16px);dominant-baseline:middle}.___STick_1d6qr_gg_._position_right_1d6qr_gg_ tspan{dominant-baseline:middle}.___STick_1d6qr_gg_._position_right_1d6qr_gg_.__multiline_1d6qr_gg_,.___STick_1d6qr_gg_._position_right_1d6qr_gg_.__multiline_1d6qr_gg_ tspan{dominant-baseline:auto}.___STick_1d6qr_gg_._position_left_1d6qr_gg_{transform:translateX(-16px);text-anchor:end;dominant-baseline:middle}.___STick_1d6qr_gg_._position_left_1d6qr_gg_ tspan{dominant-baseline:middle}.___STick_1d6qr_gg_._position_left_1d6qr_gg_.__multiline_1d6qr_gg_,.___STick_1d6qr_gg_._position_left_1d6qr_gg_.__multiline_1d6qr_gg_ tspan{dominant-baseline:auto}.___STick_1d6qr_gg_._position_custom_0_1d6qr_gg_{transform:translateY(12px);text-anchor:middle;dominant-baseline:hanging}.___STick_1d6qr_gg_._position_custom_0_1d6qr_gg_ tspan{dominant-baseline:hanging}.___STick_1d6qr_gg_._position_custom_1_1d6qr_gg_{transform:translateX(-16px);text-anchor:end;dominant-baseline:middle}.___STick_1d6qr_gg_._position_custom_1_1d6qr_gg_ tspan{dominant-baseline:middle}",
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}",
13
14
  /*__inner_css_end__*/
14
- "1d6qr_gg_"
15
+ "17qfg_gg_"
15
16
  ), /*__reshadow_css_end__*/
16
17
  {
17
- "__SAxis": "___SAxis_1d6qr_gg_",
18
- "_hide": "__hide_1d6qr_gg_",
19
- "__STick": "___STick_1d6qr_gg_",
20
- "_primaryText": "__primaryText_1d6qr_gg_",
21
- "__SGrid": "___SGrid_1d6qr_gg_",
22
- "__STitle": "___STitle_1d6qr_gg_",
23
- "--transform-origin": "--transform-origin_1d6qr",
24
- "_position_top": "_position_top_1d6qr_gg_",
25
- "_position_bottom": "_position_bottom_1d6qr_gg_",
26
- "_position_right": "_position_right_1d6qr_gg_",
27
- "_position_left": "_position_left_1d6qr_gg_",
28
- "_verticalWritingMode": "__verticalWritingMode_1d6qr_gg_",
29
- "_multiline": "__multiline_1d6qr_gg_",
30
- "_position_custom_0": "_position_custom_0_1d6qr_gg_",
31
- "_position_custom_1": "_position_custom_1_1d6qr_gg_"
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_"
32
33
  })
33
34
  );
34
35
  const CUSTOM_0 = /* @__PURE__ */ Symbol("custom_0");
@@ -204,43 +205,43 @@ function renderValue(value) {
204
205
  }
205
206
  return value;
206
207
  }
207
- function splitTextByWidth(root, text, maxWidth) {
208
- if (!text || !maxWidth || maxWidth <= 0) return [];
209
- const words = text.split(/\s+/).filter((word) => word.length > 0);
210
- if (words.length === 0) return [];
211
- const lines = [];
212
- let currentLine = words[0];
213
- for (let i = 1; i < words.length; i++) {
214
- const testLine = `${currentLine} ${words[i]}`.trim();
215
- const testWidth = measureTextWidth(root, testLine);
216
- if (testWidth <= maxWidth) {
217
- currentLine = testLine;
218
- } else {
219
- if (currentLine) {
220
- lines.push(currentLine);
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
+ }
221
236
  }
222
- currentLine = words[i];
223
- if (measureTextWidth(root, currentLine) > maxWidth) {
237
+ if (currentLine) {
224
238
  lines.push(currentLine);
225
- currentLine = "";
226
239
  }
240
+ return lines;
227
241
  }
228
- }
229
- if (currentLine) {
230
- lines.push(currentLine);
231
- }
232
- return lines;
233
- }
234
- function measureTextWidth(rootRef, text, fontSize = 12) {
235
- const textEl = document.createElementNS("http://www.w3.org/2000/svg", "text");
236
- textEl.setAttribute("font-size", fontSize);
237
- textEl.setAttribute("visibility", "hidden");
238
- textEl.textContent = text;
239
- rootRef.appendChild(textEl);
240
- const width = textEl.getComputedTextLength();
241
- rootRef.removeChild(textEl);
242
- return width;
242
+ };
243
243
  }
244
+ const measurer = new TextMeasurer();
244
245
  class AxisRoot extends Component {
245
246
  get ticks() {
246
247
  const {
@@ -269,7 +270,8 @@ class AxisRoot extends Component {
269
270
  return {
270
271
  ticks: this.ticks,
271
272
  indexScale,
272
- position
273
+ position,
274
+ splitTextByWidth: splitTextByWidth(measurer)
273
275
  };
274
276
  }
275
277
  getGridProps() {
@@ -314,17 +316,13 @@ function Ticks(props) {
314
316
  dataHintsHandler,
315
317
  children,
316
318
  childrenPosition = "inside",
317
- rootRef,
318
- multiline
319
+ multiline,
320
+ splitTextByWidth: splitTextByWidth2
319
321
  } = props;
320
- const [rootRefElement, setRootRefElement] = useState(null);
321
- useEffect(() => {
322
- if (rootRef.current) setRootRefElement(rootRef.current);
323
- }, []);
324
322
  const tickBandwidth = scale[indexScale]?.bandwidth?.();
325
323
  const ticksWithLines = ticks.map((tick) => ({
326
324
  tick,
327
- lines: typeof tick === "string" && multiline && rootRefElement ? splitTextByWidth(rootRefElement, tick, tickBandwidth) : []
325
+ lines: typeof tick === "string" && multiline ? splitTextByWidth2(tick, tickBandwidth) : []
328
326
  }));
329
327
  const pos = MAP_POSITION_TICK[position] ?? MAP_POSITION_TICK[MAP_INDEX_SCALE_SYMBOL[indexScale]];
330
328
  const positionClass = MAP_POSITION_TICK[position] ? position : `custom_${indexScale}`;
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_3j3wp_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.58 .168 278.2));transition-property:height,width,y;transition-duration:var(--duration_3j3wp);transition-timing-function:ease-in-out}.___SBar_3j3wp_gg_.__color_3j3wp_gg_{fill:var(--color_3j3wp)}.___SBar_3j3wp_gg_.__pattern_3j3wp_gg_.__color_3j3wp_gg_{fill:var(--pattern_3j3wp);stroke:var(--color_3j3wp);stroke-width:1px}.___SBar_3j3wp_gg_.__hide_3j3wp_gg_{display:none}.___SBar_3j3wp_gg_.__transparent_3j3wp_gg_{opacity:.3}.___SBar_3j3wp_gg_.__onClick_3j3wp_gg_{cursor:pointer}.___SBackground_3j3wp_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg,oklch(.88 .002 175.6));opacity:.4}.___SBackground_3j3wp_gg_.__onClick_3j3wp_gg_{cursor:pointer}.___SBarAnnotation_3j3wp_gg_{display:flex;justify-content:space-between}.___SBarLabel_3j3wp_gg_{color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));margin-right:auto}.___SBarLabel_3j3wp_gg_,.___SBarPercent_3j3wp_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,142%)}.___SBarPercent_3j3wp_gg_{color:var(--intergalactic-text-secondary,#00030095);margin-right:var(--intergalactic-spacing-2x,8px)}@media (color-gamut:p3){.___SBarPercent_3j3wp_gg_{color:var(--intergalactic-text-secondary,oklch(.088 .026 147.7/.583))}}.___SBarValue_3j3wp_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,142%);text-align:right}.___SCompactHorizontalBarHoverRect_3j3wp_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover,oklch(.177 .033 175.6/.028))}",
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))}",
16
16
  /*__inner_css_end__*/
17
- "3j3wp_gg_"
17
+ "1yabt_gg_"
18
18
  ), /*__reshadow_css_end__*/
19
19
  {
20
- "__SBar": "___SBar_3j3wp_gg_",
21
- "--duration": "--duration_3j3wp",
22
- "_color": "__color_3j3wp_gg_",
23
- "--color": "--color_3j3wp",
24
- "_pattern": "__pattern_3j3wp_gg_",
25
- "--pattern": "--pattern_3j3wp",
26
- "_hide": "__hide_3j3wp_gg_",
27
- "_transparent": "__transparent_3j3wp_gg_",
28
- "_onClick": "__onClick_3j3wp_gg_",
29
- "__SBackground": "___SBackground_3j3wp_gg_",
30
- "__SBarAnnotation": "___SBarAnnotation_3j3wp_gg_",
31
- "__SBarLabel": "___SBarLabel_3j3wp_gg_",
32
- "__SBarPercent": "___SBarPercent_3j3wp_gg_",
33
- "__SBarValue": "___SBarValue_3j3wp_gg_",
34
- "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_3j3wp_gg_"
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_"
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_1ium8_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.58 .168 278.2));stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;transition-property:cx,cy;transition-duration:var(--duration_1ium8);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SBubble_1ium8_gg_:hover{opacity:.8}}g._visible_false_1ium8_gg_{display:none}.___SBubble_1ium8_gg_.__clickable_1ium8_gg_{cursor:pointer}.___SBubble_1ium8_gg_.__color_1ium8_gg_{fill:var(--color_1ium8)}.___SBubble_1ium8_gg_.__pattern_1ium8_gg_.__color_1ium8_gg_{fill:var(--pattern_1ium8);stroke:var(--color_1ium8);stroke-width:1px}.___SBubble_1ium8_gg_.__transparent_1ium8_gg_{opacity:.3}.___SCenter_1ium8_gg_{text-anchor:middle;font-size:calc(var(--intergalactic-fs-100, 12px) - 1px);stroke:var(--intergalactic-chart-palette-order-1,oklch(.58 .168 278.2))}.___SCenter_1ium8_gg_.__color_1ium8_gg_{stroke:var(--color_1ium8)}.___SCenter_1ium8_gg_.__transparent_1ium8_gg_{opacity:.3}.___SLabel_1ium8_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.58 .168 278.2))}.___SLabel_1ium8_gg_._position_right_1ium8_gg_{text-anchor:end}.___SLabel_1ium8_gg_._position_left_1ium8_gg_{text-anchor:start}.___SLabel_1ium8_gg_.__color_1ium8_gg_{fill:var(--color_1ium8)}.___SLabel_1ium8_gg_.__transparent_1ium8_gg_{opacity:.3}",
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}",
19
19
  /*__inner_css_end__*/
20
- "1ium8_gg_"
20
+ "7qqxu_gg_"
21
21
  ), /*__reshadow_css_end__*/
22
22
  {
23
- "_visible_false": "_visible_false_1ium8_gg_",
24
- "__SBubble": "___SBubble_1ium8_gg_",
25
- "_clickable": "__clickable_1ium8_gg_",
26
- "_color": "__color_1ium8_gg_",
27
- "--color": "--color_1ium8",
28
- "_pattern": "__pattern_1ium8_gg_",
29
- "--pattern": "--pattern_1ium8",
30
- "_transparent": "__transparent_1ium8_gg_",
31
- "__SCenter": "___SCenter_1ium8_gg_",
32
- "__SLabel": "___SLabel_1ium8_gg_",
33
- "_position_right": "_position_right_1ium8_gg_",
34
- "_position_left": "_position_left_1ium8_gg_",
35
- "--duration": "--duration_1ium8"
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"
36
36
  })
37
37
  );
38
38
  class BubbleRoot extends Component {
@@ -16,26 +16,26 @@ const style = (
16
16
  /*__reshadow_css_start__*/
17
17
  (sstyled.insert(
18
18
  /*__inner_css_start__*/
19
- ".___SBar_3j3wp_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.58 .168 278.2));transition-property:height,width,y;transition-duration:var(--duration_3j3wp);transition-timing-function:ease-in-out}.___SBar_3j3wp_gg_.__color_3j3wp_gg_{fill:var(--color_3j3wp)}.___SBar_3j3wp_gg_.__pattern_3j3wp_gg_.__color_3j3wp_gg_{fill:var(--pattern_3j3wp);stroke:var(--color_3j3wp);stroke-width:1px}.___SBar_3j3wp_gg_.__hide_3j3wp_gg_{display:none}.___SBar_3j3wp_gg_.__transparent_3j3wp_gg_{opacity:.3}.___SBar_3j3wp_gg_.__onClick_3j3wp_gg_{cursor:pointer}.___SBackground_3j3wp_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg,oklch(.88 .002 175.6));opacity:.4}.___SBackground_3j3wp_gg_.__onClick_3j3wp_gg_{cursor:pointer}.___SBarAnnotation_3j3wp_gg_{display:flex;justify-content:space-between}.___SBarLabel_3j3wp_gg_{color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));margin-right:auto}.___SBarLabel_3j3wp_gg_,.___SBarPercent_3j3wp_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,142%)}.___SBarPercent_3j3wp_gg_{color:var(--intergalactic-text-secondary,#00030095);margin-right:var(--intergalactic-spacing-2x,8px)}@media (color-gamut:p3){.___SBarPercent_3j3wp_gg_{color:var(--intergalactic-text-secondary,oklch(.088 .026 147.7/.583))}}.___SBarValue_3j3wp_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,142%);text-align:right}.___SCompactHorizontalBarHoverRect_3j3wp_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover,oklch(.177 .033 175.6/.028))}",
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))}",
20
20
  /*__inner_css_end__*/
21
- "3j3wp_gg_"
21
+ "1yabt_gg_"
22
22
  ), /*__reshadow_css_end__*/
23
23
  {
24
- "__SBar": "___SBar_3j3wp_gg_",
25
- "--duration": "--duration_3j3wp",
26
- "_color": "__color_3j3wp_gg_",
27
- "--color": "--color_3j3wp",
28
- "_pattern": "__pattern_3j3wp_gg_",
29
- "--pattern": "--pattern_3j3wp",
30
- "_hide": "__hide_3j3wp_gg_",
31
- "_transparent": "__transparent_3j3wp_gg_",
32
- "_onClick": "__onClick_3j3wp_gg_",
33
- "__SBackground": "___SBackground_3j3wp_gg_",
34
- "__SBarAnnotation": "___SBarAnnotation_3j3wp_gg_",
35
- "__SBarLabel": "___SBarLabel_3j3wp_gg_",
36
- "__SBarPercent": "___SBarPercent_3j3wp_gg_",
37
- "__SBarValue": "___SBarValue_3j3wp_gg_",
38
- "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_3j3wp_gg_"
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_"
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_njxua_gg_{stroke:var(--intergalactic-chart-grid-border,#fff);fill:var(--intergalactic-chart-palette-order-1,oklch(.58 .168 278.2))}.___SPie_njxua_gg_.__color_njxua_gg_{fill:var(--color_njxua)}.___SPie_njxua_gg_.__pattern_njxua_gg_.__color_njxua_gg_{fill:var(--pattern_njxua);stroke:var(--color_njxua);stroke-width:1px}.___SPie_njxua_gg_.__transparent_njxua_gg_{opacity:.3}.___SEmptyData_njxua_gg_{fill:var(--intergalactic-chart-palette-order-null,oklch(.9 .002 177))}.___SEmptyData_njxua_gg_.__color_njxua_gg_{fill:var(--color_njxua)}.___SLabel_njxua_gg_{text-anchor:middle;vertical-anchor:middle;font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,142%)}",
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)}",
21
21
  /*__inner_css_end__*/
22
- "njxua_gg_"
22
+ "92f82_gg_"
23
23
  ), /*__reshadow_css_end__*/
24
24
  {
25
- "__SPie": "___SPie_njxua_gg_",
26
- "_color": "__color_njxua_gg_",
27
- "--color": "--color_njxua",
28
- "_pattern": "__pattern_njxua_gg_",
29
- "--pattern": "--pattern_njxua",
30
- "_transparent": "__transparent_njxua_gg_",
31
- "__SEmptyData": "___SEmptyData_njxua_gg_",
32
- "__SLabel": "___SLabel_njxua_gg_"
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_"
33
33
  })
34
34
  );
35
35
  const DEFAULT_INSTANCE = /* @__PURE__ */ Symbol("DEFAULT_INSTANCE");
package/lib/esm/Dots.mjs CHANGED
@@ -10,20 +10,23 @@ const style = (
10
10
  /*__reshadow_css_start__*/
11
11
  (sstyled.insert(
12
12
  /*__inner_css_start__*/
13
- ".___SDots_uehjh_gg_ .___SDot_uehjh_gg_{transition-duration:var(--duration_uehjh)}.___SDot_uehjh_gg_{stroke-width:1px;stroke:var(--intergalactic-chart-grid-border,#fff);fill:var(--intergalactic-chart-palette-order-1,oklch(.58 .168 278.2));transition-property:cx,cy,x,y;transition-timing-function:ease-in-out}.___SDot_uehjh_gg_.__hide_uehjh_gg_{display:none}.___SDot_uehjh_gg_.__color_uehjh_gg_{fill:var(--color_uehjh)}.___SDot_uehjh_gg_.__transparent_uehjh_gg_{opacity:.3}",
13
+ ".___SDots_c7lp2_gg_ .___SDot_c7lp2_gg_{transition-duration:var(--duration_c7lp2)}.___SDot_c7lp2_gg_{stroke-width:1px;stroke:var(--intergalactic-chart-grid-border,#fff);fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140));transition-property:cx,cy,x,y,filter;transition-timing-function:ease-in-out}.___SDot_c7lp2_gg_.__active_c7lp2_gg_{filter:drop-shadow(0 0 1px rgba(0,12,8,.161)) drop-shadow(0 1px 1px rgba(0,12,8,.161))}@media (color-gamut:p3){.___SDot_c7lp2_gg_.__active_c7lp2_gg_{filter:drop-shadow(0 0 1px oklch(.137 .026 175.7/.161)) drop-shadow(0 1px 1px oklch(.137 .026 175.7/.161))}}.___SDot_c7lp2_gg_.__hide_c7lp2_gg_{display:none}.___SDot_c7lp2_gg_.__color_c7lp2_gg_{fill:var(--color_c7lp2)}.___SDot_c7lp2_gg_.__transparent_c7lp2_gg_{opacity:.3}",
14
14
  /*__inner_css_end__*/
15
- "uehjh_gg_"
15
+ "c7lp2_gg_"
16
16
  ), /*__reshadow_css_end__*/
17
17
  {
18
- "__SDot": "___SDot_uehjh_gg_",
19
- "_hide": "__hide_uehjh_gg_",
20
- "_color": "__color_uehjh_gg_",
21
- "--color": "--color_uehjh",
22
- "_transparent": "__transparent_uehjh_gg_",
23
- "__SDots": "___SDots_uehjh_gg_",
24
- "--duration": "--duration_uehjh"
18
+ "__SDot": "___SDot_c7lp2_gg_",
19
+ "_active": "__active_c7lp2_gg_",
20
+ "_hide": "__hide_c7lp2_gg_",
21
+ "_color": "__color_c7lp2_gg_",
22
+ "--color": "--color_c7lp2",
23
+ "_transparent": "__transparent_c7lp2_gg_",
24
+ "__SDots": "___SDots_c7lp2_gg_",
25
+ "--duration": "--duration_c7lp2"
25
26
  })
26
27
  );
28
+ const BASE_RADIUS = 3.5;
29
+ const ACTIVE_RADIUS = 4.5;
27
30
  function Dots(props) {
28
31
  var _ref3;
29
32
  const {
@@ -40,7 +43,7 @@ function Dots(props) {
40
43
  scale,
41
44
  duration = 500,
42
45
  transparent,
43
- radius: radiusBase = 4,
46
+ radius: radiusBase = BASE_RADIUS,
44
47
  resolveColor,
45
48
  patterns,
46
49
  onClick
@@ -88,7 +91,7 @@ function Dots(props) {
88
91
  const isNext = d3.defined()(data[i + 1] || {});
89
92
  const active = i === activeIndex;
90
93
  const visible = typeof display === "function" ? display(i, i === activeIndex, !isPrev && !isNext) : display || i === activeIndex || !isPrev && !isNext;
91
- const radius = radiusBase * (active ? 5 / 4 : 1);
94
+ const radius = active ? ACTIVE_RADIUS : radiusBase;
92
95
  if (!d3.defined()(d)) return acc;
93
96
  if (!visible) return acc;
94
97
  if (!patterns) {
@@ -132,7 +135,7 @@ function Dots(props) {
132
135
  return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SDots, _ref3.cn("SDots", {
133
136
  "duration": `${duration}ms`,
134
137
  "onClickCapture": handlerOnClick
135
- }), /* @__PURE__ */ React.createElement(PatternSymbol, _ref3.cn("PatternSymbol", {
138
+ }), patterns && /* @__PURE__ */ React.createElement(PatternSymbol, _ref3.cn("PatternSymbol", {
136
139
  "color": resolveColor(color),
137
140
  "patternKey": color,
138
141
  "id": svgPatternId,
@@ -11,26 +11,26 @@ const style = (
11
11
  /*__reshadow_css_start__*/
12
12
  (sstyled.insert(
13
13
  /*__inner_css_start__*/
14
- ".___SBar_3j3wp_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.58 .168 278.2));transition-property:height,width,y;transition-duration:var(--duration_3j3wp);transition-timing-function:ease-in-out}.___SBar_3j3wp_gg_.__color_3j3wp_gg_{fill:var(--color_3j3wp)}.___SBar_3j3wp_gg_.__pattern_3j3wp_gg_.__color_3j3wp_gg_{fill:var(--pattern_3j3wp);stroke:var(--color_3j3wp);stroke-width:1px}.___SBar_3j3wp_gg_.__hide_3j3wp_gg_{display:none}.___SBar_3j3wp_gg_.__transparent_3j3wp_gg_{opacity:.3}.___SBar_3j3wp_gg_.__onClick_3j3wp_gg_{cursor:pointer}.___SBackground_3j3wp_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg,oklch(.88 .002 175.6));opacity:.4}.___SBackground_3j3wp_gg_.__onClick_3j3wp_gg_{cursor:pointer}.___SBarAnnotation_3j3wp_gg_{display:flex;justify-content:space-between}.___SBarLabel_3j3wp_gg_{color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));margin-right:auto}.___SBarLabel_3j3wp_gg_,.___SBarPercent_3j3wp_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,142%)}.___SBarPercent_3j3wp_gg_{color:var(--intergalactic-text-secondary,#00030095);margin-right:var(--intergalactic-spacing-2x,8px)}@media (color-gamut:p3){.___SBarPercent_3j3wp_gg_{color:var(--intergalactic-text-secondary,oklch(.088 .026 147.7/.583))}}.___SBarValue_3j3wp_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,142%);text-align:right}.___SCompactHorizontalBarHoverRect_3j3wp_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover,oklch(.177 .033 175.6/.028))}",
14
+ ".___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
15
  /*__inner_css_end__*/
16
- "3j3wp_gg_"
16
+ "1yabt_gg_"
17
17
  ), /*__reshadow_css_end__*/
18
18
  {
19
- "__SBar": "___SBar_3j3wp_gg_",
20
- "--duration": "--duration_3j3wp",
21
- "_color": "__color_3j3wp_gg_",
22
- "--color": "--color_3j3wp",
23
- "_pattern": "__pattern_3j3wp_gg_",
24
- "--pattern": "--pattern_3j3wp",
25
- "_hide": "__hide_3j3wp_gg_",
26
- "_transparent": "__transparent_3j3wp_gg_",
27
- "_onClick": "__onClick_3j3wp_gg_",
28
- "__SBackground": "___SBackground_3j3wp_gg_",
29
- "__SBarAnnotation": "___SBarAnnotation_3j3wp_gg_",
30
- "__SBarLabel": "___SBarLabel_3j3wp_gg_",
31
- "__SBarPercent": "___SBarPercent_3j3wp_gg_",
32
- "__SBarValue": "___SBarValue_3j3wp_gg_",
33
- "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_3j3wp_gg_"
19
+ "__SBar": "___SBar_1yabt_gg_",
20
+ "--duration": "--duration_1yabt",
21
+ "_color": "__color_1yabt_gg_",
22
+ "--color": "--color_1yabt",
23
+ "_pattern": "__pattern_1yabt_gg_",
24
+ "--pattern": "--pattern_1yabt",
25
+ "_hide": "__hide_1yabt_gg_",
26
+ "_transparent": "__transparent_1yabt_gg_",
27
+ "_onClick": "__onClick_1yabt_gg_",
28
+ "__SBackground": "___SBackground_1yabt_gg_",
29
+ "__SBarAnnotation": "___SBarAnnotation_1yabt_gg_",
30
+ "__SBarLabel": "___SBarLabel_1yabt_gg_",
31
+ "__SBarPercent": "___SBarPercent_1yabt_gg_",
32
+ "__SBarValue": "___SBarValue_1yabt_gg_",
33
+ "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1yabt_gg_"
34
34
  })
35
35
  );
36
36
  const MIN_WIDTH = 2;