@gravity-ui/charts 1.45.0 → 1.46.1
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.
- package/dist/cjs/components/ChartInner/index.js +2 -2
- package/dist/cjs/components/ChartInner/styles.css +2 -2
- package/dist/cjs/components/ChartInner/useChartInnerProps.js +2 -2
- package/dist/cjs/components/ChartInner/utils/title.d.ts +2 -1
- package/dist/cjs/components/ChartInner/utils/title.js +51 -14
- package/dist/cjs/components/Legend/index.js +13 -14
- package/dist/cjs/components/Title/index.d.ts +4 -2
- package/dist/cjs/components/Title/index.js +9 -2
- package/dist/cjs/components/Tooltip/index.js +22 -1
- package/dist/cjs/core/axes/x-axis.js +1 -1
- package/dist/cjs/core/axes/y-axis.js +1 -1
- package/dist/cjs/core/scales/utils.d.ts +1 -1
- package/dist/cjs/core/scales/utils.js +1 -1
- package/dist/cjs/core/scales/x-scale.js +2 -2
- package/dist/cjs/core/scales/y-scale.js +48 -4
- package/dist/cjs/core/series/prepare-area.js +1 -1
- package/dist/cjs/core/series/prepare-bar-x.js +1 -1
- package/dist/cjs/core/series/prepare-bar-y.js +1 -1
- package/dist/cjs/core/series/prepare-funnel.js +1 -1
- package/dist/cjs/core/series/prepare-heatmap.js +1 -1
- package/dist/cjs/core/series/prepare-legend.js +2 -2
- package/dist/cjs/core/series/prepare-line.js +1 -1
- package/dist/cjs/core/series/prepare-pie.js +1 -1
- package/dist/cjs/core/series/prepare-radar.js +1 -1
- package/dist/cjs/core/series/prepare-sankey.js +1 -1
- package/dist/cjs/core/series/prepare-scatter.js +1 -1
- package/dist/cjs/core/series/prepare-treemap.js +1 -1
- package/dist/cjs/core/series/prepare-waterfall.js +1 -1
- package/dist/cjs/core/series/prepare-x-range.js +1 -1
- package/dist/cjs/core/series/prepareSeries.d.ts +7 -1
- package/dist/cjs/core/series/prepareSeries.js +31 -0
- package/dist/cjs/core/series/types.d.ts +5 -0
- package/dist/cjs/core/series/utils.d.ts +4 -0
- package/dist/cjs/core/series/utils.js +9 -1
- package/dist/cjs/{hooks/useShapes/annotation/index.d.ts → core/shapes/annotation.d.ts} +1 -7
- package/dist/cjs/{hooks/useShapes/annotation/index.js → core/shapes/annotation.js} +2 -2
- package/dist/cjs/{hooks/useShapes → core/shapes}/area/prepare-data.d.ts +4 -4
- package/dist/cjs/{hooks/useShapes → core/shapes}/area/prepare-data.js +4 -4
- package/dist/cjs/core/shapes/area/renderer.d.ts +11 -0
- package/dist/cjs/core/shapes/area/renderer.js +181 -0
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/area/types.d.ts +1 -3
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/bar-x/prepare-data.d.ts +4 -4
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/bar-x/prepare-data.js +6 -6
- package/dist/cjs/core/shapes/bar-x/renderer.d.ts +9 -0
- package/dist/cjs/core/shapes/bar-x/renderer.js +110 -0
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/bar-x/types.d.ts +1 -2
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/bar-y/prepare-data.d.ts +3 -3
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/bar-y/prepare-data.js +3 -3
- package/dist/cjs/core/shapes/bar-y/renderer.d.ts +6 -0
- package/dist/cjs/core/shapes/bar-y/renderer.js +80 -0
- package/dist/cjs/{hooks/useShapes → core/shapes}/bar-y/types.d.ts +1 -1
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/bar-y/utils.js +1 -1
- package/dist/cjs/{hooks/useShapes → core/shapes}/funnel/prepare-data.d.ts +1 -1
- package/dist/cjs/{hooks/useShapes → core/shapes}/funnel/prepare-data.js +1 -1
- package/dist/cjs/core/shapes/funnel/renderer.d.ts +6 -0
- package/dist/cjs/core/shapes/funnel/renderer.js +79 -0
- package/dist/cjs/{hooks/useShapes → core/shapes}/funnel/types.d.ts +2 -2
- package/dist/cjs/{hooks/useShapes → core/shapes}/heatmap/prepare-data.d.ts +3 -3
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/heatmap/prepare-data.js +2 -2
- package/dist/cjs/core/shapes/heatmap/renderer.d.ts +6 -0
- package/dist/cjs/core/shapes/heatmap/renderer.js +55 -0
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/heatmap/types.d.ts +1 -1
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/line/prepare-data.d.ts +4 -4
- package/dist/cjs/{hooks/useShapes → core/shapes}/line/prepare-data.js +3 -3
- package/dist/cjs/core/shapes/line/renderer.d.ts +11 -0
- package/dist/cjs/core/shapes/line/renderer.js +167 -0
- package/dist/cjs/{hooks/useShapes → core/shapes}/line/types.d.ts +2 -4
- package/dist/cjs/core/shapes/marker.d.ts +45 -0
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/marker.js +2 -2
- package/dist/cjs/{hooks/useShapes → core/shapes}/pie/prepare-data.d.ts +1 -1
- package/dist/cjs/{hooks/useShapes → core/shapes}/pie/prepare-data.js +3 -3
- package/dist/cjs/core/shapes/pie/renderer.d.ts +8 -0
- package/dist/cjs/core/shapes/pie/renderer.js +160 -0
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/pie/types.d.ts +1 -1
- package/dist/cjs/{hooks/useShapes → core/shapes}/radar/prepare-data.d.ts +1 -1
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/radar/prepare-data.js +2 -2
- package/dist/cjs/core/shapes/radar/renderer.d.ts +6 -0
- package/dist/cjs/core/shapes/radar/renderer.js +126 -0
- package/dist/cjs/{hooks/useShapes → core/shapes}/radar/types.d.ts +1 -1
- package/dist/cjs/{hooks/useShapes → core/shapes}/sankey/prepare-data.d.ts +1 -1
- package/dist/cjs/{hooks/useShapes → core/shapes}/sankey/prepare-data.js +1 -1
- package/dist/cjs/core/shapes/sankey/renderer.d.ts +6 -0
- package/dist/cjs/core/shapes/sankey/renderer.js +50 -0
- package/dist/cjs/{hooks/useShapes → core/shapes}/sankey/types.d.ts +1 -1
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/scatter/prepare-data.d.ts +3 -3
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/scatter/prepare-data.js +2 -2
- package/dist/cjs/core/shapes/scatter/renderer.d.ts +6 -0
- package/dist/cjs/core/shapes/scatter/renderer.js +52 -0
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/scatter/types.d.ts +1 -1
- package/dist/cjs/{hooks/useShapes → core/shapes}/treemap/prepare-data.d.ts +1 -1
- package/dist/cjs/{hooks/useShapes → core/shapes}/treemap/prepare-data.js +3 -3
- package/dist/cjs/core/shapes/treemap/renderer.d.ts +6 -0
- package/dist/cjs/core/shapes/treemap/renderer.js +88 -0
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/treemap/types.d.ts +1 -1
- package/dist/cjs/core/shapes/utils.d.ts +52 -0
- package/dist/cjs/core/shapes/utils.js +138 -0
- package/dist/cjs/{hooks/useShapes → core/shapes}/waterfall/prepare-data.d.ts +3 -3
- package/dist/cjs/{hooks/useShapes → core/shapes}/waterfall/prepare-data.js +4 -4
- package/dist/cjs/core/shapes/waterfall/renderer.d.ts +6 -0
- package/dist/cjs/core/shapes/waterfall/renderer.js +115 -0
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/waterfall/types.d.ts +1 -1
- package/dist/cjs/{hooks/useShapes → core/shapes}/x-range/prepare-data.d.ts +3 -3
- package/dist/cjs/{hooks/useShapes → core/shapes}/x-range/prepare-data.js +4 -4
- package/dist/cjs/core/shapes/x-range/renderer.d.ts +6 -0
- package/dist/cjs/core/shapes/x-range/renderer.js +94 -0
- package/dist/{esm/hooks/useShapes → cjs/core/shapes}/x-range/types.d.ts +1 -1
- package/dist/cjs/core/types/chart/area.d.ts +0 -1
- package/dist/cjs/core/types/chart/axis.d.ts +0 -1
- package/dist/cjs/core/types/chart/base.d.ts +1 -4
- package/dist/cjs/core/types/chart/title.d.ts +18 -0
- package/dist/cjs/{hooks/utils/get-band-size.js → core/utils/band-size.js} +1 -1
- package/dist/{esm/hooks → cjs/core}/utils/bar-y.d.ts +3 -3
- package/dist/cjs/{hooks → core}/utils/bar-y.js +4 -4
- package/dist/cjs/core/utils/get-closest-data.d.ts +1 -1
- package/dist/cjs/core/utils/series/sorting.js +1 -1
- package/dist/cjs/core/utils/text.d.ts +0 -1
- package/dist/cjs/core/utils/text.js +0 -1
- package/dist/cjs/hooks/index.d.ts +1 -1
- package/dist/cjs/hooks/index.js +1 -1
- package/dist/cjs/hooks/types.d.ts +6 -3
- package/dist/cjs/hooks/useRangeSlider/types.d.ts +1 -1
- package/dist/cjs/hooks/useRangeSlider/utils.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/HtmlLayer.js +4 -3
- package/dist/cjs/hooks/useShapes/area/index.d.ts +2 -2
- package/dist/cjs/hooks/useShapes/area/index.js +13 -185
- package/dist/cjs/hooks/useShapes/bar-x/index.d.ts +4 -4
- package/dist/cjs/hooks/useShapes/bar-x/index.js +10 -119
- package/dist/cjs/hooks/useShapes/bar-y/index.d.ts +3 -3
- package/dist/cjs/hooks/useShapes/bar-y/index.js +5 -84
- package/dist/cjs/hooks/useShapes/funnel/index.d.ts +4 -4
- package/dist/cjs/hooks/useShapes/funnel/index.js +4 -83
- package/dist/cjs/hooks/useShapes/heatmap/index.d.ts +4 -4
- package/dist/cjs/hooks/useShapes/heatmap/index.js +4 -59
- package/dist/cjs/hooks/useShapes/index.d.ts +14 -15
- package/dist/cjs/hooks/useShapes/index.js +13 -13
- package/dist/cjs/hooks/useShapes/line/index.d.ts +2 -2
- package/dist/cjs/hooks/useShapes/line/index.js +14 -172
- package/dist/cjs/hooks/useShapes/pie/index.d.ts +3 -5
- package/dist/cjs/hooks/useShapes/pie/index.js +3 -158
- package/dist/cjs/hooks/useShapes/radar/index.d.ts +2 -2
- package/dist/cjs/hooks/useShapes/radar/index.js +2 -121
- package/dist/cjs/hooks/useShapes/sankey/index.d.ts +2 -2
- package/dist/cjs/hooks/useShapes/sankey/index.js +2 -51
- package/dist/cjs/hooks/useShapes/scatter/index.d.ts +3 -3
- package/dist/cjs/hooks/useShapes/scatter/index.js +3 -58
- package/dist/cjs/hooks/useShapes/treemap/index.d.ts +2 -2
- package/dist/cjs/hooks/useShapes/treemap/index.js +2 -88
- package/dist/cjs/hooks/useShapes/utils.d.ts +2 -52
- package/dist/cjs/hooks/useShapes/utils.js +3 -140
- package/dist/cjs/hooks/useShapes/waterfall/index.d.ts +4 -4
- package/dist/cjs/hooks/useShapes/waterfall/index.js +6 -119
- package/dist/cjs/hooks/useShapes/x-range/index.d.ts +4 -4
- package/dist/cjs/hooks/useShapes/x-range/index.js +3 -98
- package/dist/cjs/setup-jsdom.js +7 -0
- package/dist/cjs/types/chart-ui.d.ts +2 -0
- package/dist/esm/components/ChartInner/index.js +2 -2
- package/dist/esm/components/ChartInner/styles.css +2 -2
- package/dist/esm/components/ChartInner/useChartInnerProps.js +2 -2
- package/dist/esm/components/ChartInner/utils/title.d.ts +2 -1
- package/dist/esm/components/ChartInner/utils/title.js +51 -14
- package/dist/esm/components/Legend/index.js +13 -14
- package/dist/esm/components/Title/index.d.ts +4 -2
- package/dist/esm/components/Title/index.js +9 -2
- package/dist/esm/components/Tooltip/index.js +22 -1
- package/dist/esm/core/axes/x-axis.js +1 -1
- package/dist/esm/core/axes/y-axis.js +1 -1
- package/dist/esm/core/scales/utils.d.ts +1 -1
- package/dist/esm/core/scales/utils.js +1 -1
- package/dist/esm/core/scales/x-scale.js +2 -2
- package/dist/esm/core/scales/y-scale.js +48 -4
- package/dist/esm/core/series/prepare-area.js +1 -1
- package/dist/esm/core/series/prepare-bar-x.js +1 -1
- package/dist/esm/core/series/prepare-bar-y.js +1 -1
- package/dist/esm/core/series/prepare-funnel.js +1 -1
- package/dist/esm/core/series/prepare-heatmap.js +1 -1
- package/dist/esm/core/series/prepare-legend.js +2 -2
- package/dist/esm/core/series/prepare-line.js +1 -1
- package/dist/esm/core/series/prepare-pie.js +1 -1
- package/dist/esm/core/series/prepare-radar.js +1 -1
- package/dist/esm/core/series/prepare-sankey.js +1 -1
- package/dist/esm/core/series/prepare-scatter.js +1 -1
- package/dist/esm/core/series/prepare-treemap.js +1 -1
- package/dist/esm/core/series/prepare-waterfall.js +1 -1
- package/dist/esm/core/series/prepare-x-range.js +1 -1
- package/dist/esm/core/series/prepareSeries.d.ts +7 -1
- package/dist/esm/core/series/prepareSeries.js +31 -0
- package/dist/esm/core/series/types.d.ts +5 -0
- package/dist/esm/core/series/utils.d.ts +4 -0
- package/dist/esm/core/series/utils.js +9 -1
- package/dist/esm/{hooks/useShapes/annotation/index.d.ts → core/shapes/annotation.d.ts} +1 -7
- package/dist/esm/{hooks/useShapes/annotation/index.js → core/shapes/annotation.js} +2 -2
- package/dist/esm/{hooks/useShapes → core/shapes}/area/prepare-data.d.ts +4 -4
- package/dist/esm/{hooks/useShapes → core/shapes}/area/prepare-data.js +4 -4
- package/dist/esm/core/shapes/area/renderer.d.ts +11 -0
- package/dist/esm/core/shapes/area/renderer.js +181 -0
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/area/types.d.ts +1 -3
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/bar-x/prepare-data.d.ts +4 -4
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/bar-x/prepare-data.js +6 -6
- package/dist/esm/core/shapes/bar-x/renderer.d.ts +9 -0
- package/dist/esm/core/shapes/bar-x/renderer.js +110 -0
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/bar-x/types.d.ts +1 -2
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/bar-y/prepare-data.d.ts +3 -3
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/bar-y/prepare-data.js +3 -3
- package/dist/esm/core/shapes/bar-y/renderer.d.ts +6 -0
- package/dist/esm/core/shapes/bar-y/renderer.js +80 -0
- package/dist/esm/{hooks/useShapes → core/shapes}/bar-y/types.d.ts +1 -1
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/bar-y/utils.js +1 -1
- package/dist/esm/{hooks/useShapes → core/shapes}/funnel/prepare-data.d.ts +1 -1
- package/dist/esm/{hooks/useShapes → core/shapes}/funnel/prepare-data.js +1 -1
- package/dist/esm/core/shapes/funnel/renderer.d.ts +6 -0
- package/dist/esm/core/shapes/funnel/renderer.js +79 -0
- package/dist/esm/{hooks/useShapes → core/shapes}/funnel/types.d.ts +2 -2
- package/dist/esm/{hooks/useShapes → core/shapes}/heatmap/prepare-data.d.ts +3 -3
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/heatmap/prepare-data.js +2 -2
- package/dist/esm/core/shapes/heatmap/renderer.d.ts +6 -0
- package/dist/esm/core/shapes/heatmap/renderer.js +55 -0
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/heatmap/types.d.ts +1 -1
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/line/prepare-data.d.ts +4 -4
- package/dist/esm/{hooks/useShapes → core/shapes}/line/prepare-data.js +3 -3
- package/dist/esm/core/shapes/line/renderer.d.ts +11 -0
- package/dist/esm/core/shapes/line/renderer.js +167 -0
- package/dist/esm/{hooks/useShapes → core/shapes}/line/types.d.ts +2 -4
- package/dist/esm/core/shapes/marker.d.ts +45 -0
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/marker.js +2 -2
- package/dist/esm/{hooks/useShapes → core/shapes}/pie/prepare-data.d.ts +1 -1
- package/dist/esm/{hooks/useShapes → core/shapes}/pie/prepare-data.js +3 -3
- package/dist/esm/core/shapes/pie/renderer.d.ts +8 -0
- package/dist/esm/core/shapes/pie/renderer.js +160 -0
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/pie/types.d.ts +1 -1
- package/dist/esm/{hooks/useShapes → core/shapes}/radar/prepare-data.d.ts +1 -1
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/radar/prepare-data.js +2 -2
- package/dist/esm/core/shapes/radar/renderer.d.ts +6 -0
- package/dist/esm/core/shapes/radar/renderer.js +126 -0
- package/dist/esm/{hooks/useShapes → core/shapes}/radar/types.d.ts +1 -1
- package/dist/esm/{hooks/useShapes → core/shapes}/sankey/prepare-data.d.ts +1 -1
- package/dist/esm/{hooks/useShapes → core/shapes}/sankey/prepare-data.js +1 -1
- package/dist/esm/core/shapes/sankey/renderer.d.ts +6 -0
- package/dist/esm/core/shapes/sankey/renderer.js +50 -0
- package/dist/esm/{hooks/useShapes → core/shapes}/sankey/types.d.ts +1 -1
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/scatter/prepare-data.d.ts +3 -3
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/scatter/prepare-data.js +2 -2
- package/dist/esm/core/shapes/scatter/renderer.d.ts +6 -0
- package/dist/esm/core/shapes/scatter/renderer.js +52 -0
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/scatter/types.d.ts +1 -1
- package/dist/esm/{hooks/useShapes → core/shapes}/treemap/prepare-data.d.ts +1 -1
- package/dist/esm/{hooks/useShapes → core/shapes}/treemap/prepare-data.js +3 -3
- package/dist/esm/core/shapes/treemap/renderer.d.ts +6 -0
- package/dist/esm/core/shapes/treemap/renderer.js +88 -0
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/treemap/types.d.ts +1 -1
- package/dist/esm/core/shapes/utils.d.ts +52 -0
- package/dist/esm/core/shapes/utils.js +138 -0
- package/dist/esm/{hooks/useShapes → core/shapes}/waterfall/prepare-data.d.ts +3 -3
- package/dist/esm/{hooks/useShapes → core/shapes}/waterfall/prepare-data.js +4 -4
- package/dist/esm/core/shapes/waterfall/renderer.d.ts +6 -0
- package/dist/esm/core/shapes/waterfall/renderer.js +115 -0
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/waterfall/types.d.ts +1 -1
- package/dist/esm/{hooks/useShapes → core/shapes}/x-range/prepare-data.d.ts +3 -3
- package/dist/esm/{hooks/useShapes → core/shapes}/x-range/prepare-data.js +4 -4
- package/dist/esm/core/shapes/x-range/renderer.d.ts +6 -0
- package/dist/esm/core/shapes/x-range/renderer.js +94 -0
- package/dist/{cjs/hooks/useShapes → esm/core/shapes}/x-range/types.d.ts +1 -1
- package/dist/esm/core/types/chart/area.d.ts +0 -1
- package/dist/esm/core/types/chart/axis.d.ts +0 -1
- package/dist/esm/core/types/chart/base.d.ts +1 -4
- package/dist/esm/core/types/chart/title.d.ts +18 -0
- package/dist/esm/{hooks/utils/get-band-size.js → core/utils/band-size.js} +1 -1
- package/dist/{cjs/hooks → esm/core}/utils/bar-y.d.ts +3 -3
- package/dist/esm/{hooks → core}/utils/bar-y.js +4 -4
- package/dist/esm/core/utils/get-closest-data.d.ts +1 -1
- package/dist/esm/core/utils/series/sorting.js +1 -1
- package/dist/esm/core/utils/text.d.ts +0 -1
- package/dist/esm/core/utils/text.js +0 -1
- package/dist/esm/hooks/index.d.ts +1 -1
- package/dist/esm/hooks/index.js +1 -1
- package/dist/esm/hooks/types.d.ts +6 -3
- package/dist/esm/hooks/useRangeSlider/types.d.ts +1 -1
- package/dist/esm/hooks/useRangeSlider/utils.d.ts +1 -1
- package/dist/esm/hooks/useShapes/HtmlLayer.js +4 -3
- package/dist/esm/hooks/useShapes/area/index.d.ts +2 -2
- package/dist/esm/hooks/useShapes/area/index.js +13 -185
- package/dist/esm/hooks/useShapes/bar-x/index.d.ts +4 -4
- package/dist/esm/hooks/useShapes/bar-x/index.js +10 -119
- package/dist/esm/hooks/useShapes/bar-y/index.d.ts +3 -3
- package/dist/esm/hooks/useShapes/bar-y/index.js +5 -84
- package/dist/esm/hooks/useShapes/funnel/index.d.ts +4 -4
- package/dist/esm/hooks/useShapes/funnel/index.js +4 -83
- package/dist/esm/hooks/useShapes/heatmap/index.d.ts +4 -4
- package/dist/esm/hooks/useShapes/heatmap/index.js +4 -59
- package/dist/esm/hooks/useShapes/index.d.ts +14 -15
- package/dist/esm/hooks/useShapes/index.js +13 -13
- package/dist/esm/hooks/useShapes/line/index.d.ts +2 -2
- package/dist/esm/hooks/useShapes/line/index.js +14 -172
- package/dist/esm/hooks/useShapes/pie/index.d.ts +3 -5
- package/dist/esm/hooks/useShapes/pie/index.js +3 -158
- package/dist/esm/hooks/useShapes/radar/index.d.ts +2 -2
- package/dist/esm/hooks/useShapes/radar/index.js +2 -121
- package/dist/esm/hooks/useShapes/sankey/index.d.ts +2 -2
- package/dist/esm/hooks/useShapes/sankey/index.js +2 -51
- package/dist/esm/hooks/useShapes/scatter/index.d.ts +3 -3
- package/dist/esm/hooks/useShapes/scatter/index.js +3 -58
- package/dist/esm/hooks/useShapes/treemap/index.d.ts +2 -2
- package/dist/esm/hooks/useShapes/treemap/index.js +2 -88
- package/dist/esm/hooks/useShapes/utils.d.ts +2 -52
- package/dist/esm/hooks/useShapes/utils.js +3 -140
- package/dist/esm/hooks/useShapes/waterfall/index.d.ts +4 -4
- package/dist/esm/hooks/useShapes/waterfall/index.js +6 -119
- package/dist/esm/hooks/useShapes/x-range/index.d.ts +4 -4
- package/dist/esm/hooks/useShapes/x-range/index.js +3 -98
- package/dist/esm/setup-jsdom.js +7 -0
- package/dist/esm/types/chart-ui.d.ts +2 -0
- package/package.json +5 -2
- package/dist/cjs/hooks/useSeries/index.d.ts +0 -12
- package/dist/cjs/hooks/useSeries/index.js +0 -40
- package/dist/cjs/hooks/useSeries/types.d.ts +0 -1
- package/dist/cjs/hooks/useSeries/types.js +0 -1
- package/dist/cjs/hooks/useSeries/utils.d.ts +0 -1
- package/dist/cjs/hooks/useSeries/utils.js +0 -1
- package/dist/cjs/hooks/useShapes/marker.d.ts +0 -15
- package/dist/cjs/hooks/utils/index.d.ts +0 -1
- package/dist/cjs/hooks/utils/index.js +0 -1
- package/dist/esm/hooks/useSeries/index.d.ts +0 -12
- package/dist/esm/hooks/useSeries/index.js +0 -40
- package/dist/esm/hooks/useSeries/types.d.ts +0 -1
- package/dist/esm/hooks/useSeries/types.js +0 -1
- package/dist/esm/hooks/useSeries/utils.d.ts +0 -1
- package/dist/esm/hooks/useSeries/utils.js +0 -1
- package/dist/esm/hooks/useShapes/marker.d.ts +0 -15
- package/dist/esm/hooks/utils/index.d.ts +0 -1
- package/dist/esm/hooks/utils/index.js +0 -1
- /package/dist/cjs/{hooks/useShapes → core/shapes}/area/types.js +0 -0
- /package/dist/cjs/{hooks/constants.d.ts → core/shapes/bar-constants.d.ts} +0 -0
- /package/dist/cjs/{hooks/constants.js → core/shapes/bar-constants.js} +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/bar-x/types.js +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/bar-y/types.js +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/bar-y/utils.d.ts +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/funnel/types.js +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/heatmap/types.js +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/line/types.js +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/pie/types.js +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/pie/utils.d.ts +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/pie/utils.js +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/radar/types.js +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/sankey/sankey-layout.d.ts +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/sankey/sankey-layout.js +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/sankey/types.js +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/scatter/types.js +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/treemap/types.js +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/waterfall/types.js +0 -0
- /package/dist/cjs/{hooks/useShapes → core/shapes}/x-range/types.js +0 -0
- /package/dist/cjs/{hooks/utils/get-band-size.d.ts → core/utils/band-size.d.ts} +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/area/types.js +0 -0
- /package/dist/esm/{hooks/constants.d.ts → core/shapes/bar-constants.d.ts} +0 -0
- /package/dist/esm/{hooks/constants.js → core/shapes/bar-constants.js} +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/bar-x/types.js +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/bar-y/types.js +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/bar-y/utils.d.ts +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/funnel/types.js +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/heatmap/types.js +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/line/types.js +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/pie/types.js +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/pie/utils.d.ts +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/pie/utils.js +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/radar/types.js +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/sankey/sankey-layout.d.ts +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/sankey/sankey-layout.js +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/sankey/types.js +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/scatter/types.js +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/treemap/types.js +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/waterfall/types.js +0 -0
- /package/dist/esm/{hooks/useShapes → core/shapes}/x-range/types.js +0 -0
- /package/dist/esm/{hooks/utils/get-band-size.d.ts → core/utils/band-size.d.ts} +0 -0
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { line as lineGenerator } from 'd3-shape';
|
|
5
|
-
import get from 'lodash/get';
|
|
6
|
-
import { DASH_STYLE } from '../../../core/constants';
|
|
7
|
-
import { filterOverlappingLabels, getLineDashArray, getWaterfallPointColor } from '../../../core/utils';
|
|
2
|
+
import { renderWaterfall } from '../../../core/shapes/waterfall/renderer';
|
|
3
|
+
import { filterOverlappingLabels } from '../../../core/utils';
|
|
8
4
|
import { block } from '../../../utils';
|
|
9
5
|
import { HtmlLayer } from '../HtmlLayer';
|
|
10
|
-
export { prepareWaterfallData } from '
|
|
11
|
-
export * from '
|
|
6
|
+
export { prepareWaterfallData } from '../../../core/shapes/waterfall/prepare-data';
|
|
7
|
+
export * from '../../../core/shapes/waterfall/types';
|
|
12
8
|
const b = block('waterfall');
|
|
13
9
|
export const WaterfallSeriesShapes = (args) => {
|
|
14
10
|
const { dispatcher, preparedData, seriesOptions, htmlLayout, clipPathId } = args;
|
|
15
|
-
const hoveredDataRef = React.useRef(null);
|
|
16
11
|
const ref = React.useRef(null);
|
|
17
|
-
const connectorSelector = `.${b('connector')}`;
|
|
18
12
|
const allowOverlapDataLabels = React.useMemo(() => {
|
|
19
13
|
return preparedData.some((d) => d === null || d === void 0 ? void 0 : d.series.dataLabels.allowOverlap);
|
|
20
14
|
}, [preparedData]);
|
|
@@ -22,115 +16,8 @@ export const WaterfallSeriesShapes = (args) => {
|
|
|
22
16
|
if (!ref.current) {
|
|
23
17
|
return () => { };
|
|
24
18
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const inactiveOptions = get(seriesOptions, 'waterfall.states.inactive');
|
|
28
|
-
svgElement.selectAll('*').remove();
|
|
29
|
-
const rectSelection = svgElement
|
|
30
|
-
.selectAll('allRects')
|
|
31
|
-
.data(preparedData)
|
|
32
|
-
.join('rect')
|
|
33
|
-
.attr('class', b('segment'))
|
|
34
|
-
.attr('x', (d) => d.x)
|
|
35
|
-
.attr('y', (d) => d.y)
|
|
36
|
-
.attr('height', (d) => d.height)
|
|
37
|
-
.attr('width', (d) => d.width)
|
|
38
|
-
.attr('fill', (d) => getWaterfallPointColor(d.data, d.series))
|
|
39
|
-
.attr('opacity', (d) => d.opacity)
|
|
40
|
-
.attr('cursor', (d) => d.series.cursor);
|
|
41
|
-
let dataLabels = preparedData.map((d) => d.label).filter(Boolean);
|
|
42
|
-
if (!allowOverlapDataLabels) {
|
|
43
|
-
dataLabels = filterOverlappingLabels(dataLabels);
|
|
44
|
-
}
|
|
45
|
-
const labelSelection = svgElement
|
|
46
|
-
.selectAll('text')
|
|
47
|
-
.data(dataLabels)
|
|
48
|
-
.join('text')
|
|
49
|
-
.html((d) => d.text)
|
|
50
|
-
.attr('class', b('label'))
|
|
51
|
-
.attr('x', (d) => d.x)
|
|
52
|
-
.attr('y', (d) => d.y)
|
|
53
|
-
.attr('text-anchor', (d) => d.textAnchor)
|
|
54
|
-
.style('font-size', (d) => d.style.fontSize)
|
|
55
|
-
.style('font-weight', (d) => d.style.fontWeight || null)
|
|
56
|
-
.style('fill', (d) => d.style.fontColor || null);
|
|
57
|
-
// Add the connector line between bars
|
|
58
|
-
svgElement
|
|
59
|
-
.selectAll(connectorSelector)
|
|
60
|
-
.data(preparedData)
|
|
61
|
-
.join('path')
|
|
62
|
-
.attr('class', b('connector'))
|
|
63
|
-
.attr('d', (d, index) => {
|
|
64
|
-
const line = lineGenerator();
|
|
65
|
-
const prev = preparedData[index - 1];
|
|
66
|
-
if (!prev) {
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
const points = [];
|
|
70
|
-
if (Number(prev.data.y) > 0) {
|
|
71
|
-
points.push([prev.x, prev.y]);
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
points.push([prev.x, prev.y + prev.height]);
|
|
75
|
-
}
|
|
76
|
-
if (Number(d.data.y) > 0 && !d.data.total) {
|
|
77
|
-
points.push([d.x + d.width, d.y + d.height]);
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
points.push([d.x + d.width, d.y]);
|
|
81
|
-
}
|
|
82
|
-
return line(points);
|
|
83
|
-
})
|
|
84
|
-
.attr('stroke-width', 1)
|
|
85
|
-
.attr('stroke-dasharray', () => getLineDashArray(DASH_STYLE.Dash, 1));
|
|
86
|
-
function handleShapeHover(data) {
|
|
87
|
-
hoveredDataRef.current = data;
|
|
88
|
-
const hoverEnabled = hoverOptions === null || hoverOptions === void 0 ? void 0 : hoverOptions.enabled;
|
|
89
|
-
const inactiveEnabled = inactiveOptions === null || inactiveOptions === void 0 ? void 0 : inactiveOptions.enabled;
|
|
90
|
-
if (!data) {
|
|
91
|
-
if (hoverEnabled) {
|
|
92
|
-
rectSelection.attr('fill', (d) => getWaterfallPointColor(d.data, d.series));
|
|
93
|
-
}
|
|
94
|
-
if (inactiveEnabled) {
|
|
95
|
-
rectSelection.attr('opacity', null);
|
|
96
|
-
labelSelection.attr('opacity', null);
|
|
97
|
-
}
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
if (hoverEnabled) {
|
|
101
|
-
const hoveredValues = data.map((d) => d.data.x);
|
|
102
|
-
rectSelection.attr('fill', (d) => {
|
|
103
|
-
var _a;
|
|
104
|
-
const fillColor = getWaterfallPointColor(d.data, d.series);
|
|
105
|
-
if (hoveredValues.includes(d.data.x)) {
|
|
106
|
-
const brightness = hoverOptions === null || hoverOptions === void 0 ? void 0 : hoverOptions.brightness;
|
|
107
|
-
return ((_a = color(fillColor)) === null || _a === void 0 ? void 0 : _a.brighter(brightness).toString()) || fillColor;
|
|
108
|
-
}
|
|
109
|
-
return fillColor;
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
if (inactiveEnabled) {
|
|
113
|
-
const hoveredSeries = data.map((d) => d.series.id);
|
|
114
|
-
rectSelection.attr('opacity', (d) => {
|
|
115
|
-
return hoveredSeries.includes(d.series.id)
|
|
116
|
-
? null
|
|
117
|
-
: (inactiveOptions === null || inactiveOptions === void 0 ? void 0 : inactiveOptions.opacity) || null;
|
|
118
|
-
});
|
|
119
|
-
labelSelection.attr('opacity', (d) => {
|
|
120
|
-
return hoveredSeries.includes(d.series.id)
|
|
121
|
-
? null
|
|
122
|
-
: (inactiveOptions === null || inactiveOptions === void 0 ? void 0 : inactiveOptions.opacity) || null;
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
if (hoveredDataRef.current !== null) {
|
|
127
|
-
handleShapeHover(hoveredDataRef.current);
|
|
128
|
-
}
|
|
129
|
-
dispatcher === null || dispatcher === void 0 ? void 0 : dispatcher.on('hover-shape.waterfall', handleShapeHover);
|
|
130
|
-
return () => {
|
|
131
|
-
dispatcher === null || dispatcher === void 0 ? void 0 : dispatcher.on('hover-shape.waterfall', null);
|
|
132
|
-
};
|
|
133
|
-
}, [allowOverlapDataLabels, connectorSelector, dispatcher, preparedData, seriesOptions]);
|
|
19
|
+
return renderWaterfall({ plot: ref.current }, preparedData, seriesOptions, allowOverlapDataLabels, dispatcher);
|
|
20
|
+
}, [allowOverlapDataLabels, dispatcher, preparedData, seriesOptions]);
|
|
134
21
|
const htmlLayerData = React.useMemo(() => {
|
|
135
22
|
const items = preparedData.map((d) => d === null || d === void 0 ? void 0 : d.htmlElements).flat();
|
|
136
23
|
if (allowOverlapDataLabels) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
3
|
+
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
+
import type { PreparedXRangeData } from '../../../core/shapes/x-range/types';
|
|
5
|
+
export { prepareXRangeData } from '../../../core/shapes/x-range/prepare-data';
|
|
6
|
+
export type { PreparedXRangeData } from '../../../core/shapes/x-range/types';
|
|
7
7
|
type Args = {
|
|
8
8
|
clipPathId: string;
|
|
9
9
|
htmlLayout: HTMLElement | null;
|
|
@@ -1,112 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { select } from 'd3-selection';
|
|
4
|
-
import get from 'lodash/get';
|
|
5
|
-
import { getLineDashArray } from '../../../core/utils';
|
|
2
|
+
import { renderXRange } from '../../../core/shapes/x-range/renderer';
|
|
6
3
|
import { block } from '../../../utils';
|
|
7
4
|
import { HtmlLayer } from '../HtmlLayer';
|
|
8
|
-
|
|
9
|
-
export { prepareXRangeData } from './prepare-data';
|
|
5
|
+
export { prepareXRangeData } from '../../../core/shapes/x-range/prepare-data';
|
|
10
6
|
const b = block('x-range');
|
|
11
7
|
export function XRangeSeriesShapes(args) {
|
|
12
8
|
const { dispatcher, preparedData, seriesOptions, htmlLayout, clipPathId } = args;
|
|
13
|
-
const hoveredDataRef = React.useRef(null);
|
|
14
9
|
const ref = React.useRef(null);
|
|
15
10
|
React.useEffect(() => {
|
|
16
|
-
var _a;
|
|
17
11
|
if (!ref.current) {
|
|
18
12
|
return () => { };
|
|
19
13
|
}
|
|
20
|
-
|
|
21
|
-
svgElement.selectAll('*').remove();
|
|
22
|
-
const segmentSelection = svgElement
|
|
23
|
-
.selectAll(`path.${b('segment')}`)
|
|
24
|
-
.data(preparedData)
|
|
25
|
-
.join('path')
|
|
26
|
-
.attr('d', (d) => {
|
|
27
|
-
const borderRadius = Math.min(d.height / 2, d.width / 2, d.series.borderRadius);
|
|
28
|
-
return getRectPath({
|
|
29
|
-
x: d.x,
|
|
30
|
-
y: d.y,
|
|
31
|
-
width: d.width,
|
|
32
|
-
height: d.height,
|
|
33
|
-
borderRadius,
|
|
34
|
-
}).toString();
|
|
35
|
-
})
|
|
36
|
-
.attr('class', b('segment'))
|
|
37
|
-
.attr('fill', (d) => d.color)
|
|
38
|
-
.attr('opacity', (d) => { var _a; return (_a = d.data.opacity) !== null && _a !== void 0 ? _a : d.series.opacity; })
|
|
39
|
-
.attr('cursor', (d) => d.series.cursor);
|
|
40
|
-
svgElement
|
|
41
|
-
.selectAll(`path.${b('segment-border')}`)
|
|
42
|
-
.data(preparedData.filter((d) => d.series.borderWidth > 0))
|
|
43
|
-
.join('path')
|
|
44
|
-
.attr('d', (d) => {
|
|
45
|
-
const borderRadius = Math.min(d.height / 2, d.width / 2, d.series.borderRadius);
|
|
46
|
-
return getRectPath({
|
|
47
|
-
x: d.x,
|
|
48
|
-
y: d.y,
|
|
49
|
-
width: d.width,
|
|
50
|
-
height: d.height,
|
|
51
|
-
borderRadius,
|
|
52
|
-
}).toString();
|
|
53
|
-
})
|
|
54
|
-
.attr('class', b('segment-border'))
|
|
55
|
-
.attr('fill', 'none')
|
|
56
|
-
.attr('stroke', (d) => d.series.borderColor)
|
|
57
|
-
.attr('stroke-width', (d) => d.series.borderWidth)
|
|
58
|
-
.attr('stroke-dasharray', (d) => getLineDashArray(d.series.borderDashStyle, d.series.borderWidth))
|
|
59
|
-
.attr('opacity', (d) => { var _a; return (_a = d.data.opacity) !== null && _a !== void 0 ? _a : d.series.opacity; })
|
|
60
|
-
.attr('pointer-events', 'none');
|
|
61
|
-
const svgLabels = preparedData.flatMap((d) => d.svgLabels);
|
|
62
|
-
svgElement
|
|
63
|
-
.selectAll(`text.${b('label')}`)
|
|
64
|
-
.data(svgLabels)
|
|
65
|
-
.join('text')
|
|
66
|
-
.attr('class', b('label'))
|
|
67
|
-
.attr('x', (d) => d.x)
|
|
68
|
-
.attr('y', (d) => d.y)
|
|
69
|
-
.attr('text-anchor', (d) => d.textAnchor)
|
|
70
|
-
.attr('dominant-baseline', 'central')
|
|
71
|
-
.attr('pointer-events', 'none')
|
|
72
|
-
.style('font-size', (d) => d.style.fontSize)
|
|
73
|
-
.style('font-weight', (d) => d.style.fontWeight || null)
|
|
74
|
-
.style('fill', (d) => d.style.fontColor || null)
|
|
75
|
-
.html((d) => d.text);
|
|
76
|
-
const hoverOptions = get(seriesOptions, 'x-range.states.hover');
|
|
77
|
-
const inactiveOptions = get(seriesOptions, 'x-range.states.inactive');
|
|
78
|
-
function handleShapeHover(data) {
|
|
79
|
-
hoveredDataRef.current = data;
|
|
80
|
-
if (hoverOptions === null || hoverOptions === void 0 ? void 0 : hoverOptions.enabled) {
|
|
81
|
-
const hoveredSet = new Set(data === null || data === void 0 ? void 0 : data.map((d) => d.data));
|
|
82
|
-
segmentSelection.attr('fill', (d) => {
|
|
83
|
-
var _a;
|
|
84
|
-
const fillColor = d.color;
|
|
85
|
-
if (hoveredSet.has(d.data)) {
|
|
86
|
-
return (((_a = color(fillColor)) === null || _a === void 0 ? void 0 : _a.brighter(hoverOptions.brightness).toString()) ||
|
|
87
|
-
fillColor);
|
|
88
|
-
}
|
|
89
|
-
return fillColor;
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
if (inactiveOptions === null || inactiveOptions === void 0 ? void 0 : inactiveOptions.enabled) {
|
|
93
|
-
const hoveredSeries = data === null || data === void 0 ? void 0 : data.map((d) => d.series.id);
|
|
94
|
-
segmentSelection.attr('opacity', (d) => {
|
|
95
|
-
var _a, _b;
|
|
96
|
-
if ((hoveredSeries === null || hoveredSeries === void 0 ? void 0 : hoveredSeries.length) && !hoveredSeries.includes(d.series.id)) {
|
|
97
|
-
return inactiveOptions.opacity || null;
|
|
98
|
-
}
|
|
99
|
-
return (_b = (_a = d.data.opacity) !== null && _a !== void 0 ? _a : d.series.opacity) !== null && _b !== void 0 ? _b : null;
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (hoveredDataRef.current !== null) {
|
|
104
|
-
handleShapeHover((_a = hoveredDataRef.current) !== null && _a !== void 0 ? _a : undefined);
|
|
105
|
-
}
|
|
106
|
-
dispatcher === null || dispatcher === void 0 ? void 0 : dispatcher.on('hover-shape.x-range', handleShapeHover);
|
|
107
|
-
return () => {
|
|
108
|
-
dispatcher === null || dispatcher === void 0 ? void 0 : dispatcher.on('hover-shape.x-range', null);
|
|
109
|
-
};
|
|
14
|
+
return renderXRange({ plot: ref.current }, preparedData, seriesOptions, dispatcher);
|
|
110
15
|
}, [dispatcher, preparedData, seriesOptions]);
|
|
111
16
|
const htmlLayerData = React.useMemo(() => ({ htmlElements: preparedData.flatMap((d) => d.htmlLabels) }), [preparedData]);
|
|
112
17
|
return (React.createElement(React.Fragment, null,
|
package/dist/cjs/setup-jsdom.js
CHANGED
|
@@ -10,6 +10,13 @@ if (typeof document !== 'undefined') {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
14
|
+
global.ResizeObserver = class ResizeObserver {
|
|
15
|
+
observe() { }
|
|
16
|
+
unobserve() { }
|
|
17
|
+
disconnect() { }
|
|
18
|
+
};
|
|
19
|
+
}
|
|
13
20
|
if (typeof HTMLCanvasElement !== 'undefined') {
|
|
14
21
|
// jsdom does not implement HTMLCanvasElement.prototype.getContext (used for text measurement)
|
|
15
22
|
HTMLCanvasElement.prototype.getContext = (() => ({
|
|
@@ -24,6 +24,8 @@ export interface HtmlItem {
|
|
|
24
24
|
height: number;
|
|
25
25
|
};
|
|
26
26
|
style?: BaseTextStyle & React.CSSProperties;
|
|
27
|
+
/** Coordinate space for positioning: 'plot' uses the plot area origin, 'chart' uses the full chart origin. Defaults to 'plot'. */
|
|
28
|
+
scope?: 'plot' | 'chart';
|
|
27
29
|
}
|
|
28
30
|
export interface ShapeDataWithLabels {
|
|
29
31
|
svgLabels: LabelData[];
|
|
@@ -256,7 +256,7 @@ export const ChartInner = (props) => {
|
|
|
256
256
|
React.createElement("rect", { x: 0, y: 0, width: boundsWidth, height: boundsHeight })),
|
|
257
257
|
React.createElement("clipPath", { id: getClipPathIdByBounds({ clipPathId, bounds: 'horizontal' }) },
|
|
258
258
|
React.createElement("rect", { x: 0, y: -boundsHeight, width: boundsWidth, height: boundsHeight * 3 }))),
|
|
259
|
-
preparedTitle && React.createElement(Title, Object.assign({}, preparedTitle)),
|
|
259
|
+
preparedTitle && React.createElement(Title, Object.assign({}, preparedTitle, { htmlLayout: htmlLayout })),
|
|
260
260
|
React.createElement("g", { transform: `translate(0, ${boundsOffsetTop})` }, preparedSplit === null || preparedSplit === void 0 ? void 0 : preparedSplit.plots.map((plot, index) => {
|
|
261
261
|
return React.createElement(PlotTitle, { key: `plot-${index}`, title: plot.title });
|
|
262
262
|
})),
|
|
@@ -285,7 +285,7 @@ export const ChartInner = (props) => {
|
|
|
285
285
|
// when starting to select an area, the tooltip remains in the position where the selection began
|
|
286
286
|
onPointerMove: throttledHandlePointerMove, onPointerLeave: handlePointerLeave, onTouchStart: throttledHandleTouchMove, onTouchMove: throttledHandleTouchMove, onClick: handleChartClick }, initialized ? chartContent : null),
|
|
287
287
|
React.createElement("div", { className: b('html-layer'), ref: setHtmlLayout, style: {
|
|
288
|
-
'--g-html-layout-transform': `translate(${boundsOffsetLeft}px, ${boundsOffsetTop}px)`,
|
|
288
|
+
'--g-html-layout-plot-transform': `translate(${boundsOffsetLeft}px, ${boundsOffsetTop}px)`,
|
|
289
289
|
} }),
|
|
290
290
|
Object.keys(zoomState).length > 0 && (preparedChart === null || preparedChart === void 0 ? void 0 : preparedChart.zoom) && (React.createElement(Button, { className: b('reset-zoom-button'), onClick: () => {
|
|
291
291
|
var _a;
|
|
@@ -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 = {
|
|
@@ -53,6 +53,7 @@ export function useChartInnerProps(props) {
|
|
|
53
53
|
const preparedTitle = await getPreparedTitle({
|
|
54
54
|
title: data.title,
|
|
55
55
|
chartWidth: width,
|
|
56
|
+
chartHeight: height,
|
|
56
57
|
chartMargin: (_a = data.chart) === null || _a === void 0 ? void 0 : _a.margin,
|
|
57
58
|
});
|
|
58
59
|
const preparedChart = getPreparedChart({
|
|
@@ -203,7 +204,6 @@ export function useChartInnerProps(props) {
|
|
|
203
204
|
getYAxisWidth,
|
|
204
205
|
legendConfig,
|
|
205
206
|
});
|
|
206
|
-
//end
|
|
207
207
|
const newStateValue = {
|
|
208
208
|
allPreparedSeries,
|
|
209
209
|
boundsHeight,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { PreparedTitle } from '../../../hooks/types';
|
|
2
2
|
import type { ChartData, ChartMargin } from '../../../types';
|
|
3
|
-
export declare const getPreparedTitle: ({ title, chartWidth, chartMargin, }: {
|
|
3
|
+
export declare const getPreparedTitle: ({ title, chartWidth, chartHeight, chartMargin, }: {
|
|
4
4
|
title: ChartData["title"];
|
|
5
5
|
chartWidth: number;
|
|
6
|
+
chartHeight: number;
|
|
6
7
|
chartMargin?: Partial<ChartMargin>;
|
|
7
8
|
}) => Promise<PreparedTitle | undefined>;
|
|
@@ -1,26 +1,64 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getTextSizeFn, getTextWithElipsis, wrapText } from '../../../core/utils';
|
|
1
|
+
import { calculateNumericProperty, getLabelsSize, getTextSizeFn, getTextWithElipsis, wrapText, } from '../../../core/utils';
|
|
3
2
|
const DEFAULT_TITLE_FONT_SIZE = '15px';
|
|
4
3
|
const DEFAULT_TITLE_MARGIN = 10;
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const DEFAULT_TITLE_MAX_HEIGHT = '50%';
|
|
5
|
+
export const getPreparedTitle = async ({ title, chartWidth, chartHeight, chartMargin, }) => {
|
|
6
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
7
|
+
const titleText = title === null || title === void 0 ? void 0 : title.text;
|
|
8
|
+
if (!titleText) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
7
11
|
const chartMarginTop = (_a = chartMargin === null || chartMargin === void 0 ? void 0 : chartMargin.top) !== null && _a !== void 0 ? _a : 0;
|
|
8
12
|
const chartMarginLeft = (_b = chartMargin === null || chartMargin === void 0 ? void 0 : chartMargin.left) !== null && _b !== void 0 ? _b : 0;
|
|
9
13
|
const chartMarginRight = (_c = chartMargin === null || chartMargin === void 0 ? void 0 : chartMargin.right) !== null && _c !== void 0 ? _c : 0;
|
|
10
|
-
const titleText = get(title, 'text');
|
|
11
14
|
const titleStyle = {
|
|
12
15
|
fontSize: (_e = (_d = title === null || title === void 0 ? void 0 : title.style) === null || _d === void 0 ? void 0 : _d.fontSize) !== null && _e !== void 0 ? _e : DEFAULT_TITLE_FONT_SIZE,
|
|
13
16
|
fontWeight: (_g = (_f = title === null || title === void 0 ? void 0 : title.style) === null || _f === void 0 ? void 0 : _f.fontWeight) !== null && _g !== void 0 ? _g : 'var(--g-text-subheader-font-weight)',
|
|
14
17
|
fontColor: (_j = (_h = title === null || title === void 0 ? void 0 : title.style) === null || _h === void 0 ? void 0 : _h.fontColor) !== null && _j !== void 0 ? _j : 'var(--g-color-text-primary)',
|
|
15
18
|
};
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
const usableWidth = chartWidth - chartMarginLeft - chartMarginRight;
|
|
20
|
+
const titleMargin = (_k = title === null || title === void 0 ? void 0 : title.margin) !== null && _k !== void 0 ? _k : DEFAULT_TITLE_MARGIN;
|
|
21
|
+
if (title === null || title === void 0 ? void 0 : title.html) {
|
|
22
|
+
const titleSize = await getLabelsSize({
|
|
23
|
+
labels: [titleText],
|
|
24
|
+
style: Object.assign(Object.assign({}, titleStyle), { maxWidth: `${usableWidth}px` }),
|
|
25
|
+
html: true,
|
|
26
|
+
});
|
|
27
|
+
const resolvedMaxHeight = calculateNumericProperty({
|
|
28
|
+
value: (_l = title.maxHeight) !== null && _l !== void 0 ? _l : DEFAULT_TITLE_MAX_HEIGHT,
|
|
29
|
+
base: chartHeight,
|
|
30
|
+
});
|
|
31
|
+
const titleHeight = resolvedMaxHeight === undefined
|
|
32
|
+
? titleSize.maxHeight
|
|
33
|
+
: Math.min(titleSize.maxHeight, resolvedMaxHeight);
|
|
34
|
+
const qa = title === null || title === void 0 ? void 0 : title.qa;
|
|
35
|
+
const qaAttr = qa ? ` data-qa="${qa}"` : '';
|
|
36
|
+
const maxHeightStyle = resolvedMaxHeight === undefined ? '' : ` max-height: ${resolvedMaxHeight}px;`;
|
|
37
|
+
const htmlContent = `<div${qaAttr} style="max-width: ${usableWidth}px; overflow: hidden;${maxHeightStyle}">${titleText}</div>`;
|
|
38
|
+
const titleWidth = Math.min(titleSize.maxWidth, usableWidth);
|
|
39
|
+
return {
|
|
40
|
+
text: titleText,
|
|
41
|
+
style: titleStyle,
|
|
42
|
+
height: titleHeight,
|
|
43
|
+
margin: titleMargin,
|
|
44
|
+
qa,
|
|
45
|
+
html: true,
|
|
46
|
+
htmlElements: [
|
|
47
|
+
{
|
|
48
|
+
x: chartMarginLeft + (usableWidth - titleWidth) / 2,
|
|
49
|
+
y: chartMarginTop,
|
|
50
|
+
content: htmlContent,
|
|
51
|
+
size: { width: titleWidth, height: titleHeight },
|
|
52
|
+
style: titleStyle,
|
|
53
|
+
scope: 'chart',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
};
|
|
18
57
|
}
|
|
58
|
+
const xCenter = chartMarginLeft + usableWidth / 2;
|
|
19
59
|
const getTitleTextSize = getTextSizeFn({ style: titleStyle });
|
|
20
|
-
const maxRowCount = (
|
|
60
|
+
const maxRowCount = (_m = title === null || title === void 0 ? void 0 : title.maxRowCount) !== null && _m !== void 0 ? _m : 1;
|
|
21
61
|
const contentRows = [];
|
|
22
|
-
const usableWidth = chartWidth - chartMarginLeft - chartMarginRight;
|
|
23
|
-
const xCenter = chartMarginLeft + usableWidth / 2;
|
|
24
62
|
if (maxRowCount > 1) {
|
|
25
63
|
let titleTextRows = await wrapText({
|
|
26
64
|
text: titleText,
|
|
@@ -33,7 +71,7 @@ export const getPreparedTitle = async ({ title, chartWidth, chartMargin, }) => {
|
|
|
33
71
|
acc.push(row);
|
|
34
72
|
}
|
|
35
73
|
else {
|
|
36
|
-
acc[maxRowCount - 1].text
|
|
74
|
+
acc[maxRowCount - 1] = Object.assign(Object.assign({}, acc[maxRowCount - 1]), { text: acc[maxRowCount - 1].text + row.text });
|
|
37
75
|
}
|
|
38
76
|
return acc;
|
|
39
77
|
}, []);
|
|
@@ -71,12 +109,11 @@ export const getPreparedTitle = async ({ title, chartWidth, chartMargin, }) => {
|
|
|
71
109
|
});
|
|
72
110
|
}
|
|
73
111
|
const totalTextHeight = contentRows.reduce((acc, row) => acc + row.size.height, 0);
|
|
74
|
-
const titleHeight = totalTextHeight;
|
|
75
112
|
return {
|
|
76
113
|
text: titleText,
|
|
77
114
|
style: titleStyle,
|
|
78
|
-
height:
|
|
79
|
-
margin:
|
|
115
|
+
height: totalTextHeight,
|
|
116
|
+
margin: titleMargin,
|
|
80
117
|
qa: title === null || title === void 0 ? void 0 : title.qa,
|
|
81
118
|
contentRows,
|
|
82
119
|
};
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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(
|
|
51
|
+
.text(paginationCounterText)
|
|
50
52
|
.attr('class', b('pagination-counter'))
|
|
51
|
-
.attr('x',
|
|
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',
|
|
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,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PreparedTitle } from '../../hooks';
|
|
3
|
-
type Props = PreparedTitle
|
|
4
|
-
|
|
3
|
+
type Props = PreparedTitle & {
|
|
4
|
+
htmlLayout?: HTMLElement | null;
|
|
5
|
+
};
|
|
6
|
+
export declare const Title: (props: Props) => React.JSX.Element | null;
|
|
5
7
|
export {};
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { HtmlLayer } from '../../hooks/useShapes/HtmlLayer';
|
|
2
3
|
export const Title = (props) => {
|
|
3
|
-
const { style, qa, contentRows } = props;
|
|
4
|
+
const { style, qa, contentRows, html, htmlElements, htmlLayout } = props;
|
|
5
|
+
if (html) {
|
|
6
|
+
if (!htmlLayout || !htmlElements) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
return React.createElement(HtmlLayer, { htmlLayout: htmlLayout, preparedData: { htmlElements } });
|
|
10
|
+
}
|
|
4
11
|
return (React.createElement("text", { dominantBaseline: "hanging", textAnchor: "middle", style: {
|
|
5
12
|
fill: style === null || style === void 0 ? void 0 : style.fontColor,
|
|
6
13
|
fontSize: style === null || style === void 0 ? void 0 : style.fontSize,
|
|
7
14
|
fontWeight: style === null || style === void 0 ? void 0 : style.fontWeight,
|
|
8
|
-
}, "data-qa": qa }, contentRows.map((row, i) => (React.createElement("tspan", { key: i, x: row.x, y: row.y, dominantBaseline: "hanging", dangerouslySetInnerHTML: { __html: row.text } })))));
|
|
15
|
+
}, "data-qa": qa }, contentRows === null || contentRows === void 0 ? void 0 : contentRows.map((row, i) => (React.createElement("tspan", { key: i, x: row.x, y: row.y, dominantBaseline: "hanging", dangerouslySetInnerHTML: { __html: row.text } })))));
|
|
9
16
|
};
|
|
@@ -13,7 +13,28 @@ export const Tooltip = (props) => {
|
|
|
13
13
|
xAxis,
|
|
14
14
|
yAxis,
|
|
15
15
|
});
|
|
16
|
-
const
|
|
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;
|
|
@@ -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;
|