@gravity-ui/chartkit 5.17.1 → 5.18.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/build/components/ChartKit.css +0 -1
- package/build/components/SplitPane/Pane.d.ts +14 -0
- package/build/components/SplitPane/Pane.js +26 -0
- package/build/components/SplitPane/Resizer.d.ts +18 -0
- package/build/components/SplitPane/Resizer.js +26 -0
- package/build/components/SplitPane/SplitPane.d.ts +59 -0
- package/build/components/SplitPane/SplitPane.js +235 -0
- package/build/{plugins/highcharts/renderer/components/StyledSplitPane → components/SplitPane}/StyledSplitPane.css +0 -1
- package/build/{plugins/highcharts/renderer/components/StyledSplitPane → components/SplitPane}/StyledSplitPane.d.ts +1 -1
- package/build/{plugins/highcharts/renderer/components/StyledSplitPane → components/SplitPane}/StyledSplitPane.js +3 -3
- package/build/components/SplitPane/constants.d.ts +4 -0
- package/build/components/SplitPane/constants.js +4 -0
- package/build/components/SplitPane/index.d.ts +8 -0
- package/build/components/SplitPane/index.js +18 -0
- package/build/components/SplitPane/types.d.ts +2 -0
- package/build/constants/index.d.ts +1 -0
- package/build/constants/index.js +1 -0
- package/build/constants/misc.d.ts +10 -0
- package/build/constants/misc.js +19 -0
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/misc.d.ts +1 -0
- package/build/hooks/misc.js +8 -0
- package/build/plugins/d3/index.d.ts +1 -1
- package/build/plugins/d3/index.js +2 -1
- package/build/plugins/d3/renderer/D3Widget.d.ts +5 -1
- package/build/plugins/d3/renderer/D3Widget.js +31 -66
- package/build/plugins/d3/renderer/withSplitPane/TooltipContent.d.ts +8 -0
- package/build/plugins/d3/renderer/withSplitPane/TooltipContent.js +12 -0
- package/build/plugins/d3/renderer/withSplitPane/useWithSplitPaneState.d.ts +19 -0
- package/build/plugins/d3/renderer/withSplitPane/useWithSplitPaneState.js +46 -0
- package/build/plugins/d3/renderer/withSplitPane/withSplitPane.d.ts +4 -0
- package/build/plugins/d3/renderer/withSplitPane/withSplitPane.js +100 -0
- package/build/plugins/d3/types.d.ts +2 -2
- package/build/plugins/highcharts/renderer/HighchartsWidget.d.ts +2 -2
- package/build/plugins/highcharts/renderer/components/withSplitPane/withSplitPane.js +1 -1
- package/build/types/index.js +1 -0
- package/build/types/widget-data/pie.d.ts +1 -1
- package/build/types/widget.d.ts +6 -3
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/misc.d.ts +2 -0
- package/build/utils/misc.js +7 -0
- package/package.json +4 -4
- package/build/plugins/d3/examples/ExampleWrapper.d.ts +0 -7
- package/build/plugins/d3/examples/ExampleWrapper.js +0 -5
- package/build/plugins/d3/examples/area/Basic.d.ts +0 -2
- package/build/plugins/d3/examples/area/Basic.js +0 -34
- package/build/plugins/d3/examples/area/NegativeValues.d.ts +0 -2
- package/build/plugins/d3/examples/area/NegativeValues.js +0 -24
- package/build/plugins/d3/examples/area/PercentStacking.d.ts +0 -2
- package/build/plugins/d3/examples/area/PercentStacking.js +0 -47
- package/build/plugins/d3/examples/area/StackedArea.d.ts +0 -2
- package/build/plugins/d3/examples/area/StackedArea.js +0 -47
- package/build/plugins/d3/examples/area/TwoYAxis.d.ts +0 -2
- package/build/plugins/d3/examples/area/TwoYAxis.js +0 -58
- package/build/plugins/d3/examples/bar-x/Basic.d.ts +0 -4
- package/build/plugins/d3/examples/bar-x/Basic.js +0 -88
- package/build/plugins/d3/examples/bar-x/DataLabels.d.ts +0 -2
- package/build/plugins/d3/examples/bar-x/DataLabels.js +0 -48
- package/build/plugins/d3/examples/bar-x/GroupedColumns.d.ts +0 -2
- package/build/plugins/d3/examples/bar-x/GroupedColumns.js +0 -48
- package/build/plugins/d3/examples/bar-x/NegativeValues.d.ts +0 -2
- package/build/plugins/d3/examples/bar-x/NegativeValues.js +0 -41
- package/build/plugins/d3/examples/bar-x/PercentStack.d.ts +0 -2
- package/build/plugins/d3/examples/bar-x/PercentStack.js +0 -47
- package/build/plugins/d3/examples/bar-x/StackedColumns.d.ts +0 -2
- package/build/plugins/d3/examples/bar-x/StackedColumns.js +0 -47
- package/build/plugins/d3/examples/bar-x/TwoYAxis.d.ts +0 -2
- package/build/plugins/d3/examples/bar-x/TwoYAxis.js +0 -58
- package/build/plugins/d3/examples/bar-y/Basic.d.ts +0 -2
- package/build/plugins/d3/examples/bar-y/Basic.js +0 -45
- package/build/plugins/d3/examples/bar-y/GroupedColumns.d.ts +0 -2
- package/build/plugins/d3/examples/bar-y/GroupedColumns.js +0 -50
- package/build/plugins/d3/examples/bar-y/NegativeValues.d.ts +0 -2
- package/build/plugins/d3/examples/bar-y/NegativeValues.js +0 -40
- package/build/plugins/d3/examples/bar-y/PercentStacking.d.ts +0 -2
- package/build/plugins/d3/examples/bar-y/PercentStacking.js +0 -49
- package/build/plugins/d3/examples/bar-y/StackedColumns.d.ts +0 -2
- package/build/plugins/d3/examples/bar-y/StackedColumns.js +0 -49
- package/build/plugins/d3/examples/combined/LineAndBarX.d.ts +0 -2
- package/build/plugins/d3/examples/combined/LineAndBarX.js +0 -63
- package/build/plugins/d3/examples/line/Basic.d.ts +0 -2
- package/build/plugins/d3/examples/line/Basic.js +0 -68
- package/build/plugins/d3/examples/line/DataLabels.d.ts +0 -2
- package/build/plugins/d3/examples/line/DataLabels.js +0 -91
- package/build/plugins/d3/examples/line/LineWithMarkers.d.ts +0 -2
- package/build/plugins/d3/examples/line/LineWithMarkers.js +0 -69
- package/build/plugins/d3/examples/line/LogarithmicAxis.d.ts +0 -2
- package/build/plugins/d3/examples/line/LogarithmicAxis.js +0 -38
- package/build/plugins/d3/examples/line/Shapes.d.ts +0 -2
- package/build/plugins/d3/examples/line/Shapes.js +0 -93
- package/build/plugins/d3/examples/line/TwoYAxis.d.ts +0 -2
- package/build/plugins/d3/examples/line/TwoYAxis.js +0 -58
- package/build/plugins/d3/examples/mars-weather.d.ts +0 -13
- package/build/plugins/d3/examples/mars-weather.js +0 -1203
- package/build/plugins/d3/examples/nintendoGames.d.ts +0 -92
- package/build/plugins/d3/examples/nintendoGames.js +0 -12264
- package/build/plugins/d3/examples/pie/Basic.d.ts +0 -2
- package/build/plugins/d3/examples/pie/Basic.js +0 -32
- package/build/plugins/d3/examples/pie/Donut.d.ts +0 -2
- package/build/plugins/d3/examples/pie/Donut.js +0 -33
- package/build/plugins/d3/examples/pie/DonutWithTotals.d.ts +0 -2
- package/build/plugins/d3/examples/pie/DonutWithTotals.js +0 -36
- package/build/plugins/d3/examples/scatter/Basic.d.ts +0 -2
- package/build/plugins/d3/examples/scatter/Basic.js +0 -47
- package/build/plugins/d3/examples/scatter/TwoYAxis.d.ts +0 -2
- package/build/plugins/d3/examples/scatter/TwoYAxis.js +0 -58
- package/build/plugins/d3/renderer/components/AxisX.d.ts +0 -19
- package/build/plugins/d3/renderer/components/AxisX.js +0 -108
- package/build/plugins/d3/renderer/components/AxisY.d.ts +0 -11
- package/build/plugins/d3/renderer/components/AxisY.js +0 -199
- package/build/plugins/d3/renderer/components/Chart.d.ts +0 -10
- package/build/plugins/d3/renderer/components/Chart.js +0 -145
- package/build/plugins/d3/renderer/components/Legend.d.ts +0 -12
- package/build/plugins/d3/renderer/components/Legend.js +0 -278
- package/build/plugins/d3/renderer/components/PlotTitle.d.ts +0 -7
- package/build/plugins/d3/renderer/components/PlotTitle.js +0 -12
- package/build/plugins/d3/renderer/components/Title.d.ts +0 -7
- package/build/plugins/d3/renderer/components/Title.js +0 -8
- package/build/plugins/d3/renderer/components/Tooltip/DefaultContent.d.ts +0 -10
- package/build/plugins/d3/renderer/components/Tooltip/DefaultContent.js +0 -102
- package/build/plugins/d3/renderer/components/Tooltip/index.d.ts +0 -12
- package/build/plugins/d3/renderer/components/Tooltip/index.js +0 -28
- package/build/plugins/d3/renderer/components/index.d.ts +0 -1
- package/build/plugins/d3/renderer/components/index.js +0 -1
- package/build/plugins/d3/renderer/components/styles.css +0 -140
- package/build/plugins/d3/renderer/constants/defaults/axis.d.ts +0 -14
- package/build/plugins/d3/renderer/constants/defaults/axis.js +0 -18
- package/build/plugins/d3/renderer/constants/defaults/index.d.ts +0 -3
- package/build/plugins/d3/renderer/constants/defaults/index.js +0 -3
- package/build/plugins/d3/renderer/constants/defaults/legend.d.ts +0 -12
- package/build/plugins/d3/renderer/constants/defaults/legend.js +0 -12
- package/build/plugins/d3/renderer/constants/defaults/series-options.d.ts +0 -24
- package/build/plugins/d3/renderer/constants/defaults/series-options.js +0 -106
- package/build/plugins/d3/renderer/constants/index.d.ts +0 -3
- package/build/plugins/d3/renderer/constants/index.js +0 -24
- package/build/plugins/d3/renderer/d3-dispatcher.d.ts +0 -1
- package/build/plugins/d3/renderer/d3-dispatcher.js +0 -4
- package/build/plugins/d3/renderer/hooks/index.d.ts +0 -10
- package/build/plugins/d3/renderer/hooks/index.js +0 -10
- package/build/plugins/d3/renderer/hooks/useAxisScales/index.d.ts +0 -25
- package/build/plugins/d3/renderer/hooks/useAxisScales/index.js +0 -183
- package/build/plugins/d3/renderer/hooks/useChartDimensions/index.d.ts +0 -16
- package/build/plugins/d3/renderer/hooks/useChartDimensions/index.js +0 -34
- package/build/plugins/d3/renderer/hooks/useChartDimensions/utils.d.ts +0 -10
- package/build/plugins/d3/renderer/hooks/useChartDimensions/utils.js +0 -32
- package/build/plugins/d3/renderer/hooks/useChartOptions/chart.d.ts +0 -6
- package/build/plugins/d3/renderer/hooks/useChartOptions/chart.js +0 -28
- package/build/plugins/d3/renderer/hooks/useChartOptions/index.d.ts +0 -7
- package/build/plugins/d3/renderer/hooks/useChartOptions/index.js +0 -21
- package/build/plugins/d3/renderer/hooks/useChartOptions/title.d.ts +0 -5
- package/build/plugins/d3/renderer/hooks/useChartOptions/title.js +0 -18
- package/build/plugins/d3/renderer/hooks/useChartOptions/tooltip.d.ts +0 -5
- package/build/plugins/d3/renderer/hooks/useChartOptions/tooltip.js +0 -5
- package/build/plugins/d3/renderer/hooks/useChartOptions/types.d.ts +0 -47
- package/build/plugins/d3/renderer/hooks/useChartOptions/x-axis.d.ts +0 -7
- package/build/plugins/d3/renderer/hooks/useChartOptions/x-axis.js +0 -114
- package/build/plugins/d3/renderer/hooks/useChartOptions/y-axis.d.ts +0 -7
- package/build/plugins/d3/renderer/hooks/useChartOptions/y-axis.js +0 -116
- package/build/plugins/d3/renderer/hooks/useSeries/constants.d.ts +0 -8
- package/build/plugins/d3/renderer/hooks/useSeries/constants.js +0 -19
- package/build/plugins/d3/renderer/hooks/useSeries/index.d.ts +0 -29
- package/build/plugins/d3/renderer/hooks/useSeries/index.js +0 -82
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-area.d.ts +0 -19
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-area.js +0 -63
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-bar-x.d.ts +0 -10
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-bar-x.js +0 -38
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-bar-y.d.ts +0 -10
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-bar-y.js +0 -49
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-legend.d.ts +0 -27
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-legend.js +0 -144
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-line.d.ts +0 -22
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-line.js +0 -82
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-options.d.ts +0 -3
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-options.js +0 -5
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-pie.d.ts +0 -9
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-pie.js +0 -62
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-scatter.d.ts +0 -11
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-scatter.js +0 -47
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-treemap.d.ts +0 -11
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-treemap.js +0 -38
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-waterfall.d.ts +0 -10
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-waterfall.js +0 -37
- package/build/plugins/d3/renderer/hooks/useSeries/prepareSeries.d.ts +0 -10
- package/build/plugins/d3/renderer/hooks/useSeries/prepareSeries.js +0 -65
- package/build/plugins/d3/renderer/hooks/useSeries/types.d.ts +0 -254
- package/build/plugins/d3/renderer/hooks/useSeries/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useSeries/utils.d.ts +0 -7
- package/build/plugins/d3/renderer/hooks/useSeries/utils.js +0 -33
- package/build/plugins/d3/renderer/hooks/useShapes/HtmlLayer.d.ts +0 -8
- package/build/plugins/d3/renderer/hooks/useShapes/HtmlLayer.js +0 -22
- package/build/plugins/d3/renderer/hooks/useShapes/area/index.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/area/index.js +0 -144
- package/build/plugins/d3/renderer/hooks/useShapes/area/prepare-data.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/area/prepare-data.js +0 -158
- package/build/plugins/d3/renderer/hooks/useShapes/area/types.d.ts +0 -28
- package/build/plugins/d3/renderer/hooks/useShapes/area/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useShapes/bar-x/index.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useShapes/bar-x/index.js +0 -96
- package/build/plugins/d3/renderer/hooks/useShapes/bar-x/prepare-data.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useShapes/bar-x/prepare-data.js +0 -160
- package/build/plugins/d3/renderer/hooks/useShapes/bar-x/types.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useShapes/bar-x/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useShapes/bar-y/index.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/bar-y/index.js +0 -84
- package/build/plugins/d3/renderer/hooks/useShapes/bar-y/prepare-data.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/bar-y/prepare-data.js +0 -169
- package/build/plugins/d3/renderer/hooks/useShapes/bar-y/types.d.ts +0 -14
- package/build/plugins/d3/renderer/hooks/useShapes/bar-y/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useShapes/constants.d.ts +0 -3
- package/build/plugins/d3/renderer/hooks/useShapes/constants.js +0 -3
- package/build/plugins/d3/renderer/hooks/useShapes/index.d.ts +0 -33
- package/build/plugins/d3/renderer/hooks/useShapes/index.js +0 -153
- package/build/plugins/d3/renderer/hooks/useShapes/line/index.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/line/index.js +0 -131
- package/build/plugins/d3/renderer/hooks/useShapes/line/prepare-data.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useShapes/line/prepare-data.js +0 -91
- package/build/plugins/d3/renderer/hooks/useShapes/line/types.d.ts +0 -30
- package/build/plugins/d3/renderer/hooks/useShapes/line/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useShapes/marker.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useShapes/marker.js +0 -76
- package/build/plugins/d3/renderer/hooks/useShapes/pie/index.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useShapes/pie/index.js +0 -172
- package/build/plugins/d3/renderer/hooks/useShapes/pie/prepare-data.d.ts +0 -9
- package/build/plugins/d3/renderer/hooks/useShapes/pie/prepare-data.js +0 -186
- package/build/plugins/d3/renderer/hooks/useShapes/pie/types.d.ts +0 -42
- package/build/plugins/d3/renderer/hooks/useShapes/pie/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useShapes/pie/utils.d.ts +0 -4
- package/build/plugins/d3/renderer/hooks/useShapes/pie/utils.js +0 -15
- package/build/plugins/d3/renderer/hooks/useShapes/scatter/index.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/scatter/index.js +0 -69
- package/build/plugins/d3/renderer/hooks/useShapes/scatter/prepare-data.d.ts +0 -11
- package/build/plugins/d3/renderer/hooks/useShapes/scatter/prepare-data.js +0 -31
- package/build/plugins/d3/renderer/hooks/useShapes/scatter/types.d.ts +0 -18
- package/build/plugins/d3/renderer/hooks/useShapes/scatter/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useShapes/styles.css +0 -36
- package/build/plugins/d3/renderer/hooks/useShapes/treemap/index.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/treemap/index.js +0 -99
- package/build/plugins/d3/renderer/hooks/useShapes/treemap/prepare-data.d.ts +0 -7
- package/build/plugins/d3/renderer/hooks/useShapes/treemap/prepare-data.js +0 -114
- package/build/plugins/d3/renderer/hooks/useShapes/treemap/types.d.ts +0 -17
- package/build/plugins/d3/renderer/hooks/useShapes/treemap/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useShapes/utils.d.ts +0 -29
- package/build/plugins/d3/renderer/hooks/useShapes/utils.js +0 -53
- package/build/plugins/d3/renderer/hooks/useShapes/waterfall/index.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useShapes/waterfall/index.js +0 -128
- package/build/plugins/d3/renderer/hooks/useShapes/waterfall/prepare-data.d.ts +0 -12
- package/build/plugins/d3/renderer/hooks/useShapes/waterfall/prepare-data.js +0 -133
- package/build/plugins/d3/renderer/hooks/useShapes/waterfall/types.d.ts +0 -15
- package/build/plugins/d3/renderer/hooks/useShapes/waterfall/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useSplit/index.d.ts +0 -14
- package/build/plugins/d3/renderer/hooks/useSplit/index.js +0 -57
- package/build/plugins/d3/renderer/hooks/useSplit/types.d.ts +0 -17
- package/build/plugins/d3/renderer/hooks/useSplit/types.js +0 -1
- package/build/plugins/d3/renderer/hooks/useTooltip/index.d.ts +0 -13
- package/build/plugins/d3/renderer/hooks/useTooltip/index.js +0 -17
- package/build/plugins/d3/renderer/hooks/useTooltip/types.d.ts +0 -1
- package/build/plugins/d3/renderer/hooks/useTooltip/types.js +0 -1
- package/build/plugins/d3/renderer/types/index.d.ts +0 -24
- package/build/plugins/d3/renderer/types/index.js +0 -1
- package/build/plugins/d3/renderer/utils/axis-generators/bottom.d.ts +0 -24
- package/build/plugins/d3/renderer/utils/axis-generators/bottom.js +0 -126
- package/build/plugins/d3/renderer/utils/axis-generators/index.d.ts +0 -1
- package/build/plugins/d3/renderer/utils/axis-generators/index.js +0 -1
- package/build/plugins/d3/renderer/utils/axis.d.ts +0 -31
- package/build/plugins/d3/renderer/utils/axis.js +0 -71
- package/build/plugins/d3/renderer/utils/color.d.ts +0 -10
- package/build/plugins/d3/renderer/utils/color.js +0 -43
- package/build/plugins/d3/renderer/utils/get-closest-data.d.ts +0 -15
- package/build/plugins/d3/renderer/utils/get-closest-data.js +0 -172
- package/build/plugins/d3/renderer/utils/index.d.ts +0 -78
- package/build/plugins/d3/renderer/utils/index.js +0 -211
- package/build/plugins/d3/renderer/utils/labels.d.ts +0 -6
- package/build/plugins/d3/renderer/utils/labels.js +0 -44
- package/build/plugins/d3/renderer/utils/legend.d.ts +0 -8
- package/build/plugins/d3/renderer/utils/legend.js +0 -23
- package/build/plugins/d3/renderer/utils/math.d.ts +0 -25
- package/build/plugins/d3/renderer/utils/math.js +0 -51
- package/build/plugins/d3/renderer/utils/series/index.d.ts +0 -1
- package/build/plugins/d3/renderer/utils/series/index.js +0 -1
- package/build/plugins/d3/renderer/utils/series/waterfall.d.ts +0 -4
- package/build/plugins/d3/renderer/utils/series/waterfall.js +0 -25
- package/build/plugins/d3/renderer/utils/symbol.d.ts +0 -3
- package/build/plugins/d3/renderer/utils/symbol.js +0 -36
- package/build/plugins/d3/renderer/utils/text.d.ts +0 -29
- package/build/plugins/d3/renderer/utils/text.js +0 -139
- package/build/plugins/d3/renderer/utils/time.d.ts +0 -3
- package/build/plugins/d3/renderer/utils/time.js +0 -34
- package/build/plugins/d3/renderer/validation/__mocks__/index.d.ts +0 -3
- package/build/plugins/d3/renderer/validation/__mocks__/index.js +0 -44
- package/build/plugins/d3/renderer/validation/index.d.ts +0 -2
- package/build/plugins/d3/renderer/validation/index.js +0 -221
- package/build/plugins/d3/utils/index.d.ts +0 -4
- package/build/plugins/d3/utils/index.js +0 -4
- package/build/plugins/d3/utils/pie-center-text.d.ts +0 -7
- package/build/plugins/d3/utils/pie-center-text.js +0 -23
- /package/build/{plugins/d3/renderer/hooks/useChartOptions → components/SplitPane}/types.js +0 -0
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { ChartKitError } from '../../../../../libs';
|
|
2
|
-
import { prepareArea } from './prepare-area';
|
|
3
|
-
import { prepareBarXSeries } from './prepare-bar-x';
|
|
4
|
-
import { prepareBarYSeries } from './prepare-bar-y';
|
|
5
|
-
import { prepareLineSeries } from './prepare-line';
|
|
6
|
-
import { preparePieSeries } from './prepare-pie';
|
|
7
|
-
import { prepareScatterSeries } from './prepare-scatter';
|
|
8
|
-
import { prepareTreemap } from './prepare-treemap';
|
|
9
|
-
import { prepareWaterfallSeries } from './prepare-waterfall';
|
|
10
|
-
export function prepareSeries(args) {
|
|
11
|
-
const { type, series, seriesOptions, legend, colorScale } = args;
|
|
12
|
-
switch (type) {
|
|
13
|
-
case 'pie': {
|
|
14
|
-
return series.reduce((acc, singleSeries) => {
|
|
15
|
-
acc.push(...preparePieSeries({ series: singleSeries, seriesOptions, legend }));
|
|
16
|
-
return acc;
|
|
17
|
-
}, []);
|
|
18
|
-
}
|
|
19
|
-
case 'bar-x': {
|
|
20
|
-
return prepareBarXSeries({ series: series, legend, colorScale });
|
|
21
|
-
}
|
|
22
|
-
case 'bar-y': {
|
|
23
|
-
return prepareBarYSeries({ series: series, legend, colorScale });
|
|
24
|
-
}
|
|
25
|
-
case 'scatter': {
|
|
26
|
-
return prepareScatterSeries({ series: series, legend, colorScale });
|
|
27
|
-
}
|
|
28
|
-
case 'line': {
|
|
29
|
-
return prepareLineSeries({
|
|
30
|
-
series: series,
|
|
31
|
-
seriesOptions,
|
|
32
|
-
legend,
|
|
33
|
-
colorScale,
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
case 'area': {
|
|
37
|
-
return prepareArea({
|
|
38
|
-
series: series,
|
|
39
|
-
seriesOptions,
|
|
40
|
-
legend,
|
|
41
|
-
colorScale,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
case 'treemap': {
|
|
45
|
-
return prepareTreemap({
|
|
46
|
-
series: series,
|
|
47
|
-
seriesOptions,
|
|
48
|
-
legend,
|
|
49
|
-
colorScale,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
case 'waterfall': {
|
|
53
|
-
return prepareWaterfallSeries({
|
|
54
|
-
series: series,
|
|
55
|
-
legend,
|
|
56
|
-
colorScale,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
default: {
|
|
60
|
-
throw new ChartKitError({
|
|
61
|
-
message: `Series type "${type}" does not support data preparation for series that do not support the presence of axes`,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { DashStyle, LayoutAlgorithm, LineCap, SymbolType } from '../../../../../constants';
|
|
2
|
-
import type { AreaSeries, AreaSeriesData, BarXSeries, BarXSeriesData, BarYSeries, BarYSeriesData, BaseTextStyle, ChartKitWidgetLegend, ConnectorCurve, ConnectorShape, LineSeries, LineSeriesData, PathLegendSymbolOptions, PieSeries, PieSeriesData, RectLegendSymbolOptions, ScatterSeries, ScatterSeriesData, SymbolLegendSymbolOptions, TreemapSeries, TreemapSeriesData, WaterfallSeries, WaterfallSeriesData } from '../../../../../types';
|
|
3
|
-
import type { SeriesOptionsDefaults } from '../../constants';
|
|
4
|
-
export type RectLegendSymbol = {
|
|
5
|
-
shape: 'rect';
|
|
6
|
-
} & Required<RectLegendSymbolOptions>;
|
|
7
|
-
export type PathLegendSymbol = {
|
|
8
|
-
shape: 'path';
|
|
9
|
-
strokeWidth: number;
|
|
10
|
-
} & Required<PathLegendSymbolOptions>;
|
|
11
|
-
export type SymbolLegendSymbol = {
|
|
12
|
-
shape: 'symbol';
|
|
13
|
-
symbolType: `${SymbolType}`;
|
|
14
|
-
} & Required<SymbolLegendSymbolOptions>;
|
|
15
|
-
export type PreparedLegendSymbol = RectLegendSymbol | PathLegendSymbol | SymbolLegendSymbol;
|
|
16
|
-
export type PreparedLegend = Required<Omit<ChartKitWidgetLegend, 'title' | 'colorScale'>> & {
|
|
17
|
-
height: number;
|
|
18
|
-
lineHeight: number;
|
|
19
|
-
title: {
|
|
20
|
-
enable: boolean;
|
|
21
|
-
text: string;
|
|
22
|
-
margin: number;
|
|
23
|
-
style: BaseTextStyle;
|
|
24
|
-
height: number;
|
|
25
|
-
};
|
|
26
|
-
ticks: {
|
|
27
|
-
labelsMargin: number;
|
|
28
|
-
labelsLineHeight: number;
|
|
29
|
-
};
|
|
30
|
-
colorScale: {
|
|
31
|
-
colors: string[];
|
|
32
|
-
domain: number[];
|
|
33
|
-
stops: number[];
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
export type OnLegendItemClick = (data: {
|
|
37
|
-
name: string;
|
|
38
|
-
metaKey: boolean;
|
|
39
|
-
}) => void;
|
|
40
|
-
export type LegendItem = {
|
|
41
|
-
color: string;
|
|
42
|
-
name: string;
|
|
43
|
-
symbol: PreparedLegendSymbol;
|
|
44
|
-
textWidth: number;
|
|
45
|
-
visible?: boolean;
|
|
46
|
-
dashStyle?: DashStyle;
|
|
47
|
-
};
|
|
48
|
-
export type LegendConfig = {
|
|
49
|
-
offset: {
|
|
50
|
-
left: number;
|
|
51
|
-
top: number;
|
|
52
|
-
};
|
|
53
|
-
pagination?: {
|
|
54
|
-
limit: number;
|
|
55
|
-
maxPage: number;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
export type PreparedHaloOptions = {
|
|
59
|
-
enabled: boolean;
|
|
60
|
-
opacity: number;
|
|
61
|
-
size: number;
|
|
62
|
-
};
|
|
63
|
-
type BasePreparedSeries = {
|
|
64
|
-
color: string;
|
|
65
|
-
name: string;
|
|
66
|
-
id: string;
|
|
67
|
-
visible: boolean;
|
|
68
|
-
legend: {
|
|
69
|
-
enabled: boolean;
|
|
70
|
-
symbol: PreparedLegendSymbol;
|
|
71
|
-
};
|
|
72
|
-
cursor: string | null;
|
|
73
|
-
};
|
|
74
|
-
export type PreparedScatterSeries = {
|
|
75
|
-
type: ScatterSeries['type'];
|
|
76
|
-
data: ScatterSeriesData[];
|
|
77
|
-
marker: {
|
|
78
|
-
states: {
|
|
79
|
-
normal: {
|
|
80
|
-
symbol: `${SymbolType}`;
|
|
81
|
-
enabled: boolean;
|
|
82
|
-
radius: number;
|
|
83
|
-
borderWidth: number;
|
|
84
|
-
borderColor: string;
|
|
85
|
-
};
|
|
86
|
-
hover: {
|
|
87
|
-
enabled: boolean;
|
|
88
|
-
radius: number;
|
|
89
|
-
borderWidth: number;
|
|
90
|
-
borderColor: string;
|
|
91
|
-
halo: PreparedHaloOptions;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
yAxis: number;
|
|
96
|
-
} & BasePreparedSeries;
|
|
97
|
-
export type PreparedBarXSeries = {
|
|
98
|
-
type: BarXSeries['type'];
|
|
99
|
-
data: BarXSeriesData[];
|
|
100
|
-
stackId: string;
|
|
101
|
-
stacking: BarXSeries['stacking'];
|
|
102
|
-
dataLabels: {
|
|
103
|
-
enabled: boolean;
|
|
104
|
-
inside: boolean;
|
|
105
|
-
style: BaseTextStyle;
|
|
106
|
-
allowOverlap: boolean;
|
|
107
|
-
padding: number;
|
|
108
|
-
html: boolean;
|
|
109
|
-
};
|
|
110
|
-
yAxis: number;
|
|
111
|
-
} & BasePreparedSeries;
|
|
112
|
-
export type PreparedBarYSeries = {
|
|
113
|
-
type: BarYSeries['type'];
|
|
114
|
-
data: BarYSeriesData[];
|
|
115
|
-
stackId: string;
|
|
116
|
-
stacking: BarYSeries['stacking'];
|
|
117
|
-
dataLabels: {
|
|
118
|
-
enabled: boolean;
|
|
119
|
-
inside: boolean;
|
|
120
|
-
style: BaseTextStyle;
|
|
121
|
-
maxHeight: number;
|
|
122
|
-
maxWidth: number;
|
|
123
|
-
html: boolean;
|
|
124
|
-
};
|
|
125
|
-
} & BasePreparedSeries;
|
|
126
|
-
export type PreparedPieSeries = {
|
|
127
|
-
type: PieSeries['type'];
|
|
128
|
-
data: PieSeriesData;
|
|
129
|
-
value: PieSeriesData['value'];
|
|
130
|
-
borderColor: string;
|
|
131
|
-
borderWidth: number;
|
|
132
|
-
borderRadius: number;
|
|
133
|
-
center?: [string | number | null, string | number | null];
|
|
134
|
-
radius?: string | number;
|
|
135
|
-
innerRadius?: string | number;
|
|
136
|
-
stackId: string;
|
|
137
|
-
label?: PieSeriesData['label'];
|
|
138
|
-
dataLabels: {
|
|
139
|
-
enabled: boolean;
|
|
140
|
-
padding: number;
|
|
141
|
-
style: BaseTextStyle;
|
|
142
|
-
allowOverlap: boolean;
|
|
143
|
-
connectorPadding: number;
|
|
144
|
-
connectorShape: ConnectorShape;
|
|
145
|
-
distance: number;
|
|
146
|
-
connectorCurve: ConnectorCurve;
|
|
147
|
-
html: boolean;
|
|
148
|
-
};
|
|
149
|
-
states: {
|
|
150
|
-
hover: {
|
|
151
|
-
halo: PreparedHaloOptions;
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
renderCustomShape?: PieSeries['renderCustomShape'];
|
|
155
|
-
opacity: number | null;
|
|
156
|
-
} & BasePreparedSeries;
|
|
157
|
-
export type PreparedLineSeries = {
|
|
158
|
-
type: LineSeries['type'];
|
|
159
|
-
data: LineSeriesData[];
|
|
160
|
-
lineWidth: number;
|
|
161
|
-
dataLabels: {
|
|
162
|
-
enabled: boolean;
|
|
163
|
-
style: BaseTextStyle;
|
|
164
|
-
padding: number;
|
|
165
|
-
allowOverlap: boolean;
|
|
166
|
-
html: boolean;
|
|
167
|
-
};
|
|
168
|
-
marker: {
|
|
169
|
-
states: {
|
|
170
|
-
normal: {
|
|
171
|
-
symbol: `${SymbolType}`;
|
|
172
|
-
enabled: boolean;
|
|
173
|
-
radius: number;
|
|
174
|
-
borderWidth: number;
|
|
175
|
-
borderColor: string;
|
|
176
|
-
};
|
|
177
|
-
hover: {
|
|
178
|
-
enabled: boolean;
|
|
179
|
-
radius: number;
|
|
180
|
-
borderWidth: number;
|
|
181
|
-
borderColor: string;
|
|
182
|
-
halo: PreparedHaloOptions;
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
|
-
};
|
|
186
|
-
dashStyle: DashStyle;
|
|
187
|
-
linecap: LineCap;
|
|
188
|
-
opacity: number | null;
|
|
189
|
-
yAxis: number;
|
|
190
|
-
} & BasePreparedSeries;
|
|
191
|
-
export type PreparedAreaSeries = {
|
|
192
|
-
type: AreaSeries['type'];
|
|
193
|
-
data: AreaSeriesData[];
|
|
194
|
-
stacking: AreaSeries['stacking'];
|
|
195
|
-
stackId: string;
|
|
196
|
-
lineWidth: number;
|
|
197
|
-
opacity: number;
|
|
198
|
-
dataLabels: {
|
|
199
|
-
enabled: boolean;
|
|
200
|
-
style: BaseTextStyle;
|
|
201
|
-
padding: number;
|
|
202
|
-
allowOverlap: boolean;
|
|
203
|
-
html: boolean;
|
|
204
|
-
};
|
|
205
|
-
marker: {
|
|
206
|
-
states: {
|
|
207
|
-
normal: {
|
|
208
|
-
symbol: `${SymbolType}`;
|
|
209
|
-
enabled: boolean;
|
|
210
|
-
radius: number;
|
|
211
|
-
borderWidth: number;
|
|
212
|
-
borderColor: string;
|
|
213
|
-
};
|
|
214
|
-
hover: {
|
|
215
|
-
enabled: boolean;
|
|
216
|
-
radius: number;
|
|
217
|
-
borderWidth: number;
|
|
218
|
-
borderColor: string;
|
|
219
|
-
halo: PreparedHaloOptions;
|
|
220
|
-
};
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
yAxis: number;
|
|
224
|
-
} & BasePreparedSeries;
|
|
225
|
-
export type PreparedTreemapSeries = {
|
|
226
|
-
type: TreemapSeries['type'];
|
|
227
|
-
data: TreemapSeriesData[];
|
|
228
|
-
dataLabels: {
|
|
229
|
-
enabled: boolean;
|
|
230
|
-
style: BaseTextStyle;
|
|
231
|
-
padding: number;
|
|
232
|
-
allowOverlap: boolean;
|
|
233
|
-
html: boolean;
|
|
234
|
-
align: Required<Required<TreemapSeries>['dataLabels']>['align'];
|
|
235
|
-
};
|
|
236
|
-
layoutAlgorithm: `${LayoutAlgorithm}`;
|
|
237
|
-
} & BasePreparedSeries & Omit<TreemapSeries, keyof BasePreparedSeries>;
|
|
238
|
-
export type PreparedWaterfallSeries = {
|
|
239
|
-
type: WaterfallSeries['type'];
|
|
240
|
-
data: WaterfallSeriesData[];
|
|
241
|
-
dataLabels: {
|
|
242
|
-
enabled: boolean;
|
|
243
|
-
style: BaseTextStyle;
|
|
244
|
-
allowOverlap: boolean;
|
|
245
|
-
padding: number;
|
|
246
|
-
html: boolean;
|
|
247
|
-
};
|
|
248
|
-
positiveColor: string;
|
|
249
|
-
negativeColor: string;
|
|
250
|
-
} & BasePreparedSeries;
|
|
251
|
-
export type PreparedSeries = PreparedScatterSeries | PreparedBarXSeries | PreparedBarYSeries | PreparedPieSeries | PreparedLineSeries | PreparedAreaSeries | PreparedTreemapSeries | PreparedWaterfallSeries;
|
|
252
|
-
export type PreparedSeriesOptions = SeriesOptionsDefaults;
|
|
253
|
-
export type StackedSeries = BarXSeries | AreaSeries | BarYSeries;
|
|
254
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SymbolType } from '../../../../../constants';
|
|
2
|
-
import { ChartKitWidgetSeries } from '../../../../../types';
|
|
3
|
-
import { PreparedLegendSymbol, PreparedSeries, StackedSeries } from './types';
|
|
4
|
-
export declare const getActiveLegendItems: (series: PreparedSeries[]) => string[];
|
|
5
|
-
export declare const getAllLegendItems: (series: PreparedSeries[]) => string[];
|
|
6
|
-
export declare function prepareLegendSymbol(series: ChartKitWidgetSeries, symbolType?: `${SymbolType}`): PreparedLegendSymbol;
|
|
7
|
-
export declare function getSeriesStackId(series: StackedSeries): string;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import memoize from 'lodash/memoize';
|
|
2
|
-
import { SymbolType } from '../../../../../constants';
|
|
3
|
-
import { getRandomCKId } from '../../../../../utils';
|
|
4
|
-
import { DEFAULT_LEGEND_SYMBOL_PADDING, DEFAULT_LEGEND_SYMBOL_SIZE } from './constants';
|
|
5
|
-
export const getActiveLegendItems = (series) => {
|
|
6
|
-
return series.reduce((acc, s) => {
|
|
7
|
-
if (s.legend.enabled && s.visible) {
|
|
8
|
-
acc.push(s.name);
|
|
9
|
-
}
|
|
10
|
-
return acc;
|
|
11
|
-
}, []);
|
|
12
|
-
};
|
|
13
|
-
export const getAllLegendItems = (series) => {
|
|
14
|
-
return series.map((s) => s.name);
|
|
15
|
-
};
|
|
16
|
-
export function prepareLegendSymbol(series, symbolType) {
|
|
17
|
-
var _a;
|
|
18
|
-
const symbolOptions = ((_a = series.legend) === null || _a === void 0 ? void 0 : _a.symbol) || {};
|
|
19
|
-
return {
|
|
20
|
-
shape: 'symbol',
|
|
21
|
-
symbolType: symbolType || SymbolType.Circle,
|
|
22
|
-
width: (symbolOptions === null || symbolOptions === void 0 ? void 0 : symbolOptions.width) || DEFAULT_LEGEND_SYMBOL_SIZE,
|
|
23
|
-
padding: (symbolOptions === null || symbolOptions === void 0 ? void 0 : symbolOptions.padding) || DEFAULT_LEGEND_SYMBOL_PADDING,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
const getCommonStackId = memoize(getRandomCKId);
|
|
27
|
-
export function getSeriesStackId(series) {
|
|
28
|
-
let stackId = series.stackId;
|
|
29
|
-
if (!stackId) {
|
|
30
|
-
stackId = series.stacking ? getCommonStackId() : getRandomCKId();
|
|
31
|
-
}
|
|
32
|
-
return stackId;
|
|
33
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ShapeDataWithHtmlItems } from '../../types';
|
|
3
|
-
type Props = {
|
|
4
|
-
htmlLayout: HTMLElement | null;
|
|
5
|
-
preparedData: ShapeDataWithHtmlItems | ShapeDataWithHtmlItems[];
|
|
6
|
-
};
|
|
7
|
-
export declare const HtmlLayer: (props: Props) => React.JSX.Element | null;
|
|
8
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Portal } from '@gravity-ui/uikit';
|
|
3
|
-
export const HtmlLayer = (props) => {
|
|
4
|
-
const { htmlLayout, preparedData } = props;
|
|
5
|
-
const items = React.useMemo(() => {
|
|
6
|
-
if (Array.isArray(preparedData)) {
|
|
7
|
-
return preparedData.reduce((result, d) => {
|
|
8
|
-
result.push(...d.htmlElements);
|
|
9
|
-
return result;
|
|
10
|
-
}, []);
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
return preparedData.htmlElements;
|
|
14
|
-
}
|
|
15
|
-
}, [preparedData]);
|
|
16
|
-
if (!htmlLayout) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
return (React.createElement(Portal, { container: htmlLayout }, items.map((item, index) => {
|
|
20
|
-
return (React.createElement("div", { key: index, dangerouslySetInnerHTML: { __html: item.content }, style: { position: 'absolute', left: item.x, top: item.y } }));
|
|
21
|
-
})));
|
|
22
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../useSeries/types';
|
|
4
|
-
import type { PreparedAreaData } from './types';
|
|
5
|
-
type Args = {
|
|
6
|
-
dispatcher: Dispatch<object>;
|
|
7
|
-
preparedData: PreparedAreaData[];
|
|
8
|
-
seriesOptions: PreparedSeriesOptions;
|
|
9
|
-
htmlLayout: HTMLElement | null;
|
|
10
|
-
};
|
|
11
|
-
export declare const AreaSeriesShapes: (args: Args) => React.JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { area as areaGenerator, color, line as lineGenerator, select } from 'd3';
|
|
3
|
-
import get from 'lodash/get';
|
|
4
|
-
import { block } from '../../../../../../utils/cn';
|
|
5
|
-
import { filterOverlappingLabels } from '../../../utils';
|
|
6
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
7
|
-
import { getMarkerHaloVisibility, getMarkerVisibility, renderMarker, selectMarkerHalo, selectMarkerSymbol, setMarker, } from '../marker';
|
|
8
|
-
import { setActiveState } from '../utils';
|
|
9
|
-
const b = block('d3-area');
|
|
10
|
-
export const AreaSeriesShapes = (args) => {
|
|
11
|
-
const { dispatcher, preparedData, seriesOptions, htmlLayout } = args;
|
|
12
|
-
const ref = React.useRef(null);
|
|
13
|
-
React.useEffect(() => {
|
|
14
|
-
var _a;
|
|
15
|
-
if (!ref.current) {
|
|
16
|
-
return () => { };
|
|
17
|
-
}
|
|
18
|
-
const svgElement = select(ref.current);
|
|
19
|
-
const hoverOptions = get(seriesOptions, 'area.states.hover');
|
|
20
|
-
const inactiveOptions = get(seriesOptions, 'area.states.inactive');
|
|
21
|
-
const line = lineGenerator()
|
|
22
|
-
.x((d) => d.x)
|
|
23
|
-
.y((d) => d.y);
|
|
24
|
-
svgElement.selectAll('*').remove();
|
|
25
|
-
const shapeSelection = svgElement
|
|
26
|
-
.selectAll('shape')
|
|
27
|
-
.data(preparedData)
|
|
28
|
-
.join('g')
|
|
29
|
-
.attr('class', b('series'))
|
|
30
|
-
.attr('cursor', (d) => d.series.cursor);
|
|
31
|
-
shapeSelection
|
|
32
|
-
.append('path')
|
|
33
|
-
.attr('class', b('line'))
|
|
34
|
-
.attr('d', (d) => line(d.points))
|
|
35
|
-
.attr('fill', 'none')
|
|
36
|
-
.attr('stroke', (d) => d.color)
|
|
37
|
-
.attr('stroke-width', (d) => d.width)
|
|
38
|
-
.attr('stroke-linejoin', 'round')
|
|
39
|
-
.attr('stroke-linecap', 'round');
|
|
40
|
-
const area = areaGenerator()
|
|
41
|
-
.x((d) => d.x)
|
|
42
|
-
.y0((d) => d.y0)
|
|
43
|
-
.y1((d) => d.y);
|
|
44
|
-
shapeSelection
|
|
45
|
-
.append('path')
|
|
46
|
-
.attr('class', b('region'))
|
|
47
|
-
.attr('d', (d) => area(d.points))
|
|
48
|
-
.attr('fill', (d) => d.color)
|
|
49
|
-
.attr('opacity', (d) => d.opacity);
|
|
50
|
-
let dataLabels = preparedData.reduce((acc, d) => {
|
|
51
|
-
return acc.concat(d.labels);
|
|
52
|
-
}, []);
|
|
53
|
-
if (!((_a = preparedData[0]) === null || _a === void 0 ? void 0 : _a.series.dataLabels.allowOverlap)) {
|
|
54
|
-
dataLabels = filterOverlappingLabels(dataLabels);
|
|
55
|
-
}
|
|
56
|
-
const labelsSelection = svgElement
|
|
57
|
-
.selectAll('text')
|
|
58
|
-
.data(dataLabels)
|
|
59
|
-
.join('text')
|
|
60
|
-
.text((d) => d.text)
|
|
61
|
-
.attr('class', b('label'))
|
|
62
|
-
.attr('x', (d) => d.x)
|
|
63
|
-
.attr('y', (d) => d.y)
|
|
64
|
-
.attr('text-anchor', (d) => d.textAnchor)
|
|
65
|
-
.style('font-size', (d) => d.style.fontSize)
|
|
66
|
-
.style('font-weight', (d) => d.style.fontWeight || null)
|
|
67
|
-
.style('fill', (d) => d.style.fontColor || null);
|
|
68
|
-
const markers = preparedData.reduce((acc, d) => acc.concat(d.markers), []);
|
|
69
|
-
const markerSelection = svgElement
|
|
70
|
-
.selectAll('marker')
|
|
71
|
-
.data(markers)
|
|
72
|
-
.join('g')
|
|
73
|
-
.call(renderMarker);
|
|
74
|
-
const hoverEnabled = hoverOptions === null || hoverOptions === void 0 ? void 0 : hoverOptions.enabled;
|
|
75
|
-
const inactiveEnabled = inactiveOptions === null || inactiveOptions === void 0 ? void 0 : inactiveOptions.enabled;
|
|
76
|
-
dispatcher.on('hover-shape.area', (data) => {
|
|
77
|
-
const selected = (data === null || data === void 0 ? void 0 : data.filter((d) => d.series.type === 'area')) || [];
|
|
78
|
-
const selectedDataItems = selected.map((d) => d.data);
|
|
79
|
-
const selectedSeriesIds = selected.map((d) => { var _a; return (_a = d.series) === null || _a === void 0 ? void 0 : _a.id; });
|
|
80
|
-
shapeSelection.datum((d, index, list) => {
|
|
81
|
-
var _a;
|
|
82
|
-
const elementSelection = select(list[index]);
|
|
83
|
-
const hovered = Boolean(hoverEnabled && selectedSeriesIds.includes(d.id));
|
|
84
|
-
if (d.hovered !== hovered) {
|
|
85
|
-
d.hovered = hovered;
|
|
86
|
-
let strokeColor = d.color || '';
|
|
87
|
-
if (d.hovered) {
|
|
88
|
-
strokeColor =
|
|
89
|
-
((_a = color(strokeColor)) === null || _a === void 0 ? void 0 : _a.brighter(hoverOptions === null || hoverOptions === void 0 ? void 0 : hoverOptions.brightness).toString()) ||
|
|
90
|
-
strokeColor;
|
|
91
|
-
}
|
|
92
|
-
elementSelection.selectAll(`.${b('line')}`).attr('stroke', strokeColor);
|
|
93
|
-
elementSelection.selectAll(`.${b('region')}`).attr('fill', strokeColor);
|
|
94
|
-
}
|
|
95
|
-
return setActiveState({
|
|
96
|
-
element: list[index],
|
|
97
|
-
state: inactiveOptions,
|
|
98
|
-
active: Boolean(!inactiveEnabled ||
|
|
99
|
-
!selectedSeriesIds.length ||
|
|
100
|
-
selectedSeriesIds.includes(d.id)),
|
|
101
|
-
datum: d,
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
labelsSelection.datum((d, index, list) => {
|
|
105
|
-
return setActiveState({
|
|
106
|
-
element: list[index],
|
|
107
|
-
state: inactiveOptions,
|
|
108
|
-
active: Boolean(!inactiveEnabled ||
|
|
109
|
-
!selectedSeriesIds.length ||
|
|
110
|
-
selectedSeriesIds.includes(d.series.id)),
|
|
111
|
-
datum: d,
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
markerSelection.datum((d, index, list) => {
|
|
115
|
-
const elementSelection = select(list[index]);
|
|
116
|
-
const hovered = Boolean(hoverEnabled && selectedDataItems.includes(d.point.data));
|
|
117
|
-
if (d.hovered !== hovered) {
|
|
118
|
-
d.hovered = hovered;
|
|
119
|
-
elementSelection.attr('visibility', getMarkerVisibility(d));
|
|
120
|
-
selectMarkerHalo(elementSelection).attr('visibility', getMarkerHaloVisibility);
|
|
121
|
-
selectMarkerSymbol(elementSelection).call(setMarker, hovered ? 'hover' : 'normal');
|
|
122
|
-
}
|
|
123
|
-
if (d.point.series.marker.states.normal.enabled) {
|
|
124
|
-
const isActive = Boolean(!inactiveEnabled ||
|
|
125
|
-
!selectedSeriesIds.length ||
|
|
126
|
-
selectedSeriesIds.includes(d.point.series.id));
|
|
127
|
-
setActiveState({
|
|
128
|
-
element: list[index],
|
|
129
|
-
state: inactiveOptions,
|
|
130
|
-
active: isActive,
|
|
131
|
-
datum: d,
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
return d;
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
return () => {
|
|
138
|
-
dispatcher.on('hover-shape.area', null);
|
|
139
|
-
};
|
|
140
|
-
}, [dispatcher, preparedData, seriesOptions]);
|
|
141
|
-
return (React.createElement(React.Fragment, null,
|
|
142
|
-
React.createElement("g", { ref: ref, className: b() }),
|
|
143
|
-
React.createElement(HtmlLayer, { preparedData: preparedData, htmlLayout: htmlLayout })));
|
|
144
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ChartScale } from '../../useAxisScales';
|
|
2
|
-
import type { PreparedAxis } from '../../useChartOptions/types';
|
|
3
|
-
import type { PreparedAreaSeries } from '../../useSeries/types';
|
|
4
|
-
import type { PreparedAreaData } from './types';
|
|
5
|
-
export declare const prepareAreaData: (args: {
|
|
6
|
-
series: PreparedAreaSeries[];
|
|
7
|
-
xAxis: PreparedAxis;
|
|
8
|
-
xScale: ChartScale;
|
|
9
|
-
yAxis: PreparedAxis[];
|
|
10
|
-
yScale: ChartScale[];
|
|
11
|
-
boundsHeight: number;
|
|
12
|
-
}) => PreparedAreaData[];
|