@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,48 @@
|
|
|
1
|
+
import type { MeaningfulAny } from '../misc';
|
|
2
|
+
export type BaseSeries = {
|
|
3
|
+
/** Initial visibility of the series */
|
|
4
|
+
visible?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Options for the series data labels, appearing next to each data point.
|
|
7
|
+
* */
|
|
8
|
+
dataLabels?: {
|
|
9
|
+
/**
|
|
10
|
+
* Enable or disable the data labels
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
style?: Partial<BaseTextStyle>;
|
|
15
|
+
/**
|
|
16
|
+
* @default 5
|
|
17
|
+
* */
|
|
18
|
+
padding?: number;
|
|
19
|
+
/**
|
|
20
|
+
* @default false
|
|
21
|
+
* */
|
|
22
|
+
allowOverlap?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Allows to use any html-tags to display the content.
|
|
25
|
+
* The element will be displayed outside the box of the SVG element.
|
|
26
|
+
*
|
|
27
|
+
* @default false
|
|
28
|
+
* */
|
|
29
|
+
html?: boolean;
|
|
30
|
+
};
|
|
31
|
+
/** You can set the cursor to "pointer" if you have click events attached to the series, to signal to the user that the points and lines can be clicked. */
|
|
32
|
+
cursor?: string;
|
|
33
|
+
};
|
|
34
|
+
export type BaseSeriesData<T = MeaningfulAny> = {
|
|
35
|
+
/**
|
|
36
|
+
* A reserved subspace to store options and values for customized functionality
|
|
37
|
+
*
|
|
38
|
+
* Here you can add additional data for your own event callbacks and formatter callbacks
|
|
39
|
+
*/
|
|
40
|
+
custom?: T;
|
|
41
|
+
/** Individual color for the data chunk (point in scatter, segment in pie, bar etc) */
|
|
42
|
+
color?: string;
|
|
43
|
+
};
|
|
44
|
+
export type BaseTextStyle = {
|
|
45
|
+
fontSize: string;
|
|
46
|
+
fontWeight?: string;
|
|
47
|
+
fontColor?: string;
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ChartMargin = {
|
|
2
|
+
top: number;
|
|
3
|
+
right: number;
|
|
4
|
+
bottom: number;
|
|
5
|
+
left: number;
|
|
6
|
+
};
|
|
7
|
+
export type ChartOptions = {
|
|
8
|
+
margin?: Partial<ChartMargin>;
|
|
9
|
+
events?: {
|
|
10
|
+
click?: (data: {
|
|
11
|
+
point: unknown;
|
|
12
|
+
series: unknown;
|
|
13
|
+
}, event: PointerEvent) => void;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The halo appearing around the hovered part of series(point in line-type series or slice in pie charts) */
|
|
2
|
+
export type Halo = {
|
|
3
|
+
/** Enable or disable the halo */
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
/** The opacity of halo */
|
|
6
|
+
opacity?: number;
|
|
7
|
+
/** The pixel size of the halo. Radius for point markers or width of the outside slice in pie charts. */
|
|
8
|
+
size?: number;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { BaseTextStyle } from './base';
|
|
2
|
+
export type ChartLegend = {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Different types for different color schemes.
|
|
6
|
+
* If the color scheme is continuous, a gradient legend will be drawn.
|
|
7
|
+
* Otherwise, samples for different point values
|
|
8
|
+
*
|
|
9
|
+
* @default 'discrete'
|
|
10
|
+
*/
|
|
11
|
+
type?: 'discrete' | 'continuous';
|
|
12
|
+
/**
|
|
13
|
+
* The horizontal alignment of the legend box within the chart area.
|
|
14
|
+
*
|
|
15
|
+
* @default center
|
|
16
|
+
* */
|
|
17
|
+
align?: 'left' | 'center' | 'right';
|
|
18
|
+
/**
|
|
19
|
+
* Defines the pixel distance between each legend item
|
|
20
|
+
*
|
|
21
|
+
* @default 20
|
|
22
|
+
* */
|
|
23
|
+
itemDistance?: number;
|
|
24
|
+
/** CSS styles for each legend item */
|
|
25
|
+
itemStyle?: BaseTextStyle;
|
|
26
|
+
/**
|
|
27
|
+
* The space between the legend and the axis labels or chart area.
|
|
28
|
+
*
|
|
29
|
+
* @default 15
|
|
30
|
+
*/
|
|
31
|
+
margin?: number;
|
|
32
|
+
title?: {
|
|
33
|
+
text?: string;
|
|
34
|
+
/** CSS styles for the title */
|
|
35
|
+
style?: Partial<BaseTextStyle>;
|
|
36
|
+
/** The distance(in pixels) between the main content of the legend and its title
|
|
37
|
+
*
|
|
38
|
+
* Defaults to 4 for horizontal axes, 8 for vertical.
|
|
39
|
+
* */
|
|
40
|
+
margin?: number;
|
|
41
|
+
};
|
|
42
|
+
colorScale?: {
|
|
43
|
+
stops?: number[];
|
|
44
|
+
colors: string[];
|
|
45
|
+
domain?: number[];
|
|
46
|
+
};
|
|
47
|
+
width?: number;
|
|
48
|
+
};
|
|
49
|
+
export type BaseLegendSymbol = {
|
|
50
|
+
/**
|
|
51
|
+
* The pixel padding between the legend item symbol and the legend item text.
|
|
52
|
+
*
|
|
53
|
+
* @default 5
|
|
54
|
+
* */
|
|
55
|
+
padding?: number;
|
|
56
|
+
};
|
|
57
|
+
export type RectLegendSymbolOptions = BaseLegendSymbol & {
|
|
58
|
+
/**
|
|
59
|
+
* The pixel width of the symbol for series types that use a rectangle in the legend
|
|
60
|
+
*
|
|
61
|
+
* @default 10
|
|
62
|
+
* */
|
|
63
|
+
width?: number;
|
|
64
|
+
/**
|
|
65
|
+
* The pixel width of the symbol for series types that use a rectangle in the legend
|
|
66
|
+
*
|
|
67
|
+
* @default 10
|
|
68
|
+
* */
|
|
69
|
+
height?: number;
|
|
70
|
+
/**
|
|
71
|
+
* The border radius of the symbol for series types that use a rectangle in the legend.
|
|
72
|
+
*
|
|
73
|
+
* Defaults to half the symbolHeight, effectively creating a circle.
|
|
74
|
+
*/
|
|
75
|
+
radius?: number;
|
|
76
|
+
};
|
|
77
|
+
export type PathLegendSymbolOptions = BaseLegendSymbol & {
|
|
78
|
+
/**
|
|
79
|
+
* The pixel width of the symbol for series types that use a path in the legend
|
|
80
|
+
*
|
|
81
|
+
* @default 16
|
|
82
|
+
* */
|
|
83
|
+
width?: number;
|
|
84
|
+
};
|
|
85
|
+
export type SymbolLegendSymbolOptions = BaseLegendSymbol & {
|
|
86
|
+
/**
|
|
87
|
+
* The pixel width of the symbol for series types that use a symbol in the legend
|
|
88
|
+
*
|
|
89
|
+
* @default 8
|
|
90
|
+
* */
|
|
91
|
+
width?: number;
|
|
92
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { DashStyle, LineCap, SeriesType } from '../../constants';
|
|
2
|
+
import type { MeaningfulAny } from '../misc';
|
|
3
|
+
import type { BaseSeries, BaseSeriesData } from './base';
|
|
4
|
+
import type { ChartLegend, RectLegendSymbolOptions } from './legend';
|
|
5
|
+
import type { PointMarkerOptions } from './marker';
|
|
6
|
+
export type LineSeriesData<T = MeaningfulAny> = BaseSeriesData<T> & {
|
|
7
|
+
/**
|
|
8
|
+
* The `x` value of the point. Depending on the context , it may represents:
|
|
9
|
+
* - numeric value (for `linear` x axis)
|
|
10
|
+
* - timestamp value (for `datetime` x axis)
|
|
11
|
+
* - x axis category value (for `category` x axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `xAxis.categories`
|
|
12
|
+
*/
|
|
13
|
+
x?: string | number;
|
|
14
|
+
/**
|
|
15
|
+
* The `y` value of the point. Depending on the context , it may represents:
|
|
16
|
+
* - numeric value (for `linear` y axis)
|
|
17
|
+
* - timestamp value (for `datetime` y axis)
|
|
18
|
+
* - y axis category value (for `category` y axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `yAxis[0].categories`
|
|
19
|
+
*/
|
|
20
|
+
y?: string | number;
|
|
21
|
+
/** Data label value of the point. If not specified, the y value is used. */
|
|
22
|
+
label?: string | number;
|
|
23
|
+
marker?: {
|
|
24
|
+
states?: {
|
|
25
|
+
normal?: {
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export type LineSeries<T = MeaningfulAny> = BaseSeries & {
|
|
32
|
+
type: typeof SeriesType.Line;
|
|
33
|
+
data: LineSeriesData<T>[];
|
|
34
|
+
/** The name of the series (used in legend, tooltip etc) */
|
|
35
|
+
name: string;
|
|
36
|
+
/** The main color of the series (hex, rgba) */
|
|
37
|
+
color?: string;
|
|
38
|
+
/** Pixel width of the graph line.
|
|
39
|
+
*
|
|
40
|
+
* @default 1
|
|
41
|
+
* */
|
|
42
|
+
lineWidth?: number;
|
|
43
|
+
/** Individual series legend options. Has higher priority than legend options in widget data */
|
|
44
|
+
legend?: ChartLegend & {
|
|
45
|
+
symbol?: RectLegendSymbolOptions;
|
|
46
|
+
};
|
|
47
|
+
/** Options for the point markers of line series */
|
|
48
|
+
marker?: PointMarkerOptions;
|
|
49
|
+
/** Option for line stroke style */
|
|
50
|
+
dashStyle?: `${DashStyle}`;
|
|
51
|
+
/** Option for line cap style */
|
|
52
|
+
linecap?: `${LineCap}`;
|
|
53
|
+
/** Individual opacity for the line. */
|
|
54
|
+
opacity?: number;
|
|
55
|
+
/** Y-axis index (when using two axes) */
|
|
56
|
+
yAxis?: number;
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SymbolType } from '../../constants';
|
|
2
|
+
export type PointMarkerOptions = {
|
|
3
|
+
/** Enable or disable the point marker */
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
/** The radius of the point marker */
|
|
6
|
+
radius?: number;
|
|
7
|
+
/** The color of the point marker's border */
|
|
8
|
+
borderColor?: string;
|
|
9
|
+
/** The width of the point marker's border */
|
|
10
|
+
borderWidth?: number;
|
|
11
|
+
symbol?: `${SymbolType}`;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { BaseType } from 'd3';
|
|
2
|
+
import type { SeriesType } from '../../constants';
|
|
3
|
+
import type { MeaningfulAny } from '../misc';
|
|
4
|
+
import type { BaseSeries, BaseSeriesData } from './base';
|
|
5
|
+
import type { ChartLegend, RectLegendSymbolOptions } from './legend';
|
|
6
|
+
export type PieSeriesData<T = MeaningfulAny> = BaseSeriesData<T> & {
|
|
7
|
+
/** The value of the pie segment. */
|
|
8
|
+
value: number;
|
|
9
|
+
/** The name of the pie segment (used in legend, tooltip etc). */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Initial visibility of the pie segment. */
|
|
12
|
+
visible?: boolean;
|
|
13
|
+
/** Initial data label of the pie segment. If not specified, the value is used. */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Individual opacity for the pie segment. */
|
|
16
|
+
opacity?: number;
|
|
17
|
+
};
|
|
18
|
+
export type ConnectorShape = 'straight-line' | 'polyline';
|
|
19
|
+
export type ConnectorCurve = 'linear' | 'basic';
|
|
20
|
+
export type PieSeries<T = MeaningfulAny> = BaseSeries & {
|
|
21
|
+
type: typeof SeriesType.Pie;
|
|
22
|
+
data: PieSeriesData<T>[];
|
|
23
|
+
/**
|
|
24
|
+
* The color of the border surrounding each segment.
|
|
25
|
+
* @default `--g-color-base-background` from @gravity-ui/uikit.
|
|
26
|
+
*/
|
|
27
|
+
borderColor?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The width of the border surrounding each segment.
|
|
30
|
+
* @default '1px'
|
|
31
|
+
*/
|
|
32
|
+
borderWidth?: number;
|
|
33
|
+
/**
|
|
34
|
+
* The corner radius of the border surrounding each segment.
|
|
35
|
+
* @default 0
|
|
36
|
+
*/
|
|
37
|
+
borderRadius?: number;
|
|
38
|
+
/** The center of the pie chart relative to the chart area. */
|
|
39
|
+
center?: [string | number | null, string | number | null];
|
|
40
|
+
/**
|
|
41
|
+
* The inner radius of the pie.
|
|
42
|
+
* @default 0
|
|
43
|
+
*/
|
|
44
|
+
innerRadius?: string | number;
|
|
45
|
+
/** The radius of the pie relative to the chart area. The default behaviour is to scale to the chart area. */
|
|
46
|
+
radius?: string | number;
|
|
47
|
+
/** Individual series legend options. Has higher priority than legend options in widget data */
|
|
48
|
+
legend?: ChartLegend & {
|
|
49
|
+
symbol?: RectLegendSymbolOptions;
|
|
50
|
+
};
|
|
51
|
+
dataLabels?: BaseSeries['dataLabels'] & {
|
|
52
|
+
/**
|
|
53
|
+
* The distance of the data label from the pie's edge.
|
|
54
|
+
*
|
|
55
|
+
* @default 30
|
|
56
|
+
* */
|
|
57
|
+
distance?: number;
|
|
58
|
+
/**
|
|
59
|
+
* The distance from the data label to the connector.
|
|
60
|
+
*
|
|
61
|
+
* @default 5
|
|
62
|
+
* */
|
|
63
|
+
connectorPadding?: number;
|
|
64
|
+
/**
|
|
65
|
+
* The method that is used to generate the connector path.
|
|
66
|
+
*
|
|
67
|
+
* @default 'polyline'
|
|
68
|
+
* */
|
|
69
|
+
connectorShape?: ConnectorShape;
|
|
70
|
+
/**
|
|
71
|
+
* How to interpolate between two-dimensional [x, y] points for a connector.
|
|
72
|
+
* Works only if connectorShape equals to 'polyline'
|
|
73
|
+
*
|
|
74
|
+
* @default 'basic'
|
|
75
|
+
* */
|
|
76
|
+
connectorCurve?: ConnectorCurve;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Function for adding custom svg nodes for a series
|
|
80
|
+
*
|
|
81
|
+
* @return BaseType
|
|
82
|
+
* */
|
|
83
|
+
renderCustomShape?: (args: {
|
|
84
|
+
series: {
|
|
85
|
+
innerRadius: number;
|
|
86
|
+
};
|
|
87
|
+
}) => BaseType;
|
|
88
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { SeriesType, SymbolType } from '../../constants';
|
|
2
|
+
import type { MeaningfulAny } from '../misc';
|
|
3
|
+
import type { BaseSeries, BaseSeriesData } from './base';
|
|
4
|
+
import type { ChartLegend, RectLegendSymbolOptions } from './legend';
|
|
5
|
+
export type ScatterSeriesData<T = MeaningfulAny> = BaseSeriesData<T> & {
|
|
6
|
+
/**
|
|
7
|
+
* The `x` value of the point. Depending on the context , it may represents:
|
|
8
|
+
* - numeric value (for `linear` x axis)
|
|
9
|
+
* - timestamp value (for `datetime` x axis)
|
|
10
|
+
* - x axis category value (for `category` x axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `xAxis.categories`
|
|
11
|
+
*/
|
|
12
|
+
x?: string | number;
|
|
13
|
+
/**
|
|
14
|
+
* The `y` value of the point. Depending on the context , it may represents:
|
|
15
|
+
* - numeric value (for `linear` y axis)
|
|
16
|
+
* - timestamp value (for `datetime` y axis)
|
|
17
|
+
* - y axis category value (for `category` y axis). If the type is a string, then it is a category value itself. If the type is a number, then it is the index of an element in the array of categories described in `yAxis[0].categories`
|
|
18
|
+
*/
|
|
19
|
+
y?: string | number;
|
|
20
|
+
/**
|
|
21
|
+
* Corresponding value of axis category.
|
|
22
|
+
*
|
|
23
|
+
* @deprecated use `x` or `y` instead
|
|
24
|
+
*/
|
|
25
|
+
category?: string;
|
|
26
|
+
/** Individual radius for the point. */
|
|
27
|
+
radius?: number;
|
|
28
|
+
/** Individual opacity for the point. */
|
|
29
|
+
opacity?: number;
|
|
30
|
+
};
|
|
31
|
+
export type ScatterSeries<T = MeaningfulAny> = BaseSeries & {
|
|
32
|
+
type: typeof SeriesType.Scatter;
|
|
33
|
+
data: ScatterSeriesData<T>[];
|
|
34
|
+
/** The name of the series (used in legend, tooltip etc) */
|
|
35
|
+
name: string;
|
|
36
|
+
/** The main color of the series (hex, rgba) */
|
|
37
|
+
color?: string;
|
|
38
|
+
/** A predefined shape or symbol for the dot */
|
|
39
|
+
symbolType?: `${SymbolType}`;
|
|
40
|
+
/** Individual series legend options. Has higher priority than legend options in widget data */
|
|
41
|
+
legend?: ChartLegend & {
|
|
42
|
+
symbol?: RectLegendSymbolOptions;
|
|
43
|
+
};
|
|
44
|
+
/** Y-axis index (when using two axes) */
|
|
45
|
+
yAxis?: number;
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { DashStyle, LineCap } from '../../constants';
|
|
3
|
+
import type { MeaningfulAny } from '../misc';
|
|
4
|
+
import type { AreaSeries, AreaSeriesData } from './area';
|
|
5
|
+
import type { BarXSeries, BarXSeriesData } from './bar-x';
|
|
6
|
+
import type { BarYSeries, BarYSeriesData } from './bar-y';
|
|
7
|
+
import type { Halo } from './halo';
|
|
8
|
+
import type { LineSeries, LineSeriesData } from './line';
|
|
9
|
+
import type { PointMarkerOptions } from './marker';
|
|
10
|
+
import type { PieSeries, PieSeriesData } from './pie';
|
|
11
|
+
import type { ScatterSeries, ScatterSeriesData } from './scatter';
|
|
12
|
+
import type { TreemapSeries, TreemapSeriesData } from './treemap';
|
|
13
|
+
import type { WaterfallSeries, WaterfallSeriesData } from './waterfall';
|
|
14
|
+
export type ChartSeries<T = MeaningfulAny> = ScatterSeries<T> | PieSeries<T> | BarXSeries<T> | BarYSeries<T> | LineSeries<T> | AreaSeries<T> | TreemapSeries<T> | WaterfallSeries<T>;
|
|
15
|
+
export type ChartSeriesData<T = MeaningfulAny> = ScatterSeriesData<T> | PieSeriesData<T> | BarXSeriesData<T> | BarYSeriesData<T> | LineSeriesData<T> | AreaSeriesData<T> | TreemapSeriesData<T> | WaterfallSeriesData<T>;
|
|
16
|
+
export type DataLabelRendererData<T = MeaningfulAny> = {
|
|
17
|
+
data: ChartSeriesData<T>;
|
|
18
|
+
};
|
|
19
|
+
type BasicHoverState = {
|
|
20
|
+
/**
|
|
21
|
+
* Enable separate styles for the hovered series.
|
|
22
|
+
*
|
|
23
|
+
* @default true
|
|
24
|
+
* */
|
|
25
|
+
enabled?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* How much to brighten/darken the point on hover. Use positive to brighten, negative to darken.
|
|
28
|
+
* The behavior of this property is dependent on the implementing color space ([more details](https://d3js.org/d3-color#color_brighter)).
|
|
29
|
+
* For example in case of using rgb color you can use floating point number from `-5.0` to `5.0`.
|
|
30
|
+
* Rgb color space is used by default.
|
|
31
|
+
*
|
|
32
|
+
* @default 0.3
|
|
33
|
+
*/
|
|
34
|
+
brightness?: number;
|
|
35
|
+
};
|
|
36
|
+
export type BasicInactiveState = {
|
|
37
|
+
/**
|
|
38
|
+
* Enable separate styles for the inactive series.
|
|
39
|
+
*
|
|
40
|
+
* @default true
|
|
41
|
+
* */
|
|
42
|
+
enabled?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Opacity of series elements (bars, data labels)
|
|
45
|
+
*
|
|
46
|
+
* @default 0.5
|
|
47
|
+
* */
|
|
48
|
+
opacity?: number;
|
|
49
|
+
};
|
|
50
|
+
export type ChartSeriesOptions = {
|
|
51
|
+
/** Individual data label for each point. */
|
|
52
|
+
dataLabels?: {
|
|
53
|
+
/** Enable or disable the data labels */
|
|
54
|
+
enabled?: boolean;
|
|
55
|
+
/** Callback function to render the data label */
|
|
56
|
+
renderer?: (args: DataLabelRendererData) => React.SVGTextElementAttributes<SVGTextElement>;
|
|
57
|
+
};
|
|
58
|
+
'bar-x'?: {
|
|
59
|
+
/** The maximum allowed pixel width for a column.
|
|
60
|
+
* This prevents the columns from becoming too wide when there is a small number of points in the chart.
|
|
61
|
+
*
|
|
62
|
+
* @default 50
|
|
63
|
+
*/
|
|
64
|
+
barMaxWidth?: number;
|
|
65
|
+
/** Padding between each column or bar, in x axis units.
|
|
66
|
+
*
|
|
67
|
+
* @default 0.1
|
|
68
|
+
* */
|
|
69
|
+
barPadding?: number;
|
|
70
|
+
/** Padding between each value groups, in x axis units
|
|
71
|
+
*
|
|
72
|
+
* @default 0.2
|
|
73
|
+
*/
|
|
74
|
+
groupPadding?: number;
|
|
75
|
+
dataSorting?: {
|
|
76
|
+
/** Determines what data value should be used to sort by.
|
|
77
|
+
* Possible values are undefined to disable, "name" to sort by series name or "y"
|
|
78
|
+
*
|
|
79
|
+
* @default undefined
|
|
80
|
+
* */
|
|
81
|
+
key?: 'name' | 'y' | undefined;
|
|
82
|
+
/** Sorting direction.
|
|
83
|
+
*
|
|
84
|
+
* @default 'asc'
|
|
85
|
+
* */
|
|
86
|
+
direction?: 'asc' | 'desc';
|
|
87
|
+
};
|
|
88
|
+
/** Options for the series states that provide additional styling information to the series. */
|
|
89
|
+
states?: {
|
|
90
|
+
hover?: BasicHoverState;
|
|
91
|
+
inactive?: BasicInactiveState;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
'bar-y'?: {
|
|
95
|
+
/** The maximum allowed pixel width for a column.
|
|
96
|
+
* This prevents the columns from becoming too wide when there is a small number of points in the chart.
|
|
97
|
+
*
|
|
98
|
+
* @default 50
|
|
99
|
+
*/
|
|
100
|
+
barMaxWidth?: number;
|
|
101
|
+
/** Padding between each column or bar, in x axis units.
|
|
102
|
+
*
|
|
103
|
+
* @default 0.1
|
|
104
|
+
* */
|
|
105
|
+
barPadding?: number;
|
|
106
|
+
/** Padding between each value groups, in x axis units
|
|
107
|
+
*
|
|
108
|
+
* @default 0.2
|
|
109
|
+
*/
|
|
110
|
+
groupPadding?: number;
|
|
111
|
+
dataSorting?: {
|
|
112
|
+
/** Determines what data value should be used to sort by.
|
|
113
|
+
* Possible values are undefined to disable, "name" to sort by series name or "x"
|
|
114
|
+
*
|
|
115
|
+
* @default undefined
|
|
116
|
+
* */
|
|
117
|
+
key?: 'name' | 'x' | undefined;
|
|
118
|
+
/** Sorting direction.
|
|
119
|
+
*
|
|
120
|
+
* @default 'asc'
|
|
121
|
+
* */
|
|
122
|
+
direction?: 'asc' | 'desc';
|
|
123
|
+
};
|
|
124
|
+
/** Options for the series states that provide additional styling information to the series. */
|
|
125
|
+
states?: {
|
|
126
|
+
hover?: BasicHoverState;
|
|
127
|
+
inactive?: BasicInactiveState;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
pie?: {
|
|
131
|
+
/** Options for the series states that provide additional styling information to the series. */
|
|
132
|
+
states?: {
|
|
133
|
+
hover?: BasicHoverState & {
|
|
134
|
+
/** Options for the halo appearing outside the hovered slice */
|
|
135
|
+
halo?: Halo;
|
|
136
|
+
};
|
|
137
|
+
inactive?: BasicInactiveState;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
scatter?: {
|
|
141
|
+
/** Options for the series states that provide additional styling information to the series. */
|
|
142
|
+
states?: {
|
|
143
|
+
hover?: BasicHoverState & {
|
|
144
|
+
marker?: PointMarkerOptions & {
|
|
145
|
+
/** Options for the halo appearing around the hovered point */
|
|
146
|
+
halo?: Halo;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
inactive?: BasicInactiveState;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
line?: {
|
|
153
|
+
/** Pixel width of the graph line.
|
|
154
|
+
*
|
|
155
|
+
* @default 1
|
|
156
|
+
* */
|
|
157
|
+
lineWidth?: number;
|
|
158
|
+
/** Options for the series states that provide additional styling information to the series. */
|
|
159
|
+
states?: {
|
|
160
|
+
hover?: BasicHoverState & {
|
|
161
|
+
marker?: PointMarkerOptions & {
|
|
162
|
+
/** Options for the halo appearing around the hovered point */
|
|
163
|
+
halo?: Halo;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
inactive?: BasicInactiveState;
|
|
167
|
+
};
|
|
168
|
+
/** Options for the point markers of line series */
|
|
169
|
+
marker?: PointMarkerOptions;
|
|
170
|
+
/** Options for line style
|
|
171
|
+
*
|
|
172
|
+
* @default 'Solid'
|
|
173
|
+
* */
|
|
174
|
+
dashStyle?: `${DashStyle}`;
|
|
175
|
+
/** Options for line cap style
|
|
176
|
+
*
|
|
177
|
+
* @default 'round' when dashStyle is not 'solid', 'none' when dashStyle is not 'solid'
|
|
178
|
+
* */
|
|
179
|
+
linecap?: `${LineCap}`;
|
|
180
|
+
};
|
|
181
|
+
area?: {
|
|
182
|
+
/** Pixel width of the graph line.
|
|
183
|
+
*
|
|
184
|
+
* @default 1
|
|
185
|
+
* */
|
|
186
|
+
lineWidth?: number;
|
|
187
|
+
/** Options for the series states that provide additional styling information to the series. */
|
|
188
|
+
states?: {
|
|
189
|
+
hover?: BasicHoverState & {
|
|
190
|
+
marker?: PointMarkerOptions & {
|
|
191
|
+
/** Options for the halo appearing around the hovered point */
|
|
192
|
+
halo?: Halo;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
inactive?: BasicInactiveState;
|
|
196
|
+
};
|
|
197
|
+
/** Options for the point markers of line series */
|
|
198
|
+
marker?: PointMarkerOptions;
|
|
199
|
+
};
|
|
200
|
+
treemap?: {
|
|
201
|
+
/** Options for the series states that provide additional styling information to the series. */
|
|
202
|
+
states?: {
|
|
203
|
+
hover?: BasicHoverState;
|
|
204
|
+
inactive?: BasicInactiveState;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
waterfall?: {
|
|
208
|
+
/** The maximum allowed pixel width for a column.
|
|
209
|
+
* This prevents the columns from becoming too wide when there is a small number of points in the chart.
|
|
210
|
+
*
|
|
211
|
+
* @default 50
|
|
212
|
+
*/
|
|
213
|
+
barMaxWidth?: number;
|
|
214
|
+
/** Padding between each column or bar, in x axis units.
|
|
215
|
+
*
|
|
216
|
+
* @default 0.1
|
|
217
|
+
* */
|
|
218
|
+
barPadding?: number;
|
|
219
|
+
/** Options for the series states that provide additional styling information to the series. */
|
|
220
|
+
states?: {
|
|
221
|
+
hover?: BasicHoverState;
|
|
222
|
+
inactive?: BasicInactiveState;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BaseTextStyle } from './base';
|
|
2
|
+
export type SplitPlotOptions = {
|
|
3
|
+
title?: {
|
|
4
|
+
text: string;
|
|
5
|
+
style?: Partial<BaseTextStyle>;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export type ChartSplit = {
|
|
9
|
+
enable: boolean;
|
|
10
|
+
layout?: 'vertical';
|
|
11
|
+
gap?: string | number;
|
|
12
|
+
plots?: SplitPlotOptions[];
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|