@gravity-ui/charts 1.46.0 → 1.47.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 (445) hide show
  1. package/dist/cjs/components/ChartInner/index.js +1 -0
  2. package/dist/cjs/components/ChartInner/useChartInnerProps.d.ts +1 -0
  3. package/dist/cjs/components/ChartInner/useChartInnerProps.js +13 -6
  4. package/dist/cjs/components/Legend/index.js +13 -14
  5. package/dist/cjs/components/Tooltip/index.js +22 -1
  6. package/dist/cjs/core/axes/x-axis.js +1 -1
  7. package/dist/cjs/core/axes/y-axis.js +1 -1
  8. package/dist/cjs/core/brush/index.d.ts +2 -0
  9. package/dist/cjs/core/brush/index.js +2 -0
  10. package/dist/cjs/{hooks/useBrush → core/brush}/types.d.ts +2 -2
  11. package/dist/cjs/{hooks/useBrush → core/brush}/utils.d.ts +1 -1
  12. package/dist/cjs/core/chart/index.d.ts +1 -0
  13. package/dist/cjs/core/chart/index.js +1 -0
  14. package/dist/cjs/core/chart/types.d.ts +8 -0
  15. package/dist/cjs/core/index.d.ts +3 -0
  16. package/dist/cjs/core/index.js +3 -0
  17. package/dist/cjs/core/layout/chart-dimensions.d.ts +1 -1
  18. package/dist/cjs/core/range-slider/index.d.ts +2 -0
  19. package/dist/cjs/core/range-slider/index.js +2 -0
  20. package/dist/cjs/core/range-slider/types.d.ts +4 -0
  21. package/dist/{esm/hooks/useRangeSlider → cjs/core/range-slider}/utils.d.ts +5 -5
  22. package/dist/{esm/hooks/useRangeSlider → cjs/core/range-slider}/utils.js +1 -1
  23. package/dist/cjs/core/scales/utils.d.ts +1 -1
  24. package/dist/cjs/core/scales/utils.js +1 -1
  25. package/dist/cjs/core/scales/x-scale.d.ts +2 -2
  26. package/dist/cjs/core/scales/x-scale.js +2 -2
  27. package/dist/cjs/core/scales/y-scale.js +69 -4
  28. package/dist/cjs/core/series/prepare-area.js +1 -1
  29. package/dist/cjs/core/series/prepare-bar-x.js +1 -1
  30. package/dist/cjs/core/series/prepare-bar-y.js +1 -1
  31. package/dist/cjs/core/series/prepare-funnel.js +1 -1
  32. package/dist/cjs/core/series/prepare-heatmap.js +1 -1
  33. package/dist/cjs/core/series/prepare-legend.d.ts +1 -1
  34. package/dist/cjs/core/series/prepare-legend.js +2 -2
  35. package/dist/cjs/core/series/prepare-line.js +1 -1
  36. package/dist/cjs/core/series/prepare-pie.js +1 -1
  37. package/dist/cjs/core/series/prepare-radar.js +1 -1
  38. package/dist/cjs/core/series/prepare-sankey.js +1 -1
  39. package/dist/cjs/core/series/prepare-scatter.js +1 -1
  40. package/dist/cjs/core/series/prepare-treemap.js +1 -1
  41. package/dist/cjs/core/series/prepare-waterfall.js +1 -1
  42. package/dist/cjs/core/series/prepare-x-range.js +1 -1
  43. package/dist/cjs/core/series/prepareSeries.d.ts +7 -1
  44. package/dist/cjs/core/series/prepareSeries.js +31 -0
  45. package/dist/cjs/core/series/types.d.ts +5 -0
  46. package/dist/cjs/core/series/utils.d.ts +4 -0
  47. package/dist/cjs/core/series/utils.js +9 -1
  48. package/dist/cjs/{hooks/useShapes/annotation/index.d.ts → core/shapes/annotation.d.ts} +1 -7
  49. package/dist/cjs/{hooks/useShapes/annotation/index.js → core/shapes/annotation.js} +2 -2
  50. package/dist/cjs/{hooks/useShapes → core/shapes}/area/prepare-data.d.ts +4 -4
  51. package/dist/cjs/{hooks/useShapes → core/shapes}/area/prepare-data.js +9 -4
  52. package/dist/cjs/core/shapes/area/renderer.d.ts +11 -0
  53. package/dist/cjs/core/shapes/area/renderer.js +175 -0
  54. package/dist/cjs/{hooks/useShapes → core/shapes}/area/types.d.ts +7 -8
  55. package/dist/{esm/hooks/useShapes → cjs/core/shapes}/bar-x/prepare-data.d.ts +4 -4
  56. package/dist/{esm/hooks/useShapes → cjs/core/shapes}/bar-x/prepare-data.js +6 -6
  57. package/dist/cjs/core/shapes/bar-x/renderer.d.ts +9 -0
  58. package/dist/cjs/core/shapes/bar-x/renderer.js +104 -0
  59. package/dist/cjs/{hooks/useShapes → core/shapes}/bar-x/types.d.ts +1 -2
  60. package/dist/{esm/hooks/useShapes → cjs/core/shapes}/bar-y/prepare-data.d.ts +3 -3
  61. package/dist/{esm/hooks/useShapes → cjs/core/shapes}/bar-y/prepare-data.js +3 -3
  62. package/dist/cjs/core/shapes/bar-y/renderer.d.ts +6 -0
  63. package/dist/cjs/core/shapes/bar-y/renderer.js +74 -0
  64. package/dist/cjs/{hooks/useShapes → core/shapes}/bar-y/types.d.ts +1 -1
  65. package/dist/cjs/{hooks/useShapes → core/shapes}/bar-y/utils.js +1 -1
  66. package/dist/cjs/core/shapes/data-labels.d.ts +15 -0
  67. package/dist/cjs/core/shapes/data-labels.js +15 -0
  68. package/dist/cjs/{hooks/useShapes → core/shapes}/funnel/prepare-data.d.ts +1 -1
  69. package/dist/{esm/hooks/useShapes → cjs/core/shapes}/funnel/prepare-data.js +1 -1
  70. package/dist/cjs/core/shapes/funnel/renderer.d.ts +6 -0
  71. package/dist/cjs/core/shapes/funnel/renderer.js +74 -0
  72. package/dist/cjs/{hooks/useShapes → core/shapes}/funnel/types.d.ts +2 -2
  73. package/dist/cjs/{hooks/useShapes → core/shapes}/heatmap/prepare-data.d.ts +3 -3
  74. package/dist/cjs/{hooks/useShapes → core/shapes}/heatmap/prepare-data.js +3 -2
  75. package/dist/cjs/core/shapes/heatmap/renderer.d.ts +6 -0
  76. package/dist/cjs/core/shapes/heatmap/renderer.js +50 -0
  77. package/dist/{esm/hooks/useShapes → cjs/core/shapes}/heatmap/types.d.ts +2 -1
  78. package/dist/{esm/hooks/useShapes → cjs/core/shapes}/line/prepare-data.d.ts +4 -4
  79. package/dist/cjs/{hooks/useShapes → core/shapes}/line/prepare-data.js +12 -4
  80. package/dist/cjs/core/shapes/line/renderer.d.ts +11 -0
  81. package/dist/cjs/core/shapes/line/renderer.js +161 -0
  82. package/dist/{esm/hooks/useShapes → cjs/core/shapes}/line/types.d.ts +7 -8
  83. package/dist/cjs/core/shapes/marker.d.ts +45 -0
  84. package/dist/{esm/hooks/useShapes → cjs/core/shapes}/marker.js +2 -2
  85. package/dist/cjs/{hooks/useShapes → core/shapes}/pie/prepare-data.d.ts +1 -1
  86. package/dist/cjs/{hooks/useShapes → core/shapes}/pie/prepare-data.js +3 -3
  87. package/dist/cjs/core/shapes/pie/renderer.d.ts +8 -0
  88. package/dist/cjs/core/shapes/pie/renderer.js +160 -0
  89. package/dist/cjs/{hooks/useShapes → core/shapes}/pie/types.d.ts +1 -1
  90. package/dist/cjs/{hooks/useShapes → core/shapes}/radar/prepare-data.d.ts +1 -1
  91. package/dist/{esm/hooks/useShapes → cjs/core/shapes}/radar/prepare-data.js +2 -2
  92. package/dist/cjs/core/shapes/radar/renderer.d.ts +6 -0
  93. package/dist/cjs/core/shapes/radar/renderer.js +122 -0
  94. package/dist/cjs/{hooks/useShapes → core/shapes}/radar/types.d.ts +1 -1
  95. package/dist/cjs/{hooks/useShapes → core/shapes}/sankey/prepare-data.d.ts +1 -1
  96. package/dist/cjs/{hooks/useShapes → core/shapes}/sankey/prepare-data.js +1 -1
  97. package/dist/cjs/core/shapes/sankey/renderer.d.ts +6 -0
  98. package/dist/cjs/core/shapes/sankey/renderer.js +44 -0
  99. package/dist/{esm/hooks/useShapes → cjs/core/shapes}/sankey/types.d.ts +1 -1
  100. package/dist/{esm/hooks/useShapes → cjs/core/shapes}/scatter/prepare-data.d.ts +3 -3
  101. package/dist/cjs/{hooks/useShapes → core/shapes}/scatter/prepare-data.js +2 -2
  102. package/dist/cjs/core/shapes/scatter/renderer.d.ts +6 -0
  103. package/dist/cjs/core/shapes/scatter/renderer.js +52 -0
  104. package/dist/cjs/{hooks/useShapes → core/shapes}/scatter/types.d.ts +1 -1
  105. package/dist/cjs/{hooks/useShapes → core/shapes}/treemap/prepare-data.d.ts +1 -1
  106. package/dist/{esm/hooks/useShapes → cjs/core/shapes}/treemap/prepare-data.js +3 -3
  107. package/dist/cjs/core/shapes/treemap/renderer.d.ts +6 -0
  108. package/dist/cjs/core/shapes/treemap/renderer.js +88 -0
  109. package/dist/cjs/{hooks/useShapes → core/shapes}/treemap/types.d.ts +1 -1
  110. package/dist/cjs/core/shapes/utils.d.ts +76 -0
  111. package/dist/cjs/core/shapes/utils.js +186 -0
  112. package/dist/cjs/{hooks/useShapes → core/shapes}/waterfall/prepare-data.d.ts +3 -3
  113. package/dist/{esm/hooks/useShapes → cjs/core/shapes}/waterfall/prepare-data.js +4 -4
  114. package/dist/cjs/core/shapes/waterfall/renderer.d.ts +6 -0
  115. package/dist/cjs/core/shapes/waterfall/renderer.js +109 -0
  116. package/dist/cjs/{hooks/useShapes → core/shapes}/waterfall/types.d.ts +1 -1
  117. package/dist/cjs/{hooks/useShapes → core/shapes}/x-range/prepare-data.d.ts +3 -3
  118. package/dist/cjs/{hooks/useShapes → core/shapes}/x-range/prepare-data.js +4 -4
  119. package/dist/cjs/core/shapes/x-range/renderer.d.ts +6 -0
  120. package/dist/cjs/core/shapes/x-range/renderer.js +88 -0
  121. package/dist/cjs/{hooks/useShapes → core/shapes}/x-range/types.d.ts +1 -1
  122. package/dist/cjs/core/types/chart/area.d.ts +0 -1
  123. package/dist/cjs/core/types/chart/axis.d.ts +0 -1
  124. package/dist/cjs/core/types/chart/base.d.ts +18 -7
  125. package/dist/cjs/core/types/chart/tooltip.d.ts +3 -3
  126. package/dist/cjs/core/types/formatter.d.ts +1 -40
  127. package/dist/{esm/hooks/utils/get-band-size.js → cjs/core/utils/band-size.js} +1 -1
  128. package/dist/cjs/{hooks → core}/utils/bar-y.d.ts +3 -3
  129. package/dist/{esm/hooks → cjs/core}/utils/bar-y.js +4 -4
  130. package/dist/cjs/core/utils/format.d.ts +2 -2
  131. package/dist/cjs/core/utils/get-closest-data.d.ts +1 -1
  132. package/dist/cjs/core/utils/get-closest-data.js +13 -8
  133. package/dist/cjs/core/utils/series/sorting.js +1 -1
  134. package/dist/cjs/core/utils/text.d.ts +0 -1
  135. package/dist/cjs/core/utils/text.js +0 -1
  136. package/dist/cjs/core/zoom/index.d.ts +2 -0
  137. package/dist/cjs/core/zoom/index.js +2 -0
  138. package/dist/{esm/hooks/useZoom → cjs/core/zoom}/utils.d.ts +3 -3
  139. package/dist/{esm/hooks/useZoom → cjs/core/zoom}/utils.js +1 -1
  140. package/dist/cjs/core/zoom/zoom.d.ts +3 -3
  141. package/dist/cjs/hooks/index.d.ts +3 -3
  142. package/dist/cjs/hooks/index.js +3 -3
  143. package/dist/cjs/hooks/types.d.ts +2 -8
  144. package/dist/cjs/hooks/useBrush/index.d.ts +1 -1
  145. package/dist/cjs/hooks/useBrush/index.js +1 -1
  146. package/dist/cjs/hooks/useRangeSlider/index.js +3 -3
  147. package/dist/cjs/hooks/useRangeSlider/types.d.ts +6 -8
  148. package/dist/cjs/hooks/useShapes/area/index.d.ts +2 -2
  149. package/dist/cjs/hooks/useShapes/area/index.js +13 -185
  150. package/dist/cjs/hooks/useShapes/bar-x/index.d.ts +4 -4
  151. package/dist/cjs/hooks/useShapes/bar-x/index.js +10 -119
  152. package/dist/cjs/hooks/useShapes/bar-y/index.d.ts +3 -3
  153. package/dist/cjs/hooks/useShapes/bar-y/index.js +5 -84
  154. package/dist/cjs/hooks/useShapes/funnel/index.d.ts +4 -4
  155. package/dist/cjs/hooks/useShapes/funnel/index.js +4 -83
  156. package/dist/cjs/hooks/useShapes/heatmap/index.d.ts +4 -4
  157. package/dist/cjs/hooks/useShapes/heatmap/index.js +4 -59
  158. package/dist/cjs/hooks/useShapes/index.d.ts +15 -16
  159. package/dist/cjs/hooks/useShapes/index.js +13 -13
  160. package/dist/cjs/hooks/useShapes/line/index.d.ts +2 -2
  161. package/dist/cjs/hooks/useShapes/line/index.js +14 -172
  162. package/dist/cjs/hooks/useShapes/pie/index.d.ts +3 -5
  163. package/dist/cjs/hooks/useShapes/pie/index.js +3 -158
  164. package/dist/cjs/hooks/useShapes/radar/index.d.ts +2 -2
  165. package/dist/cjs/hooks/useShapes/radar/index.js +2 -121
  166. package/dist/cjs/hooks/useShapes/sankey/index.d.ts +2 -2
  167. package/dist/cjs/hooks/useShapes/sankey/index.js +2 -51
  168. package/dist/cjs/hooks/useShapes/scatter/index.d.ts +3 -3
  169. package/dist/cjs/hooks/useShapes/scatter/index.js +3 -58
  170. package/dist/cjs/hooks/useShapes/treemap/index.d.ts +2 -2
  171. package/dist/cjs/hooks/useShapes/treemap/index.js +2 -88
  172. package/dist/cjs/hooks/useShapes/utils.d.ts +3 -53
  173. package/dist/cjs/hooks/useShapes/utils.js +3 -140
  174. package/dist/cjs/hooks/useShapes/waterfall/index.d.ts +4 -4
  175. package/dist/cjs/hooks/useShapes/waterfall/index.js +6 -119
  176. package/dist/cjs/hooks/useShapes/x-range/index.d.ts +4 -4
  177. package/dist/cjs/hooks/useShapes/x-range/index.js +3 -98
  178. package/dist/cjs/hooks/useZoom/index.d.ts +1 -1
  179. package/dist/cjs/hooks/useZoom/index.js +1 -1
  180. package/dist/cjs/index.d.ts +1 -0
  181. package/dist/cjs/index.js +1 -0
  182. package/dist/cjs/libs/format-number/index.js +82 -14
  183. package/dist/cjs/libs/format-number/presets.d.ts +40 -0
  184. package/dist/cjs/libs/format-number/presets.js +66 -0
  185. package/dist/cjs/libs/format-number/types.d.ts +82 -3
  186. package/dist/cjs/setup-jsdom.js +7 -0
  187. package/dist/esm/components/ChartInner/index.js +1 -0
  188. package/dist/esm/components/ChartInner/useChartInnerProps.d.ts +1 -0
  189. package/dist/esm/components/ChartInner/useChartInnerProps.js +13 -6
  190. package/dist/esm/components/Legend/index.js +13 -14
  191. package/dist/esm/components/Tooltip/index.js +22 -1
  192. package/dist/esm/core/axes/x-axis.js +1 -1
  193. package/dist/esm/core/axes/y-axis.js +1 -1
  194. package/dist/esm/core/brush/index.d.ts +2 -0
  195. package/dist/esm/core/brush/index.js +2 -0
  196. package/dist/esm/{hooks/useBrush → core/brush}/types.d.ts +2 -2
  197. package/dist/esm/{hooks/useBrush → core/brush}/utils.d.ts +1 -1
  198. package/dist/esm/core/chart/index.d.ts +1 -0
  199. package/dist/esm/core/chart/index.js +1 -0
  200. package/dist/esm/core/chart/types.d.ts +8 -0
  201. package/dist/esm/core/index.d.ts +3 -0
  202. package/dist/esm/core/index.js +3 -0
  203. package/dist/esm/core/layout/chart-dimensions.d.ts +1 -1
  204. package/dist/esm/core/range-slider/index.d.ts +2 -0
  205. package/dist/esm/core/range-slider/index.js +2 -0
  206. package/dist/esm/core/range-slider/types.d.ts +4 -0
  207. package/dist/{cjs/hooks/useRangeSlider → esm/core/range-slider}/utils.d.ts +5 -5
  208. package/dist/{cjs/hooks/useRangeSlider → esm/core/range-slider}/utils.js +1 -1
  209. package/dist/esm/core/scales/utils.d.ts +1 -1
  210. package/dist/esm/core/scales/utils.js +1 -1
  211. package/dist/esm/core/scales/x-scale.d.ts +2 -2
  212. package/dist/esm/core/scales/x-scale.js +2 -2
  213. package/dist/esm/core/scales/y-scale.js +69 -4
  214. package/dist/esm/core/series/prepare-area.js +1 -1
  215. package/dist/esm/core/series/prepare-bar-x.js +1 -1
  216. package/dist/esm/core/series/prepare-bar-y.js +1 -1
  217. package/dist/esm/core/series/prepare-funnel.js +1 -1
  218. package/dist/esm/core/series/prepare-heatmap.js +1 -1
  219. package/dist/esm/core/series/prepare-legend.d.ts +1 -1
  220. package/dist/esm/core/series/prepare-legend.js +2 -2
  221. package/dist/esm/core/series/prepare-line.js +1 -1
  222. package/dist/esm/core/series/prepare-pie.js +1 -1
  223. package/dist/esm/core/series/prepare-radar.js +1 -1
  224. package/dist/esm/core/series/prepare-sankey.js +1 -1
  225. package/dist/esm/core/series/prepare-scatter.js +1 -1
  226. package/dist/esm/core/series/prepare-treemap.js +1 -1
  227. package/dist/esm/core/series/prepare-waterfall.js +1 -1
  228. package/dist/esm/core/series/prepare-x-range.js +1 -1
  229. package/dist/esm/core/series/prepareSeries.d.ts +7 -1
  230. package/dist/esm/core/series/prepareSeries.js +31 -0
  231. package/dist/esm/core/series/types.d.ts +5 -0
  232. package/dist/esm/core/series/utils.d.ts +4 -0
  233. package/dist/esm/core/series/utils.js +9 -1
  234. package/dist/esm/{hooks/useShapes/annotation/index.d.ts → core/shapes/annotation.d.ts} +1 -7
  235. package/dist/esm/{hooks/useShapes/annotation/index.js → core/shapes/annotation.js} +2 -2
  236. package/dist/esm/{hooks/useShapes → core/shapes}/area/prepare-data.d.ts +4 -4
  237. package/dist/esm/{hooks/useShapes → core/shapes}/area/prepare-data.js +9 -4
  238. package/dist/esm/core/shapes/area/renderer.d.ts +11 -0
  239. package/dist/esm/core/shapes/area/renderer.js +175 -0
  240. package/dist/esm/{hooks/useShapes → core/shapes}/area/types.d.ts +7 -8
  241. package/dist/{cjs/hooks/useShapes → esm/core/shapes}/bar-x/prepare-data.d.ts +4 -4
  242. package/dist/{cjs/hooks/useShapes → esm/core/shapes}/bar-x/prepare-data.js +6 -6
  243. package/dist/esm/core/shapes/bar-x/renderer.d.ts +9 -0
  244. package/dist/esm/core/shapes/bar-x/renderer.js +104 -0
  245. package/dist/esm/{hooks/useShapes → core/shapes}/bar-x/types.d.ts +1 -2
  246. package/dist/{cjs/hooks/useShapes → esm/core/shapes}/bar-y/prepare-data.d.ts +3 -3
  247. package/dist/{cjs/hooks/useShapes → esm/core/shapes}/bar-y/prepare-data.js +3 -3
  248. package/dist/esm/core/shapes/bar-y/renderer.d.ts +6 -0
  249. package/dist/esm/core/shapes/bar-y/renderer.js +74 -0
  250. package/dist/esm/{hooks/useShapes → core/shapes}/bar-y/types.d.ts +1 -1
  251. package/dist/esm/{hooks/useShapes → core/shapes}/bar-y/utils.js +1 -1
  252. package/dist/esm/core/shapes/data-labels.d.ts +15 -0
  253. package/dist/esm/core/shapes/data-labels.js +15 -0
  254. package/dist/esm/{hooks/useShapes → core/shapes}/funnel/prepare-data.d.ts +1 -1
  255. package/dist/{cjs/hooks/useShapes → esm/core/shapes}/funnel/prepare-data.js +1 -1
  256. package/dist/esm/core/shapes/funnel/renderer.d.ts +6 -0
  257. package/dist/esm/core/shapes/funnel/renderer.js +74 -0
  258. package/dist/esm/{hooks/useShapes → core/shapes}/funnel/types.d.ts +2 -2
  259. package/dist/esm/{hooks/useShapes → core/shapes}/heatmap/prepare-data.d.ts +3 -3
  260. package/dist/esm/{hooks/useShapes → core/shapes}/heatmap/prepare-data.js +3 -2
  261. package/dist/esm/core/shapes/heatmap/renderer.d.ts +6 -0
  262. package/dist/esm/core/shapes/heatmap/renderer.js +50 -0
  263. package/dist/{cjs/hooks/useShapes → esm/core/shapes}/heatmap/types.d.ts +2 -1
  264. package/dist/{cjs/hooks/useShapes → esm/core/shapes}/line/prepare-data.d.ts +4 -4
  265. package/dist/esm/{hooks/useShapes → core/shapes}/line/prepare-data.js +12 -4
  266. package/dist/esm/core/shapes/line/renderer.d.ts +11 -0
  267. package/dist/esm/core/shapes/line/renderer.js +161 -0
  268. package/dist/{cjs/hooks/useShapes → esm/core/shapes}/line/types.d.ts +7 -8
  269. package/dist/esm/core/shapes/marker.d.ts +45 -0
  270. package/dist/{cjs/hooks/useShapes → esm/core/shapes}/marker.js +2 -2
  271. package/dist/esm/{hooks/useShapes → core/shapes}/pie/prepare-data.d.ts +1 -1
  272. package/dist/esm/{hooks/useShapes → core/shapes}/pie/prepare-data.js +3 -3
  273. package/dist/esm/core/shapes/pie/renderer.d.ts +8 -0
  274. package/dist/esm/core/shapes/pie/renderer.js +160 -0
  275. package/dist/esm/{hooks/useShapes → core/shapes}/pie/types.d.ts +1 -1
  276. package/dist/esm/{hooks/useShapes → core/shapes}/radar/prepare-data.d.ts +1 -1
  277. package/dist/{cjs/hooks/useShapes → esm/core/shapes}/radar/prepare-data.js +2 -2
  278. package/dist/esm/core/shapes/radar/renderer.d.ts +6 -0
  279. package/dist/esm/core/shapes/radar/renderer.js +122 -0
  280. package/dist/esm/{hooks/useShapes → core/shapes}/radar/types.d.ts +1 -1
  281. package/dist/esm/{hooks/useShapes → core/shapes}/sankey/prepare-data.d.ts +1 -1
  282. package/dist/esm/{hooks/useShapes → core/shapes}/sankey/prepare-data.js +1 -1
  283. package/dist/esm/core/shapes/sankey/renderer.d.ts +6 -0
  284. package/dist/esm/core/shapes/sankey/renderer.js +44 -0
  285. package/dist/{cjs/hooks/useShapes → esm/core/shapes}/sankey/types.d.ts +1 -1
  286. package/dist/{cjs/hooks/useShapes → esm/core/shapes}/scatter/prepare-data.d.ts +3 -3
  287. package/dist/esm/{hooks/useShapes → core/shapes}/scatter/prepare-data.js +2 -2
  288. package/dist/esm/core/shapes/scatter/renderer.d.ts +6 -0
  289. package/dist/esm/core/shapes/scatter/renderer.js +52 -0
  290. package/dist/esm/{hooks/useShapes → core/shapes}/scatter/types.d.ts +1 -1
  291. package/dist/esm/{hooks/useShapes → core/shapes}/treemap/prepare-data.d.ts +1 -1
  292. package/dist/{cjs/hooks/useShapes → esm/core/shapes}/treemap/prepare-data.js +3 -3
  293. package/dist/esm/core/shapes/treemap/renderer.d.ts +6 -0
  294. package/dist/esm/core/shapes/treemap/renderer.js +88 -0
  295. package/dist/esm/{hooks/useShapes → core/shapes}/treemap/types.d.ts +1 -1
  296. package/dist/esm/core/shapes/treemap/types.js +1 -0
  297. package/dist/esm/core/shapes/utils.d.ts +76 -0
  298. package/dist/esm/core/shapes/utils.js +186 -0
  299. package/dist/esm/{hooks/useShapes → core/shapes}/waterfall/prepare-data.d.ts +3 -3
  300. package/dist/{cjs/hooks/useShapes → esm/core/shapes}/waterfall/prepare-data.js +4 -4
  301. package/dist/esm/core/shapes/waterfall/renderer.d.ts +6 -0
  302. package/dist/esm/core/shapes/waterfall/renderer.js +109 -0
  303. package/dist/esm/{hooks/useShapes → core/shapes}/waterfall/types.d.ts +1 -1
  304. package/dist/esm/core/shapes/waterfall/types.js +1 -0
  305. package/dist/esm/{hooks/useShapes → core/shapes}/x-range/prepare-data.d.ts +3 -3
  306. package/dist/esm/{hooks/useShapes → core/shapes}/x-range/prepare-data.js +4 -4
  307. package/dist/esm/core/shapes/x-range/renderer.d.ts +6 -0
  308. package/dist/esm/core/shapes/x-range/renderer.js +88 -0
  309. package/dist/esm/{hooks/useShapes → core/shapes}/x-range/types.d.ts +1 -1
  310. package/dist/esm/core/shapes/x-range/types.js +1 -0
  311. package/dist/esm/core/types/chart/area.d.ts +0 -1
  312. package/dist/esm/core/types/chart/axis.d.ts +0 -1
  313. package/dist/esm/core/types/chart/base.d.ts +18 -7
  314. package/dist/esm/core/types/chart/tooltip.d.ts +3 -3
  315. package/dist/esm/core/types/formatter.d.ts +1 -40
  316. package/dist/{cjs/hooks/utils/get-band-size.js → esm/core/utils/band-size.js} +1 -1
  317. package/dist/esm/{hooks → core}/utils/bar-y.d.ts +3 -3
  318. package/dist/{cjs/hooks → esm/core}/utils/bar-y.js +4 -4
  319. package/dist/esm/core/utils/format.d.ts +2 -2
  320. package/dist/esm/core/utils/get-closest-data.d.ts +1 -1
  321. package/dist/esm/core/utils/get-closest-data.js +13 -8
  322. package/dist/esm/core/utils/series/sorting.js +1 -1
  323. package/dist/esm/core/utils/text.d.ts +0 -1
  324. package/dist/esm/core/utils/text.js +0 -1
  325. package/dist/esm/core/zoom/index.d.ts +2 -0
  326. package/dist/esm/core/zoom/index.js +2 -0
  327. package/dist/esm/core/zoom/types.js +1 -0
  328. package/dist/{cjs/hooks/useZoom → esm/core/zoom}/utils.d.ts +3 -3
  329. package/dist/{cjs/hooks/useZoom → esm/core/zoom}/utils.js +1 -1
  330. package/dist/esm/core/zoom/zoom.d.ts +3 -3
  331. package/dist/esm/hooks/index.d.ts +3 -3
  332. package/dist/esm/hooks/index.js +3 -3
  333. package/dist/esm/hooks/types.d.ts +2 -8
  334. package/dist/esm/hooks/useBrush/index.d.ts +1 -1
  335. package/dist/esm/hooks/useBrush/index.js +1 -1
  336. package/dist/esm/hooks/useRangeSlider/index.js +3 -3
  337. package/dist/esm/hooks/useRangeSlider/types.d.ts +6 -8
  338. package/dist/esm/hooks/useShapes/area/index.d.ts +2 -2
  339. package/dist/esm/hooks/useShapes/area/index.js +13 -185
  340. package/dist/esm/hooks/useShapes/bar-x/index.d.ts +4 -4
  341. package/dist/esm/hooks/useShapes/bar-x/index.js +10 -119
  342. package/dist/esm/hooks/useShapes/bar-y/index.d.ts +3 -3
  343. package/dist/esm/hooks/useShapes/bar-y/index.js +5 -84
  344. package/dist/esm/hooks/useShapes/funnel/index.d.ts +4 -4
  345. package/dist/esm/hooks/useShapes/funnel/index.js +4 -83
  346. package/dist/esm/hooks/useShapes/heatmap/index.d.ts +4 -4
  347. package/dist/esm/hooks/useShapes/heatmap/index.js +4 -59
  348. package/dist/esm/hooks/useShapes/index.d.ts +15 -16
  349. package/dist/esm/hooks/useShapes/index.js +13 -13
  350. package/dist/esm/hooks/useShapes/line/index.d.ts +2 -2
  351. package/dist/esm/hooks/useShapes/line/index.js +14 -172
  352. package/dist/esm/hooks/useShapes/pie/index.d.ts +3 -5
  353. package/dist/esm/hooks/useShapes/pie/index.js +3 -158
  354. package/dist/esm/hooks/useShapes/radar/index.d.ts +2 -2
  355. package/dist/esm/hooks/useShapes/radar/index.js +2 -121
  356. package/dist/esm/hooks/useShapes/sankey/index.d.ts +2 -2
  357. package/dist/esm/hooks/useShapes/sankey/index.js +2 -51
  358. package/dist/esm/hooks/useShapes/scatter/index.d.ts +3 -3
  359. package/dist/esm/hooks/useShapes/scatter/index.js +3 -58
  360. package/dist/esm/hooks/useShapes/treemap/index.d.ts +2 -2
  361. package/dist/esm/hooks/useShapes/treemap/index.js +2 -88
  362. package/dist/esm/hooks/useShapes/utils.d.ts +3 -53
  363. package/dist/esm/hooks/useShapes/utils.js +3 -140
  364. package/dist/esm/hooks/useShapes/waterfall/index.d.ts +4 -4
  365. package/dist/esm/hooks/useShapes/waterfall/index.js +6 -119
  366. package/dist/esm/hooks/useShapes/x-range/index.d.ts +4 -4
  367. package/dist/esm/hooks/useShapes/x-range/index.js +3 -98
  368. package/dist/esm/hooks/useZoom/index.d.ts +1 -1
  369. package/dist/esm/hooks/useZoom/index.js +1 -1
  370. package/dist/esm/index.d.ts +1 -0
  371. package/dist/esm/index.js +1 -0
  372. package/dist/esm/libs/format-number/index.js +82 -14
  373. package/dist/esm/libs/format-number/presets.d.ts +40 -0
  374. package/dist/esm/libs/format-number/presets.js +66 -0
  375. package/dist/esm/libs/format-number/types.d.ts +82 -3
  376. package/dist/esm/setup-jsdom.js +7 -0
  377. package/package.json +5 -2
  378. package/dist/cjs/hooks/useSeries/index.d.ts +0 -12
  379. package/dist/cjs/hooks/useSeries/index.js +0 -40
  380. package/dist/cjs/hooks/useSeries/types.d.ts +0 -1
  381. package/dist/cjs/hooks/useSeries/types.js +0 -1
  382. package/dist/cjs/hooks/useSeries/utils.d.ts +0 -1
  383. package/dist/cjs/hooks/useSeries/utils.js +0 -1
  384. package/dist/cjs/hooks/useShapes/marker.d.ts +0 -15
  385. package/dist/cjs/hooks/utils/index.d.ts +0 -1
  386. package/dist/cjs/hooks/utils/index.js +0 -1
  387. package/dist/esm/hooks/useSeries/index.d.ts +0 -12
  388. package/dist/esm/hooks/useSeries/index.js +0 -40
  389. package/dist/esm/hooks/useSeries/types.d.ts +0 -1
  390. package/dist/esm/hooks/useSeries/types.js +0 -1
  391. package/dist/esm/hooks/useSeries/utils.d.ts +0 -1
  392. package/dist/esm/hooks/useSeries/utils.js +0 -1
  393. package/dist/esm/hooks/useShapes/marker.d.ts +0 -15
  394. package/dist/esm/hooks/utils/index.d.ts +0 -1
  395. package/dist/esm/hooks/utils/index.js +0 -1
  396. /package/dist/cjs/{hooks/useBrush → core/brush}/types.js +0 -0
  397. /package/dist/cjs/{hooks/useBrush → core/brush}/utils.js +0 -0
  398. /package/dist/cjs/{hooks/useShapes/area → core/chart}/types.js +0 -0
  399. /package/dist/cjs/{hooks/useShapes/bar-x → core/range-slider}/types.js +0 -0
  400. /package/dist/cjs/{hooks/useShapes/bar-y → core/shapes/area}/types.js +0 -0
  401. /package/dist/cjs/{hooks/constants.d.ts → core/shapes/bar-constants.d.ts} +0 -0
  402. /package/dist/cjs/{hooks/constants.js → core/shapes/bar-constants.js} +0 -0
  403. /package/dist/cjs/{hooks/useShapes/funnel → core/shapes/bar-x}/types.js +0 -0
  404. /package/dist/cjs/{hooks/useShapes/heatmap → core/shapes/bar-y}/types.js +0 -0
  405. /package/dist/cjs/{hooks/useShapes → core/shapes}/bar-y/utils.d.ts +0 -0
  406. /package/dist/cjs/{hooks/useShapes/line → core/shapes/funnel}/types.js +0 -0
  407. /package/dist/cjs/{hooks/useShapes/pie → core/shapes/heatmap}/types.js +0 -0
  408. /package/dist/cjs/{hooks/useShapes/radar → core/shapes/line}/types.js +0 -0
  409. /package/dist/cjs/{hooks/useShapes/sankey → core/shapes/pie}/types.js +0 -0
  410. /package/dist/cjs/{hooks/useShapes → core/shapes}/pie/utils.d.ts +0 -0
  411. /package/dist/cjs/{hooks/useShapes → core/shapes}/pie/utils.js +0 -0
  412. /package/dist/cjs/{hooks/useShapes/scatter → core/shapes/radar}/types.js +0 -0
  413. /package/dist/cjs/{hooks/useShapes → core/shapes}/sankey/sankey-layout.d.ts +0 -0
  414. /package/dist/cjs/{hooks/useShapes → core/shapes}/sankey/sankey-layout.js +0 -0
  415. /package/dist/cjs/{hooks/useShapes/treemap → core/shapes/sankey}/types.js +0 -0
  416. /package/dist/cjs/{hooks/useShapes/waterfall → core/shapes/scatter}/types.js +0 -0
  417. /package/dist/cjs/{hooks/useShapes/x-range → core/shapes/treemap}/types.js +0 -0
  418. /package/dist/cjs/{hooks/useZoom → core/shapes/waterfall}/types.js +0 -0
  419. /package/dist/{esm/hooks/useBrush → cjs/core/shapes/x-range}/types.js +0 -0
  420. /package/dist/cjs/{hooks/utils/get-band-size.d.ts → core/utils/band-size.d.ts} +0 -0
  421. /package/dist/cjs/{hooks/useZoom → core/zoom}/types.d.ts +0 -0
  422. /package/dist/{esm/hooks/useShapes/area → cjs/core/zoom}/types.js +0 -0
  423. /package/dist/esm/{hooks/useShapes/bar-x → core/brush}/types.js +0 -0
  424. /package/dist/esm/{hooks/useBrush → core/brush}/utils.js +0 -0
  425. /package/dist/esm/{hooks/useShapes/bar-y → core/chart}/types.js +0 -0
  426. /package/dist/esm/{hooks/useShapes/funnel → core/range-slider}/types.js +0 -0
  427. /package/dist/esm/{hooks/useShapes/heatmap → core/shapes/area}/types.js +0 -0
  428. /package/dist/esm/{hooks/constants.d.ts → core/shapes/bar-constants.d.ts} +0 -0
  429. /package/dist/esm/{hooks/constants.js → core/shapes/bar-constants.js} +0 -0
  430. /package/dist/esm/{hooks/useShapes/line → core/shapes/bar-x}/types.js +0 -0
  431. /package/dist/esm/{hooks/useShapes/pie → core/shapes/bar-y}/types.js +0 -0
  432. /package/dist/esm/{hooks/useShapes → core/shapes}/bar-y/utils.d.ts +0 -0
  433. /package/dist/esm/{hooks/useShapes/radar → core/shapes/funnel}/types.js +0 -0
  434. /package/dist/esm/{hooks/useShapes/sankey → core/shapes/heatmap}/types.js +0 -0
  435. /package/dist/esm/{hooks/useShapes/scatter → core/shapes/line}/types.js +0 -0
  436. /package/dist/esm/{hooks/useShapes/treemap → core/shapes/pie}/types.js +0 -0
  437. /package/dist/esm/{hooks/useShapes → core/shapes}/pie/utils.d.ts +0 -0
  438. /package/dist/esm/{hooks/useShapes → core/shapes}/pie/utils.js +0 -0
  439. /package/dist/esm/{hooks/useShapes/waterfall → core/shapes/radar}/types.js +0 -0
  440. /package/dist/esm/{hooks/useShapes → core/shapes}/sankey/sankey-layout.d.ts +0 -0
  441. /package/dist/esm/{hooks/useShapes → core/shapes}/sankey/sankey-layout.js +0 -0
  442. /package/dist/esm/{hooks/useShapes/x-range → core/shapes/sankey}/types.js +0 -0
  443. /package/dist/esm/{hooks/useZoom → core/shapes/scatter}/types.js +0 -0
  444. /package/dist/esm/{hooks/utils/get-band-size.d.ts → core/utils/band-size.d.ts} +0 -0
  445. /package/dist/esm/{hooks/useZoom → core/zoom}/types.d.ts +0 -0
@@ -55,6 +55,7 @@ export const ChartInner = (props) => {
55
55
  const { activeLegendItems, allPreparedSeries, boundsHeight, boundsOffsetLeft, boundsOffsetTop, boundsWidth, handleLegendItemClick, legendConfig, legendItems, preparedLegend, preparedSeries, preparedSeriesOptions, preparedSplit, shapes, shapesData, shapesReady, xAxis, xScale, yAxis, yScale, preparedTitle, preparedChart, } = useChartInnerProps(Object.assign(Object.assign({}, props), { clipPathId,
56
56
  dispatcher,
57
57
  htmlLayout, plotNode: plotRef.current, rangeSliderState,
58
+ updateRangeSliderState,
58
59
  updateZoomState,
59
60
  zoomState }));
60
61
  const prevWidth = usePrevious(width);
@@ -9,6 +9,7 @@ type Props = ChartInnerProps & {
9
9
  dispatcher: Dispatch<object>;
10
10
  htmlLayout: HTMLElement | null;
11
11
  plotNode: SVGGElement | null;
12
+ updateRangeSliderState: (nextState?: RangeSliderState) => void;
12
13
  updateZoomState: (nextZoomState: Partial<ZoomState>) => void;
13
14
  zoomState: Partial<ZoomState>;
14
15
  rangeSliderState?: RangeSliderState;
@@ -3,9 +3,9 @@ import isEqual from 'lodash/isEqual';
3
3
  import { DEFAULT_PALETTE, SERIES_TYPE } from '../../core/constants';
4
4
  import { getLegendComponents, getPreparedLegend } from '../../core/series/prepare-legend';
5
5
  import { getPreparedOptions } from '../../core/series/prepare-options';
6
+ import { getActiveLegendItems, getAllLegendItems } from '../../core/series/utils';
6
7
  import { getChartDimensions, getEffectiveXRange, getSortedSeriesData, getYAxisWidth, getZoomedSeriesData, isAxisRelatedSeries, } from '../../core/utils';
7
8
  import { createScales, getAxes, getPreparedSeries, getShapes, getSplit, getVisibleSeries, useZoom, } from '../../hooks';
8
- import { getActiveLegendItems, getAllLegendItems } from '../../hooks/useSeries/utils';
9
9
  import { getNormalizedXAxis, getNormalizedYAxis, getPreparedChart, getPreparedTitle, recalculateYAxisLabelsWidth, } from './utils';
10
10
  import { hasAtLeastOneSeriesDataPerPlot } from './utils/common';
11
11
  const CLIP_PATH_BY_SERIES_TYPE = {
@@ -38,7 +38,7 @@ function getBoundsOffsetLeft(args) {
38
38
  }
39
39
  export function useChartInnerProps(props) {
40
40
  var _a, _b, _c, _d, _e, _f, _g, _h;
41
- const { clipPathId, data, dispatcher, height, htmlLayout, plotNode, rangeSliderState, width, updateZoomState, zoomState, } = props;
41
+ const { clipPathId, data, dispatcher, height, htmlLayout, plotNode, rangeSliderState, width, updateRangeSliderState, updateZoomState, zoomState, } = props;
42
42
  const [selectedLegendItems, setSelectedLegendItems] = React.useState(null);
43
43
  const [chartState, setState] = React.useState(null);
44
44
  const prevStateValue = React.useRef(chartState);
@@ -48,20 +48,26 @@ export function useChartInnerProps(props) {
48
48
  currentRunRef.current++;
49
49
  const currentRun = currentRunRef.current;
50
50
  (async function () {
51
- var _a, _b, _c, _d;
51
+ var _a, _b, _c, _d, _e, _f, _g;
52
52
  const chartDataChanged = !(previousChartData.current && isEqual(previousChartData.current, data));
53
+ const axisTypeChanged = ((_b = (_a = previousChartData.current) === null || _a === void 0 ? void 0 : _a.xAxis) === null || _b === void 0 ? void 0 : _b.type) !== undefined &&
54
+ previousChartData.current.xAxis.type !== ((_c = data.xAxis) === null || _c === void 0 ? void 0 : _c.type);
55
+ if (axisTypeChanged && rangeSliderState !== undefined) {
56
+ updateRangeSliderState(undefined);
57
+ return;
58
+ }
53
59
  const preparedTitle = await getPreparedTitle({
54
60
  title: data.title,
55
61
  chartWidth: width,
56
62
  chartHeight: height,
57
- chartMargin: (_a = data.chart) === null || _a === void 0 ? void 0 : _a.margin,
63
+ chartMargin: (_d = data.chart) === null || _d === void 0 ? void 0 : _d.margin,
58
64
  });
59
65
  const preparedChart = getPreparedChart({
60
66
  chart: data.chart,
61
67
  seriesData: data.series.data,
62
68
  preparedTitle,
63
69
  });
64
- const colors = (_b = data.colors) !== null && _b !== void 0 ? _b : DEFAULT_PALETTE;
70
+ const colors = (_e = data.colors) !== null && _e !== void 0 ? _e : DEFAULT_PALETTE;
65
71
  const normalizedSeriesData = getSortedSeriesData({
66
72
  seriesData: data.series.data,
67
73
  xAxis: data.xAxis,
@@ -84,7 +90,7 @@ export function useChartInnerProps(props) {
84
90
  });
85
91
  }
86
92
  else {
87
- allPreparedSeries = (_d = (_c = prevStateValue.current) === null || _c === void 0 ? void 0 : _c.allPreparedSeries) !== null && _d !== void 0 ? _d : [];
93
+ allPreparedSeries = (_g = (_f = prevStateValue.current) === null || _f === void 0 ? void 0 : _f.allPreparedSeries) !== null && _g !== void 0 ? _g : [];
88
94
  }
89
95
  const activeLegendItems = selectedLegendItems !== null && selectedLegendItems !== void 0 ? selectedLegendItems : getActiveLegendItems(allPreparedSeries);
90
96
  const visiblePreparedSeries = getVisibleSeries({
@@ -243,6 +249,7 @@ export function useChartInnerProps(props) {
243
249
  rangeSliderState,
244
250
  dispatcher,
245
251
  htmlLayout,
252
+ updateRangeSliderState,
246
253
  clipPathId,
247
254
  ]);
248
255
  // additional start
@@ -24,11 +24,16 @@ const getLegendPosition = (args) => {
24
24
  const { offsetLeft, offsetTop, contentWidth, width } = args;
25
25
  return { top: offsetTop, left: offsetLeft + width / 2 - contentWidth / 2 };
26
26
  };
27
- const appendPaginator = (args) => {
27
+ async function appendPaginator(args) {
28
28
  const { container, pageIndex, legend, transform, pages, onArrowClick } = args;
29
29
  const paginationLine = container.append('g').attr('class', b('pagination'));
30
30
  const maxPage = pages.length;
31
- let computedWidth = 0;
31
+ const paginationCounterText = `${pageIndex + 1}/${maxPage}`;
32
+ const getTextSize = getTextSizeFn({ style: legend.itemStyle });
33
+ const [arrowIcon, counter] = await Promise.all([
34
+ getTextSize('▲'),
35
+ getTextSize(paginationCounterText),
36
+ ]);
32
37
  paginationLine
33
38
  .append('text')
34
39
  .text('▲')
@@ -36,9 +41,6 @@ const appendPaginator = (args) => {
36
41
  return b('pagination-arrow', { inactive: pageIndex === 0 });
37
42
  })
38
43
  .style('font-size', legend.itemStyle.fontSize)
39
- .each(function () {
40
- computedWidth += this.getComputedTextLength();
41
- })
42
44
  .on('click', function () {
43
45
  if (pageIndex - 1 >= 0) {
44
46
  onArrowClick(pageIndex - 1);
@@ -46,20 +48,17 @@ const appendPaginator = (args) => {
46
48
  });
47
49
  paginationLine
48
50
  .append('text')
49
- .text(`${pageIndex + 1}/${maxPage}`)
51
+ .text(paginationCounterText)
50
52
  .attr('class', b('pagination-counter'))
51
- .attr('x', computedWidth)
52
- .style('font-size', legend.itemStyle.fontSize)
53
- .each(function () {
54
- computedWidth += this.getComputedTextLength();
55
- });
53
+ .attr('x', arrowIcon.width)
54
+ .style('font-size', legend.itemStyle.fontSize);
56
55
  paginationLine
57
56
  .append('text')
58
57
  .text('▼')
59
58
  .attr('class', function () {
60
59
  return b('pagination-arrow', { inactive: pageIndex === maxPage - 1 });
61
60
  })
62
- .attr('x', computedWidth)
61
+ .attr('x', arrowIcon.width + counter.width)
63
62
  .style('font-size', legend.itemStyle.fontSize)
64
63
  .on('click', function () {
65
64
  if (pageIndex + 1 < maxPage) {
@@ -67,7 +66,7 @@ const appendPaginator = (args) => {
67
66
  }
68
67
  });
69
68
  paginationLine.attr('transform', transform);
70
- };
69
+ }
71
70
  function renderLegendSymbol(args) {
72
71
  const { selection, legend, legendLineHeight } = args;
73
72
  const line = selection.data();
@@ -277,7 +276,7 @@ export const Legend = (props) => {
277
276
  });
278
277
  if (config.pagination) {
279
278
  const transform = `translate(${[0, legend.height - legend.lineHeight / 2].join(',')})`;
280
- appendPaginator({
279
+ await appendPaginator({
281
280
  container: svgElement,
282
281
  pageIndex: pageIndex,
283
282
  legend,
@@ -13,7 +13,28 @@ export const Tooltip = (props) => {
13
13
  xAxis,
14
14
  yAxis,
15
15
  });
16
- const containerRect = (svgContainer === null || svgContainer === void 0 ? void 0 : svgContainer.getBoundingClientRect()) || { left: 0, top: 0 };
16
+ const containerRectRef = React.useRef({ left: 0, top: 0 });
17
+ React.useEffect(() => {
18
+ if (!svgContainer)
19
+ return undefined;
20
+ const updateRect = (e) => {
21
+ // Skip synthetic events (e.g. the CustomEvent('scroll') dispatched by the
22
+ // sibling useEffect below to reposition the Popup). Only native browser
23
+ // scroll events have isTrusted === true, so those still update the rect.
24
+ if (e && !e.isTrusted)
25
+ return;
26
+ containerRectRef.current = svgContainer.getBoundingClientRect();
27
+ };
28
+ updateRect();
29
+ const resizeObserver = new ResizeObserver(() => updateRect());
30
+ resizeObserver.observe(svgContainer);
31
+ window.addEventListener('scroll', updateRect, { passive: true, capture: true });
32
+ return () => {
33
+ resizeObserver.disconnect();
34
+ window.removeEventListener('scroll', updateRect, { capture: true });
35
+ };
36
+ }, [svgContainer]);
37
+ const containerRect = containerRectRef.current;
17
38
  const left = ((pointerPosition === null || pointerPosition === void 0 ? void 0 : pointerPosition[0]) || 0) + containerRect.left;
18
39
  const top = ((pointerPosition === null || pointerPosition === void 0 ? void 0 : pointerPosition[1]) || 0) + containerRect.top;
19
40
  const { anchor } = useVirtualElement({ left, top });
@@ -1,7 +1,7 @@
1
1
  import get from 'lodash/get';
2
- import { TIME_UNITS, calculateCos, calculateNumericProperty, calculateSin, formatAxisTickLabel, getDefaultDateFormat, getHorizontalHtmlTextHeight, getLabelsSize, getMinSpaceBetween, getTextSizeFn, isAxisRelatedSeries, wrapText, } from '../utils';
3
2
  import { DASH_STYLE, DEFAULT_AXIS_LABEL_FONT_SIZE, PLOT_LINE_HOVER_THRESHOLD, SERIES_TYPE, axisCrosshairDefaults, axisLabelsDefaults, axisTickMarksDefaults, xAxisTitleDefaults, } from '../constants';
4
3
  import { createXScale } from '../scales/x-scale';
4
+ import { TIME_UNITS, calculateCos, calculateNumericProperty, calculateSin, formatAxisTickLabel, getDefaultDateFormat, getHorizontalHtmlTextHeight, getLabelsSize, getMinSpaceBetween, getTextSizeFn, isAxisRelatedSeries, wrapText, } from '../utils';
5
5
  import { getXAxisTickValues } from '../utils/axis/x-axis';
6
6
  import { getPreparedRangeSlider } from './range-slider';
7
7
  import { prepareAxisPlotLabel } from './utils';
@@ -1,8 +1,8 @@
1
1
  import get from 'lodash/get';
2
- import { calculateNumericProperty, formatAxisTickLabel, getDefaultDateFormat, getHorizontalHtmlTextHeight, getLabelsSize, getMinSpaceBetween, getTextSizeFn, isAxisRelatedSeries, shouldSyncAxisWithPrimary, wrapText, } from '../utils';
3
2
  import { getTickValues } from '../../components/AxisY/utils';
4
3
  import { DASH_STYLE, DEFAULT_AXIS_LABEL_FONT_SIZE, DEFAULT_AXIS_TYPE, PLOT_LINE_HOVER_THRESHOLD, SERIES_TYPE, axisCrosshairDefaults, axisLabelsDefaults, axisTickMarksDefaults, yAxisTitleDefaults, } from '../constants';
5
4
  import { createYScale } from '../scales/y-scale';
5
+ import { calculateNumericProperty, formatAxisTickLabel, getDefaultDateFormat, getHorizontalHtmlTextHeight, getLabelsSize, getMinSpaceBetween, getTextSizeFn, isAxisRelatedSeries, shouldSyncAxisWithPrimary, wrapText, } from '../utils';
6
6
  import { prepareAxisPlotLabel } from './utils';
7
7
  export const getYAxisLabelMaxWidth = async (args) => {
8
8
  const { axis, scale, seriesData } = args;
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './utils';
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './utils';
@@ -1,6 +1,6 @@
1
1
  import type { BrushBehavior } from 'd3-brush';
2
- import type { ZoomType } from '../../core/constants';
3
- import type { ChartBrush, DeepRequired } from '../../types';
2
+ import type { ZoomType } from '../constants';
3
+ import type { ChartBrush, DeepRequired } from '../types';
4
4
  export type BrushSelection = [number, number] | [[number, number], [number, number]];
5
5
  export interface BrushArea {
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import type { BrushBehavior } from 'd3-brush';
2
- import type { ChartBrush, DeepRequired } from '../../types';
2
+ import type { ChartBrush, DeepRequired } from '../types';
3
3
  import type { BrushSelection } from './types';
4
4
  export declare function isOneDimensionalSelection(selection?: BrushSelection | null): selection is [number, number];
5
5
  export declare function setBrushBorder(this: SVGGElement, _brushInstance: BrushBehavior<unknown>, selection: BrushSelection | null, options: {
@@ -0,0 +1 @@
1
+ export * from './types';
@@ -0,0 +1 @@
1
+ export * from './types';
@@ -0,0 +1,8 @@
1
+ import type { ChartBrush, ChartMargin, ChartZoom, DeepRequired } from '../types';
2
+ export type PreparedZoom = DeepRequired<Omit<ChartZoom, 'enabled' | 'brush'>> & DeepRequired<{
3
+ brush: ChartBrush;
4
+ }>;
5
+ export type PreparedChart = {
6
+ margin: ChartMargin;
7
+ zoom: PreparedZoom | null;
8
+ };
@@ -8,3 +8,6 @@ export * from './scales';
8
8
  export * from './axes';
9
9
  export * from './layout';
10
10
  export * from './zoom';
11
+ export * from './brush';
12
+ export * from './range-slider';
13
+ export * from './chart';
@@ -8,3 +8,6 @@ export * from './scales';
8
8
  export * from './axes';
9
9
  export * from './layout';
10
10
  export * from './zoom';
11
+ export * from './brush';
12
+ export * from './range-slider';
13
+ export * from './chart';
@@ -1,6 +1,6 @@
1
- import type { PreparedChart } from '../../hooks/types';
2
1
  import type { ChartMargin, LegendConfig } from '../../types';
3
2
  import type { PreparedXAxis, PreparedYAxis } from '../axes/types';
3
+ import type { PreparedChart } from '../chart/types';
4
4
  import type { PreparedLegend, PreparedSeries } from '../series';
5
5
  export declare const getBoundsWidth: (args: {
6
6
  chartWidth: number;
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './utils';
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './utils';
@@ -0,0 +1,4 @@
1
+ export type RangeSliderState = {
2
+ max: number;
3
+ min: number;
4
+ };
@@ -1,8 +1,8 @@
1
- import type { ChartScale } from '../../core/scales/types';
2
- import type { PreparedChart } from '../types';
3
- import type { PreparedRangeSlider } from '../useAxis/types';
4
- import type { BrushSelection } from '../useBrush/types';
5
- import type { PreparedLegend } from '../useSeries/types';
1
+ import type { PreparedRangeSlider } from '../axes/types';
2
+ import type { BrushSelection } from '../brush/types';
3
+ import type { PreparedChart } from '../chart/types';
4
+ import type { ChartScale } from '../scales/types';
5
+ import type { PreparedLegend } from '../series/types';
6
6
  import type { RangeSliderState } from './types';
7
7
  export declare function getRangeSliderOffsetTop(args: {
8
8
  height: number;
@@ -1,4 +1,4 @@
1
- import { isBandScale } from '../../core/utils';
1
+ import { isBandScale } from '../utils';
2
2
  export function getRangeSliderOffsetTop(args) {
3
3
  var _a, _b;
4
4
  const { height, preparedChart, preparedLegend, preparedRangeSlider } = args;
@@ -1,7 +1,7 @@
1
- import type { AxisDirection } from '../utils';
2
1
  import type { ChartAxis, ChartSeries } from '../../types';
3
2
  import type { PreparedAxis, PreparedYAxis } from '../axes/types';
4
3
  import type { PreparedSeries } from '../series';
4
+ import type { AxisDirection } from '../utils';
5
5
  type OptionalNumber = number | undefined;
6
6
  export declare function getMinMaxPropsOrState(args: {
7
7
  axis: PreparedAxis | ChartAxis;
@@ -1,6 +1,6 @@
1
1
  import get from 'lodash/get';
2
- import { getDataCategoryValue, isSeriesWithCategoryValues } from '../utils';
3
2
  import { SERIES_TYPE } from '../constants';
3
+ import { getDataCategoryValue, isSeriesWithCategoryValues } from '../utils';
4
4
  const MARKER_SERIES_TYPES = [SERIES_TYPE.Area, SERIES_TYPE.Line, SERIES_TYPE.Scatter];
5
5
  function getNormilizedMinMax(args) {
6
6
  const { maxValues, minValues } = args;
@@ -1,7 +1,7 @@
1
- import type { RangeSliderState } from '../../hooks';
2
- import type { ChartAxis, ChartSeries } from '../../types';
3
1
  import type { PreparedAxis } from '../axes/types';
2
+ import type { RangeSliderState } from '../range-slider/types';
4
3
  import type { PreparedSeries } from '../series';
4
+ import type { ChartAxis, ChartSeries } from '../types';
5
5
  export declare function createXScale(args: {
6
6
  axis: PreparedAxis | ChartAxis;
7
7
  boundsWidth: number;
@@ -1,9 +1,9 @@
1
1
  import { extent } from 'd3-array';
2
2
  import { scaleBand, scaleLinear, scaleLog, scaleUtc } from 'd3-scale';
3
3
  import get from 'lodash/get';
4
- import { getDefaultMaxXAxisValue, getDefaultMinXAxisValue, getDomainDataXBySeries, getEffectiveXRange, } from '../utils';
5
- import { getBandSize } from '../../hooks/utils/get-band-size';
6
4
  import { DEFAULT_AXIS_TYPE, SERIES_TYPE } from '../constants';
5
+ import { getDefaultMaxXAxisValue, getDefaultMinXAxisValue, getDomainDataXBySeries, getEffectiveXRange, } from '../utils';
6
+ import { getBandSize } from '../utils/band-size';
7
7
  import { checkIsPointDomain, filterCategoriesByVisibleSeries, getMinMaxPropsOrState, hasOnlyMarkerSeries, validateArrayData, } from './utils';
8
8
  const X_AXIS_ZOOM_PADDING = 0.02;
9
9
  function calculateXAxisPadding(series) {
@@ -1,10 +1,10 @@
1
1
  import { extent, tickStep, ticks } from 'd3-array';
2
2
  import { scaleBand, scaleLinear, scaleLog, scaleUtc } from 'd3-scale';
3
3
  import get from 'lodash/get';
4
- import { CHART_SERIES_WITH_VOLUME_ON_Y_AXIS, getDefaultMinYAxisValue, getDomainDataYBySeries, shouldSyncAxisWithPrimary, } from '../utils';
5
4
  import { getTickValues } from '../../components/AxisY/utils';
6
- import { getBandSize } from '../../hooks/utils/get-band-size';
7
5
  import { SERIES_TYPE } from '../constants';
6
+ import { CHART_SERIES_WITH_VOLUME_ON_Y_AXIS, getDefaultMinYAxisValue, getDomainDataYBySeries, shouldSyncAxisWithPrimary, } from '../utils';
7
+ import { getBandSize } from '../utils/band-size';
8
8
  import { checkIsPointDomain, filterCategoriesByVisibleSeries, getMinMaxPropsOrState, hasOnlyMarkerSeries, validateArrayData, } from './utils';
9
9
  // axis is validated in `validation/index.ts`, so the value of `axis.type` is definitely valid.
10
10
  // eslint-disable-next-line consistent-return
@@ -70,6 +70,34 @@ function getDomainSyncedToPrimaryTicks(args) {
70
70
  }
71
71
  return [secondaryTicks[0], secondaryTicks[secondaryTicks.length - 1]];
72
72
  }
73
+ function getLogarithmicYMin(args) {
74
+ var _a;
75
+ const { axis, domain, yMinDomain, hasSeriesWithVolumeOnYAxis } = args;
76
+ // scaleLog cannot represent values <= 0. Pick the smallest positive value
77
+ // present in the domain, falling back to 1 if there is none.
78
+ const smallestPositive = yMinDomain > 0
79
+ ? yMinDomain
80
+ : ((_a = domain.reduce((min, v) => {
81
+ if (typeof v === 'number' && v > 0) {
82
+ return min === null ? v : Math.min(min, v);
83
+ }
84
+ return min;
85
+ }, null)) !== null && _a !== void 0 ? _a : 1);
86
+ if (!hasSeriesWithVolumeOnYAxis) {
87
+ return smallestPositive;
88
+ }
89
+ // Volume series (bar-x, area, waterfall) draw bars from yMin up to the
90
+ // value, so a bar whose value equals yMin collapses to zero height. Drop
91
+ // the baseline one decade below to give it visible space — but only when
92
+ // the later `nice()` pass (triggered by startOnTick) won't supply that
93
+ // headroom on its own. nice() rounds down to the previous decade, which
94
+ // covers any value strictly between two decades; it has nothing to round
95
+ // when the smallest value already sits on a decade (e.g. 1, 10, 100).
96
+ const startOnTick = get(axis, 'startOnTick', false);
97
+ const isOnDecade = Number.isInteger(Math.log10(smallestPositive));
98
+ const needsHeadroom = !startOnTick || isOnDecade;
99
+ return needsHeadroom ? smallestPositive / 10 : smallestPositive;
100
+ }
73
101
  function getDomainMinAlignedToStartTick(args) {
74
102
  var _a, _b;
75
103
  const { axis, range, scale, series } = args;
@@ -80,6 +108,9 @@ function getDomainMinAlignedToStartTick(args) {
80
108
  labelLineHeight: axis.labels.lineHeight,
81
109
  series,
82
110
  });
111
+ if (tickValues.length === 0) {
112
+ return dMin;
113
+ }
83
114
  const isStartOnTick = tickValues[0].y === range[0];
84
115
  let dNewMin = dMin;
85
116
  if (!isStartOnTick) {
@@ -111,6 +142,9 @@ function getDomainMaxAlignedToEndTick(args) {
111
142
  labelLineHeight: axis.labels.lineHeight,
112
143
  series,
113
144
  });
145
+ if (tickValues.length === 0) {
146
+ return dMax;
147
+ }
114
148
  let dNewMax = dMax;
115
149
  const isEndOnTick = tickValues[tickValues.length - 1].y === range[1];
116
150
  if (!isEndOnTick) {
@@ -155,12 +189,18 @@ export function createYScale(args) {
155
189
  }
156
190
  if (hasNumberAndNullValues) {
157
191
  const [yMinDomain, yMaxDomain] = extent(domain);
192
+ const hasSeriesWithVolumeOnYAxis = series.some((s) => CHART_SERIES_WITH_VOLUME_ON_Y_AXIS.includes(s.type));
158
193
  let yMin;
159
194
  if (typeof yMinPropsOrState === 'number') {
160
195
  yMin = yMinPropsOrState;
161
196
  }
162
197
  else if (axis.type === 'logarithmic') {
163
- yMin = yMinDomain;
198
+ yMin = getLogarithmicYMin({
199
+ axis,
200
+ domain,
201
+ yMinDomain,
202
+ hasSeriesWithVolumeOnYAxis,
203
+ });
164
204
  }
165
205
  else {
166
206
  const yMinDefault = getDefaultMinYAxisValue(series);
@@ -170,10 +210,35 @@ export function createYScale(args) {
170
210
  if (typeof yMaxPropsOrState === 'number') {
171
211
  yMax = yMaxPropsOrState;
172
212
  }
213
+ else if (axis.type === 'logarithmic') {
214
+ // scaleLog cannot represent values <= 0; ensure yMax is strictly
215
+ // greater than yMin so the resulting domain stays valid.
216
+ yMax = yMaxDomain > yMin ? yMaxDomain : yMin * 10;
217
+ }
173
218
  else {
174
- const hasSeriesWithVolumeOnYAxis = series.some((s) => CHART_SERIES_WITH_VOLUME_ON_Y_AXIS.includes(s.type));
175
219
  yMax = hasSeriesWithVolumeOnYAxis ? Math.max(yMaxDomain, 0) : yMaxDomain;
176
220
  }
221
+ // When the user pins only one of min/max on the wrong side of all data,
222
+ // d3 produces either an inverted scale (yMax<yMin, silently flips the
223
+ // axis) or a degenerate one (yMax===yMin, maps everything to the range
224
+ // midpoint); both leave phantom hover targets inside an empty plot.
225
+ // Expand the auto-computed side so the scale stays sane. Only applies
226
+ // when the opposite bound is auto-derived — if the user supplied both
227
+ // bounds, trust the explicit range and let point filtering hide the
228
+ // rest. Comparison uses the raw data extent because upstream coercions
229
+ // like volume-series `yMax = Math.max(yMaxDomain, 0)` can make the
230
+ // post-coerced yMin/yMax lie about where data actually sits.
231
+ // Logarithmic has its own guard.
232
+ if (axis.type === 'linear') {
233
+ const minIsUserSet = typeof yMinPropsOrState === 'number';
234
+ const maxIsUserSet = typeof yMaxPropsOrState === 'number';
235
+ if (minIsUserSet && !maxIsUserSet && yMaxDomain < yMin) {
236
+ yMax = yMin + Math.max(Math.abs(yMin), 1);
237
+ }
238
+ else if (maxIsUserSet && !minIsUserSet && yMinDomain > yMax) {
239
+ yMin = yMax - Math.max(Math.abs(yMax), 1);
240
+ }
241
+ }
177
242
  const scaleFn = axis.type === 'logarithmic' ? scaleLog : scaleLinear;
178
243
  let scale = scaleFn().domain([yMin, yMax]).range(range);
179
244
  let offsetMin = 0;
@@ -1,7 +1,7 @@
1
1
  import get from 'lodash/get';
2
2
  import merge from 'lodash/merge';
3
- import { getUniqId } from '../utils';
4
3
  import { DEFAULT_DATALABELS_STYLE, seriesRangeSliderOptionsDefaults } from '../constants';
4
+ import { getUniqId } from '../utils';
5
5
  import { DEFAULT_DATALABELS_PADDING, DEFAULT_HALO_OPTIONS, DEFAULT_POINT_MARKER_OPTIONS, } from './constants';
6
6
  import { getSeriesStackId, prepareLegendSymbol } from './utils';
7
7
  export const DEFAULT_LINE_WIDTH = 1;
@@ -1,6 +1,6 @@
1
1
  import get from 'lodash/get';
2
- import { getUniqId } from '../utils';
3
2
  import { DEFAULT_DATALABELS_STYLE, seriesRangeSliderOptionsDefaults } from '../constants';
3
+ import { getUniqId } from '../utils';
4
4
  import { DEFAULT_DATALABELS_PADDING } from './constants';
5
5
  import { getSeriesStackId, prepareLegendSymbol } from './utils';
6
6
  function prepareSeriesData(series) {
@@ -1,6 +1,6 @@
1
1
  import get from 'lodash/get';
2
- import { getLabelsSize, getUniqId } from '../utils';
3
2
  import { DEFAULT_DATALABELS_STYLE } from '../constants';
3
+ import { getLabelsSize, getUniqId } from '../utils';
4
4
  import { getFormattedValue } from '../utils/format';
5
5
  import { getSeriesStackId, prepareLegendSymbol } from './utils';
6
6
  const DEFAULT_LABEL_PADDING = 7;
@@ -1,7 +1,7 @@
1
1
  import { scaleOrdinal } from 'd3-scale';
2
2
  import get from 'lodash/get';
3
- import { getUniqId } from '../utils';
4
3
  import { DEFAULT_DATALABELS_STYLE } from '../constants';
4
+ import { getUniqId } from '../utils';
5
5
  import { prepareLegendSymbol } from './utils';
6
6
  export function prepareFunnelSeries(args) {
7
7
  var _a, _b;
@@ -1,6 +1,6 @@
1
1
  import get from 'lodash/get';
2
- import { getUniqId } from '../utils';
3
2
  import { DEFAULT_DATALABELS_STYLE } from '../constants';
3
+ import { getUniqId } from '../utils';
4
4
  import { DEFAULT_DATALABELS_PADDING } from './constants';
5
5
  import { prepareLegendSymbol } from './utils';
6
6
  function prepareSeriesData(series) {
@@ -1,5 +1,5 @@
1
- import type { PreparedChart } from '../../hooks/types';
2
1
  import type { ChartData } from '../../types';
2
+ import type { PreparedChart } from '../chart/types';
3
3
  import type { LegendItem, PreparedLegend, PreparedSeries } from './types';
4
4
  export declare function getPreparedLegend(args: {
5
5
  legend: ChartData['legend'];
@@ -2,8 +2,8 @@ import { groupBy } from 'lodash';
2
2
  import clone from 'lodash/clone';
3
3
  import get from 'lodash/get';
4
4
  import merge from 'lodash/merge';
5
- import { getDefaultColorStops, getDomainForContinuousColorScale, getLabelsSize, getTextSizeFn, getTextWithElipsis, } from '../utils';
6
5
  import { CONTINUOUS_LEGEND_SIZE, legendDefaults } from '../constants';
6
+ import { getDefaultColorStops, getDomainForContinuousColorScale, getLabelsSize, getTextSizeFn, getTextWithElipsis, } from '../utils';
7
7
  export async function getPreparedLegend(args) {
8
8
  var _a, _b, _c, _d, _e, _f, _g;
9
9
  const { legend, series } = args;
@@ -120,8 +120,8 @@ async function getGroupedLegendItems(args) {
120
120
  }
121
121
  resultItem.height = textHeight;
122
122
  if (textWidth > maxTextWidth) {
123
+ resultItem.overflowed = true;
123
124
  if (preparedLegend.html) {
124
- resultItem.overflowed = true;
125
125
  resultItem.textWidth = maxTextWidth;
126
126
  }
127
127
  else {
@@ -1,7 +1,7 @@
1
1
  import get from 'lodash/get';
2
2
  import merge from 'lodash/merge';
3
- import { getUniqId } from '../utils';
4
3
  import { DASH_STYLE, DEFAULT_DATALABELS_STYLE, LineCap, LineJoin, seriesRangeSliderOptionsDefaults, } from '../constants';
4
+ import { getUniqId } from '../utils';
5
5
  import { DEFAULT_DATALABELS_PADDING, DEFAULT_HALO_OPTIONS, DEFAULT_LEGEND_SYMBOL_PADDING, DEFAULT_POINT_MARKER_OPTIONS, } from './constants';
6
6
  export const DEFAULT_LEGEND_SYMBOL_SIZE = 16;
7
7
  export const DEFAULT_LINE_WIDTH = 1;
@@ -1,7 +1,7 @@
1
1
  import { scaleOrdinal } from 'd3-scale';
2
2
  import get from 'lodash/get';
3
- import { getUniqId } from '../utils';
4
3
  import { DEFAULT_DATALABELS_STYLE } from '../constants';
4
+ import { getUniqId } from '../utils';
5
5
  import { DEFAULT_DATALABELS_PADDING } from './constants';
6
6
  import { prepareLegendSymbol } from './utils';
7
7
  function prepareSeriesData(series) {
@@ -1,8 +1,8 @@
1
1
  import { scaleOrdinal } from 'd3-scale';
2
2
  import get from 'lodash/get';
3
3
  import merge from 'lodash/merge';
4
- import { getUniqId } from '../utils';
5
4
  import { DEFAULT_DATALABELS_STYLE } from '../constants';
5
+ import { getUniqId } from '../utils';
6
6
  import { DEFAULT_DATALABELS_PADDING, DEFAULT_HALO_OPTIONS, DEFAULT_POINT_MARKER_OPTIONS, } from './constants';
7
7
  import { prepareLegendSymbol } from './utils';
8
8
  export const DEFAULT_MARKER = Object.assign(Object.assign({}, DEFAULT_POINT_MARKER_OPTIONS), { enabled: true, radius: 2 });
@@ -1,6 +1,6 @@
1
1
  import get from 'lodash/get';
2
- import { getUniqId } from '../utils';
3
2
  import { DEFAULT_DATALABELS_STYLE } from '../constants';
3
+ import { getUniqId } from '../utils';
4
4
  import { prepareLegendSymbol } from './utils';
5
5
  export function prepareSankeySeries(args) {
6
6
  const { colorScale, legend, series } = args;
@@ -1,7 +1,7 @@
1
1
  import get from 'lodash/get';
2
2
  import merge from 'lodash/merge';
3
- import { getSymbolType, getUniqId } from '../utils';
4
3
  import { seriesRangeSliderOptionsDefaults } from '../constants';
4
+ import { getSymbolType, getUniqId } from '../utils';
5
5
  import { DEFAULT_HALO_OPTIONS, DEFAULT_POINT_MARKER_OPTIONS } from './constants';
6
6
  import { prepareLegendSymbol } from './utils';
7
7
  function prepareMarker(series, seriesOptions, index) {
@@ -1,6 +1,6 @@
1
1
  import get from 'lodash/get';
2
- import { getUniqId } from '../utils';
3
2
  import { DEFAULT_DATALABELS_STYLE, LayoutAlgorithm } from '../constants';
3
+ import { getUniqId } from '../utils';
4
4
  import { DEFAULT_DATALABELS_PADDING } from './constants';
5
5
  import { prepareLegendSymbol } from './utils';
6
6
  export function prepareTreemap(args) {
@@ -1,6 +1,6 @@
1
1
  import get from 'lodash/get';
2
- import { getUniqId } from '../utils';
3
2
  import { DEFAULT_DATALABELS_STYLE } from '../constants';
3
+ import { getUniqId } from '../utils';
4
4
  import { DEFAULT_DATALABELS_PADDING } from './constants';
5
5
  import { prepareLegendSymbol } from './utils';
6
6
  function prepareSeriesData(series) {