This repository has been archived by the owner on Dec 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(preset-chart-nvd3): migration from plugins repo (#399)
- Loading branch information
Showing
125 changed files
with
3,627 additions
and
435 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
...ages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/Stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { AreaChartPlugin } from '@superset-ui/legacy-preset-chart-nvd3'; | ||
|
||
new AreaChartPlugin().configure({ key: 'area' }).register(); | ||
|
||
export default { | ||
title: 'Legacy Chart Plugins|legacy-preset-chart-nvd3/Area', | ||
}; | ||
|
||
export { stacked } from './stories/stacked'; | ||
export { stackedWithYAxisBounds, stackedWithYAxisBoundsMinOnly } from './stories/stackedWithBounds'; | ||
export { expanded } from './stories/expanded'; | ||
export { controlsShown } from './stories/controlsShown'; |
File renamed without changes.
35 changes: 35 additions & 0 deletions
35
...ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/controlsShown.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import { SuperChart } from '@superset-ui/chart'; | ||
import dummyDatasource from '../../../../../shared/dummyDatasource'; | ||
import data from '../data'; | ||
|
||
export const controlsShown = () => ( | ||
<SuperChart | ||
chartType="area" | ||
datasource={dummyDatasource} | ||
width={400} | ||
height={400} | ||
queryData={{ data }} | ||
formData={{ | ||
bottomMargin: 'auto', | ||
colorCcheme: 'd3Category10', | ||
contribution: false, | ||
groupby: ['region'], | ||
lineInterpolation: 'linear', | ||
metrics: ['sum__SP_POP_TOTL'], | ||
richTooltip: true, | ||
showBrush: 'auto', | ||
showControls: true, | ||
showLegend: true, | ||
stackedStyle: 'stack', | ||
vizType: 'area', | ||
xAxisFormat: '%Y', | ||
xAxisLabel: '', | ||
xAxisShowminmax: false, | ||
xTicksLayout: 'auto', | ||
yAxisBounds: [null, null], | ||
yAxisFormat: '.3s', | ||
yLogScale: false, | ||
}} | ||
/> | ||
); |
35 changes: 35 additions & 0 deletions
35
...rset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/expanded.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import { SuperChart } from '@superset-ui/chart'; | ||
import dummyDatasource from '../../../../../shared/dummyDatasource'; | ||
import data from '../data'; | ||
|
||
export const expanded = () => ( | ||
<SuperChart | ||
chartType="area" | ||
datasource={dummyDatasource} | ||
width={400} | ||
height={400} | ||
queryData={{ data }} | ||
formData={{ | ||
bottomMargin: 'auto', | ||
colorCcheme: 'd3Category10', | ||
contribution: false, | ||
groupby: ['region'], | ||
lineInterpolation: 'linear', | ||
metrics: ['sum__SP_POP_TOTL'], | ||
richTooltip: true, | ||
showBrush: 'auto', | ||
showControls: false, | ||
showLegend: true, | ||
stackedStyle: 'expand', | ||
vizType: 'area', | ||
xAxisFormat: '%Y', | ||
xAxisLabel: '', | ||
xAxisShowminmax: false, | ||
xTicksLayout: 'auto', | ||
yAxisBounds: [null, null], | ||
yAxisFormat: '.3s', | ||
yLogScale: false, | ||
}} | ||
/> | ||
); |
36 changes: 36 additions & 0 deletions
36
...erset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/stacked.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import { SuperChart } from '@superset-ui/chart'; | ||
import dummyDatasource from '../../../../../shared/dummyDatasource'; | ||
import data from '../data'; | ||
|
||
export const stacked = () => ( | ||
<SuperChart | ||
id="stacked-area-chart" | ||
chartType="area" | ||
datasource={dummyDatasource} | ||
width={400} | ||
height={400} | ||
queryData={{ data }} | ||
formData={{ | ||
bottomMargin: 'auto', | ||
colorScheme: 'd3Category10', | ||
contribution: false, | ||
groupby: ['region'], | ||
lineInterpolation: 'linear', | ||
metrics: ['sum__SP_POP_TOTL'], | ||
richTooltip: true, | ||
showBrush: 'auto', | ||
showControls: false, | ||
showLegend: true, | ||
stackedStyle: 'stack', | ||
vizType: 'area', | ||
xAxisFormat: '%Y', | ||
xAxisLabel: '', | ||
xAxisShowminmax: false, | ||
xTicksLayout: 'auto', | ||
yAxisBounds: [null, null], | ||
yAxisFormat: '.3s', | ||
yLogScale: false, | ||
}} | ||
/> | ||
); |
74 changes: 74 additions & 0 deletions
74
...emo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/stackedWithBounds.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import React from 'react'; | ||
import { SuperChart } from '@superset-ui/chart'; | ||
import dummyDatasource from '../../../../../shared/dummyDatasource'; | ||
import data from '../data'; | ||
|
||
export const stackedWithYAxisBounds = () => ( | ||
<SuperChart | ||
chartType="area" | ||
datasource={dummyDatasource} | ||
width={400} | ||
height={400} | ||
queryData={{ data }} | ||
formData={{ | ||
bottomMargin: 'auto', | ||
colorCcheme: 'd3Category10', | ||
contribution: false, | ||
groupby: ['region'], | ||
lineInterpolation: 'linear', | ||
metrics: ['sum__SP_POP_TOTL'], | ||
richTooltip: true, | ||
showBrush: 'auto', | ||
showControls: false, | ||
showLegend: true, | ||
stackedStyle: 'stack', | ||
vizType: 'area', | ||
xAxisFormat: '%Y', | ||
xAxisLabel: '', | ||
xAxisShowminmax: false, | ||
xTicksLayout: 'auto', | ||
yAxisBounds: [0, 3000000000], | ||
yAxisFormat: '.3s', | ||
yLogScale: false, | ||
}} | ||
/> | ||
); | ||
|
||
stackedWithYAxisBounds.story = { | ||
name: 'Stacked with yAxisBounds', | ||
}; | ||
|
||
export const stackedWithYAxisBoundsMinOnly = () => ( | ||
<SuperChart | ||
chartType="area" | ||
datasource={dummyDatasource} | ||
width={400} | ||
height={400} | ||
queryData={{ data }} | ||
formData={{ | ||
bottomMargin: 'auto', | ||
colorCcheme: 'd3Category10', | ||
contribution: false, | ||
groupby: ['region'], | ||
lineInterpolation: 'linear', | ||
metrics: ['sum__SP_POP_TOTL'], | ||
richTooltip: true, | ||
showBrush: 'auto', | ||
showControls: true, | ||
showLegend: true, | ||
stackedStyle: 'stack', | ||
vizType: 'area', | ||
xAxisFormat: '%Y', | ||
xAxisLabel: '', | ||
xAxisShowminmax: false, | ||
xTicksLayout: 'auto', | ||
yAxisBounds: [1000000000, null], | ||
yAxisFormat: '.3s', | ||
yLogScale: false, | ||
}} | ||
/> | ||
); | ||
|
||
stackedWithYAxisBoundsMinOnly.story = { | ||
name: 'Stacked with yAxisBounds min only', | ||
}; |
12 changes: 12 additions & 0 deletions
12
packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/Stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { BarChartPlugin } from '@superset-ui/legacy-preset-chart-nvd3'; | ||
|
||
new BarChartPlugin().configure({ key: 'bar' }).register(); | ||
|
||
export default { | ||
title: 'Legacy Chart Plugins|legacy-preset-chart-nvd3/Bar', | ||
}; | ||
|
||
export { basic } from './stories/basic'; | ||
export { barWithValues } from './stories/barWithValues'; | ||
export { barWithPositiveAndNegativeValues } from './stories/barWithPositiveAndNegativeValues'; | ||
export { stackedBarWithValues } from './stories/stackedBarWithValues'; |
File renamed without changes.
41 changes: 41 additions & 0 deletions
41
...stories/plugins/legacy-preset-chart-nvd3/Bar/stories/barWithPositiveAndNegativeValues.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import { SuperChart } from '@superset-ui/chart'; | ||
import dummyDatasource from '../../../../../shared/dummyDatasource'; | ||
import data from '../data'; | ||
|
||
export const barWithPositiveAndNegativeValues = () => ( | ||
<SuperChart | ||
chartType="bar" | ||
width={400} | ||
height={400} | ||
datasource={dummyDatasource} | ||
queryData={{ | ||
data: data.map((group, i) => ({ | ||
...group, | ||
values: group.values.map(pair => ({ ...pair, y: (i % 2 === 0 ? 1 : -1) * pair.y })), | ||
})), | ||
}} | ||
formData={{ | ||
bottomMargin: 'auto', | ||
colorScheme: 'd3Category10', | ||
contribution: false, | ||
groupby: ['region'], | ||
lineInterpolation: 'linear', | ||
metrics: ['sum__SP_POP_TOTL'], | ||
richTooltip: true, | ||
showBarValue: true, | ||
showBrush: 'auto', | ||
showControls: false, | ||
showLegend: true, | ||
stackedStyle: 'stack', | ||
vizType: 'bar', | ||
xAxisFormat: '%Y', | ||
xAxisLabel: '', | ||
xAxisShowminmax: false, | ||
xTicksLayout: 'auto', | ||
yAxisBounds: [null, null], | ||
yAxisFormat: '.3s', | ||
yLogScale: false, | ||
}} | ||
/> | ||
); |
36 changes: 36 additions & 0 deletions
36
...-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/barWithValues.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import { SuperChart } from '@superset-ui/chart'; | ||
import dummyDatasource from '../../../../../shared/dummyDatasource'; | ||
import data from '../data'; | ||
|
||
export const barWithValues = () => ( | ||
<SuperChart | ||
chartType="bar" | ||
width={400} | ||
height={400} | ||
datasource={dummyDatasource} | ||
queryData={{ data }} | ||
formData={{ | ||
bottomMargin: 'auto', | ||
colorScheme: 'd3Category10', | ||
contribution: false, | ||
groupby: ['region'], | ||
lineInterpolation: 'linear', | ||
metrics: ['sum__SP_POP_TOTL'], | ||
richTooltip: true, | ||
showBarValue: false, | ||
showBrush: 'auto', | ||
showControls: false, | ||
showLegend: true, | ||
stackedStyle: 'stack', | ||
vizType: 'bar', | ||
xAxisFormat: '%Y', | ||
xAxisLabel: '', | ||
xAxisShowminmax: false, | ||
xTicksLayout: 'auto', | ||
yAxisBounds: [null, null], | ||
yAxisFormat: '.3s', | ||
yLogScale: false, | ||
}} | ||
/> | ||
); |
36 changes: 36 additions & 0 deletions
36
...superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/basic.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import { SuperChart } from '@superset-ui/chart'; | ||
import dummyDatasource from '../../../../../shared/dummyDatasource'; | ||
import data from '../data'; | ||
|
||
export const basic = () => ( | ||
<SuperChart | ||
chartType="bar" | ||
width={400} | ||
height={400} | ||
datasource={dummyDatasource} | ||
queryData={{ data }} | ||
formData={{ | ||
bottomMargin: 'auto', | ||
colorScheme: 'd3Category10', | ||
contribution: false, | ||
groupby: ['region'], | ||
lineInterpolation: 'linear', | ||
metrics: ['sum__SP_POP_TOTL'], | ||
richTooltip: true, | ||
showBarValue: false, | ||
showBrush: 'auto', | ||
showControls: false, | ||
showLegend: true, | ||
stackedStyle: 'stack', | ||
vizType: 'bar', | ||
xAxisFormat: '%Y', | ||
xAxisLabel: '', | ||
xAxisShowminmax: false, | ||
xTicksLayout: 'auto', | ||
yAxisBounds: [null, null], | ||
yAxisFormat: '.3s', | ||
yLogScale: false, | ||
}} | ||
/> | ||
); |
37 changes: 37 additions & 0 deletions
37
...o/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/stackedBarWithValues.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
import { SuperChart } from '@superset-ui/chart'; | ||
import dummyDatasource from '../../../../../shared/dummyDatasource'; | ||
import data from '../data'; | ||
|
||
export const stackedBarWithValues = () => ( | ||
<SuperChart | ||
chartType="bar" | ||
width={400} | ||
height={400} | ||
datasource={dummyDatasource} | ||
queryData={{ data }} | ||
formData={{ | ||
barStacked: true, | ||
bottomMargin: 'auto', | ||
colorScheme: 'd3Category10', | ||
contribution: false, | ||
groupby: ['region'], | ||
lineInterpolation: 'linear', | ||
metrics: ['sum__SP_POP_TOTL'], | ||
richTooltip: true, | ||
showBarValue: true, | ||
showBrush: 'auto', | ||
showControls: false, | ||
showLegend: true, | ||
stackedStyle: 'stack', | ||
vizType: 'bar', | ||
xAxisFormat: '%Y', | ||
xAxisLabel: '', | ||
xAxisShowminmax: false, | ||
xTicksLayout: 'auto', | ||
yAxisBounds: [null, null], | ||
yAxisFormat: '.3s', | ||
yLogScale: false, | ||
}} | ||
/> | ||
); |
9 changes: 9 additions & 0 deletions
9
...s/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/BoxPlot/Stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { BoxPlotChartPlugin } from '@superset-ui/legacy-preset-chart-nvd3'; | ||
|
||
new BoxPlotChartPlugin().configure({ key: 'box-plot' }).register(); | ||
|
||
export default { | ||
title: 'Legacy Chart Plugins|legacy-preset-chart-nvd3/BoxPlot', | ||
}; | ||
|
||
export { basic } from './stories/basic'; |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
...rset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/BoxPlot/stories/basic.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { SuperChart } from '@superset-ui/chart'; | ||
import dummyDatasource from '../../../../../shared/dummyDatasource'; | ||
import data from '../data'; | ||
|
||
export const basic = () => ( | ||
<SuperChart | ||
chartType="box-plot" | ||
width={400} | ||
height={400} | ||
datasource={dummyDatasource} | ||
queryData={{ data }} | ||
formData={{ | ||
colorScheme: 'd3Category10', | ||
vizType: 'box_plot', | ||
whiskerOptions: 'Min/max (no outliers)', | ||
}} | ||
/> | ||
); |
Oops, something went wrong.
dbd84f2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to following URLs: