@gravity-ui/charts 1.22.0 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/AxisX/AxisX.d.ts +3 -3
- package/dist/cjs/components/ChartInner/index.js +94 -27
- package/dist/cjs/components/ChartInner/useChartInnerHandlers.d.ts +3 -3
- package/dist/cjs/components/ChartInner/useChartInnerProps.d.ts +41 -20
- package/dist/cjs/components/ChartInner/useChartInnerProps.js +21 -9
- package/dist/cjs/components/ChartInner/useChartInnerState.d.ts +6 -1
- package/dist/cjs/components/ChartInner/useChartInnerState.js +17 -1
- package/dist/cjs/components/ChartInner/utils.d.ts +5 -2
- package/dist/cjs/components/ChartInner/utils.js +13 -0
- package/dist/cjs/components/RangeSlider/index.d.ts +6 -0
- package/dist/cjs/components/RangeSlider/index.js +41 -0
- package/dist/cjs/components/RangeSlider/styles.css +6 -0
- package/dist/cjs/components/RangeSlider/utils.d.ts +5 -0
- package/dist/cjs/components/RangeSlider/utils.js +18 -0
- package/dist/cjs/components/Tooltip/DefaultTooltipContent/index.js +2 -1
- package/dist/cjs/components/Tooltip/DefaultTooltipContent/utils.d.ts +2 -2
- package/dist/cjs/components/Tooltip/DefaultTooltipContent/utils.js +3 -2
- package/dist/cjs/components/Tooltip/index.d.ts +3 -3
- package/dist/cjs/constants/chart-types.d.ts +3 -1
- package/dist/cjs/constants/chart-types.js +2 -1
- package/dist/cjs/constants/defaults/brush.d.ts +2 -0
- package/dist/cjs/constants/defaults/brush.js +15 -0
- package/dist/cjs/constants/defaults/index.d.ts +1 -0
- package/dist/cjs/constants/defaults/index.js +1 -0
- package/dist/cjs/constants/defaults/series-options.d.ts +2 -1
- package/dist/cjs/constants/defaults/series-options.js +11 -0
- package/dist/cjs/constants/index.d.ts +1 -0
- package/dist/cjs/constants/index.js +1 -0
- package/dist/cjs/constants/zoom.d.ts +6 -0
- package/dist/cjs/constants/zoom.js +5 -0
- package/dist/cjs/hooks/index.d.ts +5 -0
- package/dist/cjs/hooks/index.js +5 -0
- package/dist/cjs/hooks/useAxis/index.d.ts +4 -3
- package/dist/cjs/hooks/useAxis/index.js +2 -2
- package/dist/cjs/hooks/useAxis/range-slider.d.ts +5 -0
- package/dist/cjs/hooks/useAxis/range-slider.js +16 -0
- package/dist/cjs/hooks/useAxis/types.d.ts +66 -0
- package/dist/cjs/hooks/useAxis/types.js +1 -0
- package/dist/cjs/hooks/{useChartOptions → useAxis}/utils.d.ts +1 -2
- package/dist/cjs/hooks/useAxis/utils.js +9 -0
- package/dist/{esm/hooks/useChartOptions → cjs/hooks/useAxis}/x-axis.d.ts +2 -2
- package/dist/{esm/hooks/useChartOptions → cjs/hooks/useAxis}/x-axis.js +5 -3
- package/dist/cjs/hooks/{useChartOptions → useAxis}/y-axis.d.ts +2 -2
- package/dist/cjs/hooks/{useChartOptions → useAxis}/y-axis.js +3 -3
- package/dist/cjs/hooks/useAxisScales/index.d.ts +3 -3
- package/dist/cjs/hooks/useAxisScales/index.js +41 -15
- package/dist/cjs/hooks/useBrush/index.js +87 -24
- package/dist/cjs/hooks/useBrush/styles.css +1 -0
- package/dist/cjs/hooks/useBrush/types.d.ts +8 -7
- package/dist/cjs/hooks/useBrush/utils.d.ts +19 -0
- package/dist/cjs/hooks/useBrush/utils.js +172 -0
- package/dist/cjs/hooks/useChartDimensions/index.d.ts +4 -4
- package/dist/cjs/hooks/useChartDimensions/index.js +14 -4
- package/dist/cjs/hooks/useChartDimensions/utils.d.ts +4 -4
- package/dist/cjs/hooks/useChartOptions/chart.js +1 -82
- package/dist/cjs/hooks/useChartOptions/index.d.ts +9 -3
- package/dist/cjs/hooks/useChartOptions/tooltip.js +1 -1
- package/dist/cjs/hooks/useChartOptions/types.d.ts +4 -64
- package/dist/cjs/hooks/useChartOptions/zoom.d.ts +11 -0
- package/dist/cjs/hooks/useChartOptions/zoom.js +91 -0
- package/dist/cjs/hooks/useCrosshair/index.d.ts +3 -3
- package/dist/cjs/hooks/useNormalizedOriginalData/index.d.ts +1 -0
- package/dist/cjs/hooks/useNormalizedOriginalData/index.js +1 -2
- package/dist/cjs/hooks/useRangeSlider/index.d.ts +4 -0
- package/dist/cjs/hooks/useRangeSlider/index.js +129 -0
- package/dist/cjs/hooks/useRangeSlider/types.d.ts +42 -0
- package/dist/cjs/hooks/useRangeSlider/types.js +1 -0
- package/dist/cjs/hooks/useRangeSlider/utils.d.ts +16 -0
- package/dist/cjs/hooks/useRangeSlider/utils.js +19 -0
- package/dist/cjs/hooks/useSeries/prepare-area.js +17 -2
- package/dist/cjs/hooks/useSeries/prepare-bar-x.js +21 -9
- package/dist/cjs/hooks/useSeries/prepare-bar-y.d.ts +3 -2
- package/dist/cjs/hooks/useSeries/prepare-bar-y.js +20 -7
- package/dist/cjs/hooks/useSeries/prepare-funnel.d.ts +10 -0
- package/dist/cjs/hooks/useSeries/prepare-funnel.js +50 -0
- package/dist/cjs/hooks/useSeries/prepare-heatmap.js +13 -1
- package/dist/cjs/hooks/useSeries/prepare-legend.js +5 -2
- package/dist/cjs/hooks/useSeries/prepare-line.js +17 -2
- package/dist/cjs/hooks/useSeries/prepare-pie.js +17 -3
- package/dist/cjs/hooks/useSeries/prepare-scatter.js +18 -1
- package/dist/cjs/hooks/useSeries/prepare-waterfall.js +18 -2
- package/dist/cjs/hooks/useSeries/prepareSeries.js +9 -0
- package/dist/cjs/hooks/useSeries/types.d.ts +22 -6
- package/dist/cjs/hooks/useShapes/area/index.d.ts +3 -3
- package/dist/cjs/hooks/useShapes/area/index.js +4 -2
- package/dist/cjs/hooks/useShapes/area/prepare-data.d.ts +3 -3
- package/dist/cjs/hooks/useShapes/area/prepare-data.js +37 -22
- package/dist/cjs/hooks/useShapes/area/types.d.ts +5 -2
- package/dist/cjs/hooks/useShapes/bar-x/index.d.ts +3 -3
- package/dist/cjs/hooks/useShapes/bar-x/index.js +2 -2
- package/dist/cjs/hooks/useShapes/bar-x/prepare-data.d.ts +3 -3
- package/dist/cjs/hooks/useShapes/bar-x/prepare-data.js +26 -15
- package/dist/cjs/hooks/useShapes/bar-y/index.d.ts +4 -4
- package/dist/cjs/hooks/useShapes/bar-y/index.js +21 -24
- package/dist/cjs/hooks/useShapes/bar-y/prepare-data.d.ts +3 -3
- package/dist/cjs/hooks/useShapes/bar-y/prepare-data.js +26 -8
- package/dist/cjs/hooks/useShapes/bar-y/types.d.ts +2 -2
- package/dist/cjs/hooks/useShapes/bar-y/utils.d.ts +3 -0
- package/dist/cjs/hooks/useShapes/bar-y/utils.js +44 -0
- package/dist/cjs/hooks/useShapes/funnel/index.d.ts +13 -0
- package/dist/cjs/hooks/useShapes/funnel/index.js +95 -0
- package/dist/cjs/hooks/useShapes/funnel/prepare-data.d.ts +9 -0
- package/dist/cjs/hooks/useShapes/funnel/prepare-data.js +120 -0
- package/dist/cjs/hooks/useShapes/funnel/types.d.ts +32 -0
- package/dist/cjs/hooks/useShapes/funnel/types.js +1 -0
- package/dist/cjs/hooks/useShapes/heatmap/index.d.ts +2 -2
- package/dist/cjs/hooks/useShapes/heatmap/index.js +2 -2
- package/dist/cjs/hooks/useShapes/heatmap/prepare-data.d.ts +3 -3
- package/dist/cjs/hooks/useShapes/heatmap/prepare-data.js +7 -3
- package/dist/cjs/hooks/useShapes/index.d.ts +15 -10
- package/dist/cjs/hooks/useShapes/index.js +47 -25
- package/dist/cjs/hooks/useShapes/line/index.d.ts +3 -3
- package/dist/cjs/hooks/useShapes/line/index.js +3 -2
- package/dist/cjs/hooks/useShapes/line/prepare-data.d.ts +3 -3
- package/dist/cjs/hooks/useShapes/line/prepare-data.js +58 -44
- package/dist/cjs/hooks/useShapes/line/types.d.ts +7 -3
- package/dist/cjs/hooks/useShapes/pie/index.d.ts +2 -2
- package/dist/cjs/hooks/useShapes/pie/index.js +2 -2
- package/dist/cjs/hooks/useShapes/pie/prepare-data.js +8 -4
- package/dist/cjs/hooks/useShapes/radar/index.d.ts +2 -2
- package/dist/cjs/hooks/useShapes/radar/index.js +2 -2
- package/dist/cjs/hooks/useShapes/sankey/index.d.ts +2 -2
- package/dist/cjs/hooks/useShapes/sankey/index.js +2 -2
- package/dist/cjs/hooks/useShapes/scatter/index.d.ts +3 -2
- package/dist/cjs/hooks/useShapes/scatter/index.js +4 -4
- package/dist/cjs/hooks/useShapes/scatter/prepare-data.d.ts +3 -3
- package/dist/cjs/hooks/useShapes/scatter/prepare-data.js +1 -1
- package/dist/cjs/hooks/useShapes/styles.css +8 -0
- package/dist/cjs/hooks/useShapes/treemap/index.d.ts +2 -2
- package/dist/cjs/hooks/useShapes/treemap/index.js +2 -2
- package/dist/cjs/hooks/useShapes/utils.d.ts +17 -9
- package/dist/cjs/hooks/useShapes/utils.js +66 -18
- package/dist/cjs/hooks/useShapes/waterfall/index.d.ts +3 -3
- package/dist/cjs/hooks/useShapes/waterfall/index.js +2 -2
- package/dist/cjs/hooks/useShapes/waterfall/prepare-data.d.ts +3 -3
- package/dist/cjs/hooks/useShapes/waterfall/prepare-data.js +18 -8
- package/dist/cjs/hooks/useTooltip/index.js +8 -4
- package/dist/cjs/hooks/useZoom/index.d.ts +4 -3
- package/dist/cjs/hooks/useZoom/index.js +2 -0
- package/dist/cjs/hooks/useZoom/utils.d.ts +5 -4
- package/dist/cjs/hooks/useZoom/utils.js +4 -3
- package/dist/cjs/hooks/utils/bar-x.d.ts +2 -2
- package/dist/cjs/hooks/utils/bar-y.d.ts +10 -3
- package/dist/cjs/hooks/utils/bar-y.js +4 -0
- package/dist/cjs/i18n/keysets/en.json +2 -2
- package/dist/cjs/i18n/keysets/ru.json +2 -2
- package/dist/cjs/types/chart/area.d.ts +18 -3
- package/dist/cjs/types/chart/axis.d.ts +45 -0
- package/dist/cjs/types/chart/bar-x.d.ts +17 -4
- package/dist/cjs/types/chart/bar-y.d.ts +12 -3
- package/dist/cjs/types/chart/base.d.ts +26 -25
- package/dist/cjs/types/chart/brush.d.ts +22 -0
- package/dist/cjs/types/chart/brush.js +1 -0
- package/dist/cjs/types/chart/funnel.d.ts +46 -0
- package/dist/cjs/types/chart/funnel.js +1 -0
- package/dist/cjs/types/chart/heatmap.d.ts +12 -3
- package/dist/cjs/types/chart/legend.d.ts +6 -0
- package/dist/cjs/types/chart/line.d.ts +18 -3
- package/dist/cjs/types/chart/pie.d.ts +12 -3
- package/dist/cjs/types/chart/radar.d.ts +2 -2
- package/dist/cjs/types/chart/sankey.d.ts +2 -2
- package/dist/cjs/types/chart/scatter.d.ts +18 -4
- package/dist/cjs/types/chart/series.d.ts +17 -2
- package/dist/cjs/types/chart/tooltip.d.ts +10 -2
- package/dist/cjs/types/chart/treemap.d.ts +2 -2
- package/dist/cjs/types/chart/waterfall.d.ts +12 -3
- package/dist/cjs/types/chart/zoom.d.ts +4 -6
- package/dist/cjs/types/index.d.ts +2 -0
- package/dist/cjs/types/index.js +2 -0
- package/dist/cjs/types/misc.d.ts +6 -0
- package/dist/cjs/utils/chart/axis.d.ts +5 -2
- package/dist/cjs/utils/chart/axis.js +47 -1
- package/dist/cjs/utils/chart/color.js +2 -1
- package/dist/cjs/utils/chart/get-closest-data.js +30 -8
- package/dist/cjs/utils/chart/index.js +3 -3
- package/dist/cjs/utils/chart/series/sorting.js +20 -7
- package/dist/cjs/utils/chart/zoom.d.ts +3 -3
- package/dist/cjs/utils/chart/zoom.js +6 -4
- package/dist/cjs/validation/index.js +6 -6
- package/dist/esm/components/AxisX/AxisX.d.ts +3 -3
- package/dist/esm/components/ChartInner/index.js +94 -27
- package/dist/esm/components/ChartInner/useChartInnerHandlers.d.ts +3 -3
- package/dist/esm/components/ChartInner/useChartInnerProps.d.ts +41 -20
- package/dist/esm/components/ChartInner/useChartInnerProps.js +21 -9
- package/dist/esm/components/ChartInner/useChartInnerState.d.ts +6 -1
- package/dist/esm/components/ChartInner/useChartInnerState.js +17 -1
- package/dist/esm/components/ChartInner/utils.d.ts +5 -2
- package/dist/esm/components/ChartInner/utils.js +13 -0
- package/dist/esm/components/RangeSlider/index.d.ts +6 -0
- package/dist/esm/components/RangeSlider/index.js +41 -0
- package/dist/esm/components/RangeSlider/styles.css +6 -0
- package/dist/esm/components/RangeSlider/utils.d.ts +5 -0
- package/dist/esm/components/RangeSlider/utils.js +18 -0
- package/dist/esm/components/Tooltip/DefaultTooltipContent/index.js +2 -1
- package/dist/esm/components/Tooltip/DefaultTooltipContent/utils.d.ts +2 -2
- package/dist/esm/components/Tooltip/DefaultTooltipContent/utils.js +3 -2
- package/dist/esm/components/Tooltip/index.d.ts +3 -3
- package/dist/esm/constants/chart-types.d.ts +3 -1
- package/dist/esm/constants/chart-types.js +2 -1
- package/dist/esm/constants/defaults/brush.d.ts +2 -0
- package/dist/esm/constants/defaults/brush.js +15 -0
- package/dist/esm/constants/defaults/index.d.ts +1 -0
- package/dist/esm/constants/defaults/index.js +1 -0
- package/dist/esm/constants/defaults/series-options.d.ts +2 -1
- package/dist/esm/constants/defaults/series-options.js +11 -0
- package/dist/esm/constants/index.d.ts +1 -0
- package/dist/esm/constants/index.js +1 -0
- package/dist/esm/constants/zoom.d.ts +6 -0
- package/dist/esm/constants/zoom.js +5 -0
- package/dist/esm/hooks/index.d.ts +5 -0
- package/dist/esm/hooks/index.js +5 -0
- package/dist/esm/hooks/useAxis/index.d.ts +4 -3
- package/dist/esm/hooks/useAxis/index.js +2 -2
- package/dist/esm/hooks/useAxis/range-slider.d.ts +5 -0
- package/dist/esm/hooks/useAxis/range-slider.js +16 -0
- package/dist/esm/hooks/useAxis/types.d.ts +66 -0
- package/dist/esm/hooks/useAxis/types.js +1 -0
- package/dist/esm/hooks/{useChartOptions → useAxis}/utils.d.ts +1 -2
- package/dist/esm/hooks/useAxis/utils.js +9 -0
- package/dist/{cjs/hooks/useChartOptions → esm/hooks/useAxis}/x-axis.d.ts +2 -2
- package/dist/{cjs/hooks/useChartOptions → esm/hooks/useAxis}/x-axis.js +5 -3
- package/dist/esm/hooks/{useChartOptions → useAxis}/y-axis.d.ts +2 -2
- package/dist/esm/hooks/{useChartOptions → useAxis}/y-axis.js +3 -3
- package/dist/esm/hooks/useAxisScales/index.d.ts +3 -3
- package/dist/esm/hooks/useAxisScales/index.js +41 -15
- package/dist/esm/hooks/useBrush/index.js +87 -24
- package/dist/esm/hooks/useBrush/styles.css +1 -0
- package/dist/esm/hooks/useBrush/types.d.ts +8 -7
- package/dist/esm/hooks/useBrush/utils.d.ts +19 -0
- package/dist/esm/hooks/useBrush/utils.js +172 -0
- package/dist/esm/hooks/useChartDimensions/index.d.ts +4 -4
- package/dist/esm/hooks/useChartDimensions/index.js +14 -4
- package/dist/esm/hooks/useChartDimensions/utils.d.ts +4 -4
- package/dist/esm/hooks/useChartOptions/chart.js +1 -82
- package/dist/esm/hooks/useChartOptions/index.d.ts +9 -3
- package/dist/esm/hooks/useChartOptions/tooltip.js +1 -1
- package/dist/esm/hooks/useChartOptions/types.d.ts +4 -64
- package/dist/esm/hooks/useChartOptions/zoom.d.ts +11 -0
- package/dist/esm/hooks/useChartOptions/zoom.js +91 -0
- package/dist/esm/hooks/useCrosshair/index.d.ts +3 -3
- package/dist/esm/hooks/useNormalizedOriginalData/index.d.ts +1 -0
- package/dist/esm/hooks/useNormalizedOriginalData/index.js +1 -2
- package/dist/esm/hooks/useRangeSlider/index.d.ts +4 -0
- package/dist/esm/hooks/useRangeSlider/index.js +129 -0
- package/dist/esm/hooks/useRangeSlider/types.d.ts +42 -0
- package/dist/esm/hooks/useRangeSlider/types.js +1 -0
- package/dist/esm/hooks/useRangeSlider/utils.d.ts +16 -0
- package/dist/esm/hooks/useRangeSlider/utils.js +19 -0
- package/dist/esm/hooks/useSeries/prepare-area.js +17 -2
- package/dist/esm/hooks/useSeries/prepare-bar-x.js +21 -9
- package/dist/esm/hooks/useSeries/prepare-bar-y.d.ts +3 -2
- package/dist/esm/hooks/useSeries/prepare-bar-y.js +20 -7
- package/dist/esm/hooks/useSeries/prepare-funnel.d.ts +10 -0
- package/dist/esm/hooks/useSeries/prepare-funnel.js +50 -0
- package/dist/esm/hooks/useSeries/prepare-heatmap.js +13 -1
- package/dist/esm/hooks/useSeries/prepare-legend.js +5 -2
- package/dist/esm/hooks/useSeries/prepare-line.js +17 -2
- package/dist/esm/hooks/useSeries/prepare-pie.js +17 -3
- package/dist/esm/hooks/useSeries/prepare-scatter.js +18 -1
- package/dist/esm/hooks/useSeries/prepare-waterfall.js +18 -2
- package/dist/esm/hooks/useSeries/prepareSeries.js +9 -0
- package/dist/esm/hooks/useSeries/types.d.ts +22 -6
- package/dist/esm/hooks/useShapes/area/index.d.ts +3 -3
- package/dist/esm/hooks/useShapes/area/index.js +4 -2
- package/dist/esm/hooks/useShapes/area/prepare-data.d.ts +3 -3
- package/dist/esm/hooks/useShapes/area/prepare-data.js +37 -22
- package/dist/esm/hooks/useShapes/area/types.d.ts +5 -2
- package/dist/esm/hooks/useShapes/bar-x/index.d.ts +3 -3
- package/dist/esm/hooks/useShapes/bar-x/index.js +2 -2
- package/dist/esm/hooks/useShapes/bar-x/prepare-data.d.ts +3 -3
- package/dist/esm/hooks/useShapes/bar-x/prepare-data.js +26 -15
- package/dist/esm/hooks/useShapes/bar-y/index.d.ts +4 -4
- package/dist/esm/hooks/useShapes/bar-y/index.js +21 -24
- package/dist/esm/hooks/useShapes/bar-y/prepare-data.d.ts +3 -3
- package/dist/esm/hooks/useShapes/bar-y/prepare-data.js +26 -8
- package/dist/esm/hooks/useShapes/bar-y/types.d.ts +2 -2
- package/dist/esm/hooks/useShapes/bar-y/utils.d.ts +3 -0
- package/dist/esm/hooks/useShapes/bar-y/utils.js +44 -0
- package/dist/esm/hooks/useShapes/funnel/index.d.ts +13 -0
- package/dist/esm/hooks/useShapes/funnel/index.js +95 -0
- package/dist/esm/hooks/useShapes/funnel/prepare-data.d.ts +9 -0
- package/dist/esm/hooks/useShapes/funnel/prepare-data.js +120 -0
- package/dist/esm/hooks/useShapes/funnel/types.d.ts +32 -0
- package/dist/esm/hooks/useShapes/funnel/types.js +1 -0
- package/dist/esm/hooks/useShapes/heatmap/index.d.ts +2 -2
- package/dist/esm/hooks/useShapes/heatmap/index.js +2 -2
- package/dist/esm/hooks/useShapes/heatmap/prepare-data.d.ts +3 -3
- package/dist/esm/hooks/useShapes/heatmap/prepare-data.js +7 -3
- package/dist/esm/hooks/useShapes/index.d.ts +15 -10
- package/dist/esm/hooks/useShapes/index.js +47 -25
- package/dist/esm/hooks/useShapes/line/index.d.ts +3 -3
- package/dist/esm/hooks/useShapes/line/index.js +3 -2
- package/dist/esm/hooks/useShapes/line/prepare-data.d.ts +3 -3
- package/dist/esm/hooks/useShapes/line/prepare-data.js +58 -44
- package/dist/esm/hooks/useShapes/line/types.d.ts +7 -3
- package/dist/esm/hooks/useShapes/pie/index.d.ts +2 -2
- package/dist/esm/hooks/useShapes/pie/index.js +2 -2
- package/dist/esm/hooks/useShapes/pie/prepare-data.js +8 -4
- package/dist/esm/hooks/useShapes/radar/index.d.ts +2 -2
- package/dist/esm/hooks/useShapes/radar/index.js +2 -2
- package/dist/esm/hooks/useShapes/sankey/index.d.ts +2 -2
- package/dist/esm/hooks/useShapes/sankey/index.js +2 -2
- package/dist/esm/hooks/useShapes/scatter/index.d.ts +3 -2
- package/dist/esm/hooks/useShapes/scatter/index.js +4 -4
- package/dist/esm/hooks/useShapes/scatter/prepare-data.d.ts +3 -3
- package/dist/esm/hooks/useShapes/scatter/prepare-data.js +1 -1
- package/dist/esm/hooks/useShapes/styles.css +8 -0
- package/dist/esm/hooks/useShapes/treemap/index.d.ts +2 -2
- package/dist/esm/hooks/useShapes/treemap/index.js +2 -2
- package/dist/esm/hooks/useShapes/utils.d.ts +17 -9
- package/dist/esm/hooks/useShapes/utils.js +66 -18
- package/dist/esm/hooks/useShapes/waterfall/index.d.ts +3 -3
- package/dist/esm/hooks/useShapes/waterfall/index.js +2 -2
- package/dist/esm/hooks/useShapes/waterfall/prepare-data.d.ts +3 -3
- package/dist/esm/hooks/useShapes/waterfall/prepare-data.js +18 -8
- package/dist/esm/hooks/useTooltip/index.js +8 -4
- package/dist/esm/hooks/useZoom/index.d.ts +4 -3
- package/dist/esm/hooks/useZoom/index.js +2 -0
- package/dist/esm/hooks/useZoom/utils.d.ts +5 -4
- package/dist/esm/hooks/useZoom/utils.js +4 -3
- package/dist/esm/hooks/utils/bar-x.d.ts +2 -2
- package/dist/esm/hooks/utils/bar-y.d.ts +10 -3
- package/dist/esm/hooks/utils/bar-y.js +4 -0
- package/dist/esm/i18n/keysets/en.json +2 -2
- package/dist/esm/i18n/keysets/ru.json +2 -2
- package/dist/esm/types/chart/area.d.ts +18 -3
- package/dist/esm/types/chart/axis.d.ts +45 -0
- package/dist/esm/types/chart/bar-x.d.ts +17 -4
- package/dist/esm/types/chart/bar-y.d.ts +12 -3
- package/dist/esm/types/chart/base.d.ts +26 -25
- package/dist/esm/types/chart/brush.d.ts +22 -0
- package/dist/esm/types/chart/brush.js +1 -0
- package/dist/esm/types/chart/funnel.d.ts +46 -0
- package/dist/esm/types/chart/funnel.js +1 -0
- package/dist/esm/types/chart/heatmap.d.ts +12 -3
- package/dist/esm/types/chart/legend.d.ts +6 -0
- package/dist/esm/types/chart/line.d.ts +18 -3
- package/dist/esm/types/chart/pie.d.ts +12 -3
- package/dist/esm/types/chart/radar.d.ts +2 -2
- package/dist/esm/types/chart/sankey.d.ts +2 -2
- package/dist/esm/types/chart/scatter.d.ts +18 -4
- package/dist/esm/types/chart/series.d.ts +17 -2
- package/dist/esm/types/chart/tooltip.d.ts +10 -2
- package/dist/esm/types/chart/treemap.d.ts +2 -2
- package/dist/esm/types/chart/waterfall.d.ts +12 -3
- package/dist/esm/types/chart/zoom.d.ts +4 -6
- package/dist/esm/types/index.d.ts +2 -0
- package/dist/esm/types/index.js +2 -0
- package/dist/esm/types/misc.d.ts +6 -0
- package/dist/esm/utils/chart/axis.d.ts +5 -2
- package/dist/esm/utils/chart/axis.js +47 -1
- package/dist/esm/utils/chart/color.js +2 -1
- package/dist/esm/utils/chart/get-closest-data.js +30 -8
- package/dist/esm/utils/chart/index.js +3 -3
- package/dist/esm/utils/chart/series/sorting.js +20 -7
- package/dist/esm/utils/chart/zoom.d.ts +3 -3
- package/dist/esm/utils/chart/zoom.js +6 -4
- package/dist/esm/validation/index.js +6 -6
- package/package.json +1 -1
- package/dist/cjs/hooks/useChartOptions/utils.js +0 -49
- package/dist/esm/hooks/useChartOptions/utils.js +0 -49
|
@@ -6,13 +6,14 @@ export const useTooltip = ({ dispatcher, tooltip }) => {
|
|
|
6
6
|
React.useEffect(() => {
|
|
7
7
|
if (tooltip === null || tooltip === void 0 ? void 0 : tooltip.enabled) {
|
|
8
8
|
dispatcher.on('hover-shape.tooltip', (nextHovered, nextPointerPosition) => {
|
|
9
|
-
const
|
|
9
|
+
const filteredNextHovered = nextHovered === null || nextHovered === void 0 ? void 0 : nextHovered.filter((item) => 'y' in item.data ? item.data.y !== null : true);
|
|
10
|
+
const isHoveredChanged = !isEqual(prevHovered.current, filteredNextHovered);
|
|
10
11
|
const newTooltipState = {
|
|
11
12
|
pointerPosition: nextPointerPosition,
|
|
12
|
-
hovered: isHoveredChanged ?
|
|
13
|
+
hovered: isHoveredChanged ? filteredNextHovered : prevHovered.current,
|
|
13
14
|
};
|
|
14
15
|
if (isHoveredChanged) {
|
|
15
|
-
prevHovered.current =
|
|
16
|
+
prevHovered.current = filteredNextHovered;
|
|
16
17
|
}
|
|
17
18
|
setTooltipState(newTooltipState);
|
|
18
19
|
});
|
|
@@ -23,5 +24,8 @@ export const useTooltip = ({ dispatcher, tooltip }) => {
|
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
26
|
}, [dispatcher, tooltip]);
|
|
26
|
-
return {
|
|
27
|
+
return {
|
|
28
|
+
hovered,
|
|
29
|
+
pointerPosition,
|
|
30
|
+
};
|
|
27
31
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { PreparedXAxis, PreparedYAxis } from '../useAxis/types';
|
|
1
2
|
import type { ChartScale } from '../useAxisScales';
|
|
2
|
-
import type {
|
|
3
|
+
import type { PreparedZoom } from '../useChartOptions/types';
|
|
3
4
|
import type { PreparedSplit } from '../useSplit/types';
|
|
4
5
|
import type { ZoomState } from './types';
|
|
5
6
|
interface UseZoomProps {
|
|
@@ -9,9 +10,9 @@ interface UseZoomProps {
|
|
|
9
10
|
plotContainerWidth: number;
|
|
10
11
|
preparedSplit: PreparedSplit;
|
|
11
12
|
preparedZoom: PreparedZoom | null;
|
|
12
|
-
xAxis:
|
|
13
|
+
xAxis: PreparedXAxis | null;
|
|
13
14
|
xScale?: ChartScale;
|
|
14
|
-
yAxis:
|
|
15
|
+
yAxis: PreparedYAxis[];
|
|
15
16
|
yScale?: (ChartScale | undefined)[];
|
|
16
17
|
}
|
|
17
18
|
export declare function useZoom(props: UseZoomProps): void;
|
|
@@ -4,6 +4,7 @@ import { useBrush } from '../useBrush';
|
|
|
4
4
|
import { selectionToZoomBounds } from './utils';
|
|
5
5
|
export function useZoom(props) {
|
|
6
6
|
const { node, onUpdate, plotContainerHeight, plotContainerWidth, preparedSplit, preparedZoom, xAxis, xScale, yAxis, yScale, } = props;
|
|
7
|
+
const isBrushDisabled = Boolean(!xAxis || !yAxis || !xScale || !yScale);
|
|
7
8
|
const areas = React.useMemo(() => {
|
|
8
9
|
const result = [];
|
|
9
10
|
if (!preparedZoom) {
|
|
@@ -47,6 +48,7 @@ export function useZoom(props) {
|
|
|
47
48
|
useBrush({
|
|
48
49
|
areas,
|
|
49
50
|
brushOptions: preparedZoom === null || preparedZoom === void 0 ? void 0 : preparedZoom.brush,
|
|
51
|
+
disabled: isBrushDisabled,
|
|
50
52
|
node,
|
|
51
53
|
type: preparedZoom === null || preparedZoom === void 0 ? void 0 : preparedZoom.type,
|
|
52
54
|
onBrushEnd: handleChartBrushEnd,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { BrushSelection } from 'd3';
|
|
2
|
+
import type { ZoomType } from '../../constants';
|
|
3
|
+
import type { PreparedXAxis, PreparedYAxis } from '../useAxis/types';
|
|
2
4
|
import type { ChartScale } from '../useAxisScales';
|
|
3
|
-
import type { PreparedAxis, PreparedZoom } from '../useChartOptions/types';
|
|
4
5
|
import type { ZoomState } from './types';
|
|
5
6
|
export declare function selectionToZoomBounds(args: {
|
|
6
7
|
selection: BrushSelection;
|
|
7
|
-
xAxis:
|
|
8
|
+
xAxis: PreparedXAxis;
|
|
8
9
|
xScale: ChartScale;
|
|
9
|
-
yAxes:
|
|
10
|
+
yAxes: PreparedYAxis[];
|
|
10
11
|
yScales: (ChartScale | undefined)[];
|
|
11
|
-
zoomType:
|
|
12
|
+
zoomType: ZoomType;
|
|
12
13
|
}): Partial<ZoomState>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { ZOOM_TYPE } from '../../constants';
|
|
1
2
|
export function selectionToZoomBounds(args) {
|
|
2
3
|
const { selection, xAxis, xScale, yAxes, yScales, zoomType } = args;
|
|
3
4
|
const zoomState = {};
|
|
4
5
|
switch (zoomType) {
|
|
5
|
-
case
|
|
6
|
+
case ZOOM_TYPE.X: {
|
|
6
7
|
const [x0, x1] = selection;
|
|
7
8
|
zoomState.x = selectionXToZoomBounds({ xAxis, xScale, selection: [x0, x1] });
|
|
8
9
|
break;
|
|
9
10
|
}
|
|
10
|
-
case
|
|
11
|
+
case ZOOM_TYPE.Y: {
|
|
11
12
|
const [y1, y0] = selection;
|
|
12
13
|
yAxes.forEach((yAxis, index) => {
|
|
13
14
|
if (!Array.isArray(zoomState.y)) {
|
|
@@ -27,7 +28,7 @@ export function selectionToZoomBounds(args) {
|
|
|
27
28
|
});
|
|
28
29
|
break;
|
|
29
30
|
}
|
|
30
|
-
case
|
|
31
|
+
case ZOOM_TYPE.XY: {
|
|
31
32
|
const [x0, y0] = selection[0];
|
|
32
33
|
const [x1, y1] = selection[1];
|
|
33
34
|
zoomState.x = selectionXToZoomBounds({ xAxis, xScale, selection: [x0, x1] });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BarXSeries, BarXSeriesData } from '../../types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PreparedXAxis } from '../useAxis/types';
|
|
3
3
|
import type { PreparedBarXSeries, PreparedSeriesOptions } from '../useSeries/types';
|
|
4
|
-
export declare function groupBarXDataByXValue<T extends BarXSeries | PreparedBarXSeries>(series: T[], xAxis:
|
|
4
|
+
export declare function groupBarXDataByXValue<T extends BarXSeries | PreparedBarXSeries>(series: T[], xAxis: PreparedXAxis): Record<string | number, Record<string, {
|
|
5
5
|
data: BarXSeriesData;
|
|
6
6
|
series: T;
|
|
7
7
|
}[]>>;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { BarYSeries, BarYSeriesData } from '../../types';
|
|
2
|
+
import type { PreparedYAxis } from '../useAxis/types';
|
|
2
3
|
import type { ChartScale } from '../useAxisScales';
|
|
3
|
-
import type { PreparedAxis } from '../useChartOptions/types';
|
|
4
4
|
import type { PreparedBarYSeries, PreparedSeriesOptions } from '../useSeries/types';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* BarY always filters out data with null or replace null by zero.
|
|
7
|
+
*/
|
|
8
|
+
type PreparedBarYSeriesData = BarYSeriesData & {
|
|
9
|
+
x?: number | string;
|
|
10
|
+
};
|
|
11
|
+
export declare function groupBarYDataByYValue<T extends BarYSeries | PreparedBarYSeries>(series: T[], yAxis: PreparedYAxis[]): Record<string | number, Record<string, {
|
|
12
|
+
data: PreparedBarYSeriesData;
|
|
7
13
|
series: T;
|
|
8
14
|
}[]>>;
|
|
9
15
|
export declare function getBarYLayout(args: {
|
|
@@ -16,3 +22,4 @@ export declare function getBarYLayout(args: {
|
|
|
16
22
|
barGap: number;
|
|
17
23
|
barSize: number;
|
|
18
24
|
};
|
|
25
|
+
export {};
|
|
@@ -4,10 +4,14 @@ import { getDataCategoryValue } from '../../utils';
|
|
|
4
4
|
import { MIN_BAR_GAP, MIN_BAR_GROUP_GAP, MIN_BAR_WIDTH } from '../constants';
|
|
5
5
|
import { getSeriesStackId } from '../useSeries/utils';
|
|
6
6
|
import { getBandSize } from './get-band-size';
|
|
7
|
+
const isSeriesDataValid = (d) => d.x !== null;
|
|
7
8
|
export function groupBarYDataByYValue(series, yAxis) {
|
|
8
9
|
const data = {};
|
|
9
10
|
series.forEach((s) => {
|
|
10
11
|
s.data.forEach((d) => {
|
|
12
|
+
if (!isSeriesDataValid(d)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
11
15
|
const axisIndex = get(s, 'yAxis', 0);
|
|
12
16
|
const seriesYAxis = yAxis[axisIndex];
|
|
13
17
|
const categories = get(seriesYAxis, 'categories', []);
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"label_unknown-plugin": "Unknown plugin type \"{{type}}\"",
|
|
5
5
|
"label_unknown-error": "Unknown error",
|
|
6
6
|
"label_invalid-axis-category-data-point": "It seems you are trying to use inappropriate data type for \"{{key}}\" value in series \"{{seriesName}}\" for axis with type \"category\". Strings and numbers are allowed.",
|
|
7
|
-
"label_invalid-axis-datetime-data-point": "It seems you are trying to use inappropriate data type for \"{{key}}\" value in series \"{{seriesName}}\" for axis with type \"datetime\".
|
|
7
|
+
"label_invalid-axis-datetime-data-point": "It seems you are trying to use inappropriate data type for \"{{key}}\" value in series \"{{seriesName}}\" for axis with type \"datetime\". Numbers are allowed.",
|
|
8
8
|
"label_invalid-axis-linear-data-point": "It seems you are trying to use inappropriate data type for \"{{key}}\" value in series \"{{seriesName}}\" for axis with type \"linear\". Numbers and nulls are allowed.",
|
|
9
|
-
"label_invalid-pie-data-value": "It seems you are trying to use inappropriate data type for \"value\" value. Only numbers are allowed.",
|
|
9
|
+
"label_invalid-pie-data-value": "It seems you are trying to use inappropriate data type for \"value\" value. Only numbers or nulls are allowed.",
|
|
10
10
|
"label_invalid-series-type": "It seems you haven't defined \"series.type\" property, or defined it incorrectly. Available values: [{{types}}].",
|
|
11
11
|
"label_invalid-series-property": "It seems you are trying to use inappropriate value for \"{{key}}\", or defined it incorrectly. Available values: [{{values}}].",
|
|
12
12
|
"label_invalid-treemap-redundant-value": "It seems you are trying to set \"value\" for container node. Check node with this properties: { id: \"{{id}}\", name: \"{{name}}\" }",
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"label_unknown-plugin": "Неизвестный тип плагина \"{{type}}\"",
|
|
5
5
|
"label_unknown-error": "Неизвестная ошибка",
|
|
6
6
|
"label_invalid-axis-category-data-point": "Похоже, что вы пытаетесь использовать недопустимый тип данных для значения \"{{key}}\" в серии \"{{seriesName}}\" для оси с типом \"category\". Допускается использование строк и чисел.",
|
|
7
|
-
"label_invalid-axis-datetime-data-point": "Похоже, что вы пытаетесь использовать недопустимый тип данных для значения \"{{key}}\" в серии \"{{seriesName}}\" для оси с типом \"datetime\". Допускается
|
|
7
|
+
"label_invalid-axis-datetime-data-point": "Похоже, что вы пытаетесь использовать недопустимый тип данных для значения \"{{key}}\" в серии \"{{seriesName}}\" для оси с типом \"datetime\". Допускается использование чисел.",
|
|
8
8
|
"label_invalid-axis-linear-data-point": "Похоже, что вы пытаетесь использовать недопустимый тип данных для значения \"{{key}}\" в серии \"{{seriesName}}\" для оси с типом \"linear\". Допускается использование чисел и значений null.",
|
|
9
|
-
"label_invalid-pie-data-value": "Похоже, что вы пытаетесь использовать недопустимый тип данных для значения \"value\". Допускается только использование
|
|
9
|
+
"label_invalid-pie-data-value": "Похоже, что вы пытаетесь использовать недопустимый тип данных для значения \"value\". Допускается только использование чисел или null.",
|
|
10
10
|
"label_invalid-series-type": "Похоже, что вы не указали значение \"series.type\" или указали его неверно. Доступные значения: [{{types}}].",
|
|
11
11
|
"label_invalid-series-property": "Похоже, что вы пытаетесь использовать недопустимое значение для \"{{key}}\", или указали его неверно. Доступные значения: [{{values}}].",
|
|
12
12
|
"label_invalid-treemap-redundant-value": "Похоже, что вы пытаетесь установить значение \"value\" для узла, используемого в качестве контейнера. Проверьте узел с этими свойствами: { id: \"{{id}}\", name: \"{{name}}\" }",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SERIES_TYPE } from '../../constants';
|
|
2
2
|
import type { MeaningfulAny } from '../misc';
|
|
3
3
|
import type { BaseSeries, BaseSeriesData } from './base';
|
|
4
4
|
import type { ChartLegend, RectLegendSymbolOptions } from './legend';
|
|
5
5
|
import type { PointMarkerOptions } from './marker';
|
|
6
|
+
import type { ChartSeriesRangeSliderOptions } from './series';
|
|
6
7
|
export interface AreaSeriesData<T = MeaningfulAny> extends BaseSeriesData<T> {
|
|
7
8
|
/**
|
|
8
9
|
* The `x` value of the point. Depending on the context , it may represents:
|
|
@@ -17,7 +18,7 @@ export interface AreaSeriesData<T = MeaningfulAny> extends BaseSeriesData<T> {
|
|
|
17
18
|
* - timestamp value (for `datetime` y axis)
|
|
18
19
|
* - y axis category value (for `category` y axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `yAxis[0].categories`
|
|
19
20
|
*/
|
|
20
|
-
y?: string | number;
|
|
21
|
+
y?: string | number | null;
|
|
21
22
|
/** Data label value of the point. If not specified, the y value is used. */
|
|
22
23
|
label?: string | number;
|
|
23
24
|
/** Individual marker options for the point. */
|
|
@@ -41,7 +42,7 @@ export interface AreaMarkerOptions extends PointMarkerOptions {
|
|
|
41
42
|
symbol?: AreaMarkerSymbol;
|
|
42
43
|
}
|
|
43
44
|
export interface AreaSeries<T = MeaningfulAny> extends BaseSeries {
|
|
44
|
-
type: typeof
|
|
45
|
+
type: typeof SERIES_TYPE.Area;
|
|
45
46
|
data: AreaSeriesData<T>[];
|
|
46
47
|
/** The name of the series (used in legend, tooltip etc) */
|
|
47
48
|
name: string;
|
|
@@ -73,4 +74,18 @@ export interface AreaSeries<T = MeaningfulAny> extends BaseSeries {
|
|
|
73
74
|
marker?: AreaMarkerOptions;
|
|
74
75
|
/** Y-axis index (when using two axes) */
|
|
75
76
|
yAxis?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Specifies how null or undefined values should be handled in the series.
|
|
79
|
+
*
|
|
80
|
+
* - `'connect'`: Connect points across null values (skip nulls in rendering)
|
|
81
|
+
* - `'zero'`: Treat null values as zero
|
|
82
|
+
* - `'skip'`: Omit the data point (creates gap in area)
|
|
83
|
+
*
|
|
84
|
+
* @default 'skip'
|
|
85
|
+
*/
|
|
86
|
+
nullMode?: 'connect' | 'zero' | 'skip';
|
|
87
|
+
/**
|
|
88
|
+
* Options to configure how this series appears and behaves in the Range Slider component.
|
|
89
|
+
*/
|
|
90
|
+
rangeSlider?: ChartSeriesRangeSliderOptions;
|
|
76
91
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { DurationInput } from '@gravity-ui/date-utils';
|
|
1
2
|
import type { AXIS_TYPE, DashStyle } from '../../constants';
|
|
2
3
|
import type { FormatNumberOptions } from '../formatter';
|
|
3
4
|
import type { BaseTextStyle } from './base';
|
|
5
|
+
import type { ChartBrush } from './brush';
|
|
4
6
|
export type ChartAxisType = (typeof AXIS_TYPE)[keyof typeof AXIS_TYPE];
|
|
5
7
|
export type ChartAxisTitleAlignment = 'left' | 'center' | 'right';
|
|
6
8
|
export interface ChartAxisLabels {
|
|
@@ -40,6 +42,40 @@ export interface ChartAxisLabels {
|
|
|
40
42
|
* */
|
|
41
43
|
maxWidth?: number | string;
|
|
42
44
|
}
|
|
45
|
+
export interface ChartAxisRangeSlider {
|
|
46
|
+
/**
|
|
47
|
+
* Range slider brush configuration.
|
|
48
|
+
*/
|
|
49
|
+
brush?: ChartBrush;
|
|
50
|
+
/**
|
|
51
|
+
* Configuration for the range slider state after the initial chart render.
|
|
52
|
+
*/
|
|
53
|
+
defaultRange?: {
|
|
54
|
+
/**
|
|
55
|
+
* Default size of the range slider.
|
|
56
|
+
*
|
|
57
|
+
* The value type depends on the axis scale:
|
|
58
|
+
* - For `datetime` axes: {@link https://github.com/gravity-ui/date-utils/blob/8d53ff16a4582831140e75f1305dc6a0112a5ad6/src/typings/duration.ts#L7 DurationInput}
|
|
59
|
+
* - For `linear` and `logarithmic` axes: numeric value
|
|
60
|
+
*/
|
|
61
|
+
size?: DurationInput | number;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Enable or disable the display of range slider
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
enabled?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* The height of the range slider in pixels.
|
|
70
|
+
* @default 40
|
|
71
|
+
*/
|
|
72
|
+
height?: number;
|
|
73
|
+
/**
|
|
74
|
+
* The pixel distance between the range slider and the the X axis or X axis labels.
|
|
75
|
+
* @default 10
|
|
76
|
+
*/
|
|
77
|
+
margin?: number;
|
|
78
|
+
}
|
|
43
79
|
export interface ChartAxis {
|
|
44
80
|
categories?: string[];
|
|
45
81
|
/** Configure a crosshair that follows either the mouse pointer or the hovered point. */
|
|
@@ -124,6 +160,15 @@ export interface ChartAxis {
|
|
|
124
160
|
order?: 'sortAsc' | 'sortDesc' | 'reverse';
|
|
125
161
|
}
|
|
126
162
|
export interface ChartXAxis extends ChartAxis {
|
|
163
|
+
/**
|
|
164
|
+
* Configuration options for the chart range slider component.
|
|
165
|
+
*
|
|
166
|
+
* The range slider allows users to select a specific range of data to display
|
|
167
|
+
* on the chart by adjusting the slider handles.
|
|
168
|
+
*
|
|
169
|
+
* Supported only for `linear`, `datetime`, and `logarithmic` axes.
|
|
170
|
+
*/
|
|
171
|
+
rangeSlider?: ChartAxisRangeSlider;
|
|
127
172
|
}
|
|
128
173
|
export type PlotLayerPlacement = 'before' | 'after';
|
|
129
174
|
export interface AxisPlot {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SERIES_TYPE } from '../../constants';
|
|
2
2
|
import type { MeaningfulAny } from '../misc';
|
|
3
3
|
import type { BaseSeries, BaseSeriesData } from './base';
|
|
4
4
|
import type { ChartLegend, RectLegendSymbolOptions } from './legend';
|
|
5
|
-
import type { ChartSeriesOptions } from './series';
|
|
5
|
+
import type { ChartSeriesOptions, ChartSeriesRangeSliderOptions } from './series';
|
|
6
6
|
export interface BarXSeriesData<T = MeaningfulAny> extends BaseSeriesData<T> {
|
|
7
7
|
/**
|
|
8
8
|
* The `x` value of the bar. Depending on the context , it may represents:
|
|
@@ -17,7 +17,7 @@ export interface BarXSeriesData<T = MeaningfulAny> extends BaseSeriesData<T> {
|
|
|
17
17
|
* - timestamp value (for `datetime` y axis)
|
|
18
18
|
* - y axis category value (for `category` y axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `yAxis[0].categories`
|
|
19
19
|
*/
|
|
20
|
-
y?: string | number;
|
|
20
|
+
y?: string | number | null;
|
|
21
21
|
/**
|
|
22
22
|
* Corresponding value of axis category.
|
|
23
23
|
*
|
|
@@ -30,7 +30,7 @@ export interface BarXSeriesData<T = MeaningfulAny> extends BaseSeriesData<T> {
|
|
|
30
30
|
opacity?: number;
|
|
31
31
|
}
|
|
32
32
|
export interface BarXSeries<T = MeaningfulAny> extends BaseSeries {
|
|
33
|
-
type: typeof
|
|
33
|
+
type: typeof SERIES_TYPE.BarX;
|
|
34
34
|
data: BarXSeriesData<T>[];
|
|
35
35
|
/** The name of the series (used in legend, tooltip etc) */
|
|
36
36
|
name: string;
|
|
@@ -69,4 +69,17 @@ export interface BarXSeries<T = MeaningfulAny> extends BaseSeries {
|
|
|
69
69
|
};
|
|
70
70
|
/** Y-axis index (when using two axes) */
|
|
71
71
|
yAxis?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Specifies how null or undefined values should be handled in the series.
|
|
74
|
+
*
|
|
75
|
+
* - `'skip'`: Omit data points with null values (no bar shown)
|
|
76
|
+
* - `'zero'`: Treat null values as zero
|
|
77
|
+
*
|
|
78
|
+
* @default 'skip'
|
|
79
|
+
*/
|
|
80
|
+
nullMode?: 'zero' | 'skip';
|
|
81
|
+
/**
|
|
82
|
+
* Options to configure how this series appears and behaves in the Range Slider component.
|
|
83
|
+
*/
|
|
84
|
+
rangeSlider?: ChartSeriesRangeSliderOptions;
|
|
72
85
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SERIES_TYPE } from '../../constants';
|
|
2
2
|
import type { MeaningfulAny } from '../misc';
|
|
3
3
|
import type { BaseSeries, BaseSeriesData } from './base';
|
|
4
4
|
import type { ChartLegend, RectLegendSymbolOptions } from './legend';
|
|
@@ -9,7 +9,7 @@ export interface BarYSeriesData<T = MeaningfulAny> extends BaseSeriesData<T> {
|
|
|
9
9
|
* - timestamp value (for `datetime` x axis)
|
|
10
10
|
* - x axis category value (for `category` x axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `xAxis.categories`
|
|
11
11
|
*/
|
|
12
|
-
x?: string | number;
|
|
12
|
+
x?: string | number | null;
|
|
13
13
|
/**
|
|
14
14
|
* The `y` value of the bar. Depending on the context , it may represents:
|
|
15
15
|
* - numeric value (for `linear` y axis)
|
|
@@ -23,7 +23,7 @@ export interface BarYSeriesData<T = MeaningfulAny> extends BaseSeriesData<T> {
|
|
|
23
23
|
opacity?: number;
|
|
24
24
|
}
|
|
25
25
|
export interface BarYSeries<T = MeaningfulAny> extends BaseSeries {
|
|
26
|
-
type: typeof
|
|
26
|
+
type: typeof SERIES_TYPE.BarY;
|
|
27
27
|
data: BarYSeriesData<T>[];
|
|
28
28
|
/** The name of the series (used in legend, tooltip etc) */
|
|
29
29
|
name: string;
|
|
@@ -71,4 +71,13 @@ export interface BarYSeries<T = MeaningfulAny> extends BaseSeries {
|
|
|
71
71
|
legend?: ChartLegend & {
|
|
72
72
|
symbol?: RectLegendSymbolOptions;
|
|
73
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* Specifies how null or undefined values should be handled in the series.
|
|
76
|
+
*
|
|
77
|
+
* - `'skip'`: Omit data points with null values (no bar shown)
|
|
78
|
+
* - `'zero'`: Treat null values as zero
|
|
79
|
+
*
|
|
80
|
+
* @default 'skip'
|
|
81
|
+
*/
|
|
82
|
+
nullMode?: 'zero' | 'skip';
|
|
74
83
|
}
|
|
@@ -15,37 +15,38 @@ export type CustomFormat = {
|
|
|
15
15
|
}) => string;
|
|
16
16
|
};
|
|
17
17
|
export type ValueFormat = NumberFormat | DateFormat;
|
|
18
|
+
export interface BaseDataLabels {
|
|
19
|
+
/**
|
|
20
|
+
* Enable or disable the data labels
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
enabled?: boolean;
|
|
24
|
+
style?: Partial<BaseTextStyle>;
|
|
25
|
+
/**
|
|
26
|
+
* @default 5
|
|
27
|
+
* */
|
|
28
|
+
padding?: number;
|
|
29
|
+
/**
|
|
30
|
+
* @default false
|
|
31
|
+
* */
|
|
32
|
+
allowOverlap?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Allows to use any html-tags to display the content.
|
|
35
|
+
* The element will be displayed outside the box of the SVG element.
|
|
36
|
+
*
|
|
37
|
+
* @default false
|
|
38
|
+
* */
|
|
39
|
+
html?: boolean;
|
|
40
|
+
/** Formatting settings for labels. */
|
|
41
|
+
format?: ValueFormat;
|
|
42
|
+
}
|
|
18
43
|
export interface BaseSeries {
|
|
19
44
|
/** Initial visibility of the series */
|
|
20
45
|
visible?: boolean;
|
|
21
46
|
/**
|
|
22
47
|
* Options for the series data labels, appearing next to each data point.
|
|
23
48
|
* */
|
|
24
|
-
dataLabels?:
|
|
25
|
-
/**
|
|
26
|
-
* Enable or disable the data labels
|
|
27
|
-
* @default true
|
|
28
|
-
*/
|
|
29
|
-
enabled?: boolean;
|
|
30
|
-
style?: Partial<BaseTextStyle>;
|
|
31
|
-
/**
|
|
32
|
-
* @default 5
|
|
33
|
-
* */
|
|
34
|
-
padding?: number;
|
|
35
|
-
/**
|
|
36
|
-
* @default false
|
|
37
|
-
* */
|
|
38
|
-
allowOverlap?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Allows to use any html-tags to display the content.
|
|
41
|
-
* The element will be displayed outside the box of the SVG element.
|
|
42
|
-
*
|
|
43
|
-
* @default false
|
|
44
|
-
* */
|
|
45
|
-
html?: boolean;
|
|
46
|
-
/** Formatting settings for labels. */
|
|
47
|
-
format?: ValueFormat;
|
|
48
|
-
};
|
|
49
|
+
dataLabels?: BaseDataLabels;
|
|
49
50
|
/** You can set the cursor to "pointer" if you have click events attached to the series, to signal to the user that the points and lines can be clicked. */
|
|
50
51
|
cursor?: string;
|
|
51
52
|
/**
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ChartBrush {
|
|
2
|
+
borderColor?: string;
|
|
3
|
+
borderWidth?: number;
|
|
4
|
+
handles?: {
|
|
5
|
+
borderColor?: string;
|
|
6
|
+
borderWidth?: number;
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Height of the handles in pixels.
|
|
10
|
+
* @default 15
|
|
11
|
+
*/
|
|
12
|
+
height?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Width of the handles in pixels.
|
|
15
|
+
* @default 8
|
|
16
|
+
*/
|
|
17
|
+
width?: number;
|
|
18
|
+
};
|
|
19
|
+
style?: {
|
|
20
|
+
fillOpacity?: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { DashStyle, SERIES_TYPE } from '../../constants';
|
|
2
|
+
import type { MeaningfulAny } from '../misc';
|
|
3
|
+
import type { BaseDataLabels, BaseSeries, BaseSeriesData } from './base';
|
|
4
|
+
import type { ChartLegend, RectLegendSymbolOptions } from './legend';
|
|
5
|
+
export interface FunnelSeriesData<T = MeaningfulAny> extends BaseSeriesData<T> {
|
|
6
|
+
/** The value of the funnel segment. */
|
|
7
|
+
value: number;
|
|
8
|
+
/** The name of the funnel segment (used in legend, tooltip etc). */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Initial data label of the funnel segment. If not specified, the value is used. */
|
|
11
|
+
label?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface FunnelSeries<T = MeaningfulAny> extends Omit<BaseSeries, 'dataLabels'> {
|
|
14
|
+
type: typeof SERIES_TYPE.Funnel;
|
|
15
|
+
data: FunnelSeriesData<T>[];
|
|
16
|
+
/** The name of the funnel series. */
|
|
17
|
+
name?: string;
|
|
18
|
+
/** The color of the funnel series. */
|
|
19
|
+
color?: string;
|
|
20
|
+
/** Individual series legend options. Has higher priority than legend options in widget data */
|
|
21
|
+
legend?: ChartLegend & {
|
|
22
|
+
symbol?: RectLegendSymbolOptions;
|
|
23
|
+
};
|
|
24
|
+
/** Lines or areas connecting the funnel segments. */
|
|
25
|
+
connectors?: {
|
|
26
|
+
enabled?: boolean;
|
|
27
|
+
/** The height of the connector area relative to the funnel segment. */
|
|
28
|
+
height?: string | number;
|
|
29
|
+
/** Option for line stroke style */
|
|
30
|
+
lineDashStyle?: DashStyle;
|
|
31
|
+
/** Opacity for the connector line. */
|
|
32
|
+
lineOpacity?: number;
|
|
33
|
+
/** Connector line color. */
|
|
34
|
+
lineColor?: string;
|
|
35
|
+
/** Connector line width in pixels. */
|
|
36
|
+
lineWidth?: number;
|
|
37
|
+
/** Connector area color. */
|
|
38
|
+
areaColor?: string;
|
|
39
|
+
/** Opacity for the connector area. */
|
|
40
|
+
areaOpacity?: number;
|
|
41
|
+
};
|
|
42
|
+
dataLabels?: Omit<BaseDataLabels, 'html' | 'allowOverlap'> & {
|
|
43
|
+
/** Horizontal alignment of the data labels. */
|
|
44
|
+
align?: 'left' | 'center' | 'right';
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SERIES_TYPE } from '../../constants';
|
|
2
2
|
import type { MeaningfulAny } from '../misc';
|
|
3
3
|
import type { BaseSeries, BaseSeriesData } from './base';
|
|
4
4
|
import type { ChartLegend, RectLegendSymbolOptions } from './legend';
|
|
@@ -18,12 +18,12 @@ export interface HeatmapSeriesData<T = MeaningfulAny> extends BaseSeriesData<T>
|
|
|
18
18
|
*/
|
|
19
19
|
y?: string | number;
|
|
20
20
|
/** Value of the heatmap cell */
|
|
21
|
-
value?: number;
|
|
21
|
+
value?: number | null;
|
|
22
22
|
/** Data label value of the heatmap cell. If not specified, the value is used. */
|
|
23
23
|
label?: string;
|
|
24
24
|
}
|
|
25
25
|
export interface HeatmapSeries<T = MeaningfulAny> extends BaseSeries {
|
|
26
|
-
type: typeof
|
|
26
|
+
type: typeof SERIES_TYPE.Heatmap;
|
|
27
27
|
data: HeatmapSeriesData<T>[];
|
|
28
28
|
/** The name of the series (used in legend, tooltip etc) */
|
|
29
29
|
name: string;
|
|
@@ -44,4 +44,13 @@ export interface HeatmapSeries<T = MeaningfulAny> extends BaseSeries {
|
|
|
44
44
|
* The color of the border surrounding each cell.
|
|
45
45
|
*/
|
|
46
46
|
borderColor?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Specifies how null or undefined values should be handled in the series.
|
|
49
|
+
*
|
|
50
|
+
* - `'zero'`: Treat null values as zero
|
|
51
|
+
* - `'skip'`: Omit data points with null values (show gaps)
|
|
52
|
+
*
|
|
53
|
+
* @default 'skip'
|
|
54
|
+
*/
|
|
55
|
+
nullMode?: 'zero' | 'skip';
|
|
47
56
|
}
|
|
@@ -59,6 +59,12 @@ export interface ChartLegend {
|
|
|
59
59
|
* @default false
|
|
60
60
|
* */
|
|
61
61
|
html?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The position of the legend box within the chart area.
|
|
64
|
+
*
|
|
65
|
+
* @default 'bottom'
|
|
66
|
+
* */
|
|
67
|
+
position?: 'top' | 'bottom';
|
|
62
68
|
}
|
|
63
69
|
export interface BaseLegendSymbol {
|
|
64
70
|
/**
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { DashStyle, LineCap,
|
|
1
|
+
import type { DashStyle, LineCap, SERIES_TYPE } from '../../constants';
|
|
2
2
|
import type { MeaningfulAny } from '../misc';
|
|
3
3
|
import type { BaseSeries, BaseSeriesData } from './base';
|
|
4
4
|
import type { ChartLegend, RectLegendSymbolOptions } from './legend';
|
|
5
5
|
import type { PointMarkerOptions } from './marker';
|
|
6
|
+
import type { ChartSeriesRangeSliderOptions } from './series';
|
|
6
7
|
export interface LineSeriesData<T = MeaningfulAny> extends BaseSeriesData<T> {
|
|
7
8
|
/**
|
|
8
9
|
* The `x` value of the point. Depending on the context , it may represents:
|
|
@@ -17,7 +18,7 @@ export interface LineSeriesData<T = MeaningfulAny> extends BaseSeriesData<T> {
|
|
|
17
18
|
* - timestamp value (for `datetime` y axis)
|
|
18
19
|
* - y axis category value (for `category` y axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `yAxis[0].categories`
|
|
19
20
|
*/
|
|
20
|
-
y?: string | number;
|
|
21
|
+
y?: string | number | null;
|
|
21
22
|
/** Data label value of the point. If not specified, the y value is used. */
|
|
22
23
|
label?: string | number;
|
|
23
24
|
marker?: {
|
|
@@ -29,7 +30,7 @@ export interface LineSeriesData<T = MeaningfulAny> extends BaseSeriesData<T> {
|
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
32
|
export interface LineSeries<T = MeaningfulAny> extends BaseSeries {
|
|
32
|
-
type: typeof
|
|
33
|
+
type: typeof SERIES_TYPE.Line;
|
|
33
34
|
data: LineSeriesData<T>[];
|
|
34
35
|
/** The name of the series (used in legend, tooltip etc) */
|
|
35
36
|
name: string;
|
|
@@ -54,4 +55,18 @@ export interface LineSeries<T = MeaningfulAny> extends BaseSeries {
|
|
|
54
55
|
opacity?: number;
|
|
55
56
|
/** Y-axis index (when using two axes) */
|
|
56
57
|
yAxis?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Specifies how null or undefined values should be handled in the series.
|
|
60
|
+
*
|
|
61
|
+
* - `'connect'`: Connect points across null values (skip nulls in rendering)
|
|
62
|
+
* - `'zero'`: Treat null values as zero
|
|
63
|
+
* - `'skip'`: Omit the data point (creates gap in line)
|
|
64
|
+
*
|
|
65
|
+
* @default 'skip'
|
|
66
|
+
*/
|
|
67
|
+
nullMode?: 'connect' | 'zero' | 'skip';
|
|
68
|
+
/**
|
|
69
|
+
* Options to configure how this series appears and behaves in the Range Slider component.
|
|
70
|
+
*/
|
|
71
|
+
rangeSlider?: ChartSeriesRangeSliderOptions;
|
|
57
72
|
}
|