@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,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/esm/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[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/charts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.46.1",
|
|
4
4
|
"description": "A flexible JavaScript library for data visualization and chart rendering using React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -54,7 +54,8 @@
|
|
|
54
54
|
"prepublishOnly": "npm run build",
|
|
55
55
|
"docs:deps": "cd ./docs && npm ci",
|
|
56
56
|
"docs:dev": "cd ./docs && npm run docs:dev",
|
|
57
|
-
"docs:build": "
|
|
57
|
+
"docs:build-examples": "vite build --config docs/examples/vite.config.ts",
|
|
58
|
+
"docs:build": "npm run docs:build-examples && cd ./docs && npm run docs:build",
|
|
58
59
|
"playwright:install": "playwright install chromium webkit --with-deps",
|
|
59
60
|
"playwright": "playwright test --config=playwright/playwright.config.ts",
|
|
60
61
|
"playwright:visual": "playwright test --project=chromium --project=webkit --config=playwright/playwright.config.ts",
|
|
@@ -113,6 +114,7 @@
|
|
|
113
114
|
"@types/lodash": "^4.17.12",
|
|
114
115
|
"@types/react": "^18.3.2",
|
|
115
116
|
"@types/react-dom": "^18.3.0",
|
|
117
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
116
118
|
"eslint": "^9.39.4",
|
|
117
119
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
118
120
|
"eslint-plugin-storybook": "^10.2.16",
|
|
@@ -127,6 +129,7 @@
|
|
|
127
129
|
"jest": "^29.7.0",
|
|
128
130
|
"jest-environment-jsdom": "^29.7.0",
|
|
129
131
|
"jest-transform-css": "^6.0.1",
|
|
132
|
+
"monaco-editor": "^0.55.1",
|
|
130
133
|
"nano-staged": "^0.8.0",
|
|
131
134
|
"npm-run-all": "^4.1.5",
|
|
132
135
|
"prettier": "^3.8.1",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PreparedLegend, PreparedSeries } from '../../core/series/types';
|
|
2
|
-
import type { ChartData } from '../../types';
|
|
3
|
-
export declare const getVisibleSeries: ({ preparedSeries, activeLegendItems, }: {
|
|
4
|
-
preparedSeries: PreparedSeries[];
|
|
5
|
-
activeLegendItems: string[];
|
|
6
|
-
}) => PreparedSeries[];
|
|
7
|
-
export declare const getPreparedSeries: ({ seriesData, seriesOptions, colors, preparedLegend, }: {
|
|
8
|
-
seriesData: ChartData["series"]["data"];
|
|
9
|
-
seriesOptions: ChartData["series"]["options"];
|
|
10
|
-
colors: string[];
|
|
11
|
-
preparedLegend?: PreparedLegend | null;
|
|
12
|
-
}) => Promise<PreparedSeries[]>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { group } from 'd3-array';
|
|
2
|
-
import { scaleOrdinal } from 'd3-scale';
|
|
3
|
-
import { prepareSeries } from '../../core/series/prepareSeries';
|
|
4
|
-
import { getSeriesNames } from '../../core/utils';
|
|
5
|
-
export const getVisibleSeries = ({ preparedSeries, activeLegendItems, }) => {
|
|
6
|
-
return preparedSeries.map((singleSeries) => {
|
|
7
|
-
if (singleSeries.legend.enabled) {
|
|
8
|
-
return Object.assign(Object.assign({}, singleSeries), { visible: activeLegendItems.includes(singleSeries.legend.groupId) });
|
|
9
|
-
}
|
|
10
|
-
return singleSeries;
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
export const getPreparedSeries = async ({ seriesData, seriesOptions, colors, preparedLegend, }) => {
|
|
14
|
-
const seriesNames = getSeriesNames(seriesData);
|
|
15
|
-
const colorScale = scaleOrdinal(seriesNames, colors);
|
|
16
|
-
const groupedSeries = group(seriesData, (item, index) => {
|
|
17
|
-
if (item.type === 'line') {
|
|
18
|
-
return `${item.type}_${index}`;
|
|
19
|
-
}
|
|
20
|
-
return item.type;
|
|
21
|
-
});
|
|
22
|
-
const acc = [];
|
|
23
|
-
if (!preparedLegend) {
|
|
24
|
-
return acc;
|
|
25
|
-
}
|
|
26
|
-
const list = Array.from(groupedSeries);
|
|
27
|
-
for (let i = 0; i < list.length; i++) {
|
|
28
|
-
const [_groupId, seriesList] = list[i];
|
|
29
|
-
const seriesType = seriesList[0].type;
|
|
30
|
-
acc.push(...(await prepareSeries({
|
|
31
|
-
type: seriesType,
|
|
32
|
-
series: seriesList,
|
|
33
|
-
seriesOptions,
|
|
34
|
-
legend: preparedLegend,
|
|
35
|
-
colorScale,
|
|
36
|
-
colors,
|
|
37
|
-
})));
|
|
38
|
-
}
|
|
39
|
-
return acc;
|
|
40
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../core/series/types';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../core/series/types';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../core/series/utils';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../core/series/utils';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { BaseType, Selection } from 'd3-selection';
|
|
2
|
-
import { SymbolType } from '../../core/constants';
|
|
3
|
-
import type { MarkerData as AreaMarkerData } from './area/types';
|
|
4
|
-
import type { MarkerData as LineMarkerData } from './line/types';
|
|
5
|
-
import type { RadarMarkerData } from './radar/types';
|
|
6
|
-
import type { MarkerData as ScatterMarkerData } from './scatter/types';
|
|
7
|
-
type MarkerData = LineMarkerData | AreaMarkerData | ScatterMarkerData | RadarMarkerData;
|
|
8
|
-
export declare function renderMarker<T extends MarkerData>(selection: Selection<BaseType, T, BaseType, unknown>): Selection<BaseType, T, BaseType, unknown>;
|
|
9
|
-
export declare function getMarkerVisibility(d: MarkerData): "" | "hidden";
|
|
10
|
-
export declare function getMarkerHaloVisibility(d: MarkerData): "" | "hidden";
|
|
11
|
-
export declare function setMarker<T extends BaseType, D extends MarkerData>(selection: Selection<T, D, BaseType | null, unknown>, state: 'normal' | 'hover'): void;
|
|
12
|
-
export declare function getMarkerSymbol(type: `${SymbolType}` | undefined, radius: number): string | null;
|
|
13
|
-
export declare function selectMarkerHalo<T>(parentSelection: Selection<BaseType, T, null, undefined>): Selection<BaseType, T, null, undefined>;
|
|
14
|
-
export declare function selectMarkerSymbol<T>(parentSelection: Selection<BaseType, T, null, undefined>): Selection<BaseType, T, null, undefined>;
|
|
15
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './bar-y';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './bar-y';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PreparedLegend, PreparedSeries } from '../../core/series/types';
|
|
2
|
-
import type { ChartData } from '../../types';
|
|
3
|
-
export declare const getVisibleSeries: ({ preparedSeries, activeLegendItems, }: {
|
|
4
|
-
preparedSeries: PreparedSeries[];
|
|
5
|
-
activeLegendItems: string[];
|
|
6
|
-
}) => PreparedSeries[];
|
|
7
|
-
export declare const getPreparedSeries: ({ seriesData, seriesOptions, colors, preparedLegend, }: {
|
|
8
|
-
seriesData: ChartData["series"]["data"];
|
|
9
|
-
seriesOptions: ChartData["series"]["options"];
|
|
10
|
-
colors: string[];
|
|
11
|
-
preparedLegend?: PreparedLegend | null;
|
|
12
|
-
}) => Promise<PreparedSeries[]>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { group } from 'd3-array';
|
|
2
|
-
import { scaleOrdinal } from 'd3-scale';
|
|
3
|
-
import { prepareSeries } from '../../core/series/prepareSeries';
|
|
4
|
-
import { getSeriesNames } from '../../core/utils';
|
|
5
|
-
export const getVisibleSeries = ({ preparedSeries, activeLegendItems, }) => {
|
|
6
|
-
return preparedSeries.map((singleSeries) => {
|
|
7
|
-
if (singleSeries.legend.enabled) {
|
|
8
|
-
return Object.assign(Object.assign({}, singleSeries), { visible: activeLegendItems.includes(singleSeries.legend.groupId) });
|
|
9
|
-
}
|
|
10
|
-
return singleSeries;
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
export const getPreparedSeries = async ({ seriesData, seriesOptions, colors, preparedLegend, }) => {
|
|
14
|
-
const seriesNames = getSeriesNames(seriesData);
|
|
15
|
-
const colorScale = scaleOrdinal(seriesNames, colors);
|
|
16
|
-
const groupedSeries = group(seriesData, (item, index) => {
|
|
17
|
-
if (item.type === 'line') {
|
|
18
|
-
return `${item.type}_${index}`;
|
|
19
|
-
}
|
|
20
|
-
return item.type;
|
|
21
|
-
});
|
|
22
|
-
const acc = [];
|
|
23
|
-
if (!preparedLegend) {
|
|
24
|
-
return acc;
|
|
25
|
-
}
|
|
26
|
-
const list = Array.from(groupedSeries);
|
|
27
|
-
for (let i = 0; i < list.length; i++) {
|
|
28
|
-
const [_groupId, seriesList] = list[i];
|
|
29
|
-
const seriesType = seriesList[0].type;
|
|
30
|
-
acc.push(...(await prepareSeries({
|
|
31
|
-
type: seriesType,
|
|
32
|
-
series: seriesList,
|
|
33
|
-
seriesOptions,
|
|
34
|
-
legend: preparedLegend,
|
|
35
|
-
colorScale,
|
|
36
|
-
colors,
|
|
37
|
-
})));
|
|
38
|
-
}
|
|
39
|
-
return acc;
|
|
40
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../core/series/types';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../core/series/types';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../core/series/utils';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../core/series/utils';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { BaseType, Selection } from 'd3-selection';
|
|
2
|
-
import { SymbolType } from '../../core/constants';
|
|
3
|
-
import type { MarkerData as AreaMarkerData } from './area/types';
|
|
4
|
-
import type { MarkerData as LineMarkerData } from './line/types';
|
|
5
|
-
import type { RadarMarkerData } from './radar/types';
|
|
6
|
-
import type { MarkerData as ScatterMarkerData } from './scatter/types';
|
|
7
|
-
type MarkerData = LineMarkerData | AreaMarkerData | ScatterMarkerData | RadarMarkerData;
|
|
8
|
-
export declare function renderMarker<T extends MarkerData>(selection: Selection<BaseType, T, BaseType, unknown>): Selection<BaseType, T, BaseType, unknown>;
|
|
9
|
-
export declare function getMarkerVisibility(d: MarkerData): "" | "hidden";
|
|
10
|
-
export declare function getMarkerHaloVisibility(d: MarkerData): "" | "hidden";
|
|
11
|
-
export declare function setMarker<T extends BaseType, D extends MarkerData>(selection: Selection<T, D, BaseType | null, unknown>, state: 'normal' | 'hover'): void;
|
|
12
|
-
export declare function getMarkerSymbol(type: `${SymbolType}` | undefined, radius: number): string | null;
|
|
13
|
-
export declare function selectMarkerHalo<T>(parentSelection: Selection<BaseType, T, null, undefined>): Selection<BaseType, T, null, undefined>;
|
|
14
|
-
export declare function selectMarkerSymbol<T>(parentSelection: Selection<BaseType, T, null, undefined>): Selection<BaseType, T, null, undefined>;
|
|
15
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './bar-y';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './bar-y';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|