@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,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Dispatch } from 'd3';
|
|
3
|
+
import type { PreparedSeriesOptions } from '../../useSeries/types';
|
|
4
|
+
import type { PreparedBarXData } from './types';
|
|
5
|
+
export { prepareBarXData } from './prepare-data';
|
|
6
|
+
export * from './types';
|
|
7
|
+
type Args = {
|
|
8
|
+
dispatcher: Dispatch<object>;
|
|
9
|
+
preparedData: PreparedBarXData[];
|
|
10
|
+
seriesOptions: PreparedSeriesOptions;
|
|
11
|
+
htmlLayout: HTMLElement | null;
|
|
12
|
+
};
|
|
13
|
+
export declare const BarXSeriesShapes: (args: Args) => React.JSX.Element;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { color, select } from 'd3';
|
|
3
|
+
import get from 'lodash/get';
|
|
4
|
+
import { block, filterOverlappingLabels } from '../../../utils';
|
|
5
|
+
import { HtmlLayer } from '../HtmlLayer';
|
|
6
|
+
export { prepareBarXData } from './prepare-data';
|
|
7
|
+
export * from './types';
|
|
8
|
+
const b = block('d3-bar-x');
|
|
9
|
+
export const BarXSeriesShapes = (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, 'bar-x.states.hover');
|
|
19
|
+
const inactiveOptions = get(seriesOptions, 'bar-x.states.inactive');
|
|
20
|
+
svgElement.selectAll('*').remove();
|
|
21
|
+
const rectSelection = svgElement
|
|
22
|
+
.selectAll('allRects')
|
|
23
|
+
.data(preparedData)
|
|
24
|
+
.join('rect')
|
|
25
|
+
.attr('class', b('segment'))
|
|
26
|
+
.attr('x', (d) => d.x)
|
|
27
|
+
.attr('y', (d) => d.y)
|
|
28
|
+
.attr('height', (d) => d.height)
|
|
29
|
+
.attr('width', (d) => d.width)
|
|
30
|
+
.attr('fill', (d) => d.data.color || d.series.color)
|
|
31
|
+
.attr('opacity', (d) => d.opacity)
|
|
32
|
+
.attr('cursor', (d) => d.series.cursor);
|
|
33
|
+
let dataLabels = preparedData.map((d) => d.label).filter(Boolean);
|
|
34
|
+
if (!((_a = preparedData[0]) === null || _a === void 0 ? void 0 : _a.series.dataLabels.allowOverlap)) {
|
|
35
|
+
dataLabels = filterOverlappingLabels(dataLabels);
|
|
36
|
+
}
|
|
37
|
+
const labelSelection = svgElement
|
|
38
|
+
.selectAll('text')
|
|
39
|
+
.data(dataLabels)
|
|
40
|
+
.join('text')
|
|
41
|
+
.text((d) => d.text)
|
|
42
|
+
.attr('class', b('label'))
|
|
43
|
+
.attr('x', (d) => d.x)
|
|
44
|
+
.attr('y', (d) => d.y)
|
|
45
|
+
.attr('text-anchor', (d) => d.textAnchor)
|
|
46
|
+
.style('font-size', (d) => d.style.fontSize)
|
|
47
|
+
.style('font-weight', (d) => d.style.fontWeight || null)
|
|
48
|
+
.style('fill', (d) => d.style.fontColor || null);
|
|
49
|
+
dispatcher.on('hover-shape.bar-x', (data) => {
|
|
50
|
+
const hoverEnabled = hoverOptions === null || hoverOptions === void 0 ? void 0 : hoverOptions.enabled;
|
|
51
|
+
const inactiveEnabled = inactiveOptions === null || inactiveOptions === void 0 ? void 0 : inactiveOptions.enabled;
|
|
52
|
+
if (!data) {
|
|
53
|
+
if (hoverEnabled) {
|
|
54
|
+
rectSelection.attr('fill', (d) => d.data.color || d.series.color);
|
|
55
|
+
}
|
|
56
|
+
if (inactiveEnabled) {
|
|
57
|
+
rectSelection.attr('opacity', null);
|
|
58
|
+
labelSelection.attr('opacity', null);
|
|
59
|
+
}
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (hoverEnabled) {
|
|
63
|
+
const hoveredValues = data.map((d) => d.data.x);
|
|
64
|
+
rectSelection.attr('fill', (d) => {
|
|
65
|
+
var _a;
|
|
66
|
+
const fillColor = d.data.color || d.series.color;
|
|
67
|
+
if (hoveredValues.includes(d.data.x)) {
|
|
68
|
+
return (((_a = color(fillColor)) === null || _a === void 0 ? void 0 : _a.brighter(hoverOptions === null || hoverOptions === void 0 ? void 0 : hoverOptions.brightness).toString()) ||
|
|
69
|
+
fillColor);
|
|
70
|
+
}
|
|
71
|
+
return fillColor;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
if (inactiveEnabled) {
|
|
75
|
+
const hoveredSeries = data.map((d) => d.series.id);
|
|
76
|
+
rectSelection.attr('opacity', (d) => {
|
|
77
|
+
return hoveredSeries.includes(d.series.id)
|
|
78
|
+
? null
|
|
79
|
+
: (inactiveOptions === null || inactiveOptions === void 0 ? void 0 : inactiveOptions.opacity) || null;
|
|
80
|
+
});
|
|
81
|
+
labelSelection.attr('opacity', (d) => {
|
|
82
|
+
return hoveredSeries.includes(d.series.id)
|
|
83
|
+
? null
|
|
84
|
+
: (inactiveOptions === null || inactiveOptions === void 0 ? void 0 : inactiveOptions.opacity) || null;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
return () => {
|
|
89
|
+
dispatcher.on('hover-shape.bar-x', null);
|
|
90
|
+
};
|
|
91
|
+
}, [dispatcher, preparedData, seriesOptions]);
|
|
92
|
+
return (React.createElement(React.Fragment, null,
|
|
93
|
+
React.createElement("g", { ref: ref, className: b() }),
|
|
94
|
+
React.createElement(HtmlLayer, { preparedData: preparedData, htmlLayout: htmlLayout })));
|
|
95
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChartScale } from '../../useAxisScales';
|
|
2
|
+
import type { PreparedAxis } from '../../useChartOptions/types';
|
|
3
|
+
import type { PreparedBarXSeries, PreparedSeriesOptions } from '../../useSeries/types';
|
|
4
|
+
import type { PreparedBarXData } from './types';
|
|
5
|
+
export declare const prepareBarXData: (args: {
|
|
6
|
+
series: PreparedBarXSeries[];
|
|
7
|
+
seriesOptions: PreparedSeriesOptions;
|
|
8
|
+
xAxis: PreparedAxis;
|
|
9
|
+
xScale: ChartScale;
|
|
10
|
+
yAxis: PreparedAxis[];
|
|
11
|
+
yScale: ChartScale[];
|
|
12
|
+
boundsHeight: number;
|
|
13
|
+
}) => PreparedBarXData[];
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { ascending, descending, max, sort } from 'd3';
|
|
2
|
+
import get from 'lodash/get';
|
|
3
|
+
import { getDataCategoryValue, getLabelsSize } from '../../../utils';
|
|
4
|
+
import { MIN_BAR_GAP, MIN_BAR_GROUP_GAP, MIN_BAR_WIDTH } from '../constants';
|
|
5
|
+
function getLabelData(d) {
|
|
6
|
+
if (!d.series.dataLabels.enabled) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
const text = String(d.data.label || d.data.y);
|
|
10
|
+
const style = d.series.dataLabels.style;
|
|
11
|
+
const html = d.series.dataLabels.html;
|
|
12
|
+
const { maxHeight: height, maxWidth: width } = getLabelsSize({
|
|
13
|
+
labels: [text],
|
|
14
|
+
style,
|
|
15
|
+
html,
|
|
16
|
+
});
|
|
17
|
+
let y = Math.max(height, d.y - d.series.dataLabels.padding);
|
|
18
|
+
if (d.series.dataLabels.inside) {
|
|
19
|
+
y = d.y + d.height / 2;
|
|
20
|
+
}
|
|
21
|
+
const x = d.x + d.width / 2;
|
|
22
|
+
return {
|
|
23
|
+
text,
|
|
24
|
+
x: html ? x - width / 2 : x,
|
|
25
|
+
y: html ? y - height : y,
|
|
26
|
+
style,
|
|
27
|
+
size: { width, height },
|
|
28
|
+
textAnchor: 'middle',
|
|
29
|
+
series: d.series,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export const prepareBarXData = (args) => {
|
|
33
|
+
const { series, seriesOptions, xAxis, xScale, yScale, boundsHeight: plotHeight } = args;
|
|
34
|
+
const categories = get(xAxis, 'categories', []);
|
|
35
|
+
const barMaxWidth = get(seriesOptions, 'bar-x.barMaxWidth');
|
|
36
|
+
const barPadding = get(seriesOptions, 'bar-x.barPadding');
|
|
37
|
+
const groupPadding = get(seriesOptions, 'bar-x.groupPadding');
|
|
38
|
+
const sortingOptions = get(seriesOptions, 'bar-x.dataSorting');
|
|
39
|
+
const comparator = (sortingOptions === null || sortingOptions === void 0 ? void 0 : sortingOptions.direction) === 'desc' ? descending : ascending;
|
|
40
|
+
const sortKey = (() => {
|
|
41
|
+
switch (sortingOptions === null || sortingOptions === void 0 ? void 0 : sortingOptions.key) {
|
|
42
|
+
case 'y': {
|
|
43
|
+
return 'data.y';
|
|
44
|
+
}
|
|
45
|
+
case 'name': {
|
|
46
|
+
return 'series.name';
|
|
47
|
+
}
|
|
48
|
+
default: {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
})();
|
|
53
|
+
const data = {};
|
|
54
|
+
series.forEach((s) => {
|
|
55
|
+
s.data.forEach((d) => {
|
|
56
|
+
const xValue = xAxis.type === 'category'
|
|
57
|
+
? getDataCategoryValue({ axisDirection: 'x', categories, data: d })
|
|
58
|
+
: d.x;
|
|
59
|
+
if (xValue) {
|
|
60
|
+
if (!data[xValue]) {
|
|
61
|
+
data[xValue] = {};
|
|
62
|
+
}
|
|
63
|
+
const xGroup = data[xValue];
|
|
64
|
+
if (!xGroup[s.stackId]) {
|
|
65
|
+
xGroup[s.stackId] = [];
|
|
66
|
+
}
|
|
67
|
+
xGroup[s.stackId].push({ data: d, series: s });
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
let bandWidth = Infinity;
|
|
72
|
+
if (xAxis.type === 'category') {
|
|
73
|
+
const xBandScale = xScale;
|
|
74
|
+
bandWidth = xBandScale.bandwidth();
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
const xLinearScale = xScale;
|
|
78
|
+
const xValues = series.reduce((acc, s) => {
|
|
79
|
+
s.data.forEach((dataItem) => acc.push(Number(dataItem.x)));
|
|
80
|
+
return acc;
|
|
81
|
+
}, []);
|
|
82
|
+
xValues.sort().forEach((xValue, index) => {
|
|
83
|
+
if (index > 0 && xValue !== xValues[index - 1]) {
|
|
84
|
+
const dist = xLinearScale(xValue) - xLinearScale(xValues[index - 1]);
|
|
85
|
+
if (dist < bandWidth) {
|
|
86
|
+
bandWidth = dist;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const maxGroupSize = max(Object.values(data), (d) => Object.values(d).length) || 1;
|
|
92
|
+
const groupGap = Math.max(bandWidth * groupPadding, MIN_BAR_GROUP_GAP);
|
|
93
|
+
const groupWidth = bandWidth - groupGap;
|
|
94
|
+
const rectGap = Math.max(bandWidth * barPadding, MIN_BAR_GAP);
|
|
95
|
+
const rectWidth = Math.max(MIN_BAR_WIDTH, Math.min(groupWidth / maxGroupSize - rectGap, barMaxWidth));
|
|
96
|
+
const result = [];
|
|
97
|
+
Object.entries(data).forEach(([xValue, val]) => {
|
|
98
|
+
const stacks = Object.values(val);
|
|
99
|
+
const currentGroupWidth = rectWidth * stacks.length + rectGap * (stacks.length - 1);
|
|
100
|
+
stacks.forEach((yValues, groupItemIndex) => {
|
|
101
|
+
let stackHeight = 0;
|
|
102
|
+
const stackItems = [];
|
|
103
|
+
const sortedData = sortKey
|
|
104
|
+
? sort(yValues, (a, b) => comparator(get(a, sortKey), get(b, sortKey)))
|
|
105
|
+
: yValues;
|
|
106
|
+
sortedData.forEach((yValue) => {
|
|
107
|
+
const yAxisIndex = yValue.series.yAxis;
|
|
108
|
+
const seriesYScale = yScale[yAxisIndex];
|
|
109
|
+
let xCenter;
|
|
110
|
+
if (xAxis.type === 'category') {
|
|
111
|
+
const xBandScale = xScale;
|
|
112
|
+
xCenter = (xBandScale(xValue) || 0) + xBandScale.bandwidth() / 2;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
const xLinearScale = xScale;
|
|
116
|
+
xCenter = xLinearScale(Number(xValue));
|
|
117
|
+
}
|
|
118
|
+
const x = xCenter - currentGroupWidth / 2 + (rectWidth + rectGap) * groupItemIndex;
|
|
119
|
+
const yDataValue = yValue.data.y;
|
|
120
|
+
const y = seriesYScale(yDataValue);
|
|
121
|
+
const base = seriesYScale(0);
|
|
122
|
+
const height = yDataValue > 0 ? base - y : y - base;
|
|
123
|
+
const barData = {
|
|
124
|
+
x,
|
|
125
|
+
y: yDataValue > 0 ? y - stackHeight : seriesYScale(0),
|
|
126
|
+
width: rectWidth,
|
|
127
|
+
height,
|
|
128
|
+
opacity: get(yValue.data, 'opacity', null),
|
|
129
|
+
data: yValue.data,
|
|
130
|
+
series: yValue.series,
|
|
131
|
+
htmlElements: [],
|
|
132
|
+
};
|
|
133
|
+
const label = getLabelData(barData);
|
|
134
|
+
if (yValue.series.dataLabels.html && label) {
|
|
135
|
+
barData.htmlElements.push({
|
|
136
|
+
x: label.x,
|
|
137
|
+
y: label.y,
|
|
138
|
+
content: label.text,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
barData.label = getLabelData(barData);
|
|
143
|
+
}
|
|
144
|
+
stackItems.push(barData);
|
|
145
|
+
stackHeight += height + 1;
|
|
146
|
+
});
|
|
147
|
+
if (series.some((s) => s.stacking === 'percent')) {
|
|
148
|
+
let acc = 0;
|
|
149
|
+
const ratio = plotHeight / (stackHeight - stackItems.length);
|
|
150
|
+
stackItems.forEach((item) => {
|
|
151
|
+
item.height = item.height * ratio;
|
|
152
|
+
item.y = plotHeight - item.height - acc;
|
|
153
|
+
acc += item.height + 1;
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
result.push(...stackItems);
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
return result;
|
|
160
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HtmlItem, LabelData, TooltipDataChunkBarX } from '../../../types';
|
|
2
|
+
import type { PreparedBarXSeries } from '../../useSeries/types';
|
|
3
|
+
export type PreparedBarXData = Omit<TooltipDataChunkBarX, 'series'> & {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
opacity: number | null;
|
|
9
|
+
series: PreparedBarXSeries;
|
|
10
|
+
label?: LabelData;
|
|
11
|
+
htmlElements: HtmlItem[];
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 { PreparedBarYData } from './types';
|
|
5
|
+
export { prepareBarYData } from './prepare-data';
|
|
6
|
+
type Args = {
|
|
7
|
+
dispatcher: Dispatch<object>;
|
|
8
|
+
preparedData: PreparedBarYData[];
|
|
9
|
+
seriesOptions: PreparedSeriesOptions;
|
|
10
|
+
htmlLayout: HTMLElement | null;
|
|
11
|
+
};
|
|
12
|
+
export declare const BarYSeriesShapes: (args: Args) => React.JSX.Element;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { color, select } from 'd3';
|
|
3
|
+
import get from 'lodash/get';
|
|
4
|
+
import { block } from '../../../utils';
|
|
5
|
+
import { HtmlLayer } from '../HtmlLayer';
|
|
6
|
+
export { prepareBarYData } from './prepare-data';
|
|
7
|
+
const b = block('d3-bar-y');
|
|
8
|
+
export const BarYSeriesShapes = (args) => {
|
|
9
|
+
const { dispatcher, preparedData, seriesOptions, htmlLayout } = args;
|
|
10
|
+
const ref = React.useRef(null);
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
if (!ref.current) {
|
|
13
|
+
return () => { };
|
|
14
|
+
}
|
|
15
|
+
const svgElement = select(ref.current);
|
|
16
|
+
svgElement.selectAll('*').remove();
|
|
17
|
+
const rectSelection = svgElement
|
|
18
|
+
.selectAll('rect')
|
|
19
|
+
.data(preparedData)
|
|
20
|
+
.join('rect')
|
|
21
|
+
.attr('class', b('segment'))
|
|
22
|
+
.attr('x', (d) => d.x)
|
|
23
|
+
.attr('y', (d) => d.y)
|
|
24
|
+
.attr('height', (d) => d.height)
|
|
25
|
+
.attr('width', (d) => d.width)
|
|
26
|
+
.attr('fill', (d) => d.color)
|
|
27
|
+
.attr('opacity', (d) => d.data.opacity || null)
|
|
28
|
+
.attr('cursor', (d) => d.series.cursor);
|
|
29
|
+
const dataLabels = preparedData.reduce((acc, d) => {
|
|
30
|
+
if (d.label) {
|
|
31
|
+
acc.push(d.label);
|
|
32
|
+
}
|
|
33
|
+
return acc;
|
|
34
|
+
}, []);
|
|
35
|
+
const labelSelection = svgElement
|
|
36
|
+
.selectAll('text')
|
|
37
|
+
.data(dataLabels)
|
|
38
|
+
.join('text')
|
|
39
|
+
.text((d) => d.text)
|
|
40
|
+
.attr('class', b('label'))
|
|
41
|
+
.attr('x', (d) => d.x)
|
|
42
|
+
.attr('y', (d) => d.y)
|
|
43
|
+
.attr('text-anchor', (d) => d.textAnchor)
|
|
44
|
+
.style('font-size', (d) => d.style.fontSize)
|
|
45
|
+
.style('font-weight', (d) => d.style.fontWeight || null)
|
|
46
|
+
.style('fill', (d) => d.style.fontColor || null);
|
|
47
|
+
const hoverOptions = get(seriesOptions, 'bar-y.states.hover');
|
|
48
|
+
const inactiveOptions = get(seriesOptions, 'bar-y.states.inactive');
|
|
49
|
+
dispatcher.on('hover-shape.bar-y', (data) => {
|
|
50
|
+
if (hoverOptions === null || hoverOptions === void 0 ? void 0 : hoverOptions.enabled) {
|
|
51
|
+
const hovered = data === null || data === void 0 ? void 0 : data.reduce((acc, d) => {
|
|
52
|
+
acc.add(d.data.y);
|
|
53
|
+
return acc;
|
|
54
|
+
}, new Set());
|
|
55
|
+
rectSelection.attr('fill', (d) => {
|
|
56
|
+
var _a;
|
|
57
|
+
const fillColor = d.color;
|
|
58
|
+
if (hovered === null || hovered === void 0 ? void 0 : hovered.has(d.data.y)) {
|
|
59
|
+
return (((_a = color(fillColor)) === null || _a === void 0 ? void 0 : _a.brighter(hoverOptions.brightness).toString()) ||
|
|
60
|
+
fillColor);
|
|
61
|
+
}
|
|
62
|
+
return fillColor;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (inactiveOptions === null || inactiveOptions === void 0 ? void 0 : inactiveOptions.enabled) {
|
|
66
|
+
const hoveredSeries = data === null || data === void 0 ? void 0 : data.map((d) => d.series.id);
|
|
67
|
+
const newOpacity = (d) => {
|
|
68
|
+
if ((hoveredSeries === null || hoveredSeries === void 0 ? void 0 : hoveredSeries.length) && !hoveredSeries.includes(d.series.id)) {
|
|
69
|
+
return inactiveOptions.opacity || null;
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
};
|
|
73
|
+
rectSelection.attr('opacity', newOpacity);
|
|
74
|
+
labelSelection.attr('opacity', newOpacity);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return () => {
|
|
78
|
+
dispatcher.on('hover-shape.bar-y', null);
|
|
79
|
+
};
|
|
80
|
+
}, [dispatcher, preparedData, seriesOptions]);
|
|
81
|
+
return (React.createElement(React.Fragment, null,
|
|
82
|
+
React.createElement("g", { ref: ref, className: b() }),
|
|
83
|
+
React.createElement(HtmlLayer, { preparedData: preparedData, htmlLayout: htmlLayout })));
|
|
84
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ChartScale } from '../../useAxisScales';
|
|
2
|
+
import type { PreparedAxis } from '../../useChartOptions/types';
|
|
3
|
+
import type { PreparedBarYSeries, PreparedSeriesOptions } from '../../useSeries/types';
|
|
4
|
+
import type { PreparedBarYData } from './types';
|
|
5
|
+
export declare const prepareBarYData: (args: {
|
|
6
|
+
series: PreparedBarYSeries[];
|
|
7
|
+
seriesOptions: PreparedSeriesOptions;
|
|
8
|
+
xAxis: PreparedAxis;
|
|
9
|
+
xScale: ChartScale;
|
|
10
|
+
yAxis: PreparedAxis[];
|
|
11
|
+
yScale: ChartScale[];
|
|
12
|
+
}) => PreparedBarYData[];
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { ascending, descending, max, sort } from 'd3';
|
|
2
|
+
import get from 'lodash/get';
|
|
3
|
+
import { getDataCategoryValue, getLabelsSize } from '../../../utils';
|
|
4
|
+
import { MIN_BAR_GAP, MIN_BAR_GROUP_GAP, MIN_BAR_WIDTH } from '../constants';
|
|
5
|
+
const DEFAULT_LABEL_PADDING = 7;
|
|
6
|
+
function groupByYValue(series, yAxis) {
|
|
7
|
+
const data = {};
|
|
8
|
+
series.forEach((s) => {
|
|
9
|
+
s.data.forEach((d) => {
|
|
10
|
+
const axisIndex = get(s, 'yAxis', 0);
|
|
11
|
+
const seriesYAxis = yAxis[axisIndex];
|
|
12
|
+
const categories = get(seriesYAxis, 'categories', []);
|
|
13
|
+
const key = seriesYAxis.type === 'category'
|
|
14
|
+
? getDataCategoryValue({ axisDirection: 'y', categories, data: d })
|
|
15
|
+
: d.y;
|
|
16
|
+
if (key) {
|
|
17
|
+
if (!data[key]) {
|
|
18
|
+
data[key] = {};
|
|
19
|
+
}
|
|
20
|
+
if (!data[key][s.stackId]) {
|
|
21
|
+
data[key][s.stackId] = [];
|
|
22
|
+
}
|
|
23
|
+
data[key][s.stackId].push({ data: d, series: s });
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
29
|
+
function getBandWidth(series, yAxis, yScale) {
|
|
30
|
+
let bandWidth = Infinity;
|
|
31
|
+
if (yAxis[0].type === 'category') {
|
|
32
|
+
bandWidth = yScale.bandwidth();
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
const scale = yScale;
|
|
36
|
+
const axisValues = series.reduce((acc, s) => {
|
|
37
|
+
s.data.forEach((dataItem) => acc.push(Number(dataItem.y)));
|
|
38
|
+
return acc;
|
|
39
|
+
}, []);
|
|
40
|
+
axisValues.sort().forEach((value, index) => {
|
|
41
|
+
if (index > 0 && value !== axisValues[index - 1]) {
|
|
42
|
+
const dist = scale(value) - scale(axisValues[index - 1]);
|
|
43
|
+
if (dist < bandWidth) {
|
|
44
|
+
bandWidth = dist;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return bandWidth;
|
|
50
|
+
}
|
|
51
|
+
function setLabel(prepared) {
|
|
52
|
+
const dataLabels = prepared.series.dataLabels;
|
|
53
|
+
if (!dataLabels.enabled) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const data = prepared.data;
|
|
57
|
+
const content = String(data.label || data.x);
|
|
58
|
+
const { maxHeight: height, maxWidth: width } = getLabelsSize({
|
|
59
|
+
labels: [content],
|
|
60
|
+
style: dataLabels.style,
|
|
61
|
+
html: dataLabels.html,
|
|
62
|
+
});
|
|
63
|
+
const x = dataLabels.inside
|
|
64
|
+
? prepared.x + prepared.width / 2
|
|
65
|
+
: prepared.x + prepared.width + DEFAULT_LABEL_PADDING;
|
|
66
|
+
const y = prepared.y + prepared.height / 2;
|
|
67
|
+
if (dataLabels.html) {
|
|
68
|
+
prepared.htmlElements.push({
|
|
69
|
+
x,
|
|
70
|
+
y: y - height / 2,
|
|
71
|
+
content,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
prepared.label = {
|
|
76
|
+
x,
|
|
77
|
+
y: y + height / 2,
|
|
78
|
+
text: content,
|
|
79
|
+
textAnchor: dataLabels.inside ? 'middle' : 'right',
|
|
80
|
+
style: dataLabels.style,
|
|
81
|
+
series: prepared.series,
|
|
82
|
+
size: { width, height },
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export const prepareBarYData = (args) => {
|
|
87
|
+
const { series, seriesOptions, yAxis, xScale, yScale: [yScale], } = args;
|
|
88
|
+
const xLinearScale = xScale;
|
|
89
|
+
const plotWidth = xLinearScale(xLinearScale.domain()[1]);
|
|
90
|
+
const barMaxWidth = get(seriesOptions, 'bar-y.barMaxWidth');
|
|
91
|
+
const barPadding = get(seriesOptions, 'bar-y.barPadding');
|
|
92
|
+
const groupPadding = get(seriesOptions, 'bar-y.groupPadding');
|
|
93
|
+
const sortingOptions = get(seriesOptions, 'bar-y.dataSorting');
|
|
94
|
+
const comparator = (sortingOptions === null || sortingOptions === void 0 ? void 0 : sortingOptions.direction) === 'desc' ? descending : ascending;
|
|
95
|
+
const sortKey = (() => {
|
|
96
|
+
switch (sortingOptions === null || sortingOptions === void 0 ? void 0 : sortingOptions.key) {
|
|
97
|
+
case 'x': {
|
|
98
|
+
return 'data.x';
|
|
99
|
+
}
|
|
100
|
+
case 'name': {
|
|
101
|
+
return 'series.name';
|
|
102
|
+
}
|
|
103
|
+
default: {
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
})();
|
|
108
|
+
const groupedData = groupByYValue(series, yAxis);
|
|
109
|
+
const bandWidth = getBandWidth(series, yAxis, yScale);
|
|
110
|
+
const maxGroupSize = max(Object.values(groupedData), (d) => Object.values(d).length) || 1;
|
|
111
|
+
const groupGap = Math.max(bandWidth * groupPadding, MIN_BAR_GROUP_GAP);
|
|
112
|
+
const groupWidth = bandWidth - groupGap;
|
|
113
|
+
const rectGap = Math.max(bandWidth * barPadding, MIN_BAR_GAP);
|
|
114
|
+
const barHeight = Math.max(MIN_BAR_WIDTH, Math.min(groupWidth / maxGroupSize - rectGap, barMaxWidth));
|
|
115
|
+
const result = [];
|
|
116
|
+
Object.entries(groupedData).forEach(([yValue, val]) => {
|
|
117
|
+
const stacks = Object.values(val);
|
|
118
|
+
const currentBarHeight = barHeight * stacks.length + rectGap * (stacks.length - 1);
|
|
119
|
+
stacks.forEach((measureValues, groupItemIndex) => {
|
|
120
|
+
const base = xLinearScale(0);
|
|
121
|
+
let stackSum = base;
|
|
122
|
+
const stackItems = [];
|
|
123
|
+
const sortedData = sortKey
|
|
124
|
+
? sort(measureValues, (a, b) => comparator(get(a, sortKey), get(b, sortKey)))
|
|
125
|
+
: measureValues;
|
|
126
|
+
sortedData.forEach(({ data, series: s }) => {
|
|
127
|
+
let center;
|
|
128
|
+
if (yAxis[0].type === 'category') {
|
|
129
|
+
const bandScale = yScale;
|
|
130
|
+
center = (bandScale(yValue) || 0) + bandWidth / 2;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
const scale = yScale;
|
|
134
|
+
center = scale(Number(yValue));
|
|
135
|
+
}
|
|
136
|
+
const y = center - currentBarHeight / 2 + (barHeight + rectGap) * groupItemIndex;
|
|
137
|
+
const xValue = Number(data.x);
|
|
138
|
+
const width = xValue > 0 ? xLinearScale(xValue) - base : base - xLinearScale(xValue);
|
|
139
|
+
const item = {
|
|
140
|
+
x: xValue > 0 ? stackSum : stackSum - width,
|
|
141
|
+
y,
|
|
142
|
+
width,
|
|
143
|
+
height: barHeight,
|
|
144
|
+
color: data.color || s.color,
|
|
145
|
+
opacity: get(data, 'opacity', null),
|
|
146
|
+
data,
|
|
147
|
+
series: s,
|
|
148
|
+
htmlElements: [],
|
|
149
|
+
};
|
|
150
|
+
stackItems.push(item);
|
|
151
|
+
stackSum += width + 1;
|
|
152
|
+
});
|
|
153
|
+
if (series.some((s) => s.stacking === 'percent')) {
|
|
154
|
+
let acc = 0;
|
|
155
|
+
const ratio = plotWidth / (stackSum - stackItems.length);
|
|
156
|
+
stackItems.forEach((item) => {
|
|
157
|
+
item.width = item.width * ratio;
|
|
158
|
+
item.x = acc;
|
|
159
|
+
acc += item.width;
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
result.push(...stackItems);
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
result.forEach((d) => {
|
|
166
|
+
setLabel(d);
|
|
167
|
+
});
|
|
168
|
+
return result;
|
|
169
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HtmlItem, LabelData, TooltipDataChunkBarX } from '../../../types';
|
|
2
|
+
import type { PreparedBarYSeries } from '../../useSeries/types';
|
|
3
|
+
export type PreparedBarYData = Omit<TooltipDataChunkBarX, 'series'> & {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
color: string;
|
|
9
|
+
opacity: number | null;
|
|
10
|
+
series: PreparedBarYSeries;
|
|
11
|
+
label?: LabelData;
|
|
12
|
+
htmlElements: HtmlItem[];
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Dispatch } from 'd3';
|
|
3
|
+
import type { PreparedSeries, PreparedSeriesOptions, PreparedSplit } from '../';
|
|
4
|
+
import type { ChartScale } from '../useAxisScales';
|
|
5
|
+
import type { PreparedAxis } from '../useChartOptions/types';
|
|
6
|
+
import type { PreparedAreaData } from './area/types';
|
|
7
|
+
import type { PreparedBarXData } from './bar-x';
|
|
8
|
+
import type { PreparedBarYData } from './bar-y/types';
|
|
9
|
+
import type { PreparedLineData } from './line/types';
|
|
10
|
+
import type { PreparedPieData } from './pie/types';
|
|
11
|
+
import type { PreparedScatterData } from './scatter/types';
|
|
12
|
+
export type { PreparedBarXData } from './bar-x';
|
|
13
|
+
export type { PreparedScatterData } from './scatter/types';
|
|
14
|
+
import type { PreparedWaterfallData } from './waterfall';
|
|
15
|
+
import './styles.css';
|
|
16
|
+
export type ShapeData = PreparedBarXData | PreparedBarYData | PreparedScatterData | PreparedLineData | PreparedPieData | PreparedAreaData | PreparedWaterfallData;
|
|
17
|
+
type Args = {
|
|
18
|
+
boundsWidth: number;
|
|
19
|
+
boundsHeight: number;
|
|
20
|
+
dispatcher: Dispatch<object>;
|
|
21
|
+
series: PreparedSeries[];
|
|
22
|
+
seriesOptions: PreparedSeriesOptions;
|
|
23
|
+
xAxis: PreparedAxis;
|
|
24
|
+
yAxis: PreparedAxis[];
|
|
25
|
+
xScale?: ChartScale;
|
|
26
|
+
yScale?: ChartScale[];
|
|
27
|
+
split: PreparedSplit;
|
|
28
|
+
htmlLayout: HTMLElement | null;
|
|
29
|
+
};
|
|
30
|
+
export declare const useShapes: (args: Args) => {
|
|
31
|
+
shapes: React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
32
|
+
shapesData: ShapeData[];
|
|
33
|
+
};
|