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

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 (339) hide show
  1. package/CHANGELOG.md +52 -1
  2. package/README.md +0 -1
  3. package/lib/cjs/Area.js +123 -23
  4. package/lib/cjs/Area.js.map +1 -1
  5. package/lib/cjs/Axis.js +109 -97
  6. package/lib/cjs/Axis.js.map +1 -1
  7. package/lib/cjs/Bar.js +16 -16
  8. package/lib/cjs/Bubble.js +14 -14
  9. package/lib/cjs/ChartMetaData.js +44 -0
  10. package/lib/cjs/ChartMetaData.js.map +1 -0
  11. package/lib/cjs/CompactHorizontalBar.js +17 -17
  12. package/lib/cjs/CompactHorizontalBar.js.map +1 -1
  13. package/lib/cjs/Donut.js +18 -19
  14. package/lib/cjs/Donut.js.map +1 -1
  15. package/lib/cjs/Dots.js +67 -13
  16. package/lib/cjs/Dots.js.map +1 -1
  17. package/lib/cjs/GroupBar.js +5 -2
  18. package/lib/cjs/GroupBar.js.map +1 -1
  19. package/lib/cjs/HorizontalBar.js +16 -16
  20. package/lib/cjs/Hover.js +55 -52
  21. package/lib/cjs/Hover.js.map +1 -1
  22. package/lib/cjs/Line.js +82 -17
  23. package/lib/cjs/Line.js.map +1 -1
  24. package/lib/cjs/Pattern.js +113 -2
  25. package/lib/cjs/Pattern.js.map +1 -1
  26. package/lib/cjs/Plot.js +5 -2
  27. package/lib/cjs/Plot.js.map +1 -1
  28. package/lib/cjs/Radar.js +19 -19
  29. package/lib/cjs/RadialTree.js +12 -12
  30. package/lib/cjs/Reference.js +55 -18
  31. package/lib/cjs/Reference.js.map +1 -1
  32. package/lib/cjs/ScatterPlot.js +9 -9
  33. package/lib/cjs/Tooltip.js +16 -14
  34. package/lib/cjs/Tooltip.js.map +1 -1
  35. package/lib/cjs/Venn.js +9 -9
  36. package/lib/cjs/a11y/PlotA11yView.js +2 -2
  37. package/lib/cjs/component/Chart/AbstractChart.js +29 -23
  38. package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
  39. package/lib/cjs/component/Chart/AbstractChart.type.js +19 -0
  40. package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
  41. package/lib/cjs/component/Chart/AreaChart.js +21 -7
  42. package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
  43. package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
  44. package/lib/cjs/component/Chart/BarChart.js +17 -8
  45. package/lib/cjs/component/Chart/BarChart.js.map +1 -1
  46. package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
  47. package/lib/cjs/component/Chart/BubbleChart.js +4 -0
  48. package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
  49. package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
  50. package/lib/cjs/component/Chart/CigaretteChart.js +5 -1
  51. package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
  52. package/lib/cjs/component/Chart/CigaretteChart.type.js.map +1 -1
  53. package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  54. package/lib/cjs/component/Chart/DonutChart.js +0 -1
  55. package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
  56. package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
  57. package/lib/cjs/component/Chart/HistogramChart.js +6 -3
  58. package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
  59. package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
  60. package/lib/cjs/component/Chart/LineChart.js +16 -6
  61. package/lib/cjs/component/Chart/LineChart.js.map +1 -1
  62. package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
  63. package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
  64. package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
  65. package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
  66. package/lib/cjs/component/Chart/index.js +43 -0
  67. package/lib/cjs/component/Chart/index.js.map +1 -1
  68. package/lib/cjs/component/ChartLegend/BaseLegend.js +0 -4
  69. package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
  70. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  71. package/lib/cjs/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
  72. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +19 -17
  73. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  74. package/lib/cjs/component/ChartLegend/LegendItem/legend-item.shadow.css +11 -11
  75. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +28 -21
  76. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  77. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  78. package/lib/cjs/component/ChartLegend/LegendTable/legend-table.shadow.css +31 -15
  79. package/lib/cjs/component/Cigarette/Cigarette.js +0 -1
  80. package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
  81. package/lib/cjs/component/Metric/Metric.js +78 -0
  82. package/lib/cjs/component/Metric/Metric.js.map +1 -0
  83. package/lib/cjs/component/Metric/Metric.type.js +2 -0
  84. package/lib/cjs/component/Metric/Metric.type.js.map +1 -0
  85. package/lib/cjs/index.js +62 -8
  86. package/lib/cjs/index.js.map +1 -1
  87. package/lib/cjs/style/abstract-chart.shadow.css +13 -3
  88. package/lib/cjs/style/area.shadow.css +8 -7
  89. package/lib/cjs/style/axis.shadow.css +51 -60
  90. package/lib/cjs/style/bar.shadow.css +7 -9
  91. package/lib/cjs/style/bubble.shadow.css +4 -6
  92. package/lib/cjs/style/donut.shadow.css +3 -5
  93. package/lib/cjs/style/dot.shadow.css +37 -4
  94. package/lib/cjs/style/hover.shadow.css +30 -13
  95. package/lib/cjs/style/line.shadow.css +3 -5
  96. package/lib/cjs/style/pattern.shadow.css +10 -0
  97. package/lib/cjs/style/plotA11yView.shadow.css +3 -3
  98. package/lib/cjs/style/radar.shadow.css +7 -7
  99. package/lib/cjs/style/radial-tree.shadow.css +3 -5
  100. package/lib/cjs/style/reference.shadow.css +5 -5
  101. package/lib/cjs/style/scatterplot.shadow.css +2 -4
  102. package/lib/cjs/style/tooltip.shadow.css +12 -14
  103. package/lib/cjs/style/venn.shadow.css +0 -2
  104. package/lib/cjs/types/Axis.d.js.map +1 -1
  105. package/lib/cjs/types/Donut.d.js.map +1 -1
  106. package/lib/cjs/types/Hover.d.js.map +1 -1
  107. package/lib/cjs/types/index.d.js +20 -0
  108. package/lib/cjs/types/index.d.js.map +1 -1
  109. package/lib/cjs/utils.js +21 -1
  110. package/lib/cjs/utils.js.map +1 -1
  111. package/lib/es6/Area.js +125 -25
  112. package/lib/es6/Area.js.map +1 -1
  113. package/lib/es6/Axis.js +109 -97
  114. package/lib/es6/Axis.js.map +1 -1
  115. package/lib/es6/Bar.js +16 -16
  116. package/lib/es6/Bubble.js +14 -14
  117. package/lib/es6/ChartMetaData.js +36 -0
  118. package/lib/es6/ChartMetaData.js.map +1 -0
  119. package/lib/es6/CompactHorizontalBar.js +17 -17
  120. package/lib/es6/CompactHorizontalBar.js.map +1 -1
  121. package/lib/es6/Donut.js +18 -19
  122. package/lib/es6/Donut.js.map +1 -1
  123. package/lib/es6/Dots.js +68 -14
  124. package/lib/es6/Dots.js.map +1 -1
  125. package/lib/es6/GroupBar.js +5 -2
  126. package/lib/es6/GroupBar.js.map +1 -1
  127. package/lib/es6/HorizontalBar.js +16 -16
  128. package/lib/es6/Hover.js +55 -52
  129. package/lib/es6/Hover.js.map +1 -1
  130. package/lib/es6/Line.js +84 -19
  131. package/lib/es6/Line.js.map +1 -1
  132. package/lib/es6/Pattern.js +108 -2
  133. package/lib/es6/Pattern.js.map +1 -1
  134. package/lib/es6/Plot.js +5 -2
  135. package/lib/es6/Plot.js.map +1 -1
  136. package/lib/es6/Radar.js +19 -19
  137. package/lib/es6/RadialTree.js +12 -12
  138. package/lib/es6/Reference.js +55 -18
  139. package/lib/es6/Reference.js.map +1 -1
  140. package/lib/es6/ScatterPlot.js +9 -9
  141. package/lib/es6/Tooltip.js +16 -14
  142. package/lib/es6/Tooltip.js.map +1 -1
  143. package/lib/es6/Venn.js +9 -9
  144. package/lib/es6/a11y/PlotA11yView.js +2 -2
  145. package/lib/es6/component/Chart/AbstractChart.js +29 -23
  146. package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
  147. package/lib/es6/component/Chart/AbstractChart.type.js +14 -1
  148. package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
  149. package/lib/es6/component/Chart/AreaChart.js +21 -7
  150. package/lib/es6/component/Chart/AreaChart.js.map +1 -1
  151. package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
  152. package/lib/es6/component/Chart/BarChart.js +17 -8
  153. package/lib/es6/component/Chart/BarChart.js.map +1 -1
  154. package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
  155. package/lib/es6/component/Chart/BubbleChart.js +4 -0
  156. package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
  157. package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
  158. package/lib/es6/component/Chart/CigaretteChart.js +5 -1
  159. package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
  160. package/lib/es6/component/Chart/CigaretteChart.type.js.map +1 -1
  161. package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  162. package/lib/es6/component/Chart/DonutChart.js +0 -1
  163. package/lib/es6/component/Chart/DonutChart.js.map +1 -1
  164. package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
  165. package/lib/es6/component/Chart/HistogramChart.js +6 -3
  166. package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
  167. package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
  168. package/lib/es6/component/Chart/LineChart.js +14 -4
  169. package/lib/es6/component/Chart/LineChart.js.map +1 -1
  170. package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
  171. package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
  172. package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
  173. package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
  174. package/lib/es6/component/Chart/index.js +2 -0
  175. package/lib/es6/component/Chart/index.js.map +1 -1
  176. package/lib/es6/component/ChartLegend/BaseLegend.js +0 -4
  177. package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
  178. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  179. package/lib/es6/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
  180. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +19 -17
  181. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  182. package/lib/es6/component/ChartLegend/LegendItem/legend-item.shadow.css +11 -11
  183. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +28 -21
  184. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  185. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  186. package/lib/es6/component/ChartLegend/LegendTable/legend-table.shadow.css +31 -15
  187. package/lib/es6/component/Cigarette/Cigarette.js +0 -1
  188. package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
  189. package/lib/es6/component/Metric/Metric.js +72 -0
  190. package/lib/es6/component/Metric/Metric.js.map +1 -0
  191. package/lib/es6/component/Metric/Metric.type.js +2 -0
  192. package/lib/es6/component/Metric/Metric.type.js.map +1 -0
  193. package/lib/es6/index.js +2 -1
  194. package/lib/es6/index.js.map +1 -1
  195. package/lib/es6/style/abstract-chart.shadow.css +13 -3
  196. package/lib/es6/style/area.shadow.css +8 -7
  197. package/lib/es6/style/axis.shadow.css +51 -60
  198. package/lib/es6/style/bar.shadow.css +7 -9
  199. package/lib/es6/style/bubble.shadow.css +4 -6
  200. package/lib/es6/style/donut.shadow.css +3 -5
  201. package/lib/es6/style/dot.shadow.css +37 -4
  202. package/lib/es6/style/hover.shadow.css +30 -13
  203. package/lib/es6/style/line.shadow.css +3 -5
  204. package/lib/es6/style/pattern.shadow.css +10 -0
  205. package/lib/es6/style/plotA11yView.shadow.css +3 -3
  206. package/lib/es6/style/radar.shadow.css +7 -7
  207. package/lib/es6/style/radial-tree.shadow.css +3 -5
  208. package/lib/es6/style/reference.shadow.css +5 -5
  209. package/lib/es6/style/scatterplot.shadow.css +2 -4
  210. package/lib/es6/style/tooltip.shadow.css +12 -14
  211. package/lib/es6/style/venn.shadow.css +0 -2
  212. package/lib/es6/types/Axis.d.js.map +1 -1
  213. package/lib/es6/types/Donut.d.js.map +1 -1
  214. package/lib/es6/types/Hover.d.js.map +1 -1
  215. package/lib/es6/types/index.d.js +5 -7
  216. package/lib/es6/types/index.d.js.map +1 -1
  217. package/lib/es6/utils.js +18 -0
  218. package/lib/es6/utils.js.map +1 -1
  219. package/lib/esm/Area.mjs +127 -26
  220. package/lib/esm/Axis.mjs +110 -98
  221. package/lib/esm/Bar.mjs +17 -17
  222. package/lib/esm/Bubble.mjs +15 -15
  223. package/lib/esm/ChartMetaData.mjs +38 -0
  224. package/lib/esm/CompactHorizontalBar.mjs +18 -18
  225. package/lib/esm/Donut.mjs +19 -20
  226. package/lib/esm/Dots.mjs +66 -15
  227. package/lib/esm/GroupBar.mjs +5 -2
  228. package/lib/esm/HorizontalBar.mjs +17 -17
  229. package/lib/esm/Hover.mjs +56 -53
  230. package/lib/esm/Line.mjs +86 -20
  231. package/lib/esm/Pattern.mjs +119 -0
  232. package/lib/esm/Plot.mjs +6 -3
  233. package/lib/esm/Radar.mjs +20 -20
  234. package/lib/esm/RadialTree.mjs +13 -13
  235. package/lib/esm/Reference.mjs +56 -19
  236. package/lib/esm/ScatterPlot.mjs +10 -10
  237. package/lib/esm/Tooltip.mjs +17 -15
  238. package/lib/esm/Venn.mjs +10 -10
  239. package/lib/esm/a11y/PlotA11yView.mjs +3 -3
  240. package/lib/esm/component/Chart/AbstractChart.mjs +28 -24
  241. package/lib/esm/component/Chart/AbstractChart.type.mjs +16 -0
  242. package/lib/esm/component/Chart/AreaChart.mjs +21 -7
  243. package/lib/esm/component/Chart/BarChart.mjs +17 -8
  244. package/lib/esm/component/Chart/BubbleChart.mjs +4 -0
  245. package/lib/esm/component/Chart/CigaretteChart.mjs +5 -1
  246. package/lib/esm/component/Chart/DonutChart.mjs +0 -1
  247. package/lib/esm/component/Chart/HistogramChart.mjs +6 -3
  248. package/lib/esm/component/Chart/LineChart.mjs +14 -4
  249. package/lib/esm/component/Chart/index.mjs +8 -0
  250. package/lib/esm/component/ChartLegend/BaseLegend.mjs +0 -4
  251. package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +5 -5
  252. package/lib/esm/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
  253. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +20 -18
  254. package/lib/esm/component/ChartLegend/LegendItem/legend-item.shadow.css +11 -11
  255. package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +29 -22
  256. package/lib/esm/component/ChartLegend/LegendTable/legend-table.shadow.css +31 -15
  257. package/lib/esm/component/Cigarette/Cigarette.mjs +0 -1
  258. package/lib/esm/component/Metric/Metric.mjs +62 -0
  259. package/lib/esm/index.mjs +42 -34
  260. package/lib/esm/style/abstract-chart.shadow.css +13 -3
  261. package/lib/esm/style/area.shadow.css +8 -7
  262. package/lib/esm/style/axis.shadow.css +51 -60
  263. package/lib/esm/style/bar.shadow.css +7 -9
  264. package/lib/esm/style/bubble.shadow.css +4 -6
  265. package/lib/esm/style/donut.shadow.css +3 -5
  266. package/lib/esm/style/dot.shadow.css +37 -4
  267. package/lib/esm/style/hover.shadow.css +30 -13
  268. package/lib/esm/style/line.shadow.css +3 -5
  269. package/lib/esm/style/pattern.shadow.css +10 -0
  270. package/lib/esm/style/plotA11yView.shadow.css +3 -3
  271. package/lib/esm/style/radar.shadow.css +7 -7
  272. package/lib/esm/style/radial-tree.shadow.css +3 -5
  273. package/lib/esm/style/reference.shadow.css +5 -5
  274. package/lib/esm/style/scatterplot.shadow.css +2 -4
  275. package/lib/esm/style/tooltip.shadow.css +12 -14
  276. package/lib/esm/style/venn.shadow.css +0 -2
  277. package/lib/esm/utils.mjs +20 -0
  278. package/lib/types/Axis.d.ts +3 -2
  279. package/lib/types/ChartMetaData.d.ts +17 -0
  280. package/lib/types/ChartMetaData.d.ts.map +1 -0
  281. package/lib/types/Donut.d.ts +1 -1
  282. package/lib/types/Hover.d.ts +2 -0
  283. package/lib/types/Pattern.d.ts +18 -0
  284. package/lib/types/Pattern.d.ts.map +1 -1
  285. package/lib/types/component/Chart/AbstractChart.d.ts +8 -4
  286. package/lib/types/component/Chart/AbstractChart.d.ts.map +1 -1
  287. package/lib/types/component/Chart/AbstractChart.type.d.ts +28 -8
  288. package/lib/types/component/Chart/AbstractChart.type.d.ts.map +1 -1
  289. package/lib/types/component/Chart/AreaChart.d.ts.map +1 -1
  290. package/lib/types/component/Chart/AreaChart.type.d.ts +8 -4
  291. package/lib/types/component/Chart/AreaChart.type.d.ts.map +1 -1
  292. package/lib/types/component/Chart/BarChart.d.ts.map +1 -1
  293. package/lib/types/component/Chart/BarChart.type.d.ts +3 -0
  294. package/lib/types/component/Chart/BarChart.type.d.ts.map +1 -1
  295. package/lib/types/component/Chart/BubbleChart.d.ts.map +1 -1
  296. package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
  297. package/lib/types/component/Chart/BubbleChart.type.d.ts.map +1 -1
  298. package/lib/types/component/Chart/CigaretteChart.d.ts.map +1 -1
  299. package/lib/types/component/Chart/CigaretteChart.type.d.ts +1 -1
  300. package/lib/types/component/Chart/CigaretteChart.type.d.ts.map +1 -1
  301. package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
  302. package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts.map +1 -1
  303. package/lib/types/component/Chart/DonutChart.d.ts.map +1 -1
  304. package/lib/types/component/Chart/DonutChart.type.d.ts +1 -2
  305. package/lib/types/component/Chart/DonutChart.type.d.ts.map +1 -1
  306. package/lib/types/component/Chart/HistogramChart.d.ts.map +1 -1
  307. package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -0
  308. package/lib/types/component/Chart/HistogramChart.type.d.ts.map +1 -1
  309. package/lib/types/component/Chart/LineChart.d.ts.map +1 -1
  310. package/lib/types/component/Chart/LineChart.type.d.ts +1 -0
  311. package/lib/types/component/Chart/LineChart.type.d.ts.map +1 -1
  312. package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
  313. package/lib/types/component/Chart/RadarChart.type.d.ts.map +1 -1
  314. package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
  315. package/lib/types/component/Chart/ScatterPlotChart.type.d.ts.map +1 -1
  316. package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
  317. package/lib/types/component/Chart/VennChart.type.d.ts.map +1 -1
  318. package/lib/types/component/Chart/index.d.ts +2 -0
  319. package/lib/types/component/Chart/index.d.ts.map +1 -1
  320. package/lib/types/component/ChartLegend/BaseLegend.d.ts.map +1 -1
  321. package/lib/types/component/ChartLegend/LegendTable/LegendTable.d.ts.map +1 -1
  322. package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +5 -3
  323. package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts.map +1 -1
  324. package/lib/types/component/Metric/Metric.d.ts +9 -0
  325. package/lib/types/component/Metric/Metric.d.ts.map +1 -0
  326. package/lib/types/component/Metric/Metric.type.d.ts +33 -0
  327. package/lib/types/component/Metric/Metric.type.d.ts.map +1 -0
  328. package/lib/types/index.d.ts +5 -7
  329. package/lib/types/utils.d.ts +4 -1
  330. package/lib/types/utils.d.ts.map +1 -1
  331. package/package.json +16 -15
  332. package/lib/cjs/color.js +0 -132
  333. package/lib/cjs/color.js.map +0 -1
  334. package/lib/cjs/style/var.css +0 -125
  335. package/lib/es6/color.js +0 -127
  336. package/lib/es6/color.js.map +0 -1
  337. package/lib/es6/style/var.css +0 -125
  338. package/lib/esm/color.mjs +0 -127
  339. package/lib/esm/utils/TextMeasurer.mjs +0 -27
package/lib/esm/Area.mjs CHANGED
@@ -6,31 +6,34 @@ import { bisector } from "d3-array";
6
6
  import { line, curveLinear, area } from "d3-shape";
7
7
  import React from "react";
8
8
  import AnimatedClipPath from "./AnimatedClipPath.mjs";
9
+ import "./component/Chart/index.mjs";
9
10
  import { SvgElement } from "./component/SvgElement.mjs";
10
11
  import createElement from "./createElement.mjs";
11
12
  import Dots from "./Dots.mjs";
12
- import { PatternFill } from "./Pattern.mjs";
13
- import { interpolateValue, getNullData, definedNullData, eventToPoint, invert, definedData, scaleOfBandwidth } from "./utils.mjs";
13
+ import { ForecastGradient, StrokeMask, PotentialGradient, PatternFill } from "./Pattern.mjs";
14
+ import { interpolateValue, getNullData, definedNullData, eventToPoint, invert, getDataOfType, definedData, scaleOfBandwidth } from "./utils.mjs";
15
+ import { FORECAST, POTENTIAL, DATA_TYPE } from "./component/Chart/AbstractChart.type.mjs";
14
16
  /*!__reshadow-styles__:"./style/area.shadow.css"*/
15
17
  const style = (
16
18
  /*__reshadow_css_start__*/
17
19
  (sstyled.insert(
18
20
  /*__inner_css_start__*/
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}",
21
+ ".___SArea_mf3t1_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));fill-opacity:.1}.___SArea_mf3t1_gg_.__withGradient_mf3t1_gg_{-webkit-mask-image:linear-gradient(180deg,#000 0,#0000007a 60%,#0000);mask-image:linear-gradient(180deg,#000 0,#0000007a 60%,#0000)}.___SArea_mf3t1_gg_.__color_mf3t1_gg_{fill:var(--color_mf3t1)}.___SArea_mf3t1_gg_.__pattern_mf3t1_gg_{fill:var(--pattern_mf3t1);fill-opacity:.5}.___SArea_mf3t1_gg_.__transparent_mf3t1_gg_{opacity:.3}.___SAreaLine_mf3t1_gg_{stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));stroke-width:2;fill:#0000}.___SAreaLine_mf3t1_gg_.__color_mf3t1_gg_{stroke:var(--color_mf3t1)}.___SAreaLine_mf3t1_gg_.__transparent_mf3t1_gg_{opacity:.3}.___SAreaLine_mf3t1_gg_,.___SArea_mf3t1_gg_{transition-property:d;transition-duration:var(--duration_mf3t1);transition-timing-function:ease-in-out}.___SNull_mf3t1_gg_{fill:#0000;stroke:var(--intergalactic-chart-palette-order-null,oklch(.9 .009 234));stroke-dasharray:4}.___SNull_mf3t1_gg_.__hide_mf3t1_gg_{display:none}",
20
22
  /*__inner_css_end__*/
21
- "12fld_gg_"
23
+ "mf3t1_gg_"
22
24
  ), /*__reshadow_css_end__*/
23
25
  {
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_"
26
+ "__SArea": "___SArea_mf3t1_gg_",
27
+ "_withGradient": "__withGradient_mf3t1_gg_",
28
+ "_color": "__color_mf3t1_gg_",
29
+ "--color": "--color_mf3t1",
30
+ "_pattern": "__pattern_mf3t1_gg_",
31
+ "--pattern": "--pattern_mf3t1",
32
+ "_transparent": "__transparent_mf3t1_gg_",
33
+ "__SAreaLine": "___SAreaLine_mf3t1_gg_",
34
+ "--duration": "--duration_mf3t1",
35
+ "__SNull": "___SNull_mf3t1_gg_",
36
+ "_hide": "__hide_mf3t1_gg_"
34
37
  })
35
38
  );
36
39
  class AreaRoot extends Component {
@@ -107,8 +110,99 @@ class AreaRoot extends Component {
107
110
  const index = bisector((d) => d[x]).center(data, vX);
108
111
  onClick(index, e);
109
112
  }
110
- render() {
113
+ renderForecast() {
111
114
  var _ref;
115
+ const SArea = SvgElement;
116
+ const SAreaLine = SvgElement;
117
+ const {
118
+ styles,
119
+ hide,
120
+ d3,
121
+ d3Line,
122
+ color,
123
+ uid,
124
+ duration,
125
+ y,
126
+ transparent,
127
+ resolveColor
128
+ } = this.asProps;
129
+ const data = getDataOfType(this.asProps.data, FORECAST, y);
130
+ return _ref = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SAreaLine, _ref.cn("SAreaLine", {
131
+ "tag": "path",
132
+ "aria-hidden": true,
133
+ "clipPath": `url(#${uid}-animation)`,
134
+ "d": d3Line(data),
135
+ "color": resolveColor(color),
136
+ "use:duration": `${duration}ms`,
137
+ "transparent": transparent,
138
+ "strokeDasharray": "0 4",
139
+ "strokeLinecap": "round"
140
+ })), /* @__PURE__ */ React.createElement(SArea, _ref.cn("SArea", {
141
+ "aria-hidden": true,
142
+ "tag": "path",
143
+ "clipPath": `url(#${uid})`,
144
+ "d": d3(data),
145
+ "hide": hide,
146
+ "pattern": `url(#${uid}-forecast-gradient)`,
147
+ "mask": `url(#${uid}-forecast-mask)`,
148
+ "use:duration": `${duration}ms`,
149
+ "transparent": transparent,
150
+ "onClickCapture": this.handlerOnClick.bind(this)
151
+ })), /* @__PURE__ */ React.createElement(ForecastGradient, _ref.cn("ForecastGradient", {
152
+ "id": `${uid}-forecast-gradient`,
153
+ "color": resolveColor(color)
154
+ })), /* @__PURE__ */ React.createElement(StrokeMask, _ref.cn("StrokeMask", {
155
+ "id": `${uid}-forecast-mask`,
156
+ "color": resolveColor(color)
157
+ })));
158
+ }
159
+ renderPotential() {
160
+ var _ref2;
161
+ const SArea = SvgElement;
162
+ const SAreaLine = SvgElement;
163
+ const {
164
+ styles,
165
+ hide,
166
+ d3,
167
+ d3Line,
168
+ uid,
169
+ duration,
170
+ y,
171
+ transparent
172
+ } = this.asProps;
173
+ const data = getDataOfType(this.asProps.data, POTENTIAL, y);
174
+ return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SAreaLine, _ref2.cn("SAreaLine", {
175
+ "tag": "path",
176
+ "aria-hidden": true,
177
+ "clipPath": `url(#${uid}-animation)`,
178
+ "d": d3Line(data),
179
+ "color": `url(#${uid}-potential-gradient-line)`,
180
+ "use:duration": `${duration}ms`,
181
+ "transparent": transparent,
182
+ "strokeDasharray": "4 4"
183
+ })), /* @__PURE__ */ React.createElement(SArea, _ref2.cn("SArea", {
184
+ "aria-hidden": true,
185
+ "tag": "path",
186
+ "clipPath": `url(#${uid})`,
187
+ "d": d3(data),
188
+ "hide": hide,
189
+ "pattern": `url(#${uid}-potential-gradient)`,
190
+ "mask": `url(#${uid}-potential-mask)`,
191
+ "use:duration": `${duration}ms`,
192
+ "transparent": transparent,
193
+ "onClickCapture": this.handlerOnClick.bind(this)
194
+ })), /* @__PURE__ */ React.createElement(PotentialGradient, _ref2.cn("PotentialGradient", {
195
+ "id": `${uid}-potential-gradient`,
196
+ "type": "area"
197
+ })), /* @__PURE__ */ React.createElement(PotentialGradient, _ref2.cn("PotentialGradient", {
198
+ "id": `${uid}-potential-gradient-line`,
199
+ "type": "line"
200
+ })), /* @__PURE__ */ React.createElement(StrokeMask, _ref2.cn("StrokeMask", {
201
+ "id": `${uid}-potential-mask`
202
+ })));
203
+ }
204
+ render() {
205
+ var _ref3;
112
206
  const SArea = this.Element;
113
207
  const SAreaLine = SvgElement;
114
208
  const {
@@ -126,13 +220,14 @@ class AreaRoot extends Component {
126
220
  transparent,
127
221
  forcedAdvancedMode,
128
222
  resolveColor,
129
- patterns
223
+ patterns,
224
+ withGradient
130
225
  } = this.asProps;
131
226
  const advancedMode = forcedAdvancedMode || !!findComponent(Children, [Area.Line.displayName]);
132
- const data = this.asProps.data.filter((item) => item[y] !== interpolateValue);
227
+ const data = this.asProps.data.filter((item) => item[y] !== interpolateValue && item[DATA_TYPE] !== FORECAST && item[DATA_TYPE] !== POTENTIAL);
133
228
  this.asProps.dataHintsHandler.specifyDataRowFields(x, y);
134
229
  this.asProps.dataHintsHandler.establishDataType("time-series");
135
- return _ref = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, !advancedMode && /* @__PURE__ */ React.createElement(SAreaLine, _ref.cn("SAreaLine", {
230
+ return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, !advancedMode && /* @__PURE__ */ React.createElement(SAreaLine, _ref3.cn("SAreaLine", {
136
231
  "tag": "path",
137
232
  "aria-hidden": true,
138
233
  "clipPath": `url(#${uid}-animation)`,
@@ -140,7 +235,7 @@ class AreaRoot extends Component {
140
235
  "color": resolveColor(color),
141
236
  "use:duration": `${duration}ms`,
142
237
  "transparent": transparent
143
- })), /* @__PURE__ */ React.createElement(SArea, _ref.cn("SArea", {
238
+ })), this.renderForecast(), this.renderPotential(), /* @__PURE__ */ React.createElement(SArea, _ref3.cn("SArea", {
144
239
  "aria-hidden": true,
145
240
  "clipPath": `url(#${uid})`,
146
241
  "render": "path",
@@ -150,13 +245,19 @@ class AreaRoot extends Component {
150
245
  "color": resolveColor(color),
151
246
  "use:duration": `${duration}ms`,
152
247
  "transparent": transparent,
153
- "onClickCapture": this.handlerOnClick.bind(this)
154
- })), duration && /* @__PURE__ */ React.createElement(AnimatedClipPath, _ref.cn("AnimatedClipPath", {
248
+ "onClickCapture": this.handlerOnClick.bind(this),
249
+ "withGradient": patterns ? void 0 : withGradient
250
+ })), duration && /* @__PURE__ */ React.createElement(AnimatedClipPath, _ref3.cn("AnimatedClipPath", {
155
251
  "duration": duration,
156
252
  "id": uid,
157
253
  "width": 0,
158
254
  "height": size[1]
159
- })), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref.cn("PatternFill", {
255
+ })), duration && /* @__PURE__ */ React.createElement(AnimatedClipPath, _ref3.cn("AnimatedClipPath", {
256
+ "duration": duration,
257
+ "id": `${uid}-animation`,
258
+ "width": 0,
259
+ "height": size[1]
260
+ })), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref3.cn("PatternFill", {
160
261
  "id": `${uid}-pattern`,
161
262
  "patternKey": color,
162
263
  "color": resolveColor(color),
@@ -184,7 +285,7 @@ _defineProperty(AreaRoot, "defaultProps", ({
184
285
  };
185
286
  });
186
287
  function Line(props) {
187
- var _ref2;
288
+ var _ref4;
188
289
  const {
189
290
  Element: SAreaLine,
190
291
  styles,
@@ -196,7 +297,7 @@ function Line(props) {
196
297
  uid,
197
298
  transparent
198
299
  } = props;
199
- return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SAreaLine, _ref2.cn("SAreaLine", {
300
+ return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SAreaLine, _ref4.cn("SAreaLine", {
200
301
  "render": "path",
201
302
  "clipPath": `url(#${uid})`,
202
303
  "d": d3(data),
@@ -206,7 +307,7 @@ function Line(props) {
206
307
  }));
207
308
  }
208
309
  function Null(props) {
209
- var _ref3;
310
+ var _ref5;
210
311
  const {
211
312
  Element: SNull,
212
313
  styles,
@@ -216,7 +317,7 @@ function Null(props) {
216
317
  color,
217
318
  resolveColor
218
319
  } = props;
219
- return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SNull, _ref3.cn("SNull", {
320
+ return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SNull, _ref5.cn("SNull", {
220
321
  "render": "path",
221
322
  "d": d3(data),
222
323
  "hide": hide,
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_1d6up_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition-property:height,width,y;transition-duration:var(--duration_1d6up);transition-timing-function:ease-in-out}.___SBar_1d6up_gg_.__color_1d6up_gg_{fill:var(--color_1d6up)}.___SBar_1d6up_gg_.__pattern_1d6up_gg_.__color_1d6up_gg_{fill:var(--pattern_1d6up);stroke:var(--color_1d6up);stroke-width:1px}.___SBar_1d6up_gg_.__hide_1d6up_gg_{display:none}.___SBar_1d6up_gg_.__transparent_1d6up_gg_{opacity:.3}.___SBar_1d6up_gg_.__onClick_1d6up_gg_{cursor:pointer}.___SBackground_1d6up_gg_{fill:var(--intergalactic-chart-grid-bar-base-bg,oklch(.92 .008 233.5));opacity:.4}.___SBackground_1d6up_gg_.__onClick_1d6up_gg_{cursor:pointer}.___SBarAnnotation_1d6up_gg_{display:flex;justify-content:space-between}.___SBarLabel_1d6up_gg_{color:var(--intergalactic-text-primary,oklch(.23 .009 245));margin-right:auto}.___SBarLabel_1d6up_gg_,.___SBarPercent_1d6up_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}.___SBarPercent_1d6up_gg_{color:var(--intergalactic-text-secondary,oklch(.182 .045 244.8/.593));margin-right:var(--intergalactic-spacing-2x,8px)}.___SBarValue_1d6up_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_1d6up_gg_{fill:var(--intergalactic-chart-grid-bar-hover,oklch(.375 .09 242.7/.05))}",
16
16
  /*__inner_css_end__*/
17
- "1yabt_gg_"
17
+ "1d6up_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_1d6up_gg_",
21
+ "--duration": "--duration_1d6up",
22
+ "_color": "__color_1d6up_gg_",
23
+ "--color": "--color_1d6up",
24
+ "_pattern": "__pattern_1d6up_gg_",
25
+ "--pattern": "--pattern_1d6up",
26
+ "_hide": "__hide_1d6up_gg_",
27
+ "_transparent": "__transparent_1d6up_gg_",
28
+ "_onClick": "__onClick_1d6up_gg_",
29
+ "__SBackground": "___SBackground_1d6up_gg_",
30
+ "__SBarAnnotation": "___SBarAnnotation_1d6up_gg_",
31
+ "__SBarLabel": "___SBarLabel_1d6up_gg_",
32
+ "__SBarPercent": "___SBarPercent_1d6up_gg_",
33
+ "__SBarValue": "___SBarValue_1d6up_gg_",
34
+ "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1d6up_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_1fxbq_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_1fxbq);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SBubble_1fxbq_gg_:hover{opacity:.8}}g._visible_false_1fxbq_gg_{display:none}.___SBubble_1fxbq_gg_.__clickable_1fxbq_gg_{cursor:pointer}.___SBubble_1fxbq_gg_.__color_1fxbq_gg_{fill:var(--color_1fxbq)}.___SBubble_1fxbq_gg_.__pattern_1fxbq_gg_.__color_1fxbq_gg_{fill:var(--pattern_1fxbq);stroke:var(--color_1fxbq);stroke-width:1px}.___SBubble_1fxbq_gg_.__transparent_1fxbq_gg_{opacity:.3}.___SCenter_1fxbq_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_1fxbq_gg_.__color_1fxbq_gg_{stroke:var(--color_1fxbq)}.___SCenter_1fxbq_gg_.__transparent_1fxbq_gg_{opacity:.3}.___SLabel_1fxbq_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SLabel_1fxbq_gg_._position_right_1fxbq_gg_{text-anchor:end}.___SLabel_1fxbq_gg_._position_left_1fxbq_gg_{text-anchor:start}.___SLabel_1fxbq_gg_.__color_1fxbq_gg_{fill:var(--color_1fxbq)}.___SLabel_1fxbq_gg_.__transparent_1fxbq_gg_{opacity:.3}",
19
19
  /*__inner_css_end__*/
20
- "7qqxu_gg_"
20
+ "1fxbq_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_1fxbq_gg_",
24
+ "__SBubble": "___SBubble_1fxbq_gg_",
25
+ "_clickable": "__clickable_1fxbq_gg_",
26
+ "_color": "__color_1fxbq_gg_",
27
+ "--color": "--color_1fxbq",
28
+ "_pattern": "__pattern_1fxbq_gg_",
29
+ "--pattern": "--pattern_1fxbq",
30
+ "_transparent": "__transparent_1fxbq_gg_",
31
+ "__SCenter": "___SCenter_1fxbq_gg_",
32
+ "__SLabel": "___SLabel_1fxbq_gg_",
33
+ "_position_right": "_position_right_1fxbq_gg_",
34
+ "_position_left": "_position_left_1fxbq_gg_",
35
+ "--duration": "--duration_1fxbq"
36
36
  })
37
37
  );
38
38
  class BubbleRoot extends Component {