Skip to content

Commit

Permalink
chore: coordinate storybook with main repository (apache#1466)
Browse files Browse the repository at this point in the history
* chore: coordinate storybook with main repository

* update lock file
  • Loading branch information
zhaoyongjie committed Nov 17, 2021
1 parent 201c801 commit 1e1535d
Show file tree
Hide file tree
Showing 20 changed files with 6,188 additions and 1,612 deletions.
7,651 changes: 6,079 additions & 1,572 deletions superset-frontend/temporary_superset_ui/superset-ui/package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"@superset-ui/plugin-chart-word-cloud": "0.18.22",
"@superset-ui/preset-chart-xy": "0.18.22",
"@types/react-loadable": "^5.5.3",
"@types/react-resizable": "^1.7.2",
"antd": "^4.9.4",
"bootstrap": "^3.4.1",
"core-js": "3.8.3",
Expand All @@ -79,7 +78,7 @@
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-loadable": "^5.5.0",
"react-resizable": "^1.10.1",
"react-resizable": "^3.0.4",
"storybook-addon-jsx": "^7.3.14"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,20 @@ import React from 'react';
import { SuperChart } from '@superset-ui/core';
import ChordChartPlugin from '@superset-ui/legacy-plugin-chart-chord';
import data from './data';
import { withResizableChartDemo } from '../../../shared/components/ResizableChartDemo';

new ChordChartPlugin().configure({ key: 'chord' }).register();

export default {
title: 'Legacy Chart Plugins/legacy-plugin-chart-chord',
decorators: [withResizableChartDemo],
};

export const basic = () => (
export const basic = ({ width, height }) => (
<SuperChart
chartType="chord"
width={400}
height={400}
width={width}
height={height}
queriesData={[{ data }]}
formData={{
colorScheme: 'd3Category10',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ import {
SuperChart,
SequentialD3,
} from '@superset-ui/core';
import CountryMapChartPlugin from '@superset-ui/legacy-plugin-chart-country-map/src';
import countries from '@superset-ui/legacy-plugin-chart-country-map/src/countries';
import CountryMapChartPlugin, {
countries,
} from '@superset-ui/legacy-plugin-chart-country-map';
import { withKnobs, select } from '@storybook/addon-knobs';
import { withResizableChartDemo } from '../../../shared/components/ResizableChartDemo';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
import React from 'react';
import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core';
import { select, withKnobs } from '@storybook/addon-knobs';
import { EchartsBoxPlotChartPlugin } from '@superset-ui/plugin-chart-echarts';
import transformProps from '@superset-ui/plugin-chart-echarts/lib/BoxPlot/transformProps';
import {
EchartsBoxPlotChartPlugin,
BoxPlotTransformProps,
} from '@superset-ui/plugin-chart-echarts';
import data from './data';
import { withResizableChartDemo } from '../../../../shared/components/ResizableChartDemo';

Expand All @@ -31,7 +33,7 @@ new EchartsBoxPlotChartPlugin()

getChartTransformPropsRegistry().registerValue(
'echarts-boxplot',
transformProps,
BoxPlotTransformProps,
);

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@
import React from 'react';
import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core';
import { boolean, number, select, withKnobs } from '@storybook/addon-knobs';
import { EchartsFunnelChartPlugin } from '@superset-ui/plugin-chart-echarts';
import transformProps from '@superset-ui/plugin-chart-echarts/lib/Funnel/transformProps';
import {
EchartsFunnelChartPlugin,
FunnelTransformProps,
} from '@superset-ui/plugin-chart-echarts';
import { dataSource } from './constants';
import { withResizableChartDemo } from '../../../../shared/components/ResizableChartDemo';

new EchartsFunnelChartPlugin().configure({ key: 'echarts-funnel' }).register();

getChartTransformPropsRegistry().registerValue(
'echarts-funnel',
transformProps,
FunnelTransformProps,
);

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@
import React from 'react';
import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core';
import { withKnobs } from '@storybook/addon-knobs';
import { EchartsGaugeChartPlugin } from '@superset-ui/plugin-chart-echarts';
import transformProps from '@superset-ui/plugin-chart-echarts/lib/Gauge/transformProps';
import {
EchartsGaugeChartPlugin,
GaugeTransformProps,
} from '@superset-ui/plugin-chart-echarts';
import { withResizableChartDemo } from '../../../../shared/components/ResizableChartDemo';
import { speed } from './data';

new EchartsGaugeChartPlugin().configure({ key: 'echarts-gauge' }).register();

getChartTransformPropsRegistry().registerValue('echarts-gauge', transformProps);
getChartTransformPropsRegistry().registerValue(
'echarts-gauge',
GaugeTransformProps,
);

export default {
title: 'Chart Plugins/plugin-chart-echarts/Gauge',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@
import React from 'react';
import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core';
import { withKnobs } from '@storybook/addon-knobs';
import { EchartsGraphChartPlugin } from '@superset-ui/plugin-chart-echarts';
import transformProps from '@superset-ui/plugin-chart-echarts/lib/Graph/transformProps';
import {
EchartsGraphChartPlugin,
GraphTransformProps,
} from '@superset-ui/plugin-chart-echarts';
import { basic } from './data';
import { withResizableChartDemo } from '../../../../shared/components/ResizableChartDemo';

new EchartsGraphChartPlugin().configure({ key: 'echarts-graph' }).register();

getChartTransformPropsRegistry().registerValue('echarts-graph', transformProps);
getChartTransformPropsRegistry().registerValue(
'echarts-graph',
GraphTransformProps,
);

export default {
title: 'Chart Plugins/plugin-chart-echarts/Graph',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ import {
select,
withKnobs,
} from '@storybook/addon-knobs';
import { EchartsTimeseriesChartPlugin } from '@superset-ui/plugin-chart-echarts';
import transformProps from '@superset-ui/plugin-chart-echarts/lib/MixedTimeseries/transformProps';
import {
EchartsTimeseriesChartPlugin,
MixedTimeseriesTransformProps,
} from '@superset-ui/plugin-chart-echarts';
import data from '../Timeseries/data';
import { withResizableChartDemo } from '../../../../shared/components/ResizableChartDemo';

Expand All @@ -37,7 +39,7 @@ new EchartsTimeseriesChartPlugin()

getChartTransformPropsRegistry().registerValue(
'mixed-timeseries',
transformProps,
MixedTimeseriesTransformProps,
);

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@
import React from 'react';
import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core';
import { boolean, number, select, withKnobs } from '@storybook/addon-knobs';
import { EchartsPieChartPlugin } from '@superset-ui/plugin-chart-echarts';
import transformProps from '@superset-ui/plugin-chart-echarts/lib/Pie/transformProps';
import {
EchartsPieChartPlugin,
PieTransformProps,
} from '@superset-ui/plugin-chart-echarts';
import { weekday, population } from './data';
import { withResizableChartDemo } from '../../../../shared/components/ResizableChartDemo';

new EchartsPieChartPlugin().configure({ key: 'echarts-pie' }).register();

getChartTransformPropsRegistry().registerValue('echarts-pie', transformProps);
getChartTransformPropsRegistry().registerValue(
'echarts-pie',
PieTransformProps,
);

export default {
title: 'Chart Plugins/plugin-chart-echarts/Pie',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@
import React from 'react';
import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core';
import { withKnobs } from '@storybook/addon-knobs';
import { EchartsRadarChartPlugin } from '@superset-ui/plugin-chart-echarts';
import transformProps from '@superset-ui/plugin-chart-echarts/lib/Radar/transformProps';
import {
EchartsRadarChartPlugin,
RadarTransformProps,
} from '@superset-ui/plugin-chart-echarts';
import { withResizableChartDemo } from '../../../../shared/components/ResizableChartDemo';
import { basic } from './data';

new EchartsRadarChartPlugin().configure({ key: 'echarts-radar' }).register();

getChartTransformPropsRegistry().registerValue('echarts-radar', transformProps);
getChartTransformPropsRegistry().registerValue(
'echarts-radar',
RadarTransformProps,
);

export default {
title: 'Chart Plugins/plugin-chart-echarts/Radar',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
import React from 'react';
import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core';
import { boolean, number, select, withKnobs } from '@storybook/addon-knobs';
import { EchartsTimeseriesChartPlugin } from '@superset-ui/plugin-chart-echarts';
import transformProps from '@superset-ui/plugin-chart-echarts/lib/Timeseries/transformProps';
import {
EchartsTimeseriesChartPlugin,
TimeseriesTransformProps,
} from '@superset-ui/plugin-chart-echarts';
import data from './data';
import { withResizableChartDemo } from '../../../../shared/components/ResizableChartDemo';

Expand All @@ -31,7 +33,7 @@ new EchartsTimeseriesChartPlugin()

getChartTransformPropsRegistry().registerValue(
'echarts-timeseries',
transformProps,
TimeseriesTransformProps,
);

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@
import React from 'react';
import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core';
import { select, withKnobs, text, number } from '@storybook/addon-knobs';
import { EchartsTreeChartPlugin } from '@superset-ui/plugin-chart-echarts';
import transformProps from '@superset-ui/plugin-chart-echarts/lib/Tree/transformProps';
import {
EchartsTreeChartPlugin,
TreeTransformProps,
} from '@superset-ui/plugin-chart-echarts';
import data from './data';
import { withResizableChartDemo } from '../../../../shared/components/ResizableChartDemo';

new EchartsTreeChartPlugin().configure({ key: 'echarts-tree' }).register();

getChartTransformPropsRegistry().registerValue('echarts-tree', transformProps);
getChartTransformPropsRegistry().registerValue(
'echarts-tree',
TreeTransformProps,
);

export default {
title: 'Chart Plugins/plugin-chart-echarts/Tree',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
import React from 'react';
import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core';
import { boolean, withKnobs, select } from '@storybook/addon-knobs';
import { EchartsTreemapChartPlugin } from '@superset-ui/plugin-chart-echarts';
import transformProps from '@superset-ui/plugin-chart-echarts/lib/Treemap/transformProps';
import {
EchartsTreemapChartPlugin,
TreemapTransformProps,
} from '@superset-ui/plugin-chart-echarts';
import data from './data';
import { withResizableChartDemo } from '../../../../shared/components/ResizableChartDemo';

Expand All @@ -31,7 +33,7 @@ new EchartsTreemapChartPlugin()

getChartTransformPropsRegistry().registerValue(
'echarts-treemap',
transformProps,
TreemapTransformProps,
);

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { withKnobs, number, boolean } from '@storybook/addon-knobs';
import { SuperChart } from '@superset-ui/core';
import TableChartPlugin, {
TableChartProps,
} from '@superset-ui/plugin-chart-table/src';
} from '@superset-ui/plugin-chart-table';
import { basicFormData, basicData, birthNames } from './testData';
import { withResizableChartDemo } from '../../../shared/components/ResizableChartDemo';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import { select, withKnobs } from '@storybook/addon-knobs';
import {
WordCloudChartPlugin,
LegacyWordCloudChartPlugin,
WordCloudTransformProps,
} from '@superset-ui/plugin-chart-word-cloud';
import transformProps from '@superset-ui/plugin-chart-word-cloud/lib/plugin/transformProps';
import { withResizableChartDemo } from '../../../shared/components/ResizableChartDemo';
import data from './data';

Expand All @@ -35,7 +35,10 @@ new LegacyWordCloudChartPlugin()

// Enable the new WordCloud Props to show case its full features
// if the control panel is updated to be able to pass formData in the new format.
getChartTransformPropsRegistry().registerValue('word-cloud2', transformProps);
getChartTransformPropsRegistry().registerValue(
'word-cloud2',
WordCloudTransformProps,
);

export default {
title: 'Chart Plugins/plugin-chart-word-cloud',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@
"experimentalDecorators": true,
"noImplicitAny": false,
"noEmit": false,
"baseUrl": "../../",
"paths": {
"@superset-ui/core": ["./packages/superset-ui-core/src"],
"@superset-ui/chart-controls": [
"./packages/superset-ui-chart-controls/src"
],
"@superset-ui/legacy-plugin-chart-*": [
"./plugins/legacy-plugin-chart-*/src"
],
"@superset-ui/legacy-preset-chart-*": [
"./plugins/legacy-preset-chart-*/src"
],
"@superset-ui/plugin-chart-*": ["./plugins/plugin-chart-*/src"],
"@superset-ui/preset-chart-*": ["./plugins/preset-chart-*/src"],
}
},
"exclude": ["node_modules"],
"include": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ export default class CountryMapChartPlugin extends ChartPlugin {
});
}
}

export { default as countries } from './countries';
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ export { default as EchartsFunnelChartPlugin } from './Funnel';
export { default as EchartsTreeChartPlugin } from './Tree';
export { default as EchartsTreemapChartPlugin } from './Treemap';

export { default as BoxPlotTransformProps } from './BoxPlot/transformProps';
export { default as FunnelTransformProps } from './Funnel/transformProps';
export { default as GaugeTransformProps } from './Gauge/transformProps';
export { default as GraphTransformProps } from './Graph/transformProps';
export { default as MixedTimeseriesTransformProps } from './MixedTimeseries/transformProps';
export { default as PieTransformProps } from './Pie/transformProps';
export { default as RadarTransformProps } from './Radar/transformProps';
export { default as TimeseriesTransformProps } from './Timeseries/transformProps';
export { default as TreeTransformProps } from './Tree/transformProps';
export { default as TreemapTransformProps } from './Treemap/transformProps';

export * from './types';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

export { default as WordCloudChartPlugin } from './plugin';
export { default as WordCloudTransformProps } from './plugin/transformProps';
export { default as LegacyWordCloudChartPlugin } from './legacyPlugin';
export * from './types';
export { default as configureEncodable } from './configureEncodable';

0 comments on commit 1e1535d

Please sign in to comment.