@gravity-ui/chartkit 5.17.0 → 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/HighchartsComponent.js +1 -1
- 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,58 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { dateTime } from '@gravity-ui/date-utils';
|
|
3
|
-
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
-
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
-
import marsWeatherData from '../mars-weather';
|
|
6
|
-
export const TwoYAxis = () => {
|
|
7
|
-
const data = marsWeatherData;
|
|
8
|
-
const pressureData = data.map((d) => ({
|
|
9
|
-
x: dateTime({ input: d.terrestrial_date, format: 'YYYY-MM-DD' }).valueOf(),
|
|
10
|
-
y: d.pressure,
|
|
11
|
-
}));
|
|
12
|
-
const tempData = data.map((d) => ({
|
|
13
|
-
x: dateTime({ input: d.terrestrial_date, format: 'YYYY-MM-DD' }).valueOf(),
|
|
14
|
-
y: d.max_temp - d.min_temp,
|
|
15
|
-
}));
|
|
16
|
-
const widgetData = {
|
|
17
|
-
series: {
|
|
18
|
-
data: [
|
|
19
|
-
{
|
|
20
|
-
type: 'area',
|
|
21
|
-
data: pressureData,
|
|
22
|
-
name: 'Pressure',
|
|
23
|
-
yAxis: 0,
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'area',
|
|
27
|
-
data: tempData,
|
|
28
|
-
name: 'Temperature range',
|
|
29
|
-
yAxis: 1,
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
yAxis: [
|
|
34
|
-
{
|
|
35
|
-
title: {
|
|
36
|
-
text: 'Pressure',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
title: {
|
|
41
|
-
text: 'Temperature range',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
xAxis: {
|
|
46
|
-
type: 'datetime',
|
|
47
|
-
title: {
|
|
48
|
-
text: 'Terrestrial date',
|
|
49
|
-
},
|
|
50
|
-
ticks: { pixelInterval: 200 },
|
|
51
|
-
},
|
|
52
|
-
title: {
|
|
53
|
-
text: 'Mars weather',
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
return (React.createElement(ExampleWrapper, null,
|
|
57
|
-
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
58
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { groups } from 'd3';
|
|
3
|
-
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
-
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
-
import nintendoGames from '../nintendoGames';
|
|
6
|
-
function prepareData({ field, filterNulls } = {
|
|
7
|
-
field: 'platform',
|
|
8
|
-
}) {
|
|
9
|
-
const gamesByPlatform = groups(nintendoGames, (item) => item[field]);
|
|
10
|
-
let resultData = gamesByPlatform;
|
|
11
|
-
if (filterNulls) {
|
|
12
|
-
resultData = gamesByPlatform.filter(([value]) => typeof value === 'number');
|
|
13
|
-
}
|
|
14
|
-
const data = resultData.map(([value, games]) => ({
|
|
15
|
-
x: value,
|
|
16
|
-
y: games.length,
|
|
17
|
-
}));
|
|
18
|
-
return {
|
|
19
|
-
categories: resultData.map(([key]) => key),
|
|
20
|
-
series: [
|
|
21
|
-
{
|
|
22
|
-
data,
|
|
23
|
-
name: 'Games released',
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export const BasicBarXChart = () => {
|
|
29
|
-
const { categories, series } = prepareData();
|
|
30
|
-
const widgetData = {
|
|
31
|
-
series: {
|
|
32
|
-
data: series.map((s) => ({
|
|
33
|
-
type: 'bar-x',
|
|
34
|
-
data: s.data,
|
|
35
|
-
name: s.name,
|
|
36
|
-
})),
|
|
37
|
-
},
|
|
38
|
-
xAxis: {
|
|
39
|
-
type: 'category',
|
|
40
|
-
categories: categories.map(String),
|
|
41
|
-
title: {
|
|
42
|
-
text: 'Game Platforms',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
yAxis: [{ title: { text: 'Number of games released' } }],
|
|
46
|
-
};
|
|
47
|
-
return (React.createElement(ExampleWrapper, null,
|
|
48
|
-
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
49
|
-
};
|
|
50
|
-
export const BasicLinearBarXChart = () => {
|
|
51
|
-
const { series } = prepareData({ field: 'meta_score' });
|
|
52
|
-
const widgetData = {
|
|
53
|
-
series: {
|
|
54
|
-
data: series.map((s) => ({
|
|
55
|
-
type: 'bar-x',
|
|
56
|
-
data: s.data,
|
|
57
|
-
name: s.name,
|
|
58
|
-
})),
|
|
59
|
-
},
|
|
60
|
-
xAxis: {
|
|
61
|
-
title: {
|
|
62
|
-
text: 'Meta scores',
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
return (React.createElement(ExampleWrapper, null,
|
|
67
|
-
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
68
|
-
};
|
|
69
|
-
export const BasicDateTimeBarXChart = () => {
|
|
70
|
-
const { series } = prepareData({ field: 'date', filterNulls: true });
|
|
71
|
-
const widgetData = {
|
|
72
|
-
series: {
|
|
73
|
-
data: series.map((s) => ({
|
|
74
|
-
type: 'bar-x',
|
|
75
|
-
data: s.data,
|
|
76
|
-
name: s.name,
|
|
77
|
-
})),
|
|
78
|
-
},
|
|
79
|
-
xAxis: {
|
|
80
|
-
type: 'datetime',
|
|
81
|
-
title: {
|
|
82
|
-
text: 'Release date',
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
return (React.createElement(ExampleWrapper, null,
|
|
87
|
-
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
88
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { groups, sort } from 'd3';
|
|
3
|
-
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
-
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
-
import nintendoGames from '../nintendoGames';
|
|
6
|
-
const years = Array.from(new Set(nintendoGames.map((g) => g.date ? new Date(g.date).getFullYear().toString() : 'unknown')));
|
|
7
|
-
function prepareData() {
|
|
8
|
-
const games = sort(nintendoGames.filter((d) => {
|
|
9
|
-
return d.date && d.user_score;
|
|
10
|
-
}), (d) => d.date);
|
|
11
|
-
const groupByYear = (d) => (d.date ? new Date(d.date).getFullYear() : 'unknown');
|
|
12
|
-
const byGenre = (genre) => {
|
|
13
|
-
const data = groups(games.filter((d) => d.genres.includes(genre)), groupByYear).map(([year, items]) => {
|
|
14
|
-
return {
|
|
15
|
-
x: years.indexOf(String(year)),
|
|
16
|
-
y: items.length,
|
|
17
|
-
};
|
|
18
|
-
});
|
|
19
|
-
return {
|
|
20
|
-
type: 'bar-x',
|
|
21
|
-
name: genre,
|
|
22
|
-
dataLabels: {
|
|
23
|
-
enabled: true,
|
|
24
|
-
},
|
|
25
|
-
stacking: 'normal',
|
|
26
|
-
data,
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
return [byGenre('Strategy'), byGenre('Shooter'), byGenre('Puzzle'), byGenre('Action')];
|
|
30
|
-
}
|
|
31
|
-
export const DataLabels = () => {
|
|
32
|
-
const series = prepareData();
|
|
33
|
-
const widgetData = {
|
|
34
|
-
series: {
|
|
35
|
-
data: series,
|
|
36
|
-
},
|
|
37
|
-
xAxis: {
|
|
38
|
-
categories: years,
|
|
39
|
-
type: 'category',
|
|
40
|
-
title: {
|
|
41
|
-
text: 'Release year',
|
|
42
|
-
},
|
|
43
|
-
ticks: { pixelInterval: 200 },
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
return (React.createElement(ExampleWrapper, null,
|
|
47
|
-
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
48
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { groups } from 'd3';
|
|
3
|
-
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
-
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
-
import nintendoGames from '../nintendoGames';
|
|
6
|
-
function prepareData() {
|
|
7
|
-
const displayedYears = [2015, 2016, 2017, 2018, 2019];
|
|
8
|
-
const games = nintendoGames.filter((ng) => displayedYears.includes(new Date(ng.date).getFullYear()));
|
|
9
|
-
const grouped = groups(games, (d) => d.platform, (d) => (d.date ? new Date(d.date).getFullYear() : 'unknown'));
|
|
10
|
-
const categories = [];
|
|
11
|
-
const series = grouped.map(([platform, years]) => {
|
|
12
|
-
return {
|
|
13
|
-
name: platform,
|
|
14
|
-
data: years.map(([year, list]) => {
|
|
15
|
-
categories.push(String(year));
|
|
16
|
-
return {
|
|
17
|
-
x: String(year),
|
|
18
|
-
y: list.length,
|
|
19
|
-
};
|
|
20
|
-
}),
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
return { categories, series };
|
|
24
|
-
}
|
|
25
|
-
export const GroupedColumns = () => {
|
|
26
|
-
const { series, categories } = prepareData();
|
|
27
|
-
const data = series.map((s) => {
|
|
28
|
-
return {
|
|
29
|
-
type: 'bar-x',
|
|
30
|
-
name: s.name,
|
|
31
|
-
data: s.data,
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
const widgetData = {
|
|
35
|
-
series: {
|
|
36
|
-
data,
|
|
37
|
-
},
|
|
38
|
-
xAxis: {
|
|
39
|
-
type: 'category',
|
|
40
|
-
categories: categories.sort(),
|
|
41
|
-
title: {
|
|
42
|
-
text: 'Release year',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
return (React.createElement(ExampleWrapper, null,
|
|
47
|
-
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
48
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { dateTime } from '@gravity-ui/date-utils';
|
|
3
|
-
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
-
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
-
import marsWeatherData from '../mars-weather';
|
|
6
|
-
export const NegativeValues = () => {
|
|
7
|
-
const data = marsWeatherData.map((d) => ({
|
|
8
|
-
x: dateTime({ input: d.terrestrial_date, format: 'YYYY-MM-DD' }).valueOf(),
|
|
9
|
-
y: d.min_temp,
|
|
10
|
-
}));
|
|
11
|
-
const widgetData = {
|
|
12
|
-
series: {
|
|
13
|
-
data: [
|
|
14
|
-
{
|
|
15
|
-
type: 'bar-x',
|
|
16
|
-
data: data,
|
|
17
|
-
name: 'Min temperature',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
yAxis: [
|
|
22
|
-
{
|
|
23
|
-
title: {
|
|
24
|
-
text: 'Min temperature',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
xAxis: {
|
|
29
|
-
type: 'datetime',
|
|
30
|
-
title: {
|
|
31
|
-
text: 'Terrestrial date',
|
|
32
|
-
},
|
|
33
|
-
ticks: { pixelInterval: 200 },
|
|
34
|
-
},
|
|
35
|
-
title: {
|
|
36
|
-
text: 'Mars weather',
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
return (React.createElement(ExampleWrapper, null,
|
|
40
|
-
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
41
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { groups } from 'd3';
|
|
3
|
-
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
-
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
-
import nintendoGames from '../nintendoGames';
|
|
6
|
-
function prepareData() {
|
|
7
|
-
const grouped = groups(nintendoGames, (d) => d.platform, (d) => (d.date ? new Date(d.date).getFullYear() : 'unknown'));
|
|
8
|
-
const categories = [];
|
|
9
|
-
const series = grouped.map(([platform, years]) => {
|
|
10
|
-
return {
|
|
11
|
-
name: platform,
|
|
12
|
-
data: years.map(([year, list]) => {
|
|
13
|
-
categories.push(String(year));
|
|
14
|
-
return {
|
|
15
|
-
x: String(year),
|
|
16
|
-
y: list.length,
|
|
17
|
-
};
|
|
18
|
-
}),
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
return { categories, series };
|
|
22
|
-
}
|
|
23
|
-
export const PercentStackColumns = () => {
|
|
24
|
-
const { series, categories } = prepareData();
|
|
25
|
-
const data = series.map((s) => {
|
|
26
|
-
return {
|
|
27
|
-
type: 'bar-x',
|
|
28
|
-
stacking: 'percent',
|
|
29
|
-
name: s.name,
|
|
30
|
-
data: s.data,
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
const widgetData = {
|
|
34
|
-
series: {
|
|
35
|
-
data: data,
|
|
36
|
-
},
|
|
37
|
-
xAxis: {
|
|
38
|
-
type: 'category',
|
|
39
|
-
categories: categories.sort(),
|
|
40
|
-
title: {
|
|
41
|
-
text: 'Release year',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
return (React.createElement(ExampleWrapper, null,
|
|
46
|
-
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
47
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { groups } from 'd3';
|
|
3
|
-
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
-
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
-
import nintendoGames from '../nintendoGames';
|
|
6
|
-
function prepareData() {
|
|
7
|
-
const grouped = groups(nintendoGames, (d) => d.platform, (d) => (d.date ? new Date(d.date).getFullYear() : 'unknown'));
|
|
8
|
-
const categories = [];
|
|
9
|
-
const series = grouped.map(([platform, years]) => {
|
|
10
|
-
return {
|
|
11
|
-
name: platform,
|
|
12
|
-
data: years.map(([year, list]) => {
|
|
13
|
-
categories.push(String(year));
|
|
14
|
-
return {
|
|
15
|
-
x: String(year),
|
|
16
|
-
y: list.length,
|
|
17
|
-
};
|
|
18
|
-
}),
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
return { categories, series };
|
|
22
|
-
}
|
|
23
|
-
export const StackedColumns = () => {
|
|
24
|
-
const { series, categories } = prepareData();
|
|
25
|
-
const data = series.map((s) => {
|
|
26
|
-
return {
|
|
27
|
-
type: 'bar-x',
|
|
28
|
-
stacking: 'normal',
|
|
29
|
-
name: s.name,
|
|
30
|
-
data: s.data,
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
const widgetData = {
|
|
34
|
-
series: {
|
|
35
|
-
data: data,
|
|
36
|
-
},
|
|
37
|
-
xAxis: {
|
|
38
|
-
type: 'category',
|
|
39
|
-
categories: categories.sort(),
|
|
40
|
-
title: {
|
|
41
|
-
text: 'Release year',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
return (React.createElement(ExampleWrapper, null,
|
|
46
|
-
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
47
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { dateTime } from '@gravity-ui/date-utils';
|
|
3
|
-
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
-
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
-
import marsWeatherData from '../mars-weather';
|
|
6
|
-
export const TwoYAxis = () => {
|
|
7
|
-
const data = marsWeatherData;
|
|
8
|
-
const pressureData = data.map((d) => ({
|
|
9
|
-
x: dateTime({ input: d.terrestrial_date, format: 'YYYY-MM-DD' }).valueOf(),
|
|
10
|
-
y: d.pressure,
|
|
11
|
-
}));
|
|
12
|
-
const tempData = data.map((d) => ({
|
|
13
|
-
x: dateTime({ input: d.terrestrial_date, format: 'YYYY-MM-DD' }).valueOf(),
|
|
14
|
-
y: d.max_temp - d.min_temp,
|
|
15
|
-
}));
|
|
16
|
-
const widgetData = {
|
|
17
|
-
series: {
|
|
18
|
-
data: [
|
|
19
|
-
{
|
|
20
|
-
type: 'bar-x',
|
|
21
|
-
data: pressureData,
|
|
22
|
-
name: 'Pressure',
|
|
23
|
-
yAxis: 0,
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'bar-x',
|
|
27
|
-
data: tempData,
|
|
28
|
-
name: 'Temperature range',
|
|
29
|
-
yAxis: 1,
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
yAxis: [
|
|
34
|
-
{
|
|
35
|
-
title: {
|
|
36
|
-
text: 'Pressure',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
title: {
|
|
41
|
-
text: 'Temperature range',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
xAxis: {
|
|
46
|
-
type: 'datetime',
|
|
47
|
-
title: {
|
|
48
|
-
text: 'Terrestrial date',
|
|
49
|
-
},
|
|
50
|
-
ticks: { pixelInterval: 200 },
|
|
51
|
-
},
|
|
52
|
-
title: {
|
|
53
|
-
text: 'Mars weather',
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
return (React.createElement(ExampleWrapper, null,
|
|
57
|
-
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
58
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { groups } from 'd3';
|
|
3
|
-
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
-
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
-
import nintendoGames from '../nintendoGames';
|
|
6
|
-
function prepareData(field = 'platform') {
|
|
7
|
-
const gamesByPlatform = groups(nintendoGames, (item) => item[field]);
|
|
8
|
-
const data = gamesByPlatform.map(([value, games]) => ({
|
|
9
|
-
y: value,
|
|
10
|
-
x: games.length,
|
|
11
|
-
}));
|
|
12
|
-
return {
|
|
13
|
-
categories: gamesByPlatform.map(([key]) => key),
|
|
14
|
-
series: [
|
|
15
|
-
{
|
|
16
|
-
data,
|
|
17
|
-
name: 'Games released',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export const Basic = () => {
|
|
23
|
-
const { categories, series } = prepareData();
|
|
24
|
-
const widgetData = {
|
|
25
|
-
series: {
|
|
26
|
-
data: series.map((s) => ({
|
|
27
|
-
type: 'bar-y',
|
|
28
|
-
data: s.data,
|
|
29
|
-
name: s.name,
|
|
30
|
-
})),
|
|
31
|
-
},
|
|
32
|
-
xAxis: { title: { text: 'Number of games released' } },
|
|
33
|
-
yAxis: [
|
|
34
|
-
{
|
|
35
|
-
type: 'category',
|
|
36
|
-
categories: categories.map(String),
|
|
37
|
-
title: {
|
|
38
|
-
text: 'Game Platforms',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
};
|
|
43
|
-
return (React.createElement(ExampleWrapper, null,
|
|
44
|
-
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
45
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { groups } from 'd3';
|
|
3
|
-
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
-
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
-
import nintendoGames from '../nintendoGames';
|
|
6
|
-
function prepareData() {
|
|
7
|
-
const displayedYears = [2015, 2016, 2017, 2018, 2019];
|
|
8
|
-
const games = nintendoGames.filter((ng) => displayedYears.includes(new Date(ng.date).getFullYear()));
|
|
9
|
-
const grouped = groups(games, (d) => d.platform, (d) => (d.date ? new Date(d.date).getFullYear() : 'unknown'));
|
|
10
|
-
const categories = [];
|
|
11
|
-
const series = grouped.map(([platform, years]) => {
|
|
12
|
-
return {
|
|
13
|
-
name: platform,
|
|
14
|
-
data: years.map(([year, list]) => {
|
|
15
|
-
categories.push(String(year));
|
|
16
|
-
return {
|
|
17
|
-
y: String(year),
|
|
18
|
-
x: list.length,
|
|
19
|
-
};
|
|
20
|
-
}),
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
return { categories, series };
|
|
24
|
-
}
|
|
25
|
-
export const GroupedColumns = () => {
|
|
26
|
-
const { series, categories } = prepareData();
|
|
27
|
-
const data = series.map((s) => {
|
|
28
|
-
return {
|
|
29
|
-
type: 'bar-y',
|
|
30
|
-
name: s.name,
|
|
31
|
-
data: s.data,
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
const widgetData = {
|
|
35
|
-
series: {
|
|
36
|
-
data: data,
|
|
37
|
-
},
|
|
38
|
-
yAxis: [
|
|
39
|
-
{
|
|
40
|
-
type: 'category',
|
|
41
|
-
categories: categories.sort(),
|
|
42
|
-
title: {
|
|
43
|
-
text: 'Release year',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
};
|
|
48
|
-
return (React.createElement(ExampleWrapper, null,
|
|
49
|
-
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
50
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { dateTime } from '@gravity-ui/date-utils';
|
|
3
|
-
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
-
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
-
import marsWeatherData from '../mars-weather';
|
|
6
|
-
export const NegativeValues = () => {
|
|
7
|
-
const data = marsWeatherData.map((d) => ({
|
|
8
|
-
y: dateTime({ input: d.terrestrial_date, format: 'YYYY-MM-DD' }).valueOf(),
|
|
9
|
-
x: d.min_temp,
|
|
10
|
-
}));
|
|
11
|
-
const widgetData = {
|
|
12
|
-
series: {
|
|
13
|
-
data: [
|
|
14
|
-
{
|
|
15
|
-
type: 'bar-y',
|
|
16
|
-
data: data,
|
|
17
|
-
name: 'Min temperature',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
xAxis: {
|
|
22
|
-
title: {
|
|
23
|
-
text: 'Min temperature',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
yAxis: [
|
|
27
|
-
{
|
|
28
|
-
type: 'datetime',
|
|
29
|
-
title: {
|
|
30
|
-
text: 'Terrestrial date',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
title: {
|
|
35
|
-
text: 'Mars weather',
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
return (React.createElement(ExampleWrapper, null,
|
|
39
|
-
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
40
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { groups } from 'd3';
|
|
3
|
-
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
-
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
-
import nintendoGames from '../nintendoGames';
|
|
6
|
-
function prepareData() {
|
|
7
|
-
const grouped = groups(nintendoGames, (d) => d.platform, (d) => (d.date ? new Date(d.date).getFullYear() : 'unknown'));
|
|
8
|
-
const categories = [];
|
|
9
|
-
const series = grouped.map(([platform, years]) => {
|
|
10
|
-
return {
|
|
11
|
-
name: platform,
|
|
12
|
-
data: years.map(([year, list]) => {
|
|
13
|
-
categories.push(String(year));
|
|
14
|
-
return {
|
|
15
|
-
y: String(year),
|
|
16
|
-
x: list.length,
|
|
17
|
-
};
|
|
18
|
-
}),
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
return { categories, series };
|
|
22
|
-
}
|
|
23
|
-
export const PercentStackingBars = () => {
|
|
24
|
-
const { series, categories } = prepareData();
|
|
25
|
-
const data = series.map((s) => {
|
|
26
|
-
return {
|
|
27
|
-
type: 'bar-y',
|
|
28
|
-
stacking: 'percent',
|
|
29
|
-
name: s.name,
|
|
30
|
-
data: s.data,
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
const widgetData = {
|
|
34
|
-
series: {
|
|
35
|
-
data: data,
|
|
36
|
-
},
|
|
37
|
-
yAxis: [
|
|
38
|
-
{
|
|
39
|
-
type: 'category',
|
|
40
|
-
categories: categories.sort(),
|
|
41
|
-
title: {
|
|
42
|
-
text: 'Release year',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
};
|
|
47
|
-
return (React.createElement(ExampleWrapper, null,
|
|
48
|
-
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
49
|
-
};
|