@gravity-ui/charts 0.1.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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/cjs/components/Axis/AxisX.d.ts +20 -0
- package/dist/cjs/components/Axis/AxisX.js +108 -0
- package/dist/cjs/components/Axis/AxisY.d.ts +12 -0
- package/dist/cjs/components/Axis/AxisY.js +199 -0
- package/dist/cjs/components/Axis/index.d.ts +2 -0
- package/dist/cjs/components/Axis/index.js +2 -0
- package/dist/cjs/components/Axis/styles.css +17 -0
- package/dist/cjs/components/ChartInner/index.d.ts +10 -0
- package/dist/cjs/components/ChartInner/index.js +143 -0
- package/dist/cjs/components/ChartInner/styles.css +10 -0
- package/dist/cjs/components/Legend/index.d.ts +13 -0
- package/dist/cjs/components/Legend/index.js +278 -0
- package/dist/cjs/components/Legend/styles.css +47 -0
- package/dist/cjs/components/PlotTitle/index.d.ts +8 -0
- package/dist/cjs/components/PlotTitle/index.js +13 -0
- package/dist/cjs/components/PlotTitle/styles.css +5 -0
- package/dist/cjs/components/Title/index.d.ts +8 -0
- package/dist/cjs/components/Title/index.js +9 -0
- package/dist/cjs/components/Title/styles.css +5 -0
- package/dist/cjs/components/Tooltip/DefaultContent.d.ts +10 -0
- package/dist/cjs/components/Tooltip/DefaultContent.js +101 -0
- package/dist/cjs/components/Tooltip/index.d.ts +13 -0
- package/dist/cjs/components/Tooltip/index.js +29 -0
- package/dist/cjs/components/Tooltip/styles.css +29 -0
- package/dist/cjs/components/index.d.ts +18 -0
- package/dist/cjs/components/index.js +66 -0
- package/dist/cjs/constants/defaults/axis.d.ts +14 -0
- package/dist/cjs/constants/defaults/axis.js +18 -0
- package/dist/cjs/constants/defaults/index.d.ts +3 -0
- package/dist/cjs/constants/defaults/index.js +3 -0
- package/dist/cjs/constants/defaults/legend.d.ts +13 -0
- package/dist/cjs/constants/defaults/legend.js +12 -0
- package/dist/cjs/constants/defaults/series-options.d.ts +24 -0
- package/dist/cjs/constants/defaults/series-options.js +106 -0
- package/dist/cjs/constants/index.d.ts +46 -0
- package/dist/cjs/constants/index.js +71 -0
- package/dist/cjs/hooks/index.d.ts +10 -0
- package/dist/cjs/hooks/index.js +10 -0
- package/dist/cjs/hooks/useAxisScales/index.d.ts +25 -0
- package/dist/cjs/hooks/useAxisScales/index.js +183 -0
- package/dist/cjs/hooks/useChartDimensions/index.d.ts +16 -0
- package/dist/cjs/hooks/useChartDimensions/index.js +34 -0
- package/dist/cjs/hooks/useChartDimensions/utils.d.ts +10 -0
- package/dist/cjs/hooks/useChartDimensions/utils.js +32 -0
- package/dist/cjs/hooks/useChartOptions/chart.d.ts +6 -0
- package/dist/cjs/hooks/useChartOptions/chart.js +28 -0
- package/dist/cjs/hooks/useChartOptions/index.d.ts +7 -0
- package/dist/cjs/hooks/useChartOptions/index.js +21 -0
- package/dist/cjs/hooks/useChartOptions/title.d.ts +5 -0
- package/dist/cjs/hooks/useChartOptions/title.js +18 -0
- package/dist/cjs/hooks/useChartOptions/tooltip.d.ts +5 -0
- package/dist/cjs/hooks/useChartOptions/tooltip.js +5 -0
- package/dist/cjs/hooks/useChartOptions/types.d.ts +47 -0
- package/dist/cjs/hooks/useChartOptions/types.js +1 -0
- package/dist/cjs/hooks/useChartOptions/x-axis.d.ts +7 -0
- package/dist/cjs/hooks/useChartOptions/x-axis.js +115 -0
- package/dist/cjs/hooks/useChartOptions/y-axis.d.ts +7 -0
- package/dist/cjs/hooks/useChartOptions/y-axis.js +117 -0
- package/dist/cjs/hooks/useSeries/constants.d.ts +8 -0
- package/dist/cjs/hooks/useSeries/constants.js +19 -0
- package/dist/cjs/hooks/useSeries/index.d.ts +29 -0
- package/dist/cjs/hooks/useSeries/index.js +82 -0
- package/dist/cjs/hooks/useSeries/prepare-area.d.ts +19 -0
- package/dist/cjs/hooks/useSeries/prepare-area.js +63 -0
- package/dist/cjs/hooks/useSeries/prepare-bar-x.d.ts +10 -0
- package/dist/cjs/hooks/useSeries/prepare-bar-x.js +38 -0
- package/dist/cjs/hooks/useSeries/prepare-bar-y.d.ts +10 -0
- package/dist/cjs/hooks/useSeries/prepare-bar-y.js +48 -0
- package/dist/cjs/hooks/useSeries/prepare-legend.d.ts +27 -0
- package/dist/cjs/hooks/useSeries/prepare-legend.js +144 -0
- package/dist/cjs/hooks/useSeries/prepare-line.d.ts +22 -0
- package/dist/cjs/hooks/useSeries/prepare-line.js +82 -0
- package/dist/cjs/hooks/useSeries/prepare-options.d.ts +3 -0
- package/dist/cjs/hooks/useSeries/prepare-options.js +5 -0
- package/dist/cjs/hooks/useSeries/prepare-pie.d.ts +9 -0
- package/dist/cjs/hooks/useSeries/prepare-pie.js +62 -0
- package/dist/cjs/hooks/useSeries/prepare-scatter.d.ts +11 -0
- package/dist/cjs/hooks/useSeries/prepare-scatter.js +46 -0
- package/dist/cjs/hooks/useSeries/prepare-treemap.d.ts +11 -0
- package/dist/cjs/hooks/useSeries/prepare-treemap.js +38 -0
- package/dist/cjs/hooks/useSeries/prepare-waterfall.d.ts +10 -0
- package/dist/cjs/hooks/useSeries/prepare-waterfall.js +37 -0
- package/dist/cjs/hooks/useSeries/prepareSeries.d.ts +10 -0
- package/dist/cjs/hooks/useSeries/prepareSeries.js +65 -0
- package/dist/cjs/hooks/useSeries/types.d.ts +253 -0
- package/dist/cjs/hooks/useSeries/types.js +1 -0
- package/dist/cjs/hooks/useSeries/utils.d.ts +7 -0
- package/dist/cjs/hooks/useSeries/utils.js +33 -0
- package/dist/cjs/hooks/useShapes/HtmlLayer.d.ts +8 -0
- package/dist/cjs/hooks/useShapes/HtmlLayer.js +22 -0
- package/dist/cjs/hooks/useShapes/area/index.d.ts +12 -0
- package/dist/cjs/hooks/useShapes/area/index.js +143 -0
- package/dist/cjs/hooks/useShapes/area/prepare-data.d.ts +12 -0
- package/dist/cjs/hooks/useShapes/area/prepare-data.js +158 -0
- package/dist/cjs/hooks/useShapes/area/types.d.ts +27 -0
- package/dist/cjs/hooks/useShapes/area/types.js +1 -0
- package/dist/cjs/hooks/useShapes/bar-x/index.d.ts +13 -0
- package/dist/cjs/hooks/useShapes/bar-x/index.js +95 -0
- package/dist/cjs/hooks/useShapes/bar-x/prepare-data.d.ts +13 -0
- package/dist/cjs/hooks/useShapes/bar-x/prepare-data.js +160 -0
- package/dist/cjs/hooks/useShapes/bar-x/types.d.ts +12 -0
- package/dist/cjs/hooks/useShapes/bar-x/types.js +1 -0
- package/dist/cjs/hooks/useShapes/bar-y/index.d.ts +12 -0
- package/dist/cjs/hooks/useShapes/bar-y/index.js +84 -0
- package/dist/cjs/hooks/useShapes/bar-y/prepare-data.d.ts +12 -0
- package/dist/cjs/hooks/useShapes/bar-y/prepare-data.js +169 -0
- package/dist/cjs/hooks/useShapes/bar-y/types.d.ts +13 -0
- package/dist/cjs/hooks/useShapes/bar-y/types.js +1 -0
- package/dist/cjs/hooks/useShapes/constants.d.ts +3 -0
- package/dist/cjs/hooks/useShapes/constants.js +3 -0
- package/dist/cjs/hooks/useShapes/index.d.ts +33 -0
- package/dist/cjs/hooks/useShapes/index.js +154 -0
- package/dist/cjs/hooks/useShapes/line/index.d.ts +12 -0
- package/dist/cjs/hooks/useShapes/line/index.js +130 -0
- package/dist/cjs/hooks/useShapes/line/prepare-data.d.ts +13 -0
- package/dist/cjs/hooks/useShapes/line/prepare-data.js +91 -0
- package/dist/cjs/hooks/useShapes/line/types.d.ts +29 -0
- package/dist/cjs/hooks/useShapes/line/types.js +1 -0
- package/dist/cjs/hooks/useShapes/marker.d.ts +14 -0
- package/dist/cjs/hooks/useShapes/marker.js +75 -0
- package/dist/cjs/hooks/useShapes/pie/index.d.ts +13 -0
- package/dist/cjs/hooks/useShapes/pie/index.js +171 -0
- package/dist/cjs/hooks/useShapes/pie/prepare-data.d.ts +9 -0
- package/dist/cjs/hooks/useShapes/pie/prepare-data.js +186 -0
- package/dist/cjs/hooks/useShapes/pie/types.d.ts +41 -0
- package/dist/cjs/hooks/useShapes/pie/types.js +1 -0
- package/dist/cjs/hooks/useShapes/pie/utils.d.ts +4 -0
- package/dist/cjs/hooks/useShapes/pie/utils.js +15 -0
- package/dist/cjs/hooks/useShapes/scatter/index.d.ts +12 -0
- package/dist/cjs/hooks/useShapes/scatter/index.js +69 -0
- package/dist/cjs/hooks/useShapes/scatter/prepare-data.d.ts +11 -0
- package/dist/cjs/hooks/useShapes/scatter/prepare-data.js +31 -0
- package/dist/cjs/hooks/useShapes/scatter/types.d.ts +17 -0
- package/dist/cjs/hooks/useShapes/scatter/types.js +1 -0
- package/dist/cjs/hooks/useShapes/styles.css +35 -0
- package/dist/cjs/hooks/useShapes/treemap/index.d.ts +12 -0
- package/dist/cjs/hooks/useShapes/treemap/index.js +98 -0
- package/dist/cjs/hooks/useShapes/treemap/prepare-data.d.ts +7 -0
- package/dist/cjs/hooks/useShapes/treemap/prepare-data.js +114 -0
- package/dist/cjs/hooks/useShapes/treemap/types.d.ts +16 -0
- package/dist/cjs/hooks/useShapes/treemap/types.js +1 -0
- package/dist/cjs/hooks/useShapes/utils.d.ts +29 -0
- package/dist/cjs/hooks/useShapes/utils.js +53 -0
- package/dist/cjs/hooks/useShapes/waterfall/index.d.ts +13 -0
- package/dist/cjs/hooks/useShapes/waterfall/index.js +127 -0
- package/dist/cjs/hooks/useShapes/waterfall/prepare-data.d.ts +12 -0
- package/dist/cjs/hooks/useShapes/waterfall/prepare-data.js +133 -0
- package/dist/cjs/hooks/useShapes/waterfall/types.d.ts +14 -0
- package/dist/cjs/hooks/useShapes/waterfall/types.js +1 -0
- package/dist/cjs/hooks/useSplit/index.d.ts +14 -0
- package/dist/cjs/hooks/useSplit/index.js +57 -0
- package/dist/cjs/hooks/useSplit/types.d.ts +17 -0
- package/dist/cjs/hooks/useSplit/types.js +1 -0
- package/dist/cjs/hooks/useTooltip/index.d.ts +13 -0
- package/dist/cjs/hooks/useTooltip/index.js +17 -0
- package/dist/cjs/hooks/useTooltip/types.d.ts +1 -0
- package/dist/cjs/hooks/useTooltip/types.js +1 -0
- package/dist/cjs/i18n/index.d.ts +8 -0
- package/dist/cjs/i18n/index.js +10 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/libs/chart-error/index.d.ts +16 -0
- package/dist/cjs/libs/chart-error/index.js +19 -0
- package/dist/cjs/libs/format-number/i18n/en.json +17 -0
- package/dist/cjs/libs/format-number/i18n/i18n.d.ts +5 -0
- package/dist/cjs/libs/format-number/i18n/i18n.js +8 -0
- package/dist/cjs/libs/format-number/i18n/ru.json +17 -0
- package/dist/cjs/libs/format-number/index.d.ts +5 -0
- package/dist/cjs/libs/format-number/index.js +87 -0
- package/dist/cjs/libs/format-number/types.d.ts +14 -0
- package/dist/cjs/libs/format-number/types.js +1 -0
- package/dist/cjs/libs/index.d.ts +2 -0
- package/dist/cjs/libs/index.js +2 -0
- package/dist/cjs/types/chart/area.d.ts +76 -0
- package/dist/cjs/types/chart/area.js +1 -0
- package/dist/cjs/types/chart/axis.d.ts +85 -0
- package/dist/cjs/types/chart/axis.js +1 -0
- package/dist/cjs/types/chart/bar-x.d.ts +67 -0
- package/dist/cjs/types/chart/bar-x.js +1 -0
- package/dist/cjs/types/chart/bar-y.d.ts +60 -0
- package/dist/cjs/types/chart/bar-y.js +1 -0
- package/dist/cjs/types/chart/base.d.ts +48 -0
- package/dist/cjs/types/chart/base.js +1 -0
- package/dist/cjs/types/chart/chart.d.ts +15 -0
- package/dist/cjs/types/chart/chart.js +1 -0
- package/dist/cjs/types/chart/halo.d.ts +9 -0
- package/dist/cjs/types/chart/halo.js +1 -0
- package/dist/cjs/types/chart/legend.d.ts +92 -0
- package/dist/cjs/types/chart/legend.js +1 -0
- package/dist/cjs/types/chart/line.d.ts +57 -0
- package/dist/cjs/types/chart/line.js +1 -0
- package/dist/cjs/types/chart/marker.d.ts +12 -0
- package/dist/cjs/types/chart/marker.js +1 -0
- package/dist/cjs/types/chart/pie.d.ts +88 -0
- package/dist/cjs/types/chart/pie.js +1 -0
- package/dist/cjs/types/chart/scatter.d.ts +46 -0
- package/dist/cjs/types/chart/scatter.js +1 -0
- package/dist/cjs/types/chart/series.d.ts +226 -0
- package/dist/cjs/types/chart/series.js +1 -0
- package/dist/cjs/types/chart/split.d.ts +13 -0
- package/dist/cjs/types/chart/split.js +1 -0
- package/dist/cjs/types/chart/title.d.ts +5 -0
- package/dist/cjs/types/chart/title.js +1 -0
- package/dist/cjs/types/chart/tooltip.d.ts +67 -0
- package/dist/cjs/types/chart/tooltip.js +1 -0
- package/dist/cjs/types/chart/treemap.d.ts +46 -0
- package/dist/cjs/types/chart/treemap.js +1 -0
- package/dist/cjs/types/chart/waterfall.d.ts +40 -0
- package/dist/cjs/types/chart/waterfall.js +1 -0
- package/dist/cjs/types/chart-ui.d.ts +24 -0
- package/dist/cjs/types/chart-ui.js +1 -0
- package/dist/cjs/types/formatter.d.ts +14 -0
- package/dist/cjs/types/formatter.js +1 -0
- package/dist/cjs/types/index.d.ts +42 -0
- package/dist/cjs/types/index.js +19 -0
- package/dist/cjs/types/misc.d.ts +4 -0
- package/dist/cjs/types/misc.js +1 -0
- package/dist/cjs/utils/chart/axis-generators/bottom.d.ts +24 -0
- package/dist/cjs/utils/chart/axis-generators/bottom.js +126 -0
- package/dist/cjs/utils/chart/axis-generators/index.d.ts +1 -0
- package/dist/cjs/utils/chart/axis-generators/index.js +1 -0
- package/dist/cjs/utils/chart/axis.d.ts +31 -0
- package/dist/cjs/utils/chart/axis.js +71 -0
- package/dist/cjs/utils/chart/color.d.ts +10 -0
- package/dist/cjs/utils/chart/color.js +43 -0
- package/dist/cjs/utils/chart/get-closest-data.d.ts +15 -0
- package/dist/cjs/utils/chart/get-closest-data.js +172 -0
- package/dist/cjs/utils/chart/index.d.ts +78 -0
- package/dist/cjs/utils/chart/index.js +210 -0
- package/dist/cjs/utils/chart/labels.d.ts +6 -0
- package/dist/cjs/utils/chart/labels.js +44 -0
- package/dist/cjs/utils/chart/legend.d.ts +8 -0
- package/dist/cjs/utils/chart/legend.js +23 -0
- package/dist/cjs/utils/chart/math.d.ts +25 -0
- package/dist/cjs/utils/chart/math.js +51 -0
- package/dist/cjs/utils/chart/series/index.d.ts +1 -0
- package/dist/cjs/utils/chart/series/index.js +1 -0
- package/dist/cjs/utils/chart/series/waterfall.d.ts +4 -0
- package/dist/cjs/utils/chart/series/waterfall.js +25 -0
- package/dist/cjs/utils/chart/symbol.d.ts +3 -0
- package/dist/cjs/utils/chart/symbol.js +36 -0
- package/dist/cjs/utils/chart/text.d.ts +29 -0
- package/dist/cjs/utils/chart/text.js +139 -0
- package/dist/cjs/utils/chart/time.d.ts +3 -0
- package/dist/cjs/utils/chart/time.js +34 -0
- package/dist/cjs/utils/chart-ui/index.d.ts +4 -0
- package/dist/cjs/utils/chart-ui/index.js +4 -0
- package/dist/cjs/utils/chart-ui/pie-center-text.d.ts +7 -0
- package/dist/cjs/utils/chart-ui/pie-center-text.js +23 -0
- package/dist/cjs/utils/cn.d.ts +3 -0
- package/dist/cjs/utils/cn.js +4 -0
- package/dist/cjs/utils/d3-dispatcher.d.ts +1 -0
- package/dist/cjs/utils/d3-dispatcher.js +4 -0
- package/dist/cjs/utils/index.d.ts +5 -0
- package/dist/cjs/utils/index.js +5 -0
- package/dist/cjs/utils/misc.d.ts +2 -0
- package/dist/cjs/utils/misc.js +8 -0
- package/dist/cjs/validation/index.d.ts +2 -0
- package/dist/cjs/validation/index.js +220 -0
- package/dist/esm/components/Axis/AxisX.d.ts +20 -0
- package/dist/esm/components/Axis/AxisX.js +108 -0
- package/dist/esm/components/Axis/AxisY.d.ts +12 -0
- package/dist/esm/components/Axis/AxisY.js +199 -0
- package/dist/esm/components/Axis/index.d.ts +2 -0
- package/dist/esm/components/Axis/index.js +2 -0
- package/dist/esm/components/Axis/styles.css +17 -0
- package/dist/esm/components/ChartInner/index.d.ts +10 -0
- package/dist/esm/components/ChartInner/index.js +143 -0
- package/dist/esm/components/ChartInner/styles.css +10 -0
- package/dist/esm/components/Legend/index.d.ts +13 -0
- package/dist/esm/components/Legend/index.js +278 -0
- package/dist/esm/components/Legend/styles.css +47 -0
- package/dist/esm/components/PlotTitle/index.d.ts +8 -0
- package/dist/esm/components/PlotTitle/index.js +13 -0
- package/dist/esm/components/PlotTitle/styles.css +5 -0
- package/dist/esm/components/Title/index.d.ts +8 -0
- package/dist/esm/components/Title/index.js +9 -0
- package/dist/esm/components/Title/styles.css +5 -0
- package/dist/esm/components/Tooltip/DefaultContent.d.ts +10 -0
- package/dist/esm/components/Tooltip/DefaultContent.js +101 -0
- package/dist/esm/components/Tooltip/index.d.ts +13 -0
- package/dist/esm/components/Tooltip/index.js +29 -0
- package/dist/esm/components/Tooltip/styles.css +29 -0
- package/dist/esm/components/index.d.ts +18 -0
- package/dist/esm/components/index.js +66 -0
- package/dist/esm/constants/defaults/axis.d.ts +14 -0
- package/dist/esm/constants/defaults/axis.js +18 -0
- package/dist/esm/constants/defaults/index.d.ts +3 -0
- package/dist/esm/constants/defaults/index.js +3 -0
- package/dist/esm/constants/defaults/legend.d.ts +13 -0
- package/dist/esm/constants/defaults/legend.js +12 -0
- package/dist/esm/constants/defaults/series-options.d.ts +24 -0
- package/dist/esm/constants/defaults/series-options.js +106 -0
- package/dist/esm/constants/index.d.ts +46 -0
- package/dist/esm/constants/index.js +71 -0
- package/dist/esm/hooks/index.d.ts +10 -0
- package/dist/esm/hooks/index.js +10 -0
- package/dist/esm/hooks/useAxisScales/index.d.ts +25 -0
- package/dist/esm/hooks/useAxisScales/index.js +183 -0
- package/dist/esm/hooks/useChartDimensions/index.d.ts +16 -0
- package/dist/esm/hooks/useChartDimensions/index.js +34 -0
- package/dist/esm/hooks/useChartDimensions/utils.d.ts +10 -0
- package/dist/esm/hooks/useChartDimensions/utils.js +32 -0
- package/dist/esm/hooks/useChartOptions/chart.d.ts +6 -0
- package/dist/esm/hooks/useChartOptions/chart.js +28 -0
- package/dist/esm/hooks/useChartOptions/index.d.ts +7 -0
- package/dist/esm/hooks/useChartOptions/index.js +21 -0
- package/dist/esm/hooks/useChartOptions/title.d.ts +5 -0
- package/dist/esm/hooks/useChartOptions/title.js +18 -0
- package/dist/esm/hooks/useChartOptions/tooltip.d.ts +5 -0
- package/dist/esm/hooks/useChartOptions/tooltip.js +5 -0
- package/dist/esm/hooks/useChartOptions/types.d.ts +47 -0
- package/dist/esm/hooks/useChartOptions/types.js +1 -0
- package/dist/esm/hooks/useChartOptions/x-axis.d.ts +7 -0
- package/dist/esm/hooks/useChartOptions/x-axis.js +115 -0
- package/dist/esm/hooks/useChartOptions/y-axis.d.ts +7 -0
- package/dist/esm/hooks/useChartOptions/y-axis.js +117 -0
- package/dist/esm/hooks/useSeries/constants.d.ts +8 -0
- package/dist/esm/hooks/useSeries/constants.js +19 -0
- package/dist/esm/hooks/useSeries/index.d.ts +29 -0
- package/dist/esm/hooks/useSeries/index.js +82 -0
- package/dist/esm/hooks/useSeries/prepare-area.d.ts +19 -0
- package/dist/esm/hooks/useSeries/prepare-area.js +63 -0
- package/dist/esm/hooks/useSeries/prepare-bar-x.d.ts +10 -0
- package/dist/esm/hooks/useSeries/prepare-bar-x.js +38 -0
- package/dist/esm/hooks/useSeries/prepare-bar-y.d.ts +10 -0
- package/dist/esm/hooks/useSeries/prepare-bar-y.js +48 -0
- package/dist/esm/hooks/useSeries/prepare-legend.d.ts +27 -0
- package/dist/esm/hooks/useSeries/prepare-legend.js +144 -0
- package/dist/esm/hooks/useSeries/prepare-line.d.ts +22 -0
- package/dist/esm/hooks/useSeries/prepare-line.js +82 -0
- package/dist/esm/hooks/useSeries/prepare-options.d.ts +3 -0
- package/dist/esm/hooks/useSeries/prepare-options.js +5 -0
- package/dist/esm/hooks/useSeries/prepare-pie.d.ts +9 -0
- package/dist/esm/hooks/useSeries/prepare-pie.js +62 -0
- package/dist/esm/hooks/useSeries/prepare-scatter.d.ts +11 -0
- package/dist/esm/hooks/useSeries/prepare-scatter.js +46 -0
- package/dist/esm/hooks/useSeries/prepare-treemap.d.ts +11 -0
- package/dist/esm/hooks/useSeries/prepare-treemap.js +38 -0
- package/dist/esm/hooks/useSeries/prepare-waterfall.d.ts +10 -0
- package/dist/esm/hooks/useSeries/prepare-waterfall.js +37 -0
- package/dist/esm/hooks/useSeries/prepareSeries.d.ts +10 -0
- package/dist/esm/hooks/useSeries/prepareSeries.js +65 -0
- package/dist/esm/hooks/useSeries/types.d.ts +253 -0
- package/dist/esm/hooks/useSeries/types.js +1 -0
- package/dist/esm/hooks/useSeries/utils.d.ts +7 -0
- package/dist/esm/hooks/useSeries/utils.js +33 -0
- package/dist/esm/hooks/useShapes/HtmlLayer.d.ts +8 -0
- package/dist/esm/hooks/useShapes/HtmlLayer.js +22 -0
- package/dist/esm/hooks/useShapes/area/index.d.ts +12 -0
- package/dist/esm/hooks/useShapes/area/index.js +143 -0
- package/dist/esm/hooks/useShapes/area/prepare-data.d.ts +12 -0
- package/dist/esm/hooks/useShapes/area/prepare-data.js +158 -0
- package/dist/esm/hooks/useShapes/area/types.d.ts +27 -0
- package/dist/esm/hooks/useShapes/area/types.js +1 -0
- package/dist/esm/hooks/useShapes/bar-x/index.d.ts +13 -0
- package/dist/esm/hooks/useShapes/bar-x/index.js +95 -0
- package/dist/esm/hooks/useShapes/bar-x/prepare-data.d.ts +13 -0
- package/dist/esm/hooks/useShapes/bar-x/prepare-data.js +160 -0
- package/dist/esm/hooks/useShapes/bar-x/types.d.ts +12 -0
- package/dist/esm/hooks/useShapes/bar-x/types.js +1 -0
- package/dist/esm/hooks/useShapes/bar-y/index.d.ts +12 -0
- package/dist/esm/hooks/useShapes/bar-y/index.js +84 -0
- package/dist/esm/hooks/useShapes/bar-y/prepare-data.d.ts +12 -0
- package/dist/esm/hooks/useShapes/bar-y/prepare-data.js +169 -0
- package/dist/esm/hooks/useShapes/bar-y/types.d.ts +13 -0
- package/dist/esm/hooks/useShapes/bar-y/types.js +1 -0
- package/dist/esm/hooks/useShapes/constants.d.ts +3 -0
- package/dist/esm/hooks/useShapes/constants.js +3 -0
- package/dist/esm/hooks/useShapes/index.d.ts +33 -0
- package/dist/esm/hooks/useShapes/index.js +154 -0
- package/dist/esm/hooks/useShapes/line/index.d.ts +12 -0
- package/dist/esm/hooks/useShapes/line/index.js +130 -0
- package/dist/esm/hooks/useShapes/line/prepare-data.d.ts +13 -0
- package/dist/esm/hooks/useShapes/line/prepare-data.js +91 -0
- package/dist/esm/hooks/useShapes/line/types.d.ts +29 -0
- package/dist/esm/hooks/useShapes/line/types.js +1 -0
- package/dist/esm/hooks/useShapes/marker.d.ts +14 -0
- package/dist/esm/hooks/useShapes/marker.js +75 -0
- package/dist/esm/hooks/useShapes/pie/index.d.ts +13 -0
- package/dist/esm/hooks/useShapes/pie/index.js +171 -0
- package/dist/esm/hooks/useShapes/pie/prepare-data.d.ts +9 -0
- package/dist/esm/hooks/useShapes/pie/prepare-data.js +186 -0
- package/dist/esm/hooks/useShapes/pie/types.d.ts +41 -0
- package/dist/esm/hooks/useShapes/pie/types.js +1 -0
- package/dist/esm/hooks/useShapes/pie/utils.d.ts +4 -0
- package/dist/esm/hooks/useShapes/pie/utils.js +15 -0
- package/dist/esm/hooks/useShapes/scatter/index.d.ts +12 -0
- package/dist/esm/hooks/useShapes/scatter/index.js +69 -0
- package/dist/esm/hooks/useShapes/scatter/prepare-data.d.ts +11 -0
- package/dist/esm/hooks/useShapes/scatter/prepare-data.js +31 -0
- package/dist/esm/hooks/useShapes/scatter/types.d.ts +17 -0
- package/dist/esm/hooks/useShapes/scatter/types.js +1 -0
- package/dist/esm/hooks/useShapes/styles.css +35 -0
- package/dist/esm/hooks/useShapes/treemap/index.d.ts +12 -0
- package/dist/esm/hooks/useShapes/treemap/index.js +98 -0
- package/dist/esm/hooks/useShapes/treemap/prepare-data.d.ts +7 -0
- package/dist/esm/hooks/useShapes/treemap/prepare-data.js +114 -0
- package/dist/esm/hooks/useShapes/treemap/types.d.ts +16 -0
- package/dist/esm/hooks/useShapes/treemap/types.js +1 -0
- package/dist/esm/hooks/useShapes/utils.d.ts +29 -0
- package/dist/esm/hooks/useShapes/utils.js +53 -0
- package/dist/esm/hooks/useShapes/waterfall/index.d.ts +13 -0
- package/dist/esm/hooks/useShapes/waterfall/index.js +127 -0
- package/dist/esm/hooks/useShapes/waterfall/prepare-data.d.ts +12 -0
- package/dist/esm/hooks/useShapes/waterfall/prepare-data.js +133 -0
- package/dist/esm/hooks/useShapes/waterfall/types.d.ts +14 -0
- package/dist/esm/hooks/useShapes/waterfall/types.js +1 -0
- package/dist/esm/hooks/useSplit/index.d.ts +14 -0
- package/dist/esm/hooks/useSplit/index.js +57 -0
- package/dist/esm/hooks/useSplit/types.d.ts +17 -0
- package/dist/esm/hooks/useSplit/types.js +1 -0
- package/dist/esm/hooks/useTooltip/index.d.ts +13 -0
- package/dist/esm/hooks/useTooltip/index.js +17 -0
- package/dist/esm/hooks/useTooltip/types.d.ts +1 -0
- package/dist/esm/hooks/useTooltip/types.js +1 -0
- package/dist/esm/i18n/index.d.ts +8 -0
- package/dist/esm/i18n/index.js +10 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/libs/chart-error/index.d.ts +16 -0
- package/dist/esm/libs/chart-error/index.js +19 -0
- package/dist/esm/libs/format-number/i18n/en.json +17 -0
- package/dist/esm/libs/format-number/i18n/i18n.d.ts +5 -0
- package/dist/esm/libs/format-number/i18n/i18n.js +8 -0
- package/dist/esm/libs/format-number/i18n/ru.json +17 -0
- package/dist/esm/libs/format-number/index.d.ts +5 -0
- package/dist/esm/libs/format-number/index.js +87 -0
- package/dist/esm/libs/format-number/types.d.ts +14 -0
- package/dist/esm/libs/format-number/types.js +1 -0
- package/dist/esm/libs/index.d.ts +2 -0
- package/dist/esm/libs/index.js +2 -0
- package/dist/esm/types/chart/area.d.ts +76 -0
- package/dist/esm/types/chart/area.js +1 -0
- package/dist/esm/types/chart/axis.d.ts +85 -0
- package/dist/esm/types/chart/axis.js +1 -0
- package/dist/esm/types/chart/bar-x.d.ts +67 -0
- package/dist/esm/types/chart/bar-x.js +1 -0
- package/dist/esm/types/chart/bar-y.d.ts +60 -0
- package/dist/esm/types/chart/bar-y.js +1 -0
- package/dist/esm/types/chart/base.d.ts +48 -0
- package/dist/esm/types/chart/base.js +1 -0
- package/dist/esm/types/chart/chart.d.ts +15 -0
- package/dist/esm/types/chart/chart.js +1 -0
- package/dist/esm/types/chart/halo.d.ts +9 -0
- package/dist/esm/types/chart/halo.js +1 -0
- package/dist/esm/types/chart/legend.d.ts +92 -0
- package/dist/esm/types/chart/legend.js +1 -0
- package/dist/esm/types/chart/line.d.ts +57 -0
- package/dist/esm/types/chart/line.js +1 -0
- package/dist/esm/types/chart/marker.d.ts +12 -0
- package/dist/esm/types/chart/marker.js +1 -0
- package/dist/esm/types/chart/pie.d.ts +88 -0
- package/dist/esm/types/chart/pie.js +1 -0
- package/dist/esm/types/chart/scatter.d.ts +46 -0
- package/dist/esm/types/chart/scatter.js +1 -0
- package/dist/esm/types/chart/series.d.ts +226 -0
- package/dist/esm/types/chart/series.js +1 -0
- package/dist/esm/types/chart/split.d.ts +13 -0
- package/dist/esm/types/chart/split.js +1 -0
- package/dist/esm/types/chart/title.d.ts +5 -0
- package/dist/esm/types/chart/title.js +1 -0
- package/dist/esm/types/chart/tooltip.d.ts +67 -0
- package/dist/esm/types/chart/tooltip.js +1 -0
- package/dist/esm/types/chart/treemap.d.ts +46 -0
- package/dist/esm/types/chart/treemap.js +1 -0
- package/dist/esm/types/chart/waterfall.d.ts +40 -0
- package/dist/esm/types/chart/waterfall.js +1 -0
- package/dist/esm/types/chart-ui.d.ts +24 -0
- package/dist/esm/types/chart-ui.js +1 -0
- package/dist/esm/types/formatter.d.ts +14 -0
- package/dist/esm/types/formatter.js +1 -0
- package/dist/esm/types/index.d.ts +42 -0
- package/dist/esm/types/index.js +19 -0
- package/dist/esm/types/misc.d.ts +4 -0
- package/dist/esm/types/misc.js +1 -0
- package/dist/esm/utils/chart/axis-generators/bottom.d.ts +24 -0
- package/dist/esm/utils/chart/axis-generators/bottom.js +126 -0
- package/dist/esm/utils/chart/axis-generators/index.d.ts +1 -0
- package/dist/esm/utils/chart/axis-generators/index.js +1 -0
- package/dist/esm/utils/chart/axis.d.ts +31 -0
- package/dist/esm/utils/chart/axis.js +71 -0
- package/dist/esm/utils/chart/color.d.ts +10 -0
- package/dist/esm/utils/chart/color.js +43 -0
- package/dist/esm/utils/chart/get-closest-data.d.ts +15 -0
- package/dist/esm/utils/chart/get-closest-data.js +172 -0
- package/dist/esm/utils/chart/index.d.ts +78 -0
- package/dist/esm/utils/chart/index.js +210 -0
- package/dist/esm/utils/chart/labels.d.ts +6 -0
- package/dist/esm/utils/chart/labels.js +44 -0
- package/dist/esm/utils/chart/legend.d.ts +8 -0
- package/dist/esm/utils/chart/legend.js +23 -0
- package/dist/esm/utils/chart/math.d.ts +25 -0
- package/dist/esm/utils/chart/math.js +51 -0
- package/dist/esm/utils/chart/series/index.d.ts +1 -0
- package/dist/esm/utils/chart/series/index.js +1 -0
- package/dist/esm/utils/chart/series/waterfall.d.ts +4 -0
- package/dist/esm/utils/chart/series/waterfall.js +25 -0
- package/dist/esm/utils/chart/symbol.d.ts +3 -0
- package/dist/esm/utils/chart/symbol.js +36 -0
- package/dist/esm/utils/chart/text.d.ts +29 -0
- package/dist/esm/utils/chart/text.js +139 -0
- package/dist/esm/utils/chart/time.d.ts +3 -0
- package/dist/esm/utils/chart/time.js +34 -0
- package/dist/esm/utils/chart-ui/index.d.ts +4 -0
- package/dist/esm/utils/chart-ui/index.js +4 -0
- package/dist/esm/utils/chart-ui/pie-center-text.d.ts +7 -0
- package/dist/esm/utils/chart-ui/pie-center-text.js +23 -0
- package/dist/esm/utils/cn.d.ts +3 -0
- package/dist/esm/utils/cn.js +4 -0
- package/dist/esm/utils/d3-dispatcher.d.ts +1 -0
- package/dist/esm/utils/d3-dispatcher.js +4 -0
- package/dist/esm/utils/index.d.ts +5 -0
- package/dist/esm/utils/index.js +5 -0
- package/dist/esm/utils/misc.d.ts +2 -0
- package/dist/esm/utils/misc.js +8 -0
- package/dist/esm/validation/index.d.ts +2 -0
- package/dist/esm/validation/index.js +220 -0
- package/package.json +140 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import type { DashStyle, LayoutAlgorithm, LineCap, SeriesOptionsDefaults, SymbolType } from '../../constants';
|
|
2
|
+
import type { AreaSeries, AreaSeriesData, BarXSeries, BarXSeriesData, BarYSeries, BarYSeriesData, BaseTextStyle, ChartLegend, ConnectorCurve, ConnectorShape, LineSeries, LineSeriesData, PathLegendSymbolOptions, PieSeries, PieSeriesData, RectLegendSymbolOptions, ScatterSeries, ScatterSeriesData, SymbolLegendSymbolOptions, TreemapSeries, TreemapSeriesData, WaterfallSeries, WaterfallSeriesData } from '../../types';
|
|
3
|
+
export type RectLegendSymbol = {
|
|
4
|
+
shape: 'rect';
|
|
5
|
+
} & Required<RectLegendSymbolOptions>;
|
|
6
|
+
export type PathLegendSymbol = {
|
|
7
|
+
shape: 'path';
|
|
8
|
+
strokeWidth: number;
|
|
9
|
+
} & Required<PathLegendSymbolOptions>;
|
|
10
|
+
export type SymbolLegendSymbol = {
|
|
11
|
+
shape: 'symbol';
|
|
12
|
+
symbolType: `${SymbolType}`;
|
|
13
|
+
} & Required<SymbolLegendSymbolOptions>;
|
|
14
|
+
export type PreparedLegendSymbol = RectLegendSymbol | PathLegendSymbol | SymbolLegendSymbol;
|
|
15
|
+
export type PreparedLegend = Required<Omit<ChartLegend, 'title' | 'colorScale'>> & {
|
|
16
|
+
height: number;
|
|
17
|
+
lineHeight: number;
|
|
18
|
+
title: {
|
|
19
|
+
enable: boolean;
|
|
20
|
+
text: string;
|
|
21
|
+
margin: number;
|
|
22
|
+
style: BaseTextStyle;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
ticks: {
|
|
26
|
+
labelsMargin: number;
|
|
27
|
+
labelsLineHeight: number;
|
|
28
|
+
};
|
|
29
|
+
colorScale: {
|
|
30
|
+
colors: string[];
|
|
31
|
+
domain: number[];
|
|
32
|
+
stops: number[];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type OnLegendItemClick = (data: {
|
|
36
|
+
name: string;
|
|
37
|
+
metaKey: boolean;
|
|
38
|
+
}) => void;
|
|
39
|
+
export type LegendItem = {
|
|
40
|
+
color: string;
|
|
41
|
+
name: string;
|
|
42
|
+
symbol: PreparedLegendSymbol;
|
|
43
|
+
textWidth: number;
|
|
44
|
+
visible?: boolean;
|
|
45
|
+
dashStyle?: DashStyle;
|
|
46
|
+
};
|
|
47
|
+
export type LegendConfig = {
|
|
48
|
+
offset: {
|
|
49
|
+
left: number;
|
|
50
|
+
top: number;
|
|
51
|
+
};
|
|
52
|
+
pagination?: {
|
|
53
|
+
limit: number;
|
|
54
|
+
maxPage: number;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export type PreparedHaloOptions = {
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
opacity: number;
|
|
60
|
+
size: number;
|
|
61
|
+
};
|
|
62
|
+
type BasePreparedSeries = {
|
|
63
|
+
color: string;
|
|
64
|
+
name: string;
|
|
65
|
+
id: string;
|
|
66
|
+
visible: boolean;
|
|
67
|
+
legend: {
|
|
68
|
+
enabled: boolean;
|
|
69
|
+
symbol: PreparedLegendSymbol;
|
|
70
|
+
};
|
|
71
|
+
cursor: string | null;
|
|
72
|
+
};
|
|
73
|
+
export type PreparedScatterSeries = {
|
|
74
|
+
type: ScatterSeries['type'];
|
|
75
|
+
data: ScatterSeriesData[];
|
|
76
|
+
marker: {
|
|
77
|
+
states: {
|
|
78
|
+
normal: {
|
|
79
|
+
symbol: `${SymbolType}`;
|
|
80
|
+
enabled: boolean;
|
|
81
|
+
radius: number;
|
|
82
|
+
borderWidth: number;
|
|
83
|
+
borderColor: string;
|
|
84
|
+
};
|
|
85
|
+
hover: {
|
|
86
|
+
enabled: boolean;
|
|
87
|
+
radius: number;
|
|
88
|
+
borderWidth: number;
|
|
89
|
+
borderColor: string;
|
|
90
|
+
halo: PreparedHaloOptions;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
yAxis: number;
|
|
95
|
+
} & BasePreparedSeries;
|
|
96
|
+
export type PreparedBarXSeries = {
|
|
97
|
+
type: BarXSeries['type'];
|
|
98
|
+
data: BarXSeriesData[];
|
|
99
|
+
stackId: string;
|
|
100
|
+
stacking: BarXSeries['stacking'];
|
|
101
|
+
dataLabels: {
|
|
102
|
+
enabled: boolean;
|
|
103
|
+
inside: boolean;
|
|
104
|
+
style: BaseTextStyle;
|
|
105
|
+
allowOverlap: boolean;
|
|
106
|
+
padding: number;
|
|
107
|
+
html: boolean;
|
|
108
|
+
};
|
|
109
|
+
yAxis: number;
|
|
110
|
+
} & BasePreparedSeries;
|
|
111
|
+
export type PreparedBarYSeries = {
|
|
112
|
+
type: BarYSeries['type'];
|
|
113
|
+
data: BarYSeriesData[];
|
|
114
|
+
stackId: string;
|
|
115
|
+
stacking: BarYSeries['stacking'];
|
|
116
|
+
dataLabels: {
|
|
117
|
+
enabled: boolean;
|
|
118
|
+
inside: boolean;
|
|
119
|
+
style: BaseTextStyle;
|
|
120
|
+
maxHeight: number;
|
|
121
|
+
maxWidth: number;
|
|
122
|
+
html: boolean;
|
|
123
|
+
};
|
|
124
|
+
} & BasePreparedSeries;
|
|
125
|
+
export type PreparedPieSeries = {
|
|
126
|
+
type: PieSeries['type'];
|
|
127
|
+
data: PieSeriesData;
|
|
128
|
+
value: PieSeriesData['value'];
|
|
129
|
+
borderColor: string;
|
|
130
|
+
borderWidth: number;
|
|
131
|
+
borderRadius: number;
|
|
132
|
+
center?: [string | number | null, string | number | null];
|
|
133
|
+
radius?: string | number;
|
|
134
|
+
innerRadius?: string | number;
|
|
135
|
+
stackId: string;
|
|
136
|
+
label?: PieSeriesData['label'];
|
|
137
|
+
dataLabels: {
|
|
138
|
+
enabled: boolean;
|
|
139
|
+
padding: number;
|
|
140
|
+
style: BaseTextStyle;
|
|
141
|
+
allowOverlap: boolean;
|
|
142
|
+
connectorPadding: number;
|
|
143
|
+
connectorShape: ConnectorShape;
|
|
144
|
+
distance: number;
|
|
145
|
+
connectorCurve: ConnectorCurve;
|
|
146
|
+
html: boolean;
|
|
147
|
+
};
|
|
148
|
+
states: {
|
|
149
|
+
hover: {
|
|
150
|
+
halo: PreparedHaloOptions;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
renderCustomShape?: PieSeries['renderCustomShape'];
|
|
154
|
+
opacity: number | null;
|
|
155
|
+
} & BasePreparedSeries;
|
|
156
|
+
export type PreparedLineSeries = {
|
|
157
|
+
type: LineSeries['type'];
|
|
158
|
+
data: LineSeriesData[];
|
|
159
|
+
lineWidth: number;
|
|
160
|
+
dataLabels: {
|
|
161
|
+
enabled: boolean;
|
|
162
|
+
style: BaseTextStyle;
|
|
163
|
+
padding: number;
|
|
164
|
+
allowOverlap: boolean;
|
|
165
|
+
html: boolean;
|
|
166
|
+
};
|
|
167
|
+
marker: {
|
|
168
|
+
states: {
|
|
169
|
+
normal: {
|
|
170
|
+
symbol: `${SymbolType}`;
|
|
171
|
+
enabled: boolean;
|
|
172
|
+
radius: number;
|
|
173
|
+
borderWidth: number;
|
|
174
|
+
borderColor: string;
|
|
175
|
+
};
|
|
176
|
+
hover: {
|
|
177
|
+
enabled: boolean;
|
|
178
|
+
radius: number;
|
|
179
|
+
borderWidth: number;
|
|
180
|
+
borderColor: string;
|
|
181
|
+
halo: PreparedHaloOptions;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
dashStyle: DashStyle;
|
|
186
|
+
linecap: LineCap;
|
|
187
|
+
opacity: number | null;
|
|
188
|
+
yAxis: number;
|
|
189
|
+
} & BasePreparedSeries;
|
|
190
|
+
export type PreparedAreaSeries = {
|
|
191
|
+
type: AreaSeries['type'];
|
|
192
|
+
data: AreaSeriesData[];
|
|
193
|
+
stacking: AreaSeries['stacking'];
|
|
194
|
+
stackId: string;
|
|
195
|
+
lineWidth: number;
|
|
196
|
+
opacity: number;
|
|
197
|
+
dataLabels: {
|
|
198
|
+
enabled: boolean;
|
|
199
|
+
style: BaseTextStyle;
|
|
200
|
+
padding: number;
|
|
201
|
+
allowOverlap: boolean;
|
|
202
|
+
html: boolean;
|
|
203
|
+
};
|
|
204
|
+
marker: {
|
|
205
|
+
states: {
|
|
206
|
+
normal: {
|
|
207
|
+
symbol: `${SymbolType}`;
|
|
208
|
+
enabled: boolean;
|
|
209
|
+
radius: number;
|
|
210
|
+
borderWidth: number;
|
|
211
|
+
borderColor: string;
|
|
212
|
+
};
|
|
213
|
+
hover: {
|
|
214
|
+
enabled: boolean;
|
|
215
|
+
radius: number;
|
|
216
|
+
borderWidth: number;
|
|
217
|
+
borderColor: string;
|
|
218
|
+
halo: PreparedHaloOptions;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
yAxis: number;
|
|
223
|
+
} & BasePreparedSeries;
|
|
224
|
+
export type PreparedTreemapSeries = {
|
|
225
|
+
type: TreemapSeries['type'];
|
|
226
|
+
data: TreemapSeriesData[];
|
|
227
|
+
dataLabels: {
|
|
228
|
+
enabled: boolean;
|
|
229
|
+
style: BaseTextStyle;
|
|
230
|
+
padding: number;
|
|
231
|
+
allowOverlap: boolean;
|
|
232
|
+
html: boolean;
|
|
233
|
+
align: Required<Required<TreemapSeries>['dataLabels']>['align'];
|
|
234
|
+
};
|
|
235
|
+
layoutAlgorithm: `${LayoutAlgorithm}`;
|
|
236
|
+
} & BasePreparedSeries & Omit<TreemapSeries, keyof BasePreparedSeries>;
|
|
237
|
+
export type PreparedWaterfallSeries = {
|
|
238
|
+
type: WaterfallSeries['type'];
|
|
239
|
+
data: WaterfallSeriesData[];
|
|
240
|
+
dataLabels: {
|
|
241
|
+
enabled: boolean;
|
|
242
|
+
style: BaseTextStyle;
|
|
243
|
+
allowOverlap: boolean;
|
|
244
|
+
padding: number;
|
|
245
|
+
html: boolean;
|
|
246
|
+
};
|
|
247
|
+
positiveColor: string;
|
|
248
|
+
negativeColor: string;
|
|
249
|
+
} & BasePreparedSeries;
|
|
250
|
+
export type PreparedSeries = PreparedScatterSeries | PreparedBarXSeries | PreparedBarYSeries | PreparedPieSeries | PreparedLineSeries | PreparedAreaSeries | PreparedTreemapSeries | PreparedWaterfallSeries;
|
|
251
|
+
export type PreparedSeriesOptions = SeriesOptionsDefaults;
|
|
252
|
+
export type StackedSeries = BarXSeries | AreaSeries | BarYSeries;
|
|
253
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SymbolType } from '../../constants';
|
|
2
|
+
import type { ChartSeries } from '../../types';
|
|
3
|
+
import type { PreparedLegendSymbol, PreparedSeries, StackedSeries } from './types';
|
|
4
|
+
export declare const getActiveLegendItems: (series: PreparedSeries[]) => string[];
|
|
5
|
+
export declare const getAllLegendItems: (series: PreparedSeries[]) => string[];
|
|
6
|
+
export declare function prepareLegendSymbol(series: ChartSeries, symbolType?: `${SymbolType}`): PreparedLegendSymbol;
|
|
7
|
+
export declare function getSeriesStackId(series: StackedSeries): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import memoize from 'lodash/memoize';
|
|
2
|
+
import { SymbolType } from '../../constants';
|
|
3
|
+
import { getUniqId } from '../../utils';
|
|
4
|
+
import { DEFAULT_LEGEND_SYMBOL_PADDING, DEFAULT_LEGEND_SYMBOL_SIZE } from './constants';
|
|
5
|
+
export const getActiveLegendItems = (series) => {
|
|
6
|
+
return series.reduce((acc, s) => {
|
|
7
|
+
if (s.legend.enabled && s.visible) {
|
|
8
|
+
acc.push(s.name);
|
|
9
|
+
}
|
|
10
|
+
return acc;
|
|
11
|
+
}, []);
|
|
12
|
+
};
|
|
13
|
+
export const getAllLegendItems = (series) => {
|
|
14
|
+
return series.map((s) => s.name);
|
|
15
|
+
};
|
|
16
|
+
export function prepareLegendSymbol(series, symbolType) {
|
|
17
|
+
var _a;
|
|
18
|
+
const symbolOptions = ((_a = series.legend) === null || _a === void 0 ? void 0 : _a.symbol) || {};
|
|
19
|
+
return {
|
|
20
|
+
shape: 'symbol',
|
|
21
|
+
symbolType: symbolType || SymbolType.Circle,
|
|
22
|
+
width: (symbolOptions === null || symbolOptions === void 0 ? void 0 : symbolOptions.width) || DEFAULT_LEGEND_SYMBOL_SIZE,
|
|
23
|
+
padding: (symbolOptions === null || symbolOptions === void 0 ? void 0 : symbolOptions.padding) || DEFAULT_LEGEND_SYMBOL_PADDING,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const getCommonStackId = memoize(getUniqId);
|
|
27
|
+
export function getSeriesStackId(series) {
|
|
28
|
+
let stackId = series.stackId;
|
|
29
|
+
if (!stackId) {
|
|
30
|
+
stackId = series.stacking ? getCommonStackId() : getUniqId();
|
|
31
|
+
}
|
|
32
|
+
return stackId;
|
|
33
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ShapeDataWithHtmlItems } from '../../types';
|
|
3
|
+
type Props = {
|
|
4
|
+
htmlLayout: HTMLElement | null;
|
|
5
|
+
preparedData: ShapeDataWithHtmlItems | ShapeDataWithHtmlItems[];
|
|
6
|
+
};
|
|
7
|
+
export declare const HtmlLayer: (props: Props) => React.JSX.Element | null;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Portal } from '@gravity-ui/uikit';
|
|
3
|
+
export const HtmlLayer = (props) => {
|
|
4
|
+
const { htmlLayout, preparedData } = props;
|
|
5
|
+
const items = React.useMemo(() => {
|
|
6
|
+
if (Array.isArray(preparedData)) {
|
|
7
|
+
return preparedData.reduce((result, d) => {
|
|
8
|
+
result.push(...d.htmlElements);
|
|
9
|
+
return result;
|
|
10
|
+
}, []);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
return preparedData.htmlElements;
|
|
14
|
+
}
|
|
15
|
+
}, [preparedData]);
|
|
16
|
+
if (!htmlLayout) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return (React.createElement(Portal, { container: htmlLayout }, items.map((item, index) => {
|
|
20
|
+
return (React.createElement("div", { key: index, dangerouslySetInnerHTML: { __html: item.content }, style: { position: 'absolute', left: item.x, top: item.y } }));
|
|
21
|
+
})));
|
|
22
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Dispatch } from 'd3';
|
|
3
|
+
import type { PreparedSeriesOptions } from '../../useSeries/types';
|
|
4
|
+
import type { PreparedAreaData } from './types';
|
|
5
|
+
type Args = {
|
|
6
|
+
dispatcher: Dispatch<object>;
|
|
7
|
+
preparedData: PreparedAreaData[];
|
|
8
|
+
seriesOptions: PreparedSeriesOptions;
|
|
9
|
+
htmlLayout: HTMLElement | null;
|
|
10
|
+
};
|
|
11
|
+
export declare const AreaSeriesShapes: (args: Args) => React.JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { area as areaGenerator, color, line as lineGenerator, select } from 'd3';
|
|
3
|
+
import get from 'lodash/get';
|
|
4
|
+
import { block, filterOverlappingLabels } from '../../..//utils';
|
|
5
|
+
import { HtmlLayer } from '../HtmlLayer';
|
|
6
|
+
import { getMarkerHaloVisibility, getMarkerVisibility, renderMarker, selectMarkerHalo, selectMarkerSymbol, setMarker, } from '../marker';
|
|
7
|
+
import { setActiveState } from '../utils';
|
|
8
|
+
const b = block('d3-area');
|
|
9
|
+
export const AreaSeriesShapes = (args) => {
|
|
10
|
+
const { dispatcher, preparedData, seriesOptions, htmlLayout } = args;
|
|
11
|
+
const ref = React.useRef(null);
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
var _a;
|
|
14
|
+
if (!ref.current) {
|
|
15
|
+
return () => { };
|
|
16
|
+
}
|
|
17
|
+
const svgElement = select(ref.current);
|
|
18
|
+
const hoverOptions = get(seriesOptions, 'area.states.hover');
|
|
19
|
+
const inactiveOptions = get(seriesOptions, 'area.states.inactive');
|
|
20
|
+
const line = lineGenerator()
|
|
21
|
+
.x((d) => d.x)
|
|
22
|
+
.y((d) => d.y);
|
|
23
|
+
svgElement.selectAll('*').remove();
|
|
24
|
+
const shapeSelection = svgElement
|
|
25
|
+
.selectAll('shape')
|
|
26
|
+
.data(preparedData)
|
|
27
|
+
.join('g')
|
|
28
|
+
.attr('class', b('series'))
|
|
29
|
+
.attr('cursor', (d) => d.series.cursor);
|
|
30
|
+
shapeSelection
|
|
31
|
+
.append('path')
|
|
32
|
+
.attr('class', b('line'))
|
|
33
|
+
.attr('d', (d) => line(d.points))
|
|
34
|
+
.attr('fill', 'none')
|
|
35
|
+
.attr('stroke', (d) => d.color)
|
|
36
|
+
.attr('stroke-width', (d) => d.width)
|
|
37
|
+
.attr('stroke-linejoin', 'round')
|
|
38
|
+
.attr('stroke-linecap', 'round');
|
|
39
|
+
const area = areaGenerator()
|
|
40
|
+
.x((d) => d.x)
|
|
41
|
+
.y0((d) => d.y0)
|
|
42
|
+
.y1((d) => d.y);
|
|
43
|
+
shapeSelection
|
|
44
|
+
.append('path')
|
|
45
|
+
.attr('class', b('region'))
|
|
46
|
+
.attr('d', (d) => area(d.points))
|
|
47
|
+
.attr('fill', (d) => d.color)
|
|
48
|
+
.attr('opacity', (d) => d.opacity);
|
|
49
|
+
let dataLabels = preparedData.reduce((acc, d) => {
|
|
50
|
+
return acc.concat(d.labels);
|
|
51
|
+
}, []);
|
|
52
|
+
if (!((_a = preparedData[0]) === null || _a === void 0 ? void 0 : _a.series.dataLabels.allowOverlap)) {
|
|
53
|
+
dataLabels = filterOverlappingLabels(dataLabels);
|
|
54
|
+
}
|
|
55
|
+
const labelsSelection = svgElement
|
|
56
|
+
.selectAll('text')
|
|
57
|
+
.data(dataLabels)
|
|
58
|
+
.join('text')
|
|
59
|
+
.text((d) => d.text)
|
|
60
|
+
.attr('class', b('label'))
|
|
61
|
+
.attr('x', (d) => d.x)
|
|
62
|
+
.attr('y', (d) => d.y)
|
|
63
|
+
.attr('text-anchor', (d) => d.textAnchor)
|
|
64
|
+
.style('font-size', (d) => d.style.fontSize)
|
|
65
|
+
.style('font-weight', (d) => d.style.fontWeight || null)
|
|
66
|
+
.style('fill', (d) => d.style.fontColor || null);
|
|
67
|
+
const markers = preparedData.reduce((acc, d) => acc.concat(d.markers), []);
|
|
68
|
+
const markerSelection = svgElement
|
|
69
|
+
.selectAll('marker')
|
|
70
|
+
.data(markers)
|
|
71
|
+
.join('g')
|
|
72
|
+
.call(renderMarker);
|
|
73
|
+
const hoverEnabled = hoverOptions === null || hoverOptions === void 0 ? void 0 : hoverOptions.enabled;
|
|
74
|
+
const inactiveEnabled = inactiveOptions === null || inactiveOptions === void 0 ? void 0 : inactiveOptions.enabled;
|
|
75
|
+
dispatcher.on('hover-shape.area', (data) => {
|
|
76
|
+
const selected = (data === null || data === void 0 ? void 0 : data.filter((d) => d.series.type === 'area')) || [];
|
|
77
|
+
const selectedDataItems = selected.map((d) => d.data);
|
|
78
|
+
const selectedSeriesIds = selected.map((d) => { var _a; return (_a = d.series) === null || _a === void 0 ? void 0 : _a.id; });
|
|
79
|
+
shapeSelection.datum((d, index, list) => {
|
|
80
|
+
var _a;
|
|
81
|
+
const elementSelection = select(list[index]);
|
|
82
|
+
const hovered = Boolean(hoverEnabled && selectedSeriesIds.includes(d.id));
|
|
83
|
+
if (d.hovered !== hovered) {
|
|
84
|
+
d.hovered = hovered;
|
|
85
|
+
let strokeColor = d.color || '';
|
|
86
|
+
if (d.hovered) {
|
|
87
|
+
strokeColor =
|
|
88
|
+
((_a = color(strokeColor)) === null || _a === void 0 ? void 0 : _a.brighter(hoverOptions === null || hoverOptions === void 0 ? void 0 : hoverOptions.brightness).toString()) ||
|
|
89
|
+
strokeColor;
|
|
90
|
+
}
|
|
91
|
+
elementSelection.selectAll(`.${b('line')}`).attr('stroke', strokeColor);
|
|
92
|
+
elementSelection.selectAll(`.${b('region')}`).attr('fill', strokeColor);
|
|
93
|
+
}
|
|
94
|
+
return setActiveState({
|
|
95
|
+
element: list[index],
|
|
96
|
+
state: inactiveOptions,
|
|
97
|
+
active: Boolean(!inactiveEnabled ||
|
|
98
|
+
!selectedSeriesIds.length ||
|
|
99
|
+
selectedSeriesIds.includes(d.id)),
|
|
100
|
+
datum: d,
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
labelsSelection.datum((d, index, list) => {
|
|
104
|
+
return setActiveState({
|
|
105
|
+
element: list[index],
|
|
106
|
+
state: inactiveOptions,
|
|
107
|
+
active: Boolean(!inactiveEnabled ||
|
|
108
|
+
!selectedSeriesIds.length ||
|
|
109
|
+
selectedSeriesIds.includes(d.series.id)),
|
|
110
|
+
datum: d,
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
markerSelection.datum((d, index, list) => {
|
|
114
|
+
const elementSelection = select(list[index]);
|
|
115
|
+
const hovered = Boolean(hoverEnabled && selectedDataItems.includes(d.point.data));
|
|
116
|
+
if (d.hovered !== hovered) {
|
|
117
|
+
d.hovered = hovered;
|
|
118
|
+
elementSelection.attr('visibility', getMarkerVisibility(d));
|
|
119
|
+
selectMarkerHalo(elementSelection).attr('visibility', getMarkerHaloVisibility);
|
|
120
|
+
selectMarkerSymbol(elementSelection).call(setMarker, hovered ? 'hover' : 'normal');
|
|
121
|
+
}
|
|
122
|
+
if (d.point.series.marker.states.normal.enabled) {
|
|
123
|
+
const isActive = Boolean(!inactiveEnabled ||
|
|
124
|
+
!selectedSeriesIds.length ||
|
|
125
|
+
selectedSeriesIds.includes(d.point.series.id));
|
|
126
|
+
setActiveState({
|
|
127
|
+
element: list[index],
|
|
128
|
+
state: inactiveOptions,
|
|
129
|
+
active: isActive,
|
|
130
|
+
datum: d,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return d;
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
return () => {
|
|
137
|
+
dispatcher.on('hover-shape.area', null);
|
|
138
|
+
};
|
|
139
|
+
}, [dispatcher, preparedData, seriesOptions]);
|
|
140
|
+
return (React.createElement(React.Fragment, null,
|
|
141
|
+
React.createElement("g", { ref: ref, className: b() }),
|
|
142
|
+
React.createElement(HtmlLayer, { preparedData: preparedData, htmlLayout: htmlLayout })));
|
|
143
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ChartScale } from '../../useAxisScales';
|
|
2
|
+
import type { PreparedAxis } from '../../useChartOptions/types';
|
|
3
|
+
import type { PreparedAreaSeries } from '../../useSeries/types';
|
|
4
|
+
import type { PreparedAreaData } from './types';
|
|
5
|
+
export declare const prepareAreaData: (args: {
|
|
6
|
+
series: PreparedAreaSeries[];
|
|
7
|
+
xAxis: PreparedAxis;
|
|
8
|
+
xScale: ChartScale;
|
|
9
|
+
yAxis: PreparedAxis[];
|
|
10
|
+
yScale: ChartScale[];
|
|
11
|
+
boundsHeight: number;
|
|
12
|
+
}) => PreparedAreaData[];
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { group, sort } from 'd3';
|
|
2
|
+
import { getDataCategoryValue, getLabelsSize, getLeftPosition } from '../../../utils';
|
|
3
|
+
import { getXValue, getYValue } from '../utils';
|
|
4
|
+
function getLabelData(point, series, xMax) {
|
|
5
|
+
const text = String(point.data.label || point.data.y);
|
|
6
|
+
const style = series.dataLabels.style;
|
|
7
|
+
const size = getLabelsSize({ labels: [text], style, html: series.dataLabels.html });
|
|
8
|
+
const labelData = {
|
|
9
|
+
text,
|
|
10
|
+
x: point.x,
|
|
11
|
+
y: point.y - series.dataLabels.padding,
|
|
12
|
+
style,
|
|
13
|
+
size: { width: size.maxWidth, height: size.maxHeight },
|
|
14
|
+
textAnchor: 'middle',
|
|
15
|
+
series: series,
|
|
16
|
+
active: true,
|
|
17
|
+
};
|
|
18
|
+
const left = getLeftPosition(labelData);
|
|
19
|
+
if (left < 0) {
|
|
20
|
+
labelData.x = labelData.x + Math.abs(left);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const right = left + labelData.size.width;
|
|
24
|
+
if (right > xMax) {
|
|
25
|
+
labelData.x = labelData.x - (right - xMax);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return labelData;
|
|
29
|
+
}
|
|
30
|
+
function getXValues(series, xAxis, xScale) {
|
|
31
|
+
const categories = xAxis.categories || [];
|
|
32
|
+
const xValues = series.reduce((acc, s) => {
|
|
33
|
+
s.data.forEach((d) => {
|
|
34
|
+
const key = String(xAxis.type === 'category'
|
|
35
|
+
? getDataCategoryValue({ axisDirection: 'x', categories, data: d })
|
|
36
|
+
: d.x);
|
|
37
|
+
if (!acc.has(key)) {
|
|
38
|
+
acc.set(key, getXValue({ point: d, xAxis, xScale }));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return acc;
|
|
42
|
+
}, new Map());
|
|
43
|
+
if (xAxis.type === 'category') {
|
|
44
|
+
return categories.reduce((acc, category) => {
|
|
45
|
+
const xValue = xValues.get(category);
|
|
46
|
+
if (typeof xValue === 'number') {
|
|
47
|
+
acc.push([category, xValue]);
|
|
48
|
+
}
|
|
49
|
+
return acc;
|
|
50
|
+
}, []);
|
|
51
|
+
}
|
|
52
|
+
return sort(Array.from(xValues), ([_x, xValue]) => xValue);
|
|
53
|
+
}
|
|
54
|
+
export const prepareAreaData = (args) => {
|
|
55
|
+
const { series, xAxis, xScale, yAxis, yScale, boundsHeight: plotHeight } = args;
|
|
56
|
+
const [_xMin, xRangeMax] = xScale.range();
|
|
57
|
+
const xMax = xRangeMax / (1 - xAxis.maxPadding);
|
|
58
|
+
return Array.from(group(series, (s) => s.stackId)).reduce((result, [_stackId, seriesStack]) => {
|
|
59
|
+
const xValues = getXValues(seriesStack, xAxis, xScale);
|
|
60
|
+
const accumulatedYValues = new Map();
|
|
61
|
+
xValues.forEach(([key]) => {
|
|
62
|
+
accumulatedYValues.set(key, 0);
|
|
63
|
+
});
|
|
64
|
+
const seriesStackData = seriesStack.reduce((acc, s) => {
|
|
65
|
+
const yAxisIndex = s.yAxis;
|
|
66
|
+
const seriesYAxis = yAxis[yAxisIndex];
|
|
67
|
+
const seriesYScale = yScale[yAxisIndex];
|
|
68
|
+
const yMin = getYValue({ point: { y: 0 }, yAxis: seriesYAxis, yScale: seriesYScale });
|
|
69
|
+
const seriesData = s.data.reduce((m, d) => {
|
|
70
|
+
const key = String(xAxis.type === 'category'
|
|
71
|
+
? getDataCategoryValue({
|
|
72
|
+
axisDirection: 'x',
|
|
73
|
+
categories: xAxis.categories || [],
|
|
74
|
+
data: d,
|
|
75
|
+
})
|
|
76
|
+
: d.x);
|
|
77
|
+
return m.set(key, d);
|
|
78
|
+
}, new Map());
|
|
79
|
+
const points = xValues.reduce((pointsAcc, [x, xValue]) => {
|
|
80
|
+
const accumulatedYValue = accumulatedYValues.get(x) || 0;
|
|
81
|
+
const d = seriesData.get(x) ||
|
|
82
|
+
{
|
|
83
|
+
x,
|
|
84
|
+
// FIXME: think about how to break the series into separate areas(null Y values)
|
|
85
|
+
y: 0,
|
|
86
|
+
};
|
|
87
|
+
const yValue = getYValue({ point: d, yAxis: seriesYAxis, yScale: seriesYScale }) -
|
|
88
|
+
accumulatedYValue;
|
|
89
|
+
accumulatedYValues.set(x, yMin - yValue);
|
|
90
|
+
pointsAcc.push({
|
|
91
|
+
y0: yMin - accumulatedYValue,
|
|
92
|
+
x: xValue,
|
|
93
|
+
y: yValue,
|
|
94
|
+
data: d,
|
|
95
|
+
series: s,
|
|
96
|
+
});
|
|
97
|
+
return pointsAcc;
|
|
98
|
+
}, []);
|
|
99
|
+
let labels = [];
|
|
100
|
+
const htmlElements = [];
|
|
101
|
+
if (s.dataLabels.enabled) {
|
|
102
|
+
const labelItems = points.map((p) => getLabelData(p, s, xMax));
|
|
103
|
+
if (s.dataLabels.html) {
|
|
104
|
+
const htmlLabels = labelItems.map((l) => {
|
|
105
|
+
return {
|
|
106
|
+
x: l.x - l.size.width / 2,
|
|
107
|
+
y: l.y,
|
|
108
|
+
content: l.text,
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
htmlElements.push(...htmlLabels);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
labels = labelItems;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
let markers = [];
|
|
118
|
+
if (s.marker.states.normal.enabled || s.marker.states.hover.enabled) {
|
|
119
|
+
markers = points.map((p) => ({
|
|
120
|
+
point: p,
|
|
121
|
+
active: true,
|
|
122
|
+
hovered: false,
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
acc.push({
|
|
126
|
+
points,
|
|
127
|
+
markers,
|
|
128
|
+
labels,
|
|
129
|
+
color: s.color,
|
|
130
|
+
opacity: s.opacity,
|
|
131
|
+
width: s.lineWidth,
|
|
132
|
+
series: s,
|
|
133
|
+
hovered: false,
|
|
134
|
+
active: true,
|
|
135
|
+
id: s.id,
|
|
136
|
+
htmlElements,
|
|
137
|
+
});
|
|
138
|
+
return acc;
|
|
139
|
+
}, []);
|
|
140
|
+
if (series.some((s) => s.stacking === 'percent')) {
|
|
141
|
+
xValues.forEach(([x], index) => {
|
|
142
|
+
const stackHeight = accumulatedYValues.get(x) || 0;
|
|
143
|
+
let acc = 0;
|
|
144
|
+
const ratio = plotHeight / stackHeight;
|
|
145
|
+
seriesStackData.forEach((item) => {
|
|
146
|
+
const point = item.points[index];
|
|
147
|
+
if (point) {
|
|
148
|
+
const height = (point.y0 - point.y) * ratio;
|
|
149
|
+
point.y0 = plotHeight - height - acc;
|
|
150
|
+
point.y = point.y0 + height;
|
|
151
|
+
acc += height;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
return result.concat(seriesStackData);
|
|
157
|
+
}, []);
|
|
158
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AreaSeriesData, HtmlItem, LabelData } from '../../../types';
|
|
2
|
+
import type { PreparedAreaSeries } from '../../useSeries/types';
|
|
3
|
+
export type PointData = {
|
|
4
|
+
y0: number;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
data: AreaSeriesData;
|
|
8
|
+
series: PreparedAreaSeries;
|
|
9
|
+
};
|
|
10
|
+
export type MarkerData = {
|
|
11
|
+
point: PointData;
|
|
12
|
+
active: boolean;
|
|
13
|
+
hovered: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type PreparedAreaData = {
|
|
16
|
+
id: string;
|
|
17
|
+
points: PointData[];
|
|
18
|
+
markers: MarkerData[];
|
|
19
|
+
color: string;
|
|
20
|
+
opacity: number;
|
|
21
|
+
width: number;
|
|
22
|
+
series: PreparedAreaSeries;
|
|
23
|
+
hovered: boolean;
|
|
24
|
+
active: boolean;
|
|
25
|
+
labels: LabelData[];
|
|
26
|
+
htmlElements: HtmlItem[];
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|