@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,10 +0,0 @@
|
|
|
1
|
-
import type { ScaleOrdinal } from 'd3';
|
|
2
|
-
import type { BarXSeries } from '../../../../../types';
|
|
3
|
-
import type { PreparedLegend, PreparedSeries } from './types';
|
|
4
|
-
type PrepareBarXSeriesArgs = {
|
|
5
|
-
colorScale: ScaleOrdinal<string, string>;
|
|
6
|
-
series: BarXSeries[];
|
|
7
|
-
legend: PreparedLegend;
|
|
8
|
-
};
|
|
9
|
-
export declare function prepareBarXSeries(args: PrepareBarXSeriesArgs): PreparedSeries[];
|
|
10
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import get from 'lodash/get';
|
|
2
|
-
import { getRandomCKId } from '../../../../../utils';
|
|
3
|
-
import { DEFAULT_DATALABELS_PADDING, DEFAULT_DATALABELS_STYLE } from './constants';
|
|
4
|
-
import { getSeriesStackId, prepareLegendSymbol } from './utils';
|
|
5
|
-
export function prepareBarXSeries(args) {
|
|
6
|
-
const { colorScale, series: seriesList, legend } = args;
|
|
7
|
-
return seriesList.map((series) => {
|
|
8
|
-
var _a, _b, _c, _d, _e;
|
|
9
|
-
const name = series.name || '';
|
|
10
|
-
const color = series.color || colorScale(name);
|
|
11
|
-
return {
|
|
12
|
-
type: series.type,
|
|
13
|
-
color,
|
|
14
|
-
name,
|
|
15
|
-
id: getRandomCKId(),
|
|
16
|
-
visible: get(series, 'visible', true),
|
|
17
|
-
legend: {
|
|
18
|
-
enabled: get(series, 'legend.enabled', legend.enabled),
|
|
19
|
-
symbol: prepareLegendSymbol(series),
|
|
20
|
-
},
|
|
21
|
-
data: series.data,
|
|
22
|
-
stacking: series.stacking,
|
|
23
|
-
stackId: getSeriesStackId(series),
|
|
24
|
-
dataLabels: {
|
|
25
|
-
enabled: ((_a = series.dataLabels) === null || _a === void 0 ? void 0 : _a.enabled) || false,
|
|
26
|
-
inside: typeof ((_b = series.dataLabels) === null || _b === void 0 ? void 0 : _b.inside) === 'boolean'
|
|
27
|
-
? (_c = series.dataLabels) === null || _c === void 0 ? void 0 : _c.inside
|
|
28
|
-
: false,
|
|
29
|
-
style: Object.assign({}, DEFAULT_DATALABELS_STYLE, (_d = series.dataLabels) === null || _d === void 0 ? void 0 : _d.style),
|
|
30
|
-
allowOverlap: ((_e = series.dataLabels) === null || _e === void 0 ? void 0 : _e.allowOverlap) || false,
|
|
31
|
-
padding: get(series, 'dataLabels.padding', DEFAULT_DATALABELS_PADDING),
|
|
32
|
-
html: get(series, 'dataLabels.html', false),
|
|
33
|
-
},
|
|
34
|
-
cursor: get(series, 'cursor', null),
|
|
35
|
-
yAxis: get(series, 'yAxis', 0),
|
|
36
|
-
};
|
|
37
|
-
}, []);
|
|
38
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ScaleOrdinal } from 'd3';
|
|
2
|
-
import type { BarYSeries } from '../../../../../types';
|
|
3
|
-
import type { PreparedLegend, PreparedSeries } from './types';
|
|
4
|
-
type PrepareBarYSeriesArgs = {
|
|
5
|
-
colorScale: ScaleOrdinal<string, string>;
|
|
6
|
-
series: BarYSeries[];
|
|
7
|
-
legend: PreparedLegend;
|
|
8
|
-
};
|
|
9
|
-
export declare function prepareBarYSeries(args: PrepareBarYSeriesArgs): PreparedSeries[];
|
|
10
|
-
export {};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import get from 'lodash/get';
|
|
2
|
-
import { getRandomCKId } from '../../../../../utils';
|
|
3
|
-
import { getLabelsSize } from '../../utils';
|
|
4
|
-
import { DEFAULT_DATALABELS_STYLE } from './constants';
|
|
5
|
-
import { getSeriesStackId, prepareLegendSymbol } from './utils';
|
|
6
|
-
function prepareDataLabels(series) {
|
|
7
|
-
var _a;
|
|
8
|
-
const enabled = get(series, 'dataLabels.enabled', false);
|
|
9
|
-
const style = Object.assign({}, DEFAULT_DATALABELS_STYLE, (_a = series.dataLabels) === null || _a === void 0 ? void 0 : _a.style);
|
|
10
|
-
const html = get(series, 'dataLabels.html', false);
|
|
11
|
-
const labels = enabled ? series.data.map((d) => String(d.label || d.x)) : [];
|
|
12
|
-
const { maxHeight = 0, maxWidth = 0 } = getLabelsSize({
|
|
13
|
-
labels,
|
|
14
|
-
style,
|
|
15
|
-
html,
|
|
16
|
-
});
|
|
17
|
-
const inside = series.stacking === 'percent' ? true : get(series, 'dataLabels.inside', false);
|
|
18
|
-
return {
|
|
19
|
-
enabled,
|
|
20
|
-
inside,
|
|
21
|
-
style,
|
|
22
|
-
maxHeight,
|
|
23
|
-
maxWidth,
|
|
24
|
-
html,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export function prepareBarYSeries(args) {
|
|
28
|
-
const { colorScale, series: seriesList, legend } = args;
|
|
29
|
-
return seriesList.map((series) => {
|
|
30
|
-
const name = series.name || '';
|
|
31
|
-
const color = series.color || colorScale(name);
|
|
32
|
-
return {
|
|
33
|
-
type: series.type,
|
|
34
|
-
color,
|
|
35
|
-
name,
|
|
36
|
-
id: getRandomCKId(),
|
|
37
|
-
visible: get(series, 'visible', true),
|
|
38
|
-
legend: {
|
|
39
|
-
enabled: get(series, 'legend.enabled', legend.enabled),
|
|
40
|
-
symbol: prepareLegendSymbol(series),
|
|
41
|
-
},
|
|
42
|
-
data: series.data,
|
|
43
|
-
stacking: series.stacking,
|
|
44
|
-
stackId: getSeriesStackId(series),
|
|
45
|
-
dataLabels: prepareDataLabels(series),
|
|
46
|
-
cursor: get(series, 'cursor', null),
|
|
47
|
-
};
|
|
48
|
-
}, []);
|
|
49
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { ChartKitWidgetData } from '../../../../../types';
|
|
2
|
-
import type { PreparedAxis, PreparedChart } from '../useChartOptions/types';
|
|
3
|
-
import type { LegendItem, PreparedLegend, PreparedSeries } from './types';
|
|
4
|
-
export declare const getPreparedLegend: (args: {
|
|
5
|
-
legend: ChartKitWidgetData['legend'];
|
|
6
|
-
series: ChartKitWidgetData['series']['data'];
|
|
7
|
-
}) => PreparedLegend;
|
|
8
|
-
export declare const getLegendComponents: (args: {
|
|
9
|
-
chartWidth: number;
|
|
10
|
-
chartHeight: number;
|
|
11
|
-
chartMargin: PreparedChart['margin'];
|
|
12
|
-
series: PreparedSeries[];
|
|
13
|
-
preparedLegend: PreparedLegend;
|
|
14
|
-
preparedYAxis: PreparedAxis[];
|
|
15
|
-
}) => {
|
|
16
|
-
legendConfig: {
|
|
17
|
-
offset: {
|
|
18
|
-
left: number;
|
|
19
|
-
top: number;
|
|
20
|
-
};
|
|
21
|
-
pagination: {
|
|
22
|
-
limit: number;
|
|
23
|
-
maxPage: number;
|
|
24
|
-
} | undefined;
|
|
25
|
-
};
|
|
26
|
-
legendItems: LegendItem[][];
|
|
27
|
-
};
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { select } from 'd3';
|
|
2
|
-
import clone from 'lodash/clone';
|
|
3
|
-
import get from 'lodash/get';
|
|
4
|
-
import merge from 'lodash/merge';
|
|
5
|
-
import { CONTINUOUS_LEGEND_SIZE, legendDefaults } from '../../constants';
|
|
6
|
-
import { getDefaultColorStops, getDomainForContinuousColorScale, getHorisontalSvgTextHeight, getLabelsSize, } from '../../utils';
|
|
7
|
-
import { getBoundsWidth } from '../useChartDimensions';
|
|
8
|
-
import { getYAxisWidth } from '../useChartDimensions/utils';
|
|
9
|
-
export const getPreparedLegend = (args) => {
|
|
10
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
11
|
-
const { legend, series } = args;
|
|
12
|
-
const enabled = Boolean(typeof (legend === null || legend === void 0 ? void 0 : legend.enabled) === 'boolean' ? legend === null || legend === void 0 ? void 0 : legend.enabled : series.length > 1);
|
|
13
|
-
const defaultItemStyle = clone(legendDefaults.itemStyle);
|
|
14
|
-
const itemStyle = get(legend, 'itemStyle');
|
|
15
|
-
const computedItemStyle = merge(defaultItemStyle, itemStyle);
|
|
16
|
-
const lineHeight = getHorisontalSvgTextHeight({ text: 'Tmp', style: computedItemStyle });
|
|
17
|
-
const legendType = get(legend, 'type', 'discrete');
|
|
18
|
-
const isTitleEnabled = Boolean((_a = legend === null || legend === void 0 ? void 0 : legend.title) === null || _a === void 0 ? void 0 : _a.text);
|
|
19
|
-
const titleMargin = isTitleEnabled ? get(legend, 'title.margin', 4) : 0;
|
|
20
|
-
const titleStyle = Object.assign({ fontSize: '12px', fontWeight: 'bold' }, get(legend, 'title.style'));
|
|
21
|
-
const titleText = isTitleEnabled ? get(legend, 'title.text', '') : '';
|
|
22
|
-
const titleHeight = isTitleEnabled
|
|
23
|
-
? getLabelsSize({ labels: [titleText], style: titleStyle }).maxHeight
|
|
24
|
-
: 0;
|
|
25
|
-
const ticks = {
|
|
26
|
-
labelsMargin: 4,
|
|
27
|
-
labelsLineHeight: 12,
|
|
28
|
-
};
|
|
29
|
-
const colorScale = {
|
|
30
|
-
colors: [],
|
|
31
|
-
domain: [],
|
|
32
|
-
stops: [],
|
|
33
|
-
};
|
|
34
|
-
let height = 0;
|
|
35
|
-
if (enabled) {
|
|
36
|
-
height += titleHeight + titleMargin;
|
|
37
|
-
if (legendType === 'continuous') {
|
|
38
|
-
height += CONTINUOUS_LEGEND_SIZE.height;
|
|
39
|
-
height += ticks.labelsLineHeight + ticks.labelsMargin;
|
|
40
|
-
colorScale.colors = (_c = (_b = legend === null || legend === void 0 ? void 0 : legend.colorScale) === null || _b === void 0 ? void 0 : _b.colors) !== null && _c !== void 0 ? _c : [];
|
|
41
|
-
colorScale.stops =
|
|
42
|
-
(_e = (_d = legend === null || legend === void 0 ? void 0 : legend.colorScale) === null || _d === void 0 ? void 0 : _d.stops) !== null && _e !== void 0 ? _e : getDefaultColorStops(colorScale.colors.length);
|
|
43
|
-
colorScale.domain =
|
|
44
|
-
(_g = (_f = legend === null || legend === void 0 ? void 0 : legend.colorScale) === null || _f === void 0 ? void 0 : _f.domain) !== null && _g !== void 0 ? _g : getDomainForContinuousColorScale({ series });
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
height += lineHeight;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
const legendWidth = get(legend, 'width', CONTINUOUS_LEGEND_SIZE.width);
|
|
51
|
-
return {
|
|
52
|
-
align: get(legend, 'align', legendDefaults.align),
|
|
53
|
-
enabled,
|
|
54
|
-
height,
|
|
55
|
-
itemDistance: get(legend, 'itemDistance', legendDefaults.itemDistance),
|
|
56
|
-
itemStyle: computedItemStyle,
|
|
57
|
-
lineHeight,
|
|
58
|
-
margin: get(legend, 'margin', legendDefaults.margin),
|
|
59
|
-
type: legendType,
|
|
60
|
-
title: {
|
|
61
|
-
enable: isTitleEnabled,
|
|
62
|
-
text: titleText,
|
|
63
|
-
margin: titleMargin,
|
|
64
|
-
style: titleStyle,
|
|
65
|
-
height: titleHeight,
|
|
66
|
-
},
|
|
67
|
-
width: legendWidth,
|
|
68
|
-
ticks,
|
|
69
|
-
colorScale,
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
const getFlattenLegendItems = (series) => {
|
|
73
|
-
return series.reduce((acc, s) => {
|
|
74
|
-
const legendEnabled = get(s, 'legend.enabled', true);
|
|
75
|
-
if (legendEnabled) {
|
|
76
|
-
acc.push(Object.assign(Object.assign({}, s), { symbol: s.legend.symbol }));
|
|
77
|
-
}
|
|
78
|
-
return acc;
|
|
79
|
-
}, []);
|
|
80
|
-
};
|
|
81
|
-
const getGroupedLegendItems = (args) => {
|
|
82
|
-
const { maxLegendWidth, items, preparedLegend } = args;
|
|
83
|
-
const result = [[]];
|
|
84
|
-
let textWidthsInLine = [0];
|
|
85
|
-
let lineIndex = 0;
|
|
86
|
-
items.forEach((item) => {
|
|
87
|
-
select(document.body)
|
|
88
|
-
.append('text')
|
|
89
|
-
.text(item.name)
|
|
90
|
-
.style('font-size', preparedLegend.itemStyle.fontSize)
|
|
91
|
-
.each(function () {
|
|
92
|
-
const resultItem = clone(item);
|
|
93
|
-
const textWidth = this.getBoundingClientRect().width;
|
|
94
|
-
resultItem.textWidth = textWidth;
|
|
95
|
-
textWidthsInLine.push(textWidth);
|
|
96
|
-
const textsWidth = textWidthsInLine.reduce((acc, width) => acc + width, 0);
|
|
97
|
-
result[lineIndex].push(resultItem);
|
|
98
|
-
const symbolsWidth = result[lineIndex].reduce((acc, { symbol }) => {
|
|
99
|
-
return acc + symbol.width + symbol.padding;
|
|
100
|
-
}, 0);
|
|
101
|
-
const distancesWidth = (result[lineIndex].length - 1) * preparedLegend.itemDistance;
|
|
102
|
-
const isOverfilled = maxLegendWidth < textsWidth + symbolsWidth + distancesWidth;
|
|
103
|
-
if (isOverfilled) {
|
|
104
|
-
result[lineIndex].pop();
|
|
105
|
-
lineIndex += 1;
|
|
106
|
-
textWidthsInLine = [textWidth];
|
|
107
|
-
const nextLineIndex = lineIndex;
|
|
108
|
-
result[nextLineIndex] = [];
|
|
109
|
-
result[nextLineIndex].push(resultItem);
|
|
110
|
-
}
|
|
111
|
-
})
|
|
112
|
-
.remove();
|
|
113
|
-
});
|
|
114
|
-
return result;
|
|
115
|
-
};
|
|
116
|
-
export const getLegendComponents = (args) => {
|
|
117
|
-
const { chartWidth, chartHeight, chartMargin, series, preparedLegend, preparedYAxis } = args;
|
|
118
|
-
const maxLegendWidth = getBoundsWidth({ chartWidth, chartMargin, preparedYAxis });
|
|
119
|
-
const maxLegendHeight = (chartHeight - chartMargin.top - chartMargin.bottom - preparedLegend.margin) / 2;
|
|
120
|
-
const flattenLegendItems = getFlattenLegendItems(series);
|
|
121
|
-
const items = getGroupedLegendItems({
|
|
122
|
-
maxLegendWidth,
|
|
123
|
-
items: flattenLegendItems,
|
|
124
|
-
preparedLegend,
|
|
125
|
-
});
|
|
126
|
-
let pagination;
|
|
127
|
-
if (preparedLegend.type === 'discrete') {
|
|
128
|
-
let legendHeight = preparedLegend.lineHeight * items.length;
|
|
129
|
-
if (maxLegendHeight < legendHeight) {
|
|
130
|
-
// extra line for paginator
|
|
131
|
-
const limit = Math.floor(maxLegendHeight / preparedLegend.lineHeight) - 1;
|
|
132
|
-
const maxPage = Math.ceil(items.length / limit);
|
|
133
|
-
pagination = { limit, maxPage };
|
|
134
|
-
legendHeight = maxLegendHeight;
|
|
135
|
-
}
|
|
136
|
-
preparedLegend.height = legendHeight;
|
|
137
|
-
}
|
|
138
|
-
const top = chartHeight - chartMargin.bottom - preparedLegend.height;
|
|
139
|
-
const offset = {
|
|
140
|
-
left: chartMargin.left + getYAxisWidth(preparedYAxis[0]),
|
|
141
|
-
top,
|
|
142
|
-
};
|
|
143
|
-
return { legendConfig: { offset, pagination }, legendItems: items };
|
|
144
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ScaleOrdinal } from 'd3';
|
|
2
|
-
import { DashStyle } from '../../../../../constants';
|
|
3
|
-
import { ChartKitWidgetSeriesOptions, LineSeries } from '../../../../../types';
|
|
4
|
-
import { PreparedLegend, PreparedLineSeries } from './types';
|
|
5
|
-
export declare const DEFAULT_LEGEND_SYMBOL_SIZE = 16;
|
|
6
|
-
export declare const DEFAULT_LINE_WIDTH = 1;
|
|
7
|
-
export declare const DEFAULT_DASH_STYLE = DashStyle.Solid;
|
|
8
|
-
export declare const DEFAULT_MARKER: {
|
|
9
|
-
enabled: boolean;
|
|
10
|
-
symbol: "circle" | "diamond" | "square" | "triangle" | "triangle-down";
|
|
11
|
-
borderColor: string;
|
|
12
|
-
borderWidth: number;
|
|
13
|
-
radius: number;
|
|
14
|
-
};
|
|
15
|
-
type PrepareLineSeriesArgs = {
|
|
16
|
-
colorScale: ScaleOrdinal<string, string>;
|
|
17
|
-
series: LineSeries[];
|
|
18
|
-
seriesOptions?: ChartKitWidgetSeriesOptions;
|
|
19
|
-
legend: PreparedLegend;
|
|
20
|
-
};
|
|
21
|
-
export declare function prepareLineSeries(args: PrepareLineSeriesArgs): PreparedLineSeries[];
|
|
22
|
-
export {};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import get from 'lodash/get';
|
|
2
|
-
import merge from 'lodash/merge';
|
|
3
|
-
import { DashStyle, LineCap } from '../../../../../constants';
|
|
4
|
-
import { getRandomCKId } from '../../../../../utils';
|
|
5
|
-
import { DEFAULT_DATALABELS_PADDING, DEFAULT_DATALABELS_STYLE, DEFAULT_HALO_OPTIONS, DEFAULT_LEGEND_SYMBOL_PADDING, DEFAULT_POINT_MARKER_OPTIONS, } from './constants';
|
|
6
|
-
export const DEFAULT_LEGEND_SYMBOL_SIZE = 16;
|
|
7
|
-
export const DEFAULT_LINE_WIDTH = 1;
|
|
8
|
-
export const DEFAULT_DASH_STYLE = DashStyle.Solid;
|
|
9
|
-
export const DEFAULT_MARKER = Object.assign(Object.assign({}, DEFAULT_POINT_MARKER_OPTIONS), { enabled: false });
|
|
10
|
-
function prepareLinecap(dashStyle, series, seriesOptions) {
|
|
11
|
-
const defaultLineCap = dashStyle === DashStyle.Solid ? LineCap.Round : LineCap.None;
|
|
12
|
-
const lineCapFromSeriesOptions = get(seriesOptions, 'line.linecap', defaultLineCap);
|
|
13
|
-
return get(series, 'linecap', lineCapFromSeriesOptions);
|
|
14
|
-
}
|
|
15
|
-
function prepareLineLegendSymbol(series, seriesOptions) {
|
|
16
|
-
var _a;
|
|
17
|
-
const symbolOptions = ((_a = series.legend) === null || _a === void 0 ? void 0 : _a.symbol) || {};
|
|
18
|
-
const defaultLineWidth = get(seriesOptions, 'line.lineWidth', DEFAULT_LINE_WIDTH);
|
|
19
|
-
return {
|
|
20
|
-
shape: 'path',
|
|
21
|
-
width: (symbolOptions === null || symbolOptions === void 0 ? void 0 : symbolOptions.width) || DEFAULT_LEGEND_SYMBOL_SIZE,
|
|
22
|
-
padding: (symbolOptions === null || symbolOptions === void 0 ? void 0 : symbolOptions.padding) || DEFAULT_LEGEND_SYMBOL_PADDING,
|
|
23
|
-
strokeWidth: get(series, 'lineWidth', defaultLineWidth),
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function prepareMarker(series, seriesOptions) {
|
|
27
|
-
var _a;
|
|
28
|
-
const seriesHoverState = get(seriesOptions, 'line.states.hover');
|
|
29
|
-
const markerNormalState = Object.assign({}, DEFAULT_MARKER, (_a = seriesOptions === null || seriesOptions === void 0 ? void 0 : seriesOptions.line) === null || _a === void 0 ? void 0 : _a.marker, series.marker);
|
|
30
|
-
const hoveredMarkerDefaultOptions = {
|
|
31
|
-
enabled: true,
|
|
32
|
-
radius: markerNormalState.radius,
|
|
33
|
-
borderWidth: 1,
|
|
34
|
-
borderColor: '#ffffff',
|
|
35
|
-
halo: DEFAULT_HALO_OPTIONS,
|
|
36
|
-
};
|
|
37
|
-
return {
|
|
38
|
-
states: {
|
|
39
|
-
normal: markerNormalState,
|
|
40
|
-
hover: merge(hoveredMarkerDefaultOptions, seriesHoverState === null || seriesHoverState === void 0 ? void 0 : seriesHoverState.marker),
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
export function prepareLineSeries(args) {
|
|
45
|
-
const { colorScale, series: seriesList, seriesOptions, legend } = args;
|
|
46
|
-
const defaultLineWidth = get(seriesOptions, 'line.lineWidth', DEFAULT_LINE_WIDTH);
|
|
47
|
-
const defaultDashStyle = get(seriesOptions, 'line.dashStyle', DEFAULT_DASH_STYLE);
|
|
48
|
-
return seriesList.map((series) => {
|
|
49
|
-
var _a, _b;
|
|
50
|
-
const id = getRandomCKId();
|
|
51
|
-
const name = series.name || '';
|
|
52
|
-
const color = series.color || colorScale(name);
|
|
53
|
-
const dashStyle = get(series, 'dashStyle', defaultDashStyle);
|
|
54
|
-
const prepared = {
|
|
55
|
-
type: series.type,
|
|
56
|
-
color,
|
|
57
|
-
lineWidth: get(series, 'lineWidth', defaultLineWidth),
|
|
58
|
-
name,
|
|
59
|
-
id,
|
|
60
|
-
visible: get(series, 'visible', true),
|
|
61
|
-
legend: {
|
|
62
|
-
enabled: get(series, 'legend.enabled', legend.enabled),
|
|
63
|
-
symbol: prepareLineLegendSymbol(series, seriesOptions),
|
|
64
|
-
},
|
|
65
|
-
data: series.data,
|
|
66
|
-
dataLabels: {
|
|
67
|
-
enabled: ((_a = series.dataLabels) === null || _a === void 0 ? void 0 : _a.enabled) || false,
|
|
68
|
-
style: Object.assign({}, DEFAULT_DATALABELS_STYLE, (_b = series.dataLabels) === null || _b === void 0 ? void 0 : _b.style),
|
|
69
|
-
padding: get(series, 'dataLabels.padding', DEFAULT_DATALABELS_PADDING),
|
|
70
|
-
allowOverlap: get(series, 'dataLabels.allowOverlap', false),
|
|
71
|
-
html: get(series, 'dataLabels.html', false),
|
|
72
|
-
},
|
|
73
|
-
marker: prepareMarker(series, seriesOptions),
|
|
74
|
-
dashStyle: dashStyle,
|
|
75
|
-
linecap: prepareLinecap(dashStyle, series, seriesOptions),
|
|
76
|
-
opacity: get(series, 'opacity', null),
|
|
77
|
-
cursor: get(series, 'cursor', null),
|
|
78
|
-
yAxis: get(series, 'yAxis', 0),
|
|
79
|
-
};
|
|
80
|
-
return prepared;
|
|
81
|
-
}, []);
|
|
82
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ChartKitWidgetSeriesOptions, PieSeries } from '../../../../../types';
|
|
2
|
-
import { PreparedLegend, PreparedSeries } from './types';
|
|
3
|
-
type PreparePieSeriesArgs = {
|
|
4
|
-
series: PieSeries;
|
|
5
|
-
seriesOptions?: ChartKitWidgetSeriesOptions;
|
|
6
|
-
legend: PreparedLegend;
|
|
7
|
-
};
|
|
8
|
-
export declare function preparePieSeries(args: PreparePieSeriesArgs): PreparedSeries[];
|
|
9
|
-
export {};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { scaleOrdinal } from 'd3';
|
|
2
|
-
import get from 'lodash/get';
|
|
3
|
-
import { getRandomCKId } from '../../../../../utils';
|
|
4
|
-
import { DEFAULT_PALETTE } from '../../constants';
|
|
5
|
-
import { DEFAULT_DATALABELS_PADDING, DEFAULT_DATALABELS_STYLE } from './constants';
|
|
6
|
-
import { prepareLegendSymbol } from './utils';
|
|
7
|
-
export function preparePieSeries(args) {
|
|
8
|
-
const { series, seriesOptions, legend } = args;
|
|
9
|
-
const dataNames = series.data.map((d) => d.name);
|
|
10
|
-
const colorScale = scaleOrdinal(dataNames, DEFAULT_PALETTE);
|
|
11
|
-
const stackId = getRandomCKId();
|
|
12
|
-
const seriesHoverState = get(seriesOptions, 'pie.states.hover');
|
|
13
|
-
const preparedSeries = series.data.map((dataItem, i) => {
|
|
14
|
-
var _a, _b, _c;
|
|
15
|
-
const result = {
|
|
16
|
-
type: 'pie',
|
|
17
|
-
data: dataItem,
|
|
18
|
-
dataLabels: {
|
|
19
|
-
enabled: get(series, 'dataLabels.enabled', true),
|
|
20
|
-
style: Object.assign({}, DEFAULT_DATALABELS_STYLE, (_a = series.dataLabels) === null || _a === void 0 ? void 0 : _a.style),
|
|
21
|
-
padding: get(series, 'dataLabels.padding', DEFAULT_DATALABELS_PADDING),
|
|
22
|
-
allowOverlap: get(series, 'dataLabels.allowOverlap', false),
|
|
23
|
-
connectorPadding: get(series, 'dataLabels.connectorPadding', 5),
|
|
24
|
-
connectorShape: get(series, 'dataLabels.connectorShape', 'polyline'),
|
|
25
|
-
distance: get(series, 'dataLabels.distance', 25),
|
|
26
|
-
connectorCurve: get(series, 'dataLabels.connectorCurve', 'basic'),
|
|
27
|
-
html: get(series, 'dataLabels.html', false),
|
|
28
|
-
},
|
|
29
|
-
label: dataItem.label,
|
|
30
|
-
value: dataItem.value,
|
|
31
|
-
visible: typeof dataItem.visible === 'boolean' ? dataItem.visible : true,
|
|
32
|
-
name: dataItem.name,
|
|
33
|
-
id: `Series ${i}`,
|
|
34
|
-
color: dataItem.color || colorScale(dataItem.name),
|
|
35
|
-
legend: {
|
|
36
|
-
enabled: get(series, 'legend.enabled', legend.enabled),
|
|
37
|
-
symbol: prepareLegendSymbol(series),
|
|
38
|
-
},
|
|
39
|
-
center: series.center || ['50%', '50%'],
|
|
40
|
-
borderColor: series.borderColor || '',
|
|
41
|
-
borderRadius: (_b = series.borderRadius) !== null && _b !== void 0 ? _b : 0,
|
|
42
|
-
borderWidth: (_c = series.borderWidth) !== null && _c !== void 0 ? _c : 1,
|
|
43
|
-
radius: series.radius || '100%',
|
|
44
|
-
innerRadius: series.innerRadius || 0,
|
|
45
|
-
stackId,
|
|
46
|
-
states: {
|
|
47
|
-
hover: {
|
|
48
|
-
halo: {
|
|
49
|
-
enabled: get(seriesHoverState, 'halo.enabled', true),
|
|
50
|
-
opacity: get(seriesHoverState, 'halo.opacity', 0.25),
|
|
51
|
-
size: get(seriesHoverState, 'halo.size', 10),
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
renderCustomShape: series.renderCustomShape,
|
|
56
|
-
opacity: get(dataItem, 'opacity', null),
|
|
57
|
-
cursor: get(series, 'cursor', null),
|
|
58
|
-
};
|
|
59
|
-
return result;
|
|
60
|
-
});
|
|
61
|
-
return preparedSeries;
|
|
62
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ScaleOrdinal } from 'd3';
|
|
2
|
-
import type { ChartKitWidgetSeriesOptions, ScatterSeries } from '../../../../../types';
|
|
3
|
-
import type { PreparedLegend, PreparedScatterSeries } from './types';
|
|
4
|
-
interface PrepareScatterSeriesArgs {
|
|
5
|
-
colorScale: ScaleOrdinal<string, string>;
|
|
6
|
-
series: ScatterSeries[];
|
|
7
|
-
legend: PreparedLegend;
|
|
8
|
-
seriesOptions?: ChartKitWidgetSeriesOptions;
|
|
9
|
-
}
|
|
10
|
-
export declare function prepareScatterSeries(args: PrepareScatterSeriesArgs): PreparedScatterSeries[];
|
|
11
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import get from 'lodash/get';
|
|
2
|
-
import merge from 'lodash/merge';
|
|
3
|
-
import { getRandomCKId } from '../../../../../utils';
|
|
4
|
-
import { getSymbolType } from '../../utils';
|
|
5
|
-
import { DEFAULT_HALO_OPTIONS, DEFAULT_POINT_MARKER_OPTIONS } from './constants';
|
|
6
|
-
import { prepareLegendSymbol } from './utils';
|
|
7
|
-
function prepareMarker(series, seriesOptions, index) {
|
|
8
|
-
const seriesHoverState = get(seriesOptions, 'scatter.states.hover');
|
|
9
|
-
const markerNormalState = Object.assign(Object.assign({}, DEFAULT_POINT_MARKER_OPTIONS), { enabled: true, symbol: series.symbolType || getSymbolType(index) });
|
|
10
|
-
const hoveredMarkerDefaultOptions = {
|
|
11
|
-
enabled: true,
|
|
12
|
-
radius: markerNormalState.radius,
|
|
13
|
-
borderWidth: 1,
|
|
14
|
-
borderColor: '#ffffff',
|
|
15
|
-
halo: DEFAULT_HALO_OPTIONS,
|
|
16
|
-
};
|
|
17
|
-
return {
|
|
18
|
-
states: {
|
|
19
|
-
normal: markerNormalState,
|
|
20
|
-
hover: merge(hoveredMarkerDefaultOptions, seriesHoverState === null || seriesHoverState === void 0 ? void 0 : seriesHoverState.marker),
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export function prepareScatterSeries(args) {
|
|
25
|
-
const { colorScale, series, seriesOptions, legend } = args;
|
|
26
|
-
return series.map((s, index) => {
|
|
27
|
-
const id = getRandomCKId();
|
|
28
|
-
const name = 'name' in s && s.name ? s.name : '';
|
|
29
|
-
const symbolType = s.symbolType || getSymbolType(index);
|
|
30
|
-
const prepared = {
|
|
31
|
-
id,
|
|
32
|
-
type: s.type,
|
|
33
|
-
name,
|
|
34
|
-
color: get(s, 'color', colorScale(name)),
|
|
35
|
-
visible: get(s, 'visible', true),
|
|
36
|
-
legend: {
|
|
37
|
-
enabled: get(s, 'legend.enabled', legend.enabled),
|
|
38
|
-
symbol: prepareLegendSymbol(s, symbolType),
|
|
39
|
-
},
|
|
40
|
-
data: s.data,
|
|
41
|
-
marker: prepareMarker(s, seriesOptions, index),
|
|
42
|
-
cursor: get(s, 'cursor', null),
|
|
43
|
-
yAxis: get(s, 'yAxis', 0),
|
|
44
|
-
};
|
|
45
|
-
return prepared;
|
|
46
|
-
}, []);
|
|
47
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ScaleOrdinal } from 'd3';
|
|
2
|
-
import type { ChartKitWidgetSeriesOptions, TreemapSeries } from '../../../../../types';
|
|
3
|
-
import type { PreparedLegend, PreparedTreemapSeries } from './types';
|
|
4
|
-
type PrepareTreemapSeriesArgs = {
|
|
5
|
-
colorScale: ScaleOrdinal<string, string>;
|
|
6
|
-
legend: PreparedLegend;
|
|
7
|
-
series: TreemapSeries[];
|
|
8
|
-
seriesOptions?: ChartKitWidgetSeriesOptions;
|
|
9
|
-
};
|
|
10
|
-
export declare function prepareTreemap(args: PrepareTreemapSeriesArgs): PreparedTreemapSeries[];
|
|
11
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import get from 'lodash/get';
|
|
2
|
-
import { LayoutAlgorithm } from '../../../../../constants';
|
|
3
|
-
import { getRandomCKId } from '../../../../../utils';
|
|
4
|
-
import { DEFAULT_DATALABELS_PADDING, DEFAULT_DATALABELS_STYLE } from './constants';
|
|
5
|
-
import { prepareLegendSymbol } from './utils';
|
|
6
|
-
export function prepareTreemap(args) {
|
|
7
|
-
const { colorScale, legend, series } = args;
|
|
8
|
-
return series.map((s) => {
|
|
9
|
-
var _a;
|
|
10
|
-
const id = getRandomCKId();
|
|
11
|
-
const name = s.name || '';
|
|
12
|
-
const color = s.color || colorScale(name);
|
|
13
|
-
const preparedSeries = {
|
|
14
|
-
color,
|
|
15
|
-
data: s.data,
|
|
16
|
-
dataLabels: {
|
|
17
|
-
enabled: get(s, 'dataLabels.enabled', true),
|
|
18
|
-
style: Object.assign({}, DEFAULT_DATALABELS_STYLE, (_a = s.dataLabels) === null || _a === void 0 ? void 0 : _a.style),
|
|
19
|
-
padding: get(s, 'dataLabels.padding', DEFAULT_DATALABELS_PADDING),
|
|
20
|
-
allowOverlap: get(s, 'dataLabels.allowOverlap', false),
|
|
21
|
-
html: get(s, 'dataLabels.html', false),
|
|
22
|
-
align: get(s, 'dataLabels.align', 'left'),
|
|
23
|
-
},
|
|
24
|
-
id,
|
|
25
|
-
type: s.type,
|
|
26
|
-
name,
|
|
27
|
-
visible: get(s, 'visible', true),
|
|
28
|
-
legend: {
|
|
29
|
-
enabled: get(s, 'legend.enabled', legend.enabled),
|
|
30
|
-
symbol: prepareLegendSymbol(s),
|
|
31
|
-
},
|
|
32
|
-
levels: s.levels,
|
|
33
|
-
layoutAlgorithm: get(s, 'layoutAlgorithm', LayoutAlgorithm.Binary),
|
|
34
|
-
cursor: get(s, 'cursor', null),
|
|
35
|
-
};
|
|
36
|
-
return preparedSeries;
|
|
37
|
-
});
|
|
38
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ScaleOrdinal } from 'd3';
|
|
2
|
-
import type { WaterfallSeries } from '../../../../../types';
|
|
3
|
-
import type { PreparedLegend, PreparedSeries } from './types';
|
|
4
|
-
type PrepareWaterfallSeriesArgs = {
|
|
5
|
-
colorScale: ScaleOrdinal<string, string>;
|
|
6
|
-
series: WaterfallSeries[];
|
|
7
|
-
legend: PreparedLegend;
|
|
8
|
-
};
|
|
9
|
-
export declare function prepareWaterfallSeries(args: PrepareWaterfallSeriesArgs): PreparedSeries[];
|
|
10
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import get from 'lodash/get';
|
|
2
|
-
import { getRandomCKId } from '../../../../../utils';
|
|
3
|
-
import { DEFAULT_PALETTE } from '../../constants';
|
|
4
|
-
import { DEFAULT_DATALABELS_PADDING, DEFAULT_DATALABELS_STYLE } from './constants';
|
|
5
|
-
import { prepareLegendSymbol } from './utils';
|
|
6
|
-
export function prepareWaterfallSeries(args) {
|
|
7
|
-
const { colorScale, series: seriesList, legend } = args;
|
|
8
|
-
const [, negativeColor, positiveColor] = DEFAULT_PALETTE;
|
|
9
|
-
return seriesList.map((series) => {
|
|
10
|
-
var _a, _b, _c;
|
|
11
|
-
const name = series.name || '';
|
|
12
|
-
const color = series.color || colorScale(name);
|
|
13
|
-
const prepared = {
|
|
14
|
-
type: series.type,
|
|
15
|
-
color,
|
|
16
|
-
positiveColor: positiveColor,
|
|
17
|
-
negativeColor: negativeColor,
|
|
18
|
-
name,
|
|
19
|
-
id: getRandomCKId(),
|
|
20
|
-
visible: get(series, 'visible', true),
|
|
21
|
-
legend: {
|
|
22
|
-
enabled: get(series, 'legend.enabled', legend.enabled),
|
|
23
|
-
symbol: prepareLegendSymbol(series),
|
|
24
|
-
},
|
|
25
|
-
data: series.data,
|
|
26
|
-
dataLabels: {
|
|
27
|
-
enabled: ((_a = series.dataLabels) === null || _a === void 0 ? void 0 : _a.enabled) || false,
|
|
28
|
-
style: Object.assign({}, DEFAULT_DATALABELS_STYLE, (_b = series.dataLabels) === null || _b === void 0 ? void 0 : _b.style),
|
|
29
|
-
allowOverlap: ((_c = series.dataLabels) === null || _c === void 0 ? void 0 : _c.allowOverlap) || false,
|
|
30
|
-
padding: get(series, 'dataLabels.padding', DEFAULT_DATALABELS_PADDING),
|
|
31
|
-
html: get(series, 'dataLabels.html', false),
|
|
32
|
-
},
|
|
33
|
-
cursor: get(series, 'cursor', null),
|
|
34
|
-
};
|
|
35
|
-
return prepared;
|
|
36
|
-
}, []);
|
|
37
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ScaleOrdinal } from 'd3';
|
|
2
|
-
import type { ChartKitWidgetSeries, ChartKitWidgetSeriesOptions } from '../../../../../types';
|
|
3
|
-
import type { PreparedLegend, PreparedSeries } from './types';
|
|
4
|
-
export declare function prepareSeries(args: {
|
|
5
|
-
type: ChartKitWidgetSeries['type'];
|
|
6
|
-
series: ChartKitWidgetSeries[];
|
|
7
|
-
seriesOptions?: ChartKitWidgetSeriesOptions;
|
|
8
|
-
legend: PreparedLegend;
|
|
9
|
-
colorScale: ScaleOrdinal<string, string>;
|
|
10
|
-
}): PreparedSeries[];
|