diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json
index 0dd9bb121..736890dc7 100644
--- a/superset-frontend/package-lock.json
+++ b/superset-frontend/package-lock.json
@@ -46,7 +46,6 @@
"@superset-ui/plugin-chart-pivot-table": "file:./plugins/plugin-chart-pivot-table",
"@superset-ui/plugin-chart-table": "file:./plugins/plugin-chart-table",
"@superset-ui/plugin-chart-word-cloud": "file:./plugins/plugin-chart-word-cloud",
- "@superset-ui/preset-chart-xy": "file:./plugins/preset-chart-xy",
"@superset-ui/switchboard": "file:./packages/superset-ui-switchboard",
"@types/d3-format": "^3.0.1",
"@visx/axis": "^3.0.1",
@@ -19878,10 +19877,6 @@
"resolved": "plugins/plugin-chart-word-cloud",
"link": true
},
- "node_modules/@superset-ui/preset-chart-xy": {
- "resolved": "plugins/preset-chart-xy",
- "link": true
- },
"node_modules/@superset-ui/switchboard": {
"resolved": "packages/superset-ui-switchboard",
"link": true
@@ -60470,8 +60465,7 @@
"@superset-ui/legacy-preset-chart-nvd3": "*",
"@superset-ui/plugin-chart-echarts": "*",
"@superset-ui/plugin-chart-table": "*",
- "@superset-ui/plugin-chart-word-cloud": "*",
- "@superset-ui/preset-chart-xy": "*"
+ "@superset-ui/plugin-chart-word-cloud": "*"
}
},
"packages/superset-ui-demo/node_modules/@superset-ui/legacy-plugin-chart-time-table": {
@@ -61822,135 +61816,6 @@
"d3-array": "2"
}
},
- "plugins/preset-chart-xy": {
- "name": "@superset-ui/preset-chart-xy",
- "version": "0.18.25",
- "license": "Apache-2.0",
- "dependencies": {
- "@data-ui/theme": "^0.0.84",
- "@data-ui/xy-chart": "^0.0.84",
- "@vx/axis": "^0.0.198",
- "@vx/legend": "^0.0.198",
- "@vx/scale": "^0.0.197",
- "csstype": "^2.6.3",
- "encodable": "^0.7.6",
- "lodash": "^4.17.11",
- "reselect": "^4.0.0"
- },
- "peerDependencies": {
- "@superset-ui/chart-controls": "*",
- "@superset-ui/core": "*",
- "react": "^16.2"
- }
- },
- "plugins/preset-chart-xy/node_modules/@vx/axis": {
- "version": "0.0.198",
- "resolved": "https://registry.npmjs.org/@vx/axis/-/axis-0.0.198.tgz",
- "integrity": "sha512-XqHzGOBgkJD8gR1g9F7uOhT4Sjlwpl/H3xLehtDooRmKf3J0hy8C7L5rCgh7n8ARi+vYg+3A1zUo0JBIO5k4PQ==",
- "dependencies": {
- "@types/classnames": "^2.2.9",
- "@types/react": "*",
- "@vx/group": "0.0.198",
- "@vx/point": "0.0.198",
- "@vx/shape": "0.0.198",
- "@vx/text": "0.0.198",
- "classnames": "^2.2.5",
- "prop-types": "^15.6.0"
- },
- "peerDependencies": {
- "react": "^16.3.0-0"
- }
- },
- "plugins/preset-chart-xy/node_modules/@vx/curve": {
- "version": "0.0.198",
- "resolved": "https://registry.npmjs.org/@vx/curve/-/curve-0.0.198.tgz",
- "integrity": "sha512-ZINtD0t5eLu3bEeaOWZxGXrHK5WCbGoxDdou7yPWD6xg8kpTD4/Vq0adRFNCxS1TZUlUjCJ2KqY2PmewO+Hdcw==",
- "dependencies": {
- "@types/d3-shape": "^1.3.1",
- "d3-shape": "^1.0.6"
- }
- },
- "plugins/preset-chart-xy/node_modules/@vx/group": {
- "version": "0.0.198",
- "resolved": "https://registry.npmjs.org/@vx/group/-/group-0.0.198.tgz",
- "integrity": "sha512-0PivE+fWZlPkSzFO/is5m4VSSv3pg+sS1yxYAZHbNffUvn472WDWptriHvoUIPQe0lOXhTSrc73UQzew9GtW/g==",
- "dependencies": {
- "@types/classnames": "^2.2.9",
- "@types/react": "*",
- "classnames": "^2.2.5",
- "prop-types": "^15.6.2"
- },
- "peerDependencies": {
- "react": "^15.0.0-0 || ^16.0.0-0"
- }
- },
- "plugins/preset-chart-xy/node_modules/@vx/legend": {
- "version": "0.0.198",
- "resolved": "https://registry.npmjs.org/@vx/legend/-/legend-0.0.198.tgz",
- "integrity": "sha512-3S2/yP6IvkkhUlTj6In5M1OrzY1OaT1D06hRxuiOLAbaXTerhbUGwIjGSNoovQM6JebFlbWnnA5xH1SKgw5GGA==",
- "dependencies": {
- "@types/classnames": "^2.2.9",
- "@types/d3-scale": "^2.1.1",
- "@types/react": "*",
- "@vx/group": "0.0.198",
- "classnames": "^2.2.5",
- "prop-types": "^15.5.10"
- },
- "peerDependencies": {
- "react": "^16.3.0-0"
- }
- },
- "plugins/preset-chart-xy/node_modules/@vx/point": {
- "version": "0.0.198",
- "resolved": "https://registry.npmjs.org/@vx/point/-/point-0.0.198.tgz",
- "integrity": "sha512-oFlw8uBLf4JDX7OJc+7eQXcnlLszdQgEs531u0t6HNpARQY/jTeeMLVUlp8sNF0XBOC+iVHU8Qe8TJdz/ONBAA=="
- },
- "plugins/preset-chart-xy/node_modules/@vx/scale": {
- "version": "0.0.197",
- "resolved": "https://registry.npmjs.org/@vx/scale/-/scale-0.0.197.tgz",
- "integrity": "sha512-FF0POm9rh66I3Om5DsuxynwWU+Q645aTF47vgP2dVDeOOq3Oet7CZzmXLDh3W6nVcxvzq1UdPwu94dto2PUfhg==",
- "dependencies": {
- "@types/d3-scale": "^2.1.1",
- "d3-scale": "^2.2.2"
- }
- },
- "plugins/preset-chart-xy/node_modules/@vx/shape": {
- "version": "0.0.198",
- "resolved": "https://registry.npmjs.org/@vx/shape/-/shape-0.0.198.tgz",
- "integrity": "sha512-3Ky2PlSXYmh/Wt+tT4OBmsLpTe8Vu5pZ1EwbMQ0H/NNl6d4BsNqBUzr++0WC/kLsuNs5NENDvG77N9u2ztMrYA==",
- "dependencies": {
- "@types/classnames": "^2.2.9",
- "@types/d3-path": "^1.0.8",
- "@types/d3-shape": "^1.3.1",
- "@types/react": "*",
- "@vx/curve": "0.0.198",
- "@vx/group": "0.0.198",
- "classnames": "^2.2.5",
- "d3-path": "^1.0.5",
- "d3-shape": "^1.2.0",
- "prop-types": "^15.5.10"
- },
- "peerDependencies": {
- "react": "^16.3.0-0"
- }
- },
- "plugins/preset-chart-xy/node_modules/@vx/text": {
- "version": "0.0.198",
- "resolved": "https://registry.npmjs.org/@vx/text/-/text-0.0.198.tgz",
- "integrity": "sha512-MZhLeIhjbPlAeq+heUFXzrAztkjpfhAjeg+RXDg1dTJTtkbBD0w1bwadSPHuC7Rzj6yNQChzVDYl51dO/k4ExQ==",
- "dependencies": {
- "@types/classnames": "^2.2.9",
- "@types/lodash": "^4.14.146",
- "@types/react": "*",
- "classnames": "^2.2.5",
- "lodash": "^4.17.15",
- "prop-types": "^15.7.2",
- "reduce-css-calc": "^1.3.0"
- },
- "peerDependencies": {
- "react": "^16.3.0-0"
- }
- },
"spec": {
"extraneous": true
},
@@ -77698,115 +77563,6 @@
}
}
},
- "@superset-ui/preset-chart-xy": {
- "version": "file:plugins/preset-chart-xy",
- "requires": {
- "@data-ui/theme": "^0.0.84",
- "@data-ui/xy-chart": "^0.0.84",
- "@vx/axis": "^0.0.198",
- "@vx/legend": "^0.0.198",
- "@vx/scale": "^0.0.197",
- "csstype": "^2.6.3",
- "encodable": "^0.7.6",
- "lodash": "^4.17.11",
- "reselect": "^4.0.0"
- },
- "dependencies": {
- "@vx/axis": {
- "version": "0.0.198",
- "resolved": "https://registry.npmjs.org/@vx/axis/-/axis-0.0.198.tgz",
- "integrity": "sha512-XqHzGOBgkJD8gR1g9F7uOhT4Sjlwpl/H3xLehtDooRmKf3J0hy8C7L5rCgh7n8ARi+vYg+3A1zUo0JBIO5k4PQ==",
- "requires": {
- "@types/classnames": "^2.2.9",
- "@types/react": "*",
- "@vx/group": "0.0.198",
- "@vx/point": "0.0.198",
- "@vx/shape": "0.0.198",
- "@vx/text": "0.0.198",
- "classnames": "^2.2.5",
- "prop-types": "^15.6.0"
- }
- },
- "@vx/curve": {
- "version": "0.0.198",
- "resolved": "https://registry.npmjs.org/@vx/curve/-/curve-0.0.198.tgz",
- "integrity": "sha512-ZINtD0t5eLu3bEeaOWZxGXrHK5WCbGoxDdou7yPWD6xg8kpTD4/Vq0adRFNCxS1TZUlUjCJ2KqY2PmewO+Hdcw==",
- "requires": {
- "@types/d3-shape": "^1.3.1",
- "d3-shape": "^1.0.6"
- }
- },
- "@vx/group": {
- "version": "0.0.198",
- "resolved": "https://registry.npmjs.org/@vx/group/-/group-0.0.198.tgz",
- "integrity": "sha512-0PivE+fWZlPkSzFO/is5m4VSSv3pg+sS1yxYAZHbNffUvn472WDWptriHvoUIPQe0lOXhTSrc73UQzew9GtW/g==",
- "requires": {
- "@types/classnames": "^2.2.9",
- "@types/react": "*",
- "classnames": "^2.2.5",
- "prop-types": "^15.6.2"
- }
- },
- "@vx/legend": {
- "version": "0.0.198",
- "resolved": "https://registry.npmjs.org/@vx/legend/-/legend-0.0.198.tgz",
- "integrity": "sha512-3S2/yP6IvkkhUlTj6In5M1OrzY1OaT1D06hRxuiOLAbaXTerhbUGwIjGSNoovQM6JebFlbWnnA5xH1SKgw5GGA==",
- "requires": {
- "@types/classnames": "^2.2.9",
- "@types/d3-scale": "^2.1.1",
- "@types/react": "*",
- "@vx/group": "0.0.198",
- "classnames": "^2.2.5",
- "prop-types": "^15.5.10"
- }
- },
- "@vx/point": {
- "version": "0.0.198",
- "resolved": "https://registry.npmjs.org/@vx/point/-/point-0.0.198.tgz",
- "integrity": "sha512-oFlw8uBLf4JDX7OJc+7eQXcnlLszdQgEs531u0t6HNpARQY/jTeeMLVUlp8sNF0XBOC+iVHU8Qe8TJdz/ONBAA=="
- },
- "@vx/scale": {
- "version": "0.0.197",
- "resolved": "https://registry.npmjs.org/@vx/scale/-/scale-0.0.197.tgz",
- "integrity": "sha512-FF0POm9rh66I3Om5DsuxynwWU+Q645aTF47vgP2dVDeOOq3Oet7CZzmXLDh3W6nVcxvzq1UdPwu94dto2PUfhg==",
- "requires": {
- "@types/d3-scale": "^2.1.1",
- "d3-scale": "^2.2.2"
- }
- },
- "@vx/shape": {
- "version": "0.0.198",
- "resolved": "https://registry.npmjs.org/@vx/shape/-/shape-0.0.198.tgz",
- "integrity": "sha512-3Ky2PlSXYmh/Wt+tT4OBmsLpTe8Vu5pZ1EwbMQ0H/NNl6d4BsNqBUzr++0WC/kLsuNs5NENDvG77N9u2ztMrYA==",
- "requires": {
- "@types/classnames": "^2.2.9",
- "@types/d3-path": "^1.0.8",
- "@types/d3-shape": "^1.3.1",
- "@types/react": "*",
- "@vx/curve": "0.0.198",
- "@vx/group": "0.0.198",
- "classnames": "^2.2.5",
- "d3-path": "^1.0.5",
- "d3-shape": "^1.2.0",
- "prop-types": "^15.5.10"
- }
- },
- "@vx/text": {
- "version": "0.0.198",
- "resolved": "https://registry.npmjs.org/@vx/text/-/text-0.0.198.tgz",
- "integrity": "sha512-MZhLeIhjbPlAeq+heUFXzrAztkjpfhAjeg+RXDg1dTJTtkbBD0w1bwadSPHuC7Rzj6yNQChzVDYl51dO/k4ExQ==",
- "requires": {
- "@types/classnames": "^2.2.9",
- "@types/lodash": "^4.14.146",
- "@types/react": "*",
- "classnames": "^2.2.5",
- "lodash": "^4.17.15",
- "prop-types": "^15.7.2",
- "reduce-css-calc": "^1.3.0"
- }
- }
- }
- },
"@superset-ui/switchboard": {
"version": "file:packages/superset-ui-switchboard"
},
diff --git a/superset-frontend/package.json b/superset-frontend/package.json
index 39e99e3c6..ec1595220 100644
--- a/superset-frontend/package.json
+++ b/superset-frontend/package.json
@@ -111,7 +111,6 @@
"@superset-ui/plugin-chart-pivot-table": "file:./plugins/plugin-chart-pivot-table",
"@superset-ui/plugin-chart-table": "file:./plugins/plugin-chart-table",
"@superset-ui/plugin-chart-word-cloud": "file:./plugins/plugin-chart-word-cloud",
- "@superset-ui/preset-chart-xy": "file:./plugins/preset-chart-xy",
"@superset-ui/switchboard": "file:./packages/superset-ui-switchboard",
"@types/d3-format": "^3.0.1",
"@visx/axis": "^3.0.1",
diff --git a/superset-frontend/packages/superset-ui-demo/.storybook/preview.js b/superset-frontend/packages/superset-ui-demo/.storybook/preview.js
index 980aefa82..4ba3fcae6 100644
--- a/superset-frontend/packages/superset-ui-demo/.storybook/preview.js
+++ b/superset-frontend/packages/superset-ui-demo/.storybook/preview.js
@@ -11,7 +11,6 @@ import {
SequentialCommon,
SequentialD3,
} from '@superset-ui/core';
-import { configureEncodable } from '@superset-ui/preset-chart-xy';
import themeDecorator from './themeDecorator';
import 'bootstrap/dist/css/bootstrap.min.css';
@@ -80,5 +79,3 @@ const sequentialSchemeRegistry = getSequentialSchemeRegistry();
getTimeFormatterRegistry()
.registerValue('smart_date', smartDateFormatter)
.setDefaultKey('smart_date');
-
-configureEncodable();
diff --git a/superset-frontend/packages/superset-ui-demo/package.json b/superset-frontend/packages/superset-ui-demo/package.json
index c33ae8c9c..4dada29ce 100644
--- a/superset-frontend/packages/superset-ui-demo/package.json
+++ b/superset-frontend/packages/superset-ui-demo/package.json
@@ -87,7 +87,6 @@
"@superset-ui/legacy-preset-chart-nvd3": "*",
"@superset-ui/plugin-chart-echarts": "*",
"@superset-ui/plugin-chart-table": "*",
- "@superset-ui/plugin-chart-word-cloud": "*",
- "@superset-ui/preset-chart-xy": "*"
+ "@superset-ui/plugin-chart-word-cloud": "*"
}
}
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/Stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/Stories.tsx
deleted file mode 100644
index 6fa4efb07..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/Stories.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import {
- BoxPlotChartPlugin,
- LegacyBoxPlotChartPlugin,
-} from '@superset-ui/preset-chart-xy';
-import { BOX_PLOT_PLUGIN_LEGACY_TYPE, BOX_PLOT_PLUGIN_TYPE } from './constants';
-
-new LegacyBoxPlotChartPlugin()
- .configure({ key: BOX_PLOT_PLUGIN_LEGACY_TYPE })
- .register();
-new BoxPlotChartPlugin().configure({ key: BOX_PLOT_PLUGIN_TYPE }).register();
-
-export default {
- title: 'Chart Plugins/preset-chart-xy/BoxPlot',
-};
-
-export { basic, horizontal } from './stories/Basic';
-export { legacy } from './stories/Legacy';
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/constants.ts b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/constants.ts
deleted file mode 100644
index ed761a222..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/constants.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-export const BOX_PLOT_PLUGIN_TYPE = 'v2-box-plot';
-export const BOX_PLOT_PLUGIN_LEGACY_TYPE = 'v2-box-plot/legacy';
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/data.ts b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/data.ts
deleted file mode 100644
index 367b4d2de..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/data.ts
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* eslint-disable sort-keys, no-magic-numbers */
-export default [
- {
- label: 'East Asia & Pacific',
- values: {
- Q1: 1384725172.5,
- Q2: 1717904169.0,
- Q3: 2032724922.5,
- whisker_high: 2240687901.0,
- whisker_low: 1031863394.0,
- outliers: [],
- },
- },
- {
- label: 'Europe & Central Asia',
- values: {
- Q1: 751386460.5,
- Q2: 820716895.0,
- Q3: 862814192.5,
- whisker_high: 903095786.0,
- whisker_low: 660881033.0,
- outliers: [],
- },
- },
- {
- label: 'Latin America & Caribbean',
- values: {
- Q1: 313690832.5,
- Q2: 421490233.0,
- Q3: 529668114.5,
- whisker_high: 626270167.0,
- whisker_low: 220564224.0,
- outliers: [],
- },
- },
- {
- label: 'Middle East & North Africa',
- values: {
- Q1: 152382756.5,
- Q2: 232066828.0,
- Q3: 318191071.5,
- whisker_high: 417451428.0,
- whisker_low: 105512645.0,
- outliers: [],
- },
- },
- {
- label: 'North America',
- values: {
- Q1: 235506847.5,
- Q2: 268896849.0,
- Q3: 314553651.5,
- whisker_high: 354462656.0,
- whisker_low: 198624409.0,
- outliers: [],
- },
- },
- {
- label: 'South Asia',
- values: {
- Q1: 772373036.5,
- Q2: 1059570231.0,
- Q3: 1398841234.0,
- whisker_high: 1720976995.0,
- whisker_low: 572036107.0,
- outliers: [],
- },
- },
- {
- label: 'Sub-Saharan Africa',
- values: {
- Q1: 320037758.0,
- Q2: 467337821.0,
- Q3: 676768689.0,
- whisker_high: 974315323.0,
- whisker_low: 228268752.0,
- outliers: [],
- },
- },
-];
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/stories/Basic.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/stories/Basic.tsx
deleted file mode 100644
index 32fc4661c..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/stories/Basic.tsx
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* eslint-disable no-magic-numbers, sort-keys */
-import React from 'react';
-import { SuperChart } from '@superset-ui/core';
-import data from '../data';
-
-export const basic = () => (
-
-);
-
-export const horizontal = () => (
-
-);
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/stories/Legacy.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/stories/Legacy.tsx
deleted file mode 100644
index e7bcefbe8..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/BoxPlot/stories/Legacy.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from 'react';
-import { SuperChart } from '@superset-ui/core';
-import data from '../data';
-import dummyDatasource from '../../../../../shared/dummyDatasource';
-
-export const legacy = () => (
-
-);
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/Stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/Stories.tsx
deleted file mode 100644
index 8b20351c6..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/Stories.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import {
- LineChartPlugin,
- LegacyLineChartPlugin,
-} from '@superset-ui/preset-chart-xy';
-import { withKnobs } from '@storybook/addon-knobs';
-import { LINE_PLUGIN_TYPE, LINE_PLUGIN_LEGACY_TYPE } from './constants';
-
-new LegacyLineChartPlugin()
- .configure({ key: LINE_PLUGIN_LEGACY_TYPE })
- .register();
-new LineChartPlugin().configure({ key: LINE_PLUGIN_TYPE }).register();
-
-export default {
- title: 'Chart Plugins/preset-chart-xy/Line',
- decorators: [withKnobs],
-};
-
-export { default as basic } from './stories/basic';
-export { default as withLabelFlush } from './stories/flush';
-export { default as withMissingData } from './stories/missing';
-export { default as legacyShim } from './stories/legacy';
-export { default as withTimeShift } from './stories/timeShift';
-export { default as query } from './stories/query';
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/constants.ts b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/constants.ts
deleted file mode 100644
index e3ec6eda8..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/constants.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-export const LINE_PLUGIN_TYPE = 'v2-line';
-export const LINE_PLUGIN_LEGACY_TYPE = 'v2-line/legacy';
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/data/data.js b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/data/data.js
deleted file mode 100644
index 66342a674..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/data/data.js
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* eslint-disable sort-keys, no-magic-numbers */
-export default [
- { x: -157766400000, y: 24703, name: 'Christopher' },
- { x: -126230400000, y: 27861, name: 'Christopher' },
- { x: -94694400000, y: 29436, name: 'Christopher' },
- { x: -63158400000, y: 31463, name: 'Christopher' },
- { x: -31536000000, y: 35718, name: 'Christopher' },
- { x: 0, y: 41758, name: 'Christopher' },
- { x: 31536000000, y: 48172, name: 'Christopher' },
- { x: 63072000000, y: 52092, name: 'Christopher' },
- { x: 94694400000, y: 48217, name: 'Christopher' },
- { x: 126230400000, y: 48476, name: 'Christopher' },
- { x: 157766400000, y: 46438, name: 'Christopher' },
- { x: 189302400000, y: 45086, name: 'Christopher' },
- { x: 220924800000, y: 46610, name: 'Christopher' },
- { x: 252460800000, y: 47107, name: 'Christopher' },
- { x: 283996800000, y: 50514, name: 'Christopher' },
- { x: 315532800000, y: 48969, name: 'Christopher' },
- { x: 347155200000, y: 50108, name: 'Christopher' },
- { x: 378691200000, y: 59055, name: 'Christopher' },
- { x: 410227200000, y: 59188, name: 'Christopher' },
- { x: 441763200000, y: 59859, name: 'Christopher' },
- { x: 473385600000, y: 59516, name: 'Christopher' },
- { x: 504921600000, y: 56633, name: 'Christopher' },
- { x: 536457600000, y: 54466, name: 'Christopher' },
- { x: 567993600000, y: 52996, name: 'Christopher' },
- { x: 599616000000, y: 53205, name: 'Christopher' },
- { x: 631152000000, y: 52322, name: 'Christopher' },
- { x: 662688000000, y: 47109, name: 'Christopher' },
- { x: 694224000000, y: 42470, name: 'Christopher' },
- { x: 725846400000, y: 38257, name: 'Christopher' },
- { x: 757382400000, y: 34823, name: 'Christopher' },
- { x: 788918400000, y: 32728, name: 'Christopher' },
- { x: 820454400000, y: 30988, name: 'Christopher' },
- { x: 852076800000, y: 29179, name: 'Christopher' },
- { x: 883612800000, y: 27083, name: 'Christopher' },
- { x: 915148800000, y: 25700, name: 'Christopher' },
- { x: 946684800000, y: 24959, name: 'Christopher' },
- { x: 978307200000, y: 23180, name: 'Christopher' },
- { x: 1009843200000, y: 21731, name: 'Christopher' },
- { x: 1041379200000, y: 20793, name: 'Christopher' },
- { x: 1072915200000, y: 19739, name: 'Christopher' },
- { x: 1104537600000, y: 19190, name: 'Christopher' },
- { x: 1136073600000, y: 19674, name: 'Christopher' },
- { x: 1167609600000, y: 19986, name: 'Christopher' },
- { x: 1199145600000, y: 17771, name: 'Christopher' },
- { x: -157766400000, y: 67646, name: 'David' },
- { x: -126230400000, y: 66207, name: 'David' },
- { x: -94694400000, y: 66581, name: 'David' },
- { x: -63158400000, y: 63531, name: 'David' },
- { x: -31536000000, y: 63502, name: 'David' },
- { x: 0, y: 61570, name: 'David' },
- { x: 31536000000, y: 52948, name: 'David' },
- { x: 63072000000, y: 46218, name: 'David' },
- { x: 94694400000, y: 40968, name: 'David' },
- { x: 126230400000, y: 41654, name: 'David' },
- { x: 157766400000, y: 39019, name: 'David' },
- { x: 189302400000, y: 39165, name: 'David' },
- { x: 220924800000, y: 40407, name: 'David' },
- { x: 252460800000, y: 40533, name: 'David' },
- { x: 283996800000, y: 41898, name: 'David' },
- { x: 315532800000, y: 41743, name: 'David' },
- { x: 347155200000, y: 40486, name: 'David' },
- { x: 378691200000, y: 40283, name: 'David' },
- { x: 410227200000, y: 39048, name: 'David' },
- { x: 441763200000, y: 38346, name: 'David' },
- { x: 473385600000, y: 38395, name: 'David' },
- { x: 504921600000, y: 37021, name: 'David' },
- { x: 536457600000, y: 36672, name: 'David' },
- { x: 567993600000, y: 35214, name: 'David' },
- { x: 599616000000, y: 35139, name: 'David' },
- { x: 631152000000, y: 33661, name: 'David' },
- { x: 662688000000, y: 30347, name: 'David' },
- { x: 694224000000, y: 28344, name: 'David' },
- { x: 725846400000, y: 26947, name: 'David' },
- { x: 757382400000, y: 24784, name: 'David' },
- { x: 788918400000, y: 22967, name: 'David' },
- { x: 820454400000, y: 22941, name: 'David' },
- { x: 852076800000, y: 21824, name: 'David' },
- { x: 883612800000, y: 20816, name: 'David' },
- { x: 915148800000, y: 20267, name: 'David' },
- { x: 946684800000, y: 19695, name: 'David' },
- { x: 978307200000, y: 19281, name: 'David' },
- { x: 1009843200000, y: 18600, name: 'David' },
- { x: 1041379200000, y: 18557, name: 'David' },
- { x: 1072915200000, y: 18315, name: 'David' },
- { x: 1104537600000, y: 18017, name: 'David' },
- { x: 1136073600000, y: 17510, name: 'David' },
- { x: 1167609600000, y: 17400, name: 'David' },
- { x: 1199145600000, y: 16049, name: 'David' },
- { x: -157766400000, y: 67506, name: 'James' },
- { x: -126230400000, y: 65036, name: 'James' },
- { x: -94694400000, y: 61554, name: 'James' },
- { x: -63158400000, y: 60584, name: 'James' },
- { x: -31536000000, y: 59824, name: 'James' },
- { x: 0, y: 61597, name: 'James' },
- { x: 31536000000, y: 54463, name: 'James' },
- { x: 63072000000, y: 46960, name: 'James' },
- { x: 94694400000, y: 42782, name: 'James' },
- { x: 126230400000, y: 41258, name: 'James' },
- { x: 157766400000, y: 39471, name: 'James' },
- { x: 189302400000, y: 38203, name: 'James' },
- { x: 220924800000, y: 39916, name: 'James' },
- { x: 252460800000, y: 39783, name: 'James' },
- { x: 283996800000, y: 39237, name: 'James' },
- { x: 315532800000, y: 39185, name: 'James' },
- { x: 347155200000, y: 38176, name: 'James' },
- { x: 378691200000, y: 38750, name: 'James' },
- { x: 410227200000, y: 36228, name: 'James' },
- { x: 441763200000, y: 35728, name: 'James' },
- { x: 473385600000, y: 35750, name: 'James' },
- { x: 504921600000, y: 33955, name: 'James' },
- { x: 536457600000, y: 32552, name: 'James' },
- { x: 567993600000, y: 32418, name: 'James' },
- { x: 599616000000, y: 32658, name: 'James' },
- { x: 631152000000, y: 32288, name: 'James' },
- { x: 662688000000, y: 30460, name: 'James' },
- { x: 694224000000, y: 28450, name: 'James' },
- { x: 725846400000, y: 26193, name: 'James' },
- { x: 757382400000, y: 24706, name: 'James' },
- { x: 788918400000, y: 22691, name: 'James' },
- { x: 820454400000, y: 21122, name: 'James' },
- { x: 852076800000, y: 20368, name: 'James' },
- { x: 883612800000, y: 19651, name: 'James' },
- { x: 915148800000, y: 18508, name: 'James' },
- { x: 946684800000, y: 17939, name: 'James' },
- { x: 978307200000, y: 17023, name: 'James' },
- { x: 1009843200000, y: 16905, name: 'James' },
- { x: 1041379200000, y: 16832, name: 'James' },
- { x: 1072915200000, y: 16459, name: 'James' },
- { x: 1104537600000, y: 16046, name: 'James' },
- { x: 1136073600000, y: 16139, name: 'James' },
- { x: 1167609600000, y: 15821, name: 'James' },
- { x: 1199145600000, y: 14920, name: 'James' },
- { x: -157766400000, y: 71390, name: 'John' },
- { x: -126230400000, y: 64858, name: 'John' },
- { x: -94694400000, y: 61480, name: 'John' },
- { x: -63158400000, y: 60754, name: 'John' },
- { x: -31536000000, y: 58644, name: 'John' },
- { x: 0, y: 58348, name: 'John' },
- { x: 31536000000, y: 51382, name: 'John' },
- { x: 63072000000, y: 43028, name: 'John' },
- { x: 94694400000, y: 39061, name: 'John' },
- { x: 126230400000, y: 37553, name: 'John' },
- { x: 157766400000, y: 34970, name: 'John' },
- { x: 189302400000, y: 33876, name: 'John' },
- { x: 220924800000, y: 34103, name: 'John' },
- { x: 252460800000, y: 33895, name: 'John' },
- { x: 283996800000, y: 35305, name: 'John' },
- { x: 315532800000, y: 35131, name: 'John' },
- { x: 347155200000, y: 34761, name: 'John' },
- { x: 378691200000, y: 34560, name: 'John' },
- { x: 410227200000, y: 33047, name: 'John' },
- { x: 441763200000, y: 32484, name: 'John' },
- { x: 473385600000, y: 31397, name: 'John' },
- { x: 504921600000, y: 30103, name: 'John' },
- { x: 536457600000, y: 29462, name: 'John' },
- { x: 567993600000, y: 29301, name: 'John' },
- { x: 599616000000, y: 29751, name: 'John' },
- { x: 631152000000, y: 29011, name: 'John' },
- { x: 662688000000, y: 27727, name: 'John' },
- { x: 694224000000, y: 26156, name: 'John' },
- { x: 725846400000, y: 24918, name: 'John' },
- { x: 757382400000, y: 24119, name: 'John' },
- { x: 788918400000, y: 23174, name: 'John' },
- { x: 820454400000, y: 22104, name: 'John' },
- { x: 852076800000, y: 21330, name: 'John' },
- { x: 883612800000, y: 20556, name: 'John' },
- { x: 915148800000, y: 20280, name: 'John' },
- { x: 946684800000, y: 20032, name: 'John' },
- { x: 978307200000, y: 18839, name: 'John' },
- { x: 1009843200000, y: 17400, name: 'John' },
- { x: 1041379200000, y: 17170, name: 'John' },
- { x: 1072915200000, y: 16381, name: 'John' },
- { x: 1104537600000, y: 15692, name: 'John' },
- { x: 1136073600000, y: 15083, name: 'John' },
- { x: 1167609600000, y: 14348, name: 'John' },
- { x: 1199145600000, y: 13110, name: 'John' },
- { x: -157766400000, y: 80812, name: 'Michael' },
- { x: -126230400000, y: 79709, name: 'Michael' },
- { x: -94694400000, y: 82204, name: 'Michael' },
- { x: -63158400000, y: 81785, name: 'Michael' },
- { x: -31536000000, y: 84893, name: 'Michael' },
- { x: 0, y: 85015, name: 'Michael' },
- { x: 31536000000, y: 77321, name: 'Michael' },
- { x: 63072000000, y: 71197, name: 'Michael' },
- { x: 94694400000, y: 67598, name: 'Michael' },
- { x: 126230400000, y: 67304, name: 'Michael' },
- { x: 157766400000, y: 68149, name: 'Michael' },
- { x: 189302400000, y: 66686, name: 'Michael' },
- { x: 220924800000, y: 67344, name: 'Michael' },
- { x: 252460800000, y: 66875, name: 'Michael' },
- { x: 283996800000, y: 67473, name: 'Michael' },
- { x: 315532800000, y: 68375, name: 'Michael' },
- { x: 347155200000, y: 68467, name: 'Michael' },
- { x: 378691200000, y: 67904, name: 'Michael' },
- { x: 410227200000, y: 67708, name: 'Michael' },
- { x: 441763200000, y: 67457, name: 'Michael' },
- { x: 473385600000, y: 64667, name: 'Michael' },
- { x: 504921600000, y: 63959, name: 'Michael' },
- { x: 536457600000, y: 63442, name: 'Michael' },
- { x: 567993600000, y: 63924, name: 'Michael' },
- { x: 599616000000, y: 65233, name: 'Michael' },
- { x: 631152000000, y: 65138, name: 'Michael' },
- { x: 662688000000, y: 60646, name: 'Michael' },
- { x: 694224000000, y: 54216, name: 'Michael' },
- { x: 725846400000, y: 49443, name: 'Michael' },
- { x: 757382400000, y: 44361, name: 'Michael' },
- { x: 788918400000, y: 41311, name: 'Michael' },
- { x: 820454400000, y: 38284, name: 'Michael' },
- { x: 852076800000, y: 37459, name: 'Michael' },
- { x: 883612800000, y: 36525, name: 'Michael' },
- { x: 915148800000, y: 33820, name: 'Michael' },
- { x: 946684800000, y: 31956, name: 'Michael' },
- { x: 978307200000, y: 29612, name: 'Michael' },
- { x: 1009843200000, y: 28156, name: 'Michael' },
- { x: 1041379200000, y: 27031, name: 'Michael' },
- { x: 1072915200000, y: 25418, name: 'Michael' },
- { x: 1104537600000, y: 23678, name: 'Michael' },
- { x: 1136073600000, y: 22498, name: 'Michael' },
- { x: 1167609600000, y: 21805, name: 'Michael' },
- { x: 1199145600000, y: 20271, name: 'Michael' },
-];
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/data/data2.js b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/data/data2.js
deleted file mode 100644
index 26be2718a..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/data/data2.js
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* eslint-disable sort-keys, no-magic-numbers */
-export default [
- { x: -157766400000, y: 24703, snapshot: 'Last year' },
- { x: -126230400000, y: 27861, snapshot: 'Last year' },
- { x: -94694400000, y: 29436, snapshot: 'Last year' },
- { x: -63158400000, y: 31463, snapshot: 'Last year' },
- { x: -31536000000, y: 35718, snapshot: 'Last year' },
- { x: 0, y: 41758, snapshot: 'Last year' },
- { x: 31536000000, y: 48172, snapshot: 'Last year' },
- { x: 63072000000, y: 52092, snapshot: 'Last year' },
- { x: 94694400000, y: 48217, snapshot: 'Last year' },
- { x: 126230400000, y: 48476, snapshot: 'Last year' },
- { x: 157766400000, y: 46438, snapshot: 'Last year' },
- { x: 189302400000, y: 45086, snapshot: 'Last year' },
- { x: 220924800000, y: 46610, snapshot: 'Last year' },
- { x: 252460800000, y: 47107, snapshot: 'Last year' },
- { x: 283996800000, y: 50514, snapshot: 'Last year' },
- { x: 315532800000, y: 48969, snapshot: 'Last year' },
- { x: 347155200000, y: 50108, snapshot: 'Last year' },
- { x: 378691200000, y: 59055, snapshot: 'Last year' },
- { x: 410227200000, y: 59188, snapshot: 'Last year' },
- { x: 441763200000, y: 59859, snapshot: 'Last year' },
- { x: 473385600000, y: 59516, snapshot: 'Last year' },
- { x: 504921600000, y: 56633, snapshot: 'Last year' },
- { x: 536457600000, y: 54466, snapshot: 'Last year' },
- { x: 567993600000, y: 52996, snapshot: 'Last year' },
- { x: 599616000000, y: 53205, snapshot: 'Last year' },
- { x: 631152000000, y: 52322, snapshot: 'Last year' },
- { x: 662688000000, y: 47109, snapshot: 'Last year' },
- { x: 694224000000, y: 42470, snapshot: 'Last year' },
- { x: 725846400000, y: 38257, snapshot: 'Last year' },
- { x: 757382400000, y: 34823, snapshot: 'Last year' },
- { x: 788918400000, y: 32728, snapshot: 'Last year' },
- { x: 820454400000, y: 30988, snapshot: 'Last year' },
- { x: 852076800000, y: 29179, snapshot: 'Last year' },
- { x: 883612800000, y: 27083, snapshot: 'Last year' },
- { x: 915148800000, y: 25700, snapshot: 'Last year' },
- { x: 946684800000, y: 24959, snapshot: 'Last year' },
- { x: 978307200000, y: 23180, snapshot: 'Last year' },
- { x: 1009843200000, y: 21731, snapshot: 'Last year' },
- { x: 1041379200000, y: 20793, snapshot: 'Last year' },
- { x: 1072915200000, y: 19739, snapshot: 'Last year' },
- { x: 1104537600000, y: 19190, snapshot: 'Last year' },
- { x: 1136073600000, y: 19674, snapshot: 'Last year' },
- { x: 1167609600000, y: 19986, snapshot: 'Last year' },
- { x: 1199145600000, y: 17771, snapshot: 'Last year' },
- { x: -157766400000, y: 80812, snapshot: 'Current' },
- { x: -126230400000, y: 79709, snapshot: 'Current' },
- { x: -94694400000, y: 82204, snapshot: 'Current' },
- { x: -63158400000, y: 81785, snapshot: 'Current' },
- { x: -31536000000, y: 84893, snapshot: 'Current' },
- { x: 0, y: 85015, snapshot: 'Current' },
- { x: 31536000000, y: 77321, snapshot: 'Current' },
- { x: 63072000000, y: 71197, snapshot: 'Current' },
- { x: 94694400000, y: 67598, snapshot: 'Current' },
- { x: 126230400000, y: 67304, snapshot: 'Current' },
- { x: 157766400000, y: 68149, snapshot: 'Current' },
- { x: 189302400000, y: 66686, snapshot: 'Current' },
- { x: 220924800000, y: 67344, snapshot: 'Current' },
- { x: 252460800000, y: 66875, snapshot: 'Current' },
- { x: 283996800000, y: 67473, snapshot: 'Current' },
- { x: 315532800000, y: 68375, snapshot: 'Current' },
- { x: 347155200000, y: 68467, snapshot: 'Current' },
- { x: 378691200000, y: 67904, snapshot: 'Current' },
- { x: 410227200000, y: 67708, snapshot: 'Current' },
- { x: 441763200000, y: 67457, snapshot: 'Current' },
- { x: 473385600000, y: 64667, snapshot: 'Current' },
- { x: 504921600000, y: 63959, snapshot: 'Current' },
- { x: 536457600000, y: 63442, snapshot: 'Current' },
- { x: 567993600000, y: 63924, snapshot: 'Current' },
- { x: 599616000000, y: 65233, snapshot: 'Current' },
- { x: 631152000000, y: 65138, snapshot: 'Current' },
- { x: 662688000000, y: 60646, snapshot: 'Current' },
- { x: 694224000000, y: 54216, snapshot: 'Current' },
- { x: 725846400000, y: 49443, snapshot: 'Current' },
- { x: 757382400000, y: 44361, snapshot: 'Current' },
- { x: 788918400000, y: 41311, snapshot: 'Current' },
- { x: 820454400000, y: 38284, snapshot: 'Current' },
- { x: 852076800000, y: 37459, snapshot: 'Current' },
- { x: 883612800000, y: 36525, snapshot: 'Current' },
- { x: 915148800000, y: 33820, snapshot: 'Current' },
- { x: 946684800000, y: 31956, snapshot: 'Current' },
- { x: 978307200000, y: 29612, snapshot: 'Current' },
- { x: 1009843200000, y: 28156, snapshot: 'Current' },
- { x: 1041379200000, y: 27031, snapshot: 'Current' },
- { x: 1072915200000, y: 25418, snapshot: 'Current' },
- { x: 1104537600000, y: 23678, snapshot: 'Current' },
- { x: 1136073600000, y: 22498, snapshot: 'Current' },
- { x: 1167609600000, y: 21805, snapshot: 'Current' },
- { x: 1199145600000, y: 20271, snapshot: 'Current' },
-];
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/data/legacyData.js b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/data/legacyData.js
deleted file mode 100644
index 5d43d8e4b..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/data/legacyData.js
+++ /dev/null
@@ -1,927 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* eslint-disable sort-keys, no-magic-numbers */
-export default [
- {
- key: ['Christopher'],
- values: [
- {
- x: -157766400000.0,
- y: 24703,
- },
- {
- x: -126230400000.0,
- y: 27861,
- },
- {
- x: -94694400000.0,
- y: 29436,
- },
- {
- x: -63158400000.0,
- y: 31463,
- },
- {
- x: -31536000000.0,
- y: 35718,
- },
- {
- x: 0.0,
- y: 41758,
- },
- {
- x: 31536000000.0,
- y: 48172,
- },
- {
- x: 63072000000.0,
- y: 52092,
- },
- {
- x: 94694400000.0,
- y: 48217,
- },
- {
- x: 126230400000.0,
- y: 48476,
- },
- {
- x: 157766400000.0,
- y: 46438,
- },
- {
- x: 189302400000.0,
- y: 45086,
- },
- {
- x: 220924800000.0,
- y: 46610,
- },
- {
- x: 252460800000.0,
- y: 47107,
- },
- {
- x: 283996800000.0,
- y: 50514,
- },
- {
- x: 315532800000.0,
- y: 48969,
- },
- {
- x: 347155200000.0,
- y: 50108,
- },
- {
- x: 378691200000.0,
- y: 59055,
- },
- {
- x: 410227200000.0,
- y: 59188,
- },
- {
- x: 441763200000.0,
- y: 59859,
- },
- {
- x: 473385600000.0,
- y: 59516,
- },
- {
- x: 504921600000.0,
- y: 56633,
- },
- {
- x: 536457600000.0,
- y: 54466,
- },
- {
- x: 567993600000.0,
- y: 52996,
- },
- {
- x: 599616000000.0,
- y: 53205,
- },
- {
- x: 631152000000.0,
- y: 52322,
- },
- {
- x: 662688000000.0,
- y: 47109,
- },
- {
- x: 694224000000.0,
- y: 42470,
- },
- {
- x: 725846400000.0,
- y: 38257,
- },
- {
- x: 757382400000.0,
- y: 34823,
- },
- {
- x: 788918400000.0,
- y: 32728,
- },
- {
- x: 820454400000.0,
- y: 30988,
- },
- {
- x: 852076800000.0,
- y: 29179,
- },
- {
- x: 883612800000.0,
- y: 27083,
- },
- {
- x: 915148800000.0,
- y: 25700,
- },
- {
- x: 946684800000.0,
- y: 24959,
- },
- {
- x: 978307200000.0,
- y: 23180,
- },
- {
- x: 1009843200000.0,
- y: 21731,
- },
- {
- x: 1041379200000.0,
- y: 20793,
- },
- {
- x: 1072915200000.0,
- y: 19739,
- },
- {
- x: 1104537600000.0,
- y: 19190,
- },
- {
- x: 1136073600000.0,
- y: 19674,
- },
- {
- x: 1167609600000.0,
- y: 19986,
- },
- {
- x: 1199145600000.0,
- y: 17771,
- },
- ],
- },
- {
- key: ['David'],
- values: [
- {
- x: -157766400000.0,
- y: 67646,
- },
- {
- x: -126230400000.0,
- y: 66207,
- },
- {
- x: -94694400000.0,
- y: 66581,
- },
- {
- x: -63158400000.0,
- y: 63531,
- },
- {
- x: -31536000000.0,
- y: 63502,
- },
- {
- x: 0.0,
- y: 61570,
- },
- {
- x: 31536000000.0,
- y: 52948,
- },
- {
- x: 63072000000.0,
- y: 46218,
- },
- {
- x: 94694400000.0,
- y: 40968,
- },
- {
- x: 126230400000.0,
- y: 41654,
- },
- {
- x: 157766400000.0,
- y: 39019,
- },
- {
- x: 189302400000.0,
- y: 39165,
- },
- {
- x: 220924800000.0,
- y: 40407,
- },
- {
- x: 252460800000.0,
- y: 40533,
- },
- {
- x: 283996800000.0,
- y: 41898,
- },
- {
- x: 315532800000.0,
- y: 41743,
- },
- {
- x: 347155200000.0,
- y: 40486,
- },
- {
- x: 378691200000.0,
- y: 40283,
- },
- {
- x: 410227200000.0,
- y: 39048,
- },
- {
- x: 441763200000.0,
- y: 38346,
- },
- {
- x: 473385600000.0,
- y: 38395,
- },
- {
- x: 504921600000.0,
- y: 37021,
- },
- {
- x: 536457600000.0,
- y: 36672,
- },
- {
- x: 567993600000.0,
- y: 35214,
- },
- {
- x: 599616000000.0,
- y: 35139,
- },
- {
- x: 631152000000.0,
- y: 33661,
- },
- {
- x: 662688000000.0,
- y: 30347,
- },
- {
- x: 694224000000.0,
- y: 28344,
- },
- {
- x: 725846400000.0,
- y: 26947,
- },
- {
- x: 757382400000.0,
- y: 24784,
- },
- {
- x: 788918400000.0,
- y: 22967,
- },
- {
- x: 820454400000.0,
- y: 22941,
- },
- {
- x: 852076800000.0,
- y: 21824,
- },
- {
- x: 883612800000.0,
- y: 20816,
- },
- {
- x: 915148800000.0,
- y: 20267,
- },
- {
- x: 946684800000.0,
- y: 19695,
- },
- {
- x: 978307200000.0,
- y: 19281,
- },
- {
- x: 1009843200000.0,
- y: 18600,
- },
- {
- x: 1041379200000.0,
- y: 18557,
- },
- {
- x: 1072915200000.0,
- y: 18315,
- },
- {
- x: 1104537600000.0,
- y: 18017,
- },
- {
- x: 1136073600000.0,
- y: 17510,
- },
- {
- x: 1167609600000.0,
- y: 17400,
- },
- {
- x: 1199145600000.0,
- y: 16049,
- },
- ],
- },
- {
- key: ['James'],
- values: [
- {
- x: -157766400000.0,
- y: 67506,
- },
- {
- x: -126230400000.0,
- y: 65036,
- },
- {
- x: -94694400000.0,
- y: 61554,
- },
- {
- x: -63158400000.0,
- y: 60584,
- },
- {
- x: -31536000000.0,
- y: 59824,
- },
- {
- x: 0.0,
- y: 61597,
- },
- {
- x: 31536000000.0,
- y: 54463,
- },
- {
- x: 63072000000.0,
- y: 46960,
- },
- {
- x: 94694400000.0,
- y: 42782,
- },
- {
- x: 126230400000.0,
- y: 41258,
- },
- {
- x: 157766400000.0,
- y: 39471,
- },
- {
- x: 189302400000.0,
- y: 38203,
- },
- {
- x: 220924800000.0,
- y: 39916,
- },
- {
- x: 252460800000.0,
- y: 39783,
- },
- {
- x: 283996800000.0,
- y: 39237,
- },
- {
- x: 315532800000.0,
- y: 39185,
- },
- {
- x: 347155200000.0,
- y: 38176,
- },
- {
- x: 378691200000.0,
- y: 38750,
- },
- {
- x: 410227200000.0,
- y: 36228,
- },
- {
- x: 441763200000.0,
- y: 35728,
- },
- {
- x: 473385600000.0,
- y: 35750,
- },
- {
- x: 504921600000.0,
- y: 33955,
- },
- {
- x: 536457600000.0,
- y: 32552,
- },
- {
- x: 567993600000.0,
- y: 32418,
- },
- {
- x: 599616000000.0,
- y: 32658,
- },
- {
- x: 631152000000.0,
- y: 32288,
- },
- {
- x: 662688000000.0,
- y: 30460,
- },
- {
- x: 694224000000.0,
- y: 28450,
- },
- {
- x: 725846400000.0,
- y: 26193,
- },
- {
- x: 757382400000.0,
- y: 24706,
- },
- {
- x: 788918400000.0,
- y: 22691,
- },
- {
- x: 820454400000.0,
- y: 21122,
- },
- {
- x: 852076800000.0,
- y: 20368,
- },
- {
- x: 883612800000.0,
- y: 19651,
- },
- {
- x: 915148800000.0,
- y: 18508,
- },
- {
- x: 946684800000.0,
- y: 17939,
- },
- {
- x: 978307200000.0,
- y: 17023,
- },
- {
- x: 1009843200000.0,
- y: 16905,
- },
- {
- x: 1041379200000.0,
- y: 16832,
- },
- {
- x: 1072915200000.0,
- y: 16459,
- },
- {
- x: 1104537600000.0,
- y: 16046,
- },
- {
- x: 1136073600000.0,
- y: 16139,
- },
- {
- x: 1167609600000.0,
- y: 15821,
- },
- {
- x: 1199145600000.0,
- y: 14920,
- },
- ],
- },
- {
- key: ['John'],
- values: [
- {
- x: -157766400000.0,
- y: 71390,
- },
- {
- x: -126230400000.0,
- y: 64858,
- },
- {
- x: -94694400000.0,
- y: 61480,
- },
- {
- x: -63158400000.0,
- y: 60754,
- },
- {
- x: -31536000000.0,
- y: 58644,
- },
- {
- x: 0.0,
- y: 58348,
- },
- {
- x: 31536000000.0,
- y: 51382,
- },
- {
- x: 63072000000.0,
- y: 43028,
- },
- {
- x: 94694400000.0,
- y: 39061,
- },
- {
- x: 126230400000.0,
- y: 37553,
- },
- {
- x: 157766400000.0,
- y: 34970,
- },
- {
- x: 189302400000.0,
- y: 33876,
- },
- {
- x: 220924800000.0,
- y: 34103,
- },
- {
- x: 252460800000.0,
- y: 33895,
- },
- {
- x: 283996800000.0,
- y: 35305,
- },
- {
- x: 315532800000.0,
- y: 35131,
- },
- {
- x: 347155200000.0,
- y: 34761,
- },
- {
- x: 378691200000.0,
- y: 34560,
- },
- {
- x: 410227200000.0,
- y: 33047,
- },
- {
- x: 441763200000.0,
- y: 32484,
- },
- {
- x: 473385600000.0,
- y: 31397,
- },
- {
- x: 504921600000.0,
- y: 30103,
- },
- {
- x: 536457600000.0,
- y: 29462,
- },
- {
- x: 567993600000.0,
- y: 29301,
- },
- {
- x: 599616000000.0,
- y: 29751,
- },
- {
- x: 631152000000.0,
- y: 29011,
- },
- {
- x: 662688000000.0,
- y: 27727,
- },
- {
- x: 694224000000.0,
- y: 26156,
- },
- {
- x: 725846400000.0,
- y: 24918,
- },
- {
- x: 757382400000.0,
- y: 24119,
- },
- {
- x: 788918400000.0,
- y: 23174,
- },
- {
- x: 820454400000.0,
- y: 22104,
- },
- {
- x: 852076800000.0,
- y: 21330,
- },
- {
- x: 883612800000.0,
- y: 20556,
- },
- {
- x: 915148800000.0,
- y: 20280,
- },
- {
- x: 946684800000.0,
- y: 20032,
- },
- {
- x: 978307200000.0,
- y: 18839,
- },
- {
- x: 1009843200000.0,
- y: 17400,
- },
- {
- x: 1041379200000.0,
- y: 17170,
- },
- {
- x: 1072915200000.0,
- y: 16381,
- },
- {
- x: 1104537600000.0,
- y: 15692,
- },
- {
- x: 1136073600000.0,
- y: 15083,
- },
- {
- x: 1167609600000.0,
- y: 14348,
- },
- {
- x: 1199145600000.0,
- y: 13110,
- },
- ],
- },
- {
- key: ['Michael'],
- values: [
- {
- x: -157766400000.0,
- y: 80812,
- },
- {
- x: -126230400000.0,
- y: 79709,
- },
- {
- x: -94694400000.0,
- y: 82204,
- },
- {
- x: -63158400000.0,
- y: 81785,
- },
- {
- x: -31536000000.0,
- y: 84893,
- },
- {
- x: 0.0,
- y: 85015,
- },
- {
- x: 31536000000.0,
- y: 77321,
- },
- {
- x: 63072000000.0,
- y: 71197,
- },
- {
- x: 94694400000.0,
- y: 67598,
- },
- {
- x: 126230400000.0,
- y: 67304,
- },
- {
- x: 157766400000.0,
- y: 68149,
- },
- {
- x: 189302400000.0,
- y: 66686,
- },
- {
- x: 220924800000.0,
- y: 67344,
- },
- {
- x: 252460800000.0,
- y: 66875,
- },
- {
- x: 283996800000.0,
- y: 67473,
- },
- {
- x: 315532800000.0,
- y: 68375,
- },
- {
- x: 347155200000.0,
- y: 68467,
- },
- {
- x: 378691200000.0,
- y: 67904,
- },
- {
- x: 410227200000.0,
- y: 67708,
- },
- {
- x: 441763200000.0,
- y: 67457,
- },
- {
- x: 473385600000.0,
- y: 64667,
- },
- {
- x: 504921600000.0,
- y: 63959,
- },
- {
- x: 536457600000.0,
- y: 63442,
- },
- {
- x: 567993600000.0,
- y: 63924,
- },
- {
- x: 599616000000.0,
- y: 65233,
- },
- {
- x: 631152000000.0,
- y: 65138,
- },
- {
- x: 662688000000.0,
- y: 60646,
- },
- {
- x: 694224000000.0,
- y: 54216,
- },
- {
- x: 725846400000.0,
- y: 49443,
- },
- {
- x: 757382400000.0,
- y: 44361,
- },
- {
- x: 788918400000.0,
- y: 41311,
- },
- {
- x: 820454400000.0,
- y: 38284,
- },
- {
- x: 852076800000.0,
- y: 37459,
- },
- {
- x: 883612800000.0,
- y: 36525,
- },
- {
- x: 915148800000.0,
- y: 33820,
- },
- {
- x: 946684800000.0,
- y: 31956,
- },
- {
- x: 978307200000.0,
- y: 29612,
- },
- {
- x: 1009843200000.0,
- y: 28156,
- },
- {
- x: 1041379200000.0,
- y: 27031,
- },
- {
- x: 1072915200000.0,
- y: 25418,
- },
- {
- x: 1104537600000.0,
- y: 23678,
- },
- {
- x: 1136073600000.0,
- y: 22498,
- },
- {
- x: 1167609600000.0,
- y: 21805,
- },
- {
- x: 1199145600000.0,
- y: 20271,
- },
- ],
- },
-];
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/basic.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/basic.tsx
deleted file mode 100644
index 4659a5c88..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/basic.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from 'react';
-import { SuperChart } from '@superset-ui/core';
-import { radios } from '@storybook/addon-knobs';
-import data from '../data/data';
-import { LINE_PLUGIN_TYPE } from '../constants';
-import dummyDatasource from '../../../../../shared/dummyDatasource';
-
-export default () => (
-
-);
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/flush.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/flush.tsx
deleted file mode 100644
index aff3f5cfa..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/flush.tsx
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from 'react';
-import { SuperChart } from '@superset-ui/core';
-import { radios } from '@storybook/addon-knobs';
-import rawData from '../data/data';
-import { LINE_PLUGIN_TYPE } from '../constants';
-import dummyDatasource from '../../../../../shared/dummyDatasource';
-
-const MIN_TIME = new Date(Date.UTC(1980, 0, 1)).getTime();
-const MAX_TIME = new Date(Date.UTC(2000, 1, 1)).getTime();
-const data = rawData.filter(({ x }) => x >= MIN_TIME && x <= MAX_TIME);
-
-export default () => (
- <>
-
- ,
-
- >
-);
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/legacy.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/legacy.tsx
deleted file mode 100644
index 4899e6465..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/legacy.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from 'react';
-import { SuperChart } from '@superset-ui/core';
-import data from '../data/legacyData';
-import { LINE_PLUGIN_LEGACY_TYPE } from '../constants';
-import dummyDatasource from '../../../../../shared/dummyDatasource';
-
-export default () => (
- <>
-
- ,
-
- >
-);
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/missing.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/missing.tsx
deleted file mode 100644
index 04d96a3e5..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/missing.tsx
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from 'react';
-import { SuperChart, seedRandom } from '@superset-ui/core';
-import data from '../data/data';
-import { LINE_PLUGIN_TYPE } from '../constants';
-import dummyDatasource from '../../../../../shared/dummyDatasource';
-
-const missingData = data.map(({ y, ...rest }) => ({
- ...rest,
- y: seedRandom() < 0.25 ? null : y,
-}));
-
-const missing = () => (
-
-);
-
-export default missing;
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/query.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/query.tsx
deleted file mode 100644
index bd0cbd5cb..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/query.tsx
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { LINE_PLUGIN_TYPE, LINE_PLUGIN_LEGACY_TYPE } from '../constants';
-import createQueryStory from '../../../../../shared/components/createQueryStory';
-
-export default createQueryStory({
- choices: {
- 'Line Chart - Legacy API': {
- chartType: LINE_PLUGIN_LEGACY_TYPE,
- formData: {
- datasource: '3__table',
- viz_type: 'line',
- url_params: {},
- granularity_sqla: 'ds',
- time_grain_sqla: 'P1D',
- time_range: '100 years ago : now',
- metrics: ['sum__num'],
- adhoc_filters: [],
- groupby: [],
- limit: 25,
- row_limit: 50000,
- },
- },
- 'Line Chart - /api/v1/query': {
- chartType: LINE_PLUGIN_TYPE,
- formData: {
- viz_type: LINE_PLUGIN_TYPE,
- datasource: '3__table',
- granularity_sqla: 'ds',
- time_grain_sqla: 'P1D',
- time_range: '100 years ago : now',
- metrics: ['sum__num'],
- limit: 25,
- row_limit: 50000,
- encoding: {
- x: {
- field: '__timestamp',
- type: 'temporal',
- format: '%Y',
- scale: {
- type: 'time',
- },
- axis: {
- title: 'Time',
- },
- },
- y: {
- field: 'sum__num',
- type: 'quantitative',
- scale: {
- type: 'linear',
- },
- axis: {
- title: 'Number of Babies',
- },
- },
- stroke: {
- field: 'gender',
- type: 'nominal',
- legend: true,
- },
- },
- },
- },
- },
-});
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/timeShift.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/timeShift.tsx
deleted file mode 100644
index 12a85fe28..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/timeShift.tsx
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from 'react';
-import { SuperChart, useTheme } from '@superset-ui/core';
-import data from '../data/data2';
-import { LINE_PLUGIN_TYPE } from '../constants';
-import dummyDatasource from '../../../../../shared/dummyDatasource';
-
-export default () => {
- const theme = useTheme();
- return (
-
- );
-};
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/Stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/Stories.tsx
deleted file mode 100644
index ec3135e6d..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/Stories.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import {
- ScatterPlotChartPlugin,
- LegacyScatterPlotChartPlugin,
-} from '@superset-ui/preset-chart-xy';
-import { withKnobs } from '@storybook/addon-knobs';
-import {
- SCATTER_PLOT_PLUGIN_TYPE,
- SCATTER_PLOT_PLUGIN_LEGACY_TYPE,
-} from './constants';
-
-new LegacyScatterPlotChartPlugin()
- .configure({ key: SCATTER_PLOT_PLUGIN_LEGACY_TYPE })
- .register();
-new ScatterPlotChartPlugin()
- .configure({ key: SCATTER_PLOT_PLUGIN_TYPE })
- .register();
-
-export default {
- title: 'Chart Plugins/preset-chart-xy/ScatterPlot',
- decorators: [withKnobs],
-};
-
-export { default as basic } from './stories/basic';
-export { default as bubble } from './stories/bubble';
-export { default as legacy } from './stories/legacy';
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/constants.ts b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/constants.ts
deleted file mode 100644
index 3b1ffbf01..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/constants.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-export const SCATTER_PLOT_PLUGIN_TYPE = 'v2-scatter-plot';
-export const SCATTER_PLOT_PLUGIN_LEGACY_TYPE = 'v2-scatter-plot/legacy';
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/data/data.ts b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/data/data.ts
deleted file mode 100644
index ee5856772..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/data/data.ts
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* eslint-disable sort-keys, no-magic-numbers */
-export default [
- {
- country_name: 'China',
- region: 'East Asia & Pacific',
- sum__SP_POP_TOTL: 1344130000,
- sum__SP_RUR_TOTL_ZS: 49.427,
- sum__SP_DYN_LE00_IN: 75.042,
- },
- {
- country_name: 'Indonesia',
- region: 'East Asia & Pacific',
- sum__SP_POP_TOTL: 244808254,
- sum__SP_RUR_TOTL_ZS: 49.288,
- sum__SP_DYN_LE00_IN: 70.3915609756,
- },
- {
- country_name: 'Japan',
- region: 'East Asia & Pacific',
- sum__SP_POP_TOTL: 127817277,
- sum__SP_RUR_TOTL_ZS: 8.752,
- sum__SP_DYN_LE00_IN: 82.5912195122,
- },
- {
- country_name: 'Philippines',
- region: 'East Asia & Pacific',
- sum__SP_POP_TOTL: 94501233,
- sum__SP_RUR_TOTL_ZS: 54.983,
- sum__SP_DYN_LE00_IN: 68.3914878049,
- },
- {
- country_name: 'Vietnam',
- region: 'East Asia & Pacific',
- sum__SP_POP_TOTL: 87840000,
- sum__SP_RUR_TOTL_ZS: 68.971,
- sum__SP_DYN_LE00_IN: 75.457902439,
- },
- {
- country_name: 'Thailand',
- region: 'East Asia & Pacific',
- sum__SP_POP_TOTL: 66902958,
- sum__SP_RUR_TOTL_ZS: 54.606,
- sum__SP_DYN_LE00_IN: 74.008902439,
- },
- {
- country_name: 'Myanmar',
- region: 'East Asia & Pacific',
- sum__SP_POP_TOTL: 52125411,
- sum__SP_RUR_TOTL_ZS: 68.065,
- sum__SP_DYN_LE00_IN: 64.7612439024,
- },
- {
- country_name: 'India',
- region: 'South Asia',
- sum__SP_POP_TOTL: 1247446011,
- sum__SP_RUR_TOTL_ZS: 68.724,
- sum__SP_DYN_LE00_IN: 65.9584878049,
- },
- {
- country_name: 'Pakistan',
- region: 'South Asia',
- sum__SP_POP_TOTL: 173669648,
- sum__SP_RUR_TOTL_ZS: 62.993,
- sum__SP_DYN_LE00_IN: 66.2838780488,
- },
- {
- country_name: 'Bangladesh',
- region: 'South Asia',
- sum__SP_POP_TOTL: 153405612,
- sum__SP_RUR_TOTL_ZS: 68.775,
- sum__SP_DYN_LE00_IN: 69.891804878,
- },
- {
- country_name: 'United States',
- region: 'North America',
- sum__SP_POP_TOTL: 311721632,
- sum__SP_RUR_TOTL_ZS: 19.06,
- sum__SP_DYN_LE00_IN: 78.6414634146,
- },
- {
- country_name: 'Brazil',
- region: 'Latin America & Caribbean',
- sum__SP_POP_TOTL: 200517584,
- sum__SP_RUR_TOTL_ZS: 15.377,
- sum__SP_DYN_LE00_IN: 73.3473658537,
- },
- {
- country_name: 'Mexico',
- region: 'Latin America & Caribbean',
- sum__SP_POP_TOTL: 120365271,
- sum__SP_RUR_TOTL_ZS: 21.882,
- sum__SP_DYN_LE00_IN: 76.9141707317,
- },
- {
- country_name: 'Nigeria',
- region: 'Sub-Saharan Africa',
- sum__SP_POP_TOTL: 163770669,
- sum__SP_RUR_TOTL_ZS: 55.638,
- sum__SP_DYN_LE00_IN: 51.7102439024,
- },
- {
- country_name: 'Ethiopia',
- region: 'Sub-Saharan Africa',
- sum__SP_POP_TOTL: 89858696,
- sum__SP_RUR_TOTL_ZS: 82.265,
- sum__SP_DYN_LE00_IN: 62.2528536585,
- },
- {
- country_name: 'Congo, Dem. Rep.',
- region: 'Sub-Saharan Africa',
- sum__SP_POP_TOTL: 68087376,
- sum__SP_RUR_TOTL_ZS: 59.558,
- sum__SP_DYN_LE00_IN: 49.3007073171,
- },
- {
- country_name: 'South Africa',
- region: 'Sub-Saharan Africa',
- sum__SP_POP_TOTL: 51553479,
- sum__SP_RUR_TOTL_ZS: 37.254,
- sum__SP_DYN_LE00_IN: 55.2956585366,
- },
- {
- country_name: 'Russian Federation',
- region: 'Europe & Central Asia',
- sum__SP_POP_TOTL: 142960868,
- sum__SP_RUR_TOTL_ZS: 26.268,
- sum__SP_DYN_LE00_IN: 69.6585365854,
- },
- {
- country_name: 'Germany',
- region: 'Europe & Central Asia',
- sum__SP_POP_TOTL: 81797673,
- sum__SP_RUR_TOTL_ZS: 25.512,
- sum__SP_DYN_LE00_IN: 80.7414634146,
- },
- {
- country_name: 'Turkey',
- region: 'Europe & Central Asia',
- sum__SP_POP_TOTL: 73199372,
- sum__SP_RUR_TOTL_ZS: 28.718,
- sum__SP_DYN_LE00_IN: 74.5404878049,
- },
- {
- country_name: 'France',
- region: 'Europe & Central Asia',
- sum__SP_POP_TOTL: 65342776,
- sum__SP_RUR_TOTL_ZS: 21.416,
- sum__SP_DYN_LE00_IN: 82.1146341463,
- },
- {
- country_name: 'United Kingdom',
- region: 'Europe & Central Asia',
- sum__SP_POP_TOTL: 63258918,
- sum__SP_RUR_TOTL_ZS: 18.43,
- sum__SP_DYN_LE00_IN: 80.9512195122,
- },
- {
- country_name: 'Italy',
- region: 'Europe & Central Asia',
- sum__SP_POP_TOTL: 59379449,
- sum__SP_RUR_TOTL_ZS: 31.556,
- sum__SP_DYN_LE00_IN: 82.187804878,
- },
- {
- country_name: 'Egypt, Arab Rep.',
- region: 'Middle East & North Africa',
- sum__SP_POP_TOTL: 83787634,
- sum__SP_RUR_TOTL_ZS: 57,
- sum__SP_DYN_LE00_IN: 70.6785609756,
- },
- {
- country_name: 'Iran, Islamic Rep.',
- region: 'Middle East & North Africa',
- sum__SP_POP_TOTL: 75184322,
- sum__SP_RUR_TOTL_ZS: 28.8,
- sum__SP_DYN_LE00_IN: 73.4493170732,
- },
-];
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/data/legacyData.ts b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/data/legacyData.ts
deleted file mode 100644
index 167f36303..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/data/legacyData.ts
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* eslint-disable sort-keys, no-magic-numbers */
-export default [
- {
- key: 'East Asia & Pacific',
- values: [
- {
- country_name: 'China',
- region: 'East Asia & Pacific',
- sum__SP_POP_TOTL: 1344130000.0,
- sum__SP_RUR_TOTL_ZS: 49.427,
- sum__SP_DYN_LE00_IN: 75.042,
- x: 49.427,
- y: 75.042,
- size: 1344130000.0,
- shape: 'circle',
- group: 'East Asia & Pacific',
- },
- {
- country_name: 'Indonesia',
- region: 'East Asia & Pacific',
- sum__SP_POP_TOTL: 244808254.0,
- sum__SP_RUR_TOTL_ZS: 49.288,
- sum__SP_DYN_LE00_IN: 70.3915609756,
- x: 49.288,
- y: 70.3915609756,
- size: 244808254.0,
- shape: 'circle',
- group: 'East Asia & Pacific',
- },
- {
- country_name: 'Japan',
- region: 'East Asia & Pacific',
- sum__SP_POP_TOTL: 127817277.0,
- sum__SP_RUR_TOTL_ZS: 8.752,
- sum__SP_DYN_LE00_IN: 82.5912195122,
- x: 8.752,
- y: 82.5912195122,
- size: 127817277.0,
- shape: 'circle',
- group: 'East Asia & Pacific',
- },
- {
- country_name: 'Philippines',
- region: 'East Asia & Pacific',
- sum__SP_POP_TOTL: 94501233.0,
- sum__SP_RUR_TOTL_ZS: 54.983,
- sum__SP_DYN_LE00_IN: 68.3914878049,
- x: 54.983,
- y: 68.3914878049,
- size: 94501233.0,
- shape: 'circle',
- group: 'East Asia & Pacific',
- },
- {
- country_name: 'Vietnam',
- region: 'East Asia & Pacific',
- sum__SP_POP_TOTL: 87840000.0,
- sum__SP_RUR_TOTL_ZS: 68.971,
- sum__SP_DYN_LE00_IN: 75.457902439,
- x: 68.971,
- y: 75.457902439,
- size: 87840000.0,
- shape: 'circle',
- group: 'East Asia & Pacific',
- },
- {
- country_name: 'Thailand',
- region: 'East Asia & Pacific',
- sum__SP_POP_TOTL: 66902958.0,
- sum__SP_RUR_TOTL_ZS: 54.606,
- sum__SP_DYN_LE00_IN: 74.008902439,
- x: 54.606,
- y: 74.008902439,
- size: 66902958.0,
- shape: 'circle',
- group: 'East Asia & Pacific',
- },
- {
- country_name: 'Myanmar',
- region: 'East Asia & Pacific',
- sum__SP_POP_TOTL: 52125411.0,
- sum__SP_RUR_TOTL_ZS: 68.065,
- sum__SP_DYN_LE00_IN: 64.7612439024,
- x: 68.065,
- y: 64.7612439024,
- size: 52125411.0,
- shape: 'circle',
- group: 'East Asia & Pacific',
- },
- ],
- },
- {
- key: 'South Asia',
- values: [
- {
- country_name: 'India',
- region: 'South Asia',
- sum__SP_POP_TOTL: 1247446011.0,
- sum__SP_RUR_TOTL_ZS: 68.724,
- sum__SP_DYN_LE00_IN: 65.9584878049,
- x: 68.724,
- y: 65.9584878049,
- size: 1247446011.0,
- shape: 'circle',
- group: 'South Asia',
- },
- {
- country_name: 'Pakistan',
- region: 'South Asia',
- sum__SP_POP_TOTL: 173669648.0,
- sum__SP_RUR_TOTL_ZS: 62.993,
- sum__SP_DYN_LE00_IN: 66.2838780488,
- x: 62.993,
- y: 66.2838780488,
- size: 173669648.0,
- shape: 'circle',
- group: 'South Asia',
- },
- {
- country_name: 'Bangladesh',
- region: 'South Asia',
- sum__SP_POP_TOTL: 153405612.0,
- sum__SP_RUR_TOTL_ZS: 68.775,
- sum__SP_DYN_LE00_IN: 69.891804878,
- x: 68.775,
- y: 69.891804878,
- size: 153405612.0,
- shape: 'circle',
- group: 'South Asia',
- },
- ],
- },
- {
- key: 'North America',
- values: [
- {
- country_name: 'United States',
- region: 'North America',
- sum__SP_POP_TOTL: 311721632.0,
- sum__SP_RUR_TOTL_ZS: 19.06,
- sum__SP_DYN_LE00_IN: 78.6414634146,
- x: 19.06,
- y: 78.6414634146,
- size: 311721632.0,
- shape: 'circle',
- group: 'North America',
- },
- ],
- },
- {
- key: 'Latin America & Caribbean',
- values: [
- {
- country_name: 'Brazil',
- region: 'Latin America & Caribbean',
- sum__SP_POP_TOTL: 200517584.0,
- sum__SP_RUR_TOTL_ZS: 15.377,
- sum__SP_DYN_LE00_IN: 73.3473658537,
- x: 15.377,
- y: 73.3473658537,
- size: 200517584.0,
- shape: 'circle',
- group: 'Latin America & Caribbean',
- },
- {
- country_name: 'Mexico',
- region: 'Latin America & Caribbean',
- sum__SP_POP_TOTL: 120365271.0,
- sum__SP_RUR_TOTL_ZS: 21.882,
- sum__SP_DYN_LE00_IN: 76.9141707317,
- x: 21.882,
- y: 76.9141707317,
- size: 120365271.0,
- shape: 'circle',
- group: 'Latin America & Caribbean',
- },
- ],
- },
- {
- key: 'Sub-Saharan Africa',
- values: [
- {
- country_name: 'Nigeria',
- region: 'Sub-Saharan Africa',
- sum__SP_POP_TOTL: 163770669.0,
- sum__SP_RUR_TOTL_ZS: 55.638,
- sum__SP_DYN_LE00_IN: 51.7102439024,
- x: 55.638,
- y: 51.7102439024,
- size: 163770669.0,
- shape: 'circle',
- group: 'Sub-Saharan Africa',
- },
- {
- country_name: 'Ethiopia',
- region: 'Sub-Saharan Africa',
- sum__SP_POP_TOTL: 89858696.0,
- sum__SP_RUR_TOTL_ZS: 82.265,
- sum__SP_DYN_LE00_IN: 62.2528536585,
- x: 82.265,
- y: 62.2528536585,
- size: 89858696.0,
- shape: 'circle',
- group: 'Sub-Saharan Africa',
- },
- {
- country_name: 'Congo, Dem. Rep.',
- region: 'Sub-Saharan Africa',
- sum__SP_POP_TOTL: 68087376.0,
- sum__SP_RUR_TOTL_ZS: 59.558,
- sum__SP_DYN_LE00_IN: 49.3007073171,
- x: 59.558,
- y: 49.3007073171,
- size: 68087376.0,
- shape: 'circle',
- group: 'Sub-Saharan Africa',
- },
- {
- country_name: 'South Africa',
- region: 'Sub-Saharan Africa',
- sum__SP_POP_TOTL: 51553479.0,
- sum__SP_RUR_TOTL_ZS: 37.254,
- sum__SP_DYN_LE00_IN: 55.2956585366,
- x: 37.254,
- y: 55.2956585366,
- size: 51553479.0,
- shape: 'circle',
- group: 'Sub-Saharan Africa',
- },
- ],
- },
- {
- key: 'Europe & Central Asia',
- values: [
- {
- country_name: 'Russian Federation',
- region: 'Europe & Central Asia',
- sum__SP_POP_TOTL: 142960868.0,
- sum__SP_RUR_TOTL_ZS: 26.268,
- sum__SP_DYN_LE00_IN: 69.6585365854,
- x: 26.268,
- y: 69.6585365854,
- size: 142960868.0,
- shape: 'circle',
- group: 'Europe & Central Asia',
- },
- {
- country_name: 'Germany',
- region: 'Europe & Central Asia',
- sum__SP_POP_TOTL: 81797673.0,
- sum__SP_RUR_TOTL_ZS: 25.512,
- sum__SP_DYN_LE00_IN: 80.7414634146,
- x: 25.512,
- y: 80.7414634146,
- size: 81797673.0,
- shape: 'circle',
- group: 'Europe & Central Asia',
- },
- {
- country_name: 'Turkey',
- region: 'Europe & Central Asia',
- sum__SP_POP_TOTL: 73199372.0,
- sum__SP_RUR_TOTL_ZS: 28.718,
- sum__SP_DYN_LE00_IN: 74.5404878049,
- x: 28.718,
- y: 74.5404878049,
- size: 73199372.0,
- shape: 'circle',
- group: 'Europe & Central Asia',
- },
- {
- country_name: 'France',
- region: 'Europe & Central Asia',
- sum__SP_POP_TOTL: 65342776.0,
- sum__SP_RUR_TOTL_ZS: 21.416,
- sum__SP_DYN_LE00_IN: 82.1146341463,
- x: 21.416,
- y: 82.1146341463,
- size: 65342776.0,
- shape: 'circle',
- group: 'Europe & Central Asia',
- },
- {
- country_name: 'United Kingdom',
- region: 'Europe & Central Asia',
- sum__SP_POP_TOTL: 63258918.0,
- sum__SP_RUR_TOTL_ZS: 18.43,
- sum__SP_DYN_LE00_IN: 80.9512195122,
- x: 18.43,
- y: 80.9512195122,
- size: 63258918.0,
- shape: 'circle',
- group: 'Europe & Central Asia',
- },
- {
- country_name: 'Italy',
- region: 'Europe & Central Asia',
- sum__SP_POP_TOTL: 59379449.0,
- sum__SP_RUR_TOTL_ZS: 31.556,
- sum__SP_DYN_LE00_IN: 82.187804878,
- x: 31.556,
- y: 82.187804878,
- size: 59379449.0,
- shape: 'circle',
- group: 'Europe & Central Asia',
- },
- ],
- },
- {
- key: 'Middle East & North Africa',
- values: [
- {
- country_name: 'Egypt, Arab Rep.',
- region: 'Middle East & North Africa',
- sum__SP_POP_TOTL: 83787634.0,
- sum__SP_RUR_TOTL_ZS: 57.0,
- sum__SP_DYN_LE00_IN: 70.6785609756,
- x: 57.0,
- y: 70.6785609756,
- size: 83787634.0,
- shape: 'circle',
- group: 'Middle East & North Africa',
- },
- {
- country_name: 'Iran, Islamic Rep.',
- region: 'Middle East & North Africa',
- sum__SP_POP_TOTL: 75184322.0,
- sum__SP_RUR_TOTL_ZS: 28.8,
- sum__SP_DYN_LE00_IN: 73.4493170732,
- x: 28.8,
- y: 73.4493170732,
- size: 75184322.0,
- shape: 'circle',
- group: 'Middle East & North Africa',
- },
- ],
- },
-];
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/stories/basic.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/stories/basic.tsx
deleted file mode 100644
index 42bc33130..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/stories/basic.tsx
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* eslint-disable no-magic-numbers, sort-keys */
-import * as React from 'react';
-import { SuperChart } from '@superset-ui/core';
-import { radios } from '@storybook/addon-knobs';
-import data from '../data/data';
-import { SCATTER_PLOT_PLUGIN_TYPE } from '../constants';
-import dummyDatasource from '../../../../../shared/dummyDatasource';
-
-export default () => (
-
-);
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/stories/bubble.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/stories/bubble.tsx
deleted file mode 100644
index 6a782b2b4..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/stories/bubble.tsx
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* eslint-disable no-magic-numbers, sort-keys */
-import * as React from 'react';
-import { SuperChart } from '@superset-ui/core';
-import { radios } from '@storybook/addon-knobs';
-import dummyDatasource from '../../../../../shared/dummyDatasource';
-import data from '../data/data';
-import { SCATTER_PLOT_PLUGIN_TYPE } from '../constants';
-
-export default () => (
-
-);
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/stories/legacy.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/stories/legacy.tsx
deleted file mode 100644
index 48e88dcf5..000000000
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/ScatterPlot/stories/legacy.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import * as React from 'react';
-import { SuperChart } from '@superset-ui/core';
-import data from '../data/legacyData';
-import { SCATTER_PLOT_PLUGIN_LEGACY_TYPE } from '../constants';
-import dummyDatasource from '../../../../../shared/dummyDatasource';
-
-export default () => (
-
-);
diff --git a/superset-frontend/plugins/preset-chart-xy/CHANGELOG.md b/superset-frontend/plugins/preset-chart-xy/CHANGELOG.md
deleted file mode 100644
index 866615dbb..000000000
--- a/superset-frontend/plugins/preset-chart-xy/CHANGELOG.md
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-# Change Log
-
-All notable changes to this project will be documented in this file.
-See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-
-# [0.18.0](https://github.com/apache-superset/superset-ui/compare/v0.17.87...v0.18.0) (2021-08-30)
-
-**Note:** Version bump only for package @superset-ui/preset-chart-xy
diff --git a/superset-frontend/plugins/preset-chart-xy/README.md b/superset-frontend/plugins/preset-chart-xy/README.md
deleted file mode 100644
index f76c8698e..000000000
--- a/superset-frontend/plugins/preset-chart-xy/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-## @superset-ui/preset-chart-xy
-
-[](https://www.npmjs.com/package/@superset-ui/preset-chart-xy)
-[](https://david-dm.org/apache-superset/superset-ui-plugins?path=packages/superset-ui-preset-chart-xy)
-
-This plugin provides basic charts on cartesian coordinates (Line, Box Plot) for Superset.
-
-> DISCLAIMER: It is still under heavy development and the APIs are subject to changes.
-
-### Usage
-
-Configure `key`, which can be any `string`, and register the plugin. This `key` will be used to
-lookup this chart throughout the app.
-
-```js
-import { BoxPlotChartPlugin } from '@superset-ui/preset-chart-xy';
-
-new BoxPlotChartPlugin().configure({ key: 'box-plot' }).register();
-```
-
-Then use it via `SuperChart`. See
-[storybook](https://apache-superset.github.io/superset-ui-plugins/?selectedKind=plugin-chart-box-plot)
-for more details.
-
-```js
-
-```
diff --git a/superset-frontend/plugins/preset-chart-xy/package.json b/superset-frontend/plugins/preset-chart-xy/package.json
deleted file mode 100644
index 92eecf898..000000000
--- a/superset-frontend/plugins/preset-chart-xy/package.json
+++ /dev/null
@@ -1,48 +0,0 @@
-{
- "name": "@superset-ui/preset-chart-xy",
- "version": "0.18.25",
- "description": "Superset Chart - XY",
- "sideEffects": [
- "*.css"
- ],
- "main": "lib/index.js",
- "module": "esm/index.js",
- "files": [
- "esm",
- "lib",
- "types"
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/apache/superset.git",
- "directory": "superset-frontend/packages/preset-chart-xy"
- },
- "keywords": [
- "superset"
- ],
- "author": "Superset",
- "license": "Apache-2.0",
- "bugs": {
- "url": "https://github.com/apache/superset/issues"
- },
- "homepage": "https://github.com/apache/superset/tree/master/superset-frontend/plugins/preset-chart-xy#readme",
- "publishConfig": {
- "access": "public"
- },
- "dependencies": {
- "@data-ui/theme": "^0.0.84",
- "@data-ui/xy-chart": "^0.0.84",
- "@vx/axis": "^0.0.198",
- "@vx/legend": "^0.0.198",
- "@vx/scale": "^0.0.197",
- "csstype": "^2.6.3",
- "encodable": "^0.7.6",
- "lodash": "^4.17.11",
- "reselect": "^4.0.0"
- },
- "peerDependencies": {
- "@superset-ui/chart-controls": "*",
- "@superset-ui/core": "*",
- "react": "^16.2"
- }
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/controlPanel.ts b/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/controlPanel.ts
deleted file mode 100644
index 10587b382..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/controlPanel.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import { t } from '@superset-ui/core';
-import { ControlPanelConfig, sections } from '@superset-ui/chart-controls';
-
-const config: ControlPanelConfig = {
- controlPanelSections: [
- sections.legacyRegularTime,
- {
- label: t('Query'),
- expanded: true,
- controlSetRows: [['metrics'], ['adhoc_filters'], ['groupby'], ['limit']],
- },
- {
- label: t('Chart Options'),
- expanded: true,
- controlSetRows: [
- ['color_scheme'],
- [
- {
- name: 'whisker_options',
- config: {
- type: 'SelectControl',
- freeForm: true,
- label: t('Whisker/outlier options'),
- default: 'Tukey',
- description: t(
- 'Determines how whiskers and outliers are calculated.',
- ),
- choices: [
- ['Tukey', t('Tukey')],
- ['Min/max (no outliers)', t('Min/max (no outliers)')],
- ['2/98 percentiles', t('2/98 percentiles')],
- ['9/91 percentiles', t('9/91 percentiles')],
- ],
- },
- },
- {
- name: 'x_ticks_layout',
- config: {
- type: 'SelectControl',
- label: t('X Tick Layout'),
- choices: [
- ['auto', t('auto')],
- ['flat', t('flat')],
- ['45°', '45°'],
- ['staggered', t('staggered')],
- ],
- default: 'auto',
- clearable: false,
- renderTrigger: true,
- description: t('The way the ticks are laid out on the X-axis'),
- },
- },
- ],
- ],
- },
- ],
-};
-
-export default config;
diff --git a/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/createMetadata.ts b/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/createMetadata.ts
deleted file mode 100644
index 5b602806b..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/createMetadata.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { t, ChartMetadata } from '@superset-ui/core';
-import thumbnail from './images/thumbnail.png';
-
-export default function createMetadata(useLegacyApi = false) {
- return new ChartMetadata({
- category: t('Distribution'),
- description: '',
- name: t('Box Plot'),
- thumbnail,
- useLegacyApi,
- });
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/images/thumbnail.png b/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/images/thumbnail.png
deleted file mode 100644
index d5eab92b0..000000000
Binary files a/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/images/thumbnail.png and /dev/null differ
diff --git a/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/index.ts b/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/index.ts
deleted file mode 100644
index 19b4ce139..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/index.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import { ChartPlugin } from '@superset-ui/core';
-import createMetadata from './createMetadata';
-import transformProps from './transformProps';
-import controlPanel from './controlPanel';
-import configureEncodable from '../configureEncodable';
-
-configureEncodable();
-
-export default class BoxPlotChartPlugin extends ChartPlugin {
- constructor() {
- super({
- loadChart: () => import('../components/BoxPlot/BoxPlot'),
- metadata: createMetadata(),
- transformProps,
- controlPanel,
- });
- }
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/legacy/index.ts b/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/legacy/index.ts
deleted file mode 100644
index 9423d9619..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/legacy/index.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import { ChartPlugin, QueryFormData } from '@superset-ui/core';
-import createMetadata from '../createMetadata';
-import transformProps, { LegacyBoxPlotChartProps } from './transformProps';
-import controlPanel from '../controlPanel';
-
-export default class BoxPlotChartPlugin extends ChartPlugin<
- QueryFormData,
- LegacyBoxPlotChartProps
-> {
- constructor() {
- super({
- loadChart: () => import('../../components/BoxPlot/BoxPlot'),
- metadata: createMetadata(true),
- transformProps,
- controlPanel,
- });
- }
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/legacy/transformProps.ts b/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/legacy/transformProps.ts
deleted file mode 100644
index 19fe42f27..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/legacy/transformProps.ts
+++ /dev/null
@@ -1,122 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import {
- ChartProps,
- LegacyQueryData,
- QueryFormData,
- QueryFormMetric,
-} from '@superset-ui/core';
-import {
- RawBoxPlotDataRow,
- BoxPlotDataRow,
-} from '../../components/BoxPlot/types';
-
-export type LegacyBoxPlotFormData = {
- groupby?: QueryFormData['groupby'];
- metrics?: QueryFormData['metrics'];
- colorScheme?: string;
-};
-
-export type LegacyBoxPlotChartProps = ChartProps & {
- formData: LegacyBoxPlotFormData;
- queriesData: (LegacyQueryData & {
- data?: RawBoxPlotDataRow[];
- })[];
-};
-
-export default function transformProps(chartProps: LegacyBoxPlotChartProps) {
- const { width, height, datasource, formData, queriesData } = chartProps;
- const { verboseMap = {} } = datasource;
- const { colorScheme, groupby = [], metrics = [] } = formData;
-
- const data = (queriesData[0].data || []).map(({ label, values }) => ({
- label,
- min: values.whisker_low,
- max: values.whisker_high,
- firstQuartile: values.Q1,
- median: values.Q2,
- thirdQuartile: values.Q3,
- outliers: values.outliers,
- }));
-
- const xAxisLabel = groupby.join('/');
-
- let metric: QueryFormMetric = '';
- if (Array.isArray(metrics)) {
- metric = metrics.length > 0 ? metrics[0] : '';
- } else {
- metric = metrics;
- }
- const yAxisLabel =
- typeof metric === 'string' ? verboseMap[metric] || metric : metric.label;
-
- const boxPlotValues = data.reduce((r: number[], e: BoxPlotDataRow) => {
- r.push(e.min, e.max, ...e.outliers);
-
- return r;
- }, []);
-
- const minBoxPlotValue = Math.min(...boxPlotValues);
- const maxBoxPlotValue = Math.max(...boxPlotValues);
- const valueDomain = [
- minBoxPlotValue - 0.1 * Math.abs(minBoxPlotValue),
- maxBoxPlotValue + 0.1 * Math.abs(maxBoxPlotValue),
- ];
-
- return {
- data,
- width,
- height,
- encoding: {
- x: {
- field: 'label',
- type: 'nominal',
- scale: {
- type: 'band',
- paddingInner: 0.15,
- paddingOuter: 0.3,
- },
- axis: {
- title: xAxisLabel,
- },
- },
- y: {
- field: 'value',
- type: 'quantitative',
- scale: {
- type: 'linear',
- domain: valueDomain,
- },
- axis: {
- title: yAxisLabel,
- numTicks: 5,
- format: 'SMART_NUMBER',
- },
- },
- color: {
- field: 'label',
- type: 'nominal',
- scale: {
- scheme: colorScheme,
- },
- legend: false,
- },
- },
- };
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/transformProps.ts b/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/transformProps.ts
deleted file mode 100644
index 6d0a41747..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/BoxPlot/transformProps.ts
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { pick } from 'lodash';
-import { ChartProps } from '@superset-ui/core';
-import { BoxPlotDataRow, RawBoxPlotDataRow } from '../components/BoxPlot/types';
-import { HookProps } from '../components/BoxPlot/BoxPlot';
-import { BoxPlotEncoding } from '../components/BoxPlot/Encoder';
-
-export default function transformProps(chartProps: ChartProps) {
- const { width, height, formData, queriesData } = chartProps;
- const { margin, theme } = formData;
- const encoding = formData.encoding as BoxPlotEncoding;
-
- const data = (queriesData[0].data as RawBoxPlotDataRow[]).map(
- ({ label, values }) => ({
- label,
- min: values.whisker_low,
- max: values.whisker_high,
- firstQuartile: values.Q1,
- median: values.Q2,
- thirdQuartile: values.Q3,
- outliers: values.outliers,
- }),
- );
-
- const isHorizontal = encoding.y.type === 'nominal';
-
- const boxPlotValues = data.reduce((r: number[], e: BoxPlotDataRow) => {
- r.push(e.min, e.max, ...e.outliers);
-
- return r;
- }, []);
-
- const minBoxPlotValue = Math.min(...boxPlotValues);
- const maxBoxPlotValue = Math.max(...boxPlotValues);
- const valueDomain = [
- minBoxPlotValue - 0.1 * Math.abs(minBoxPlotValue),
- maxBoxPlotValue + 0.1 * Math.abs(maxBoxPlotValue),
- ];
-
- if (isHorizontal) {
- if (encoding.x.scale) {
- encoding.x.scale.domain = valueDomain;
- } else {
- encoding.x.scale = { domain: valueDomain };
- }
- } else if (encoding.y.scale) {
- encoding.y.scale.domain = valueDomain;
- } else {
- encoding.y.scale = { domain: valueDomain };
- }
-
- const hooks = chartProps.hooks as HookProps;
-
- const fieldsFromHooks: (keyof HookProps)[] = [
- 'TooltipRenderer',
- 'LegendRenderer',
- 'LegendGroupRenderer',
- 'LegendItemRenderer',
- 'LegendItemMarkRenderer',
- 'LegendItemLabelRenderer',
- ];
-
- return {
- data,
- width,
- height,
- margin,
- theme,
- encoding,
- ...pick(hooks, fieldsFromHooks),
- };
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/Line/ChartFormData.ts b/superset-frontend/plugins/preset-chart-xy/src/Line/ChartFormData.ts
deleted file mode 100644
index e9d6749ad..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/Line/ChartFormData.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { QueryFormData } from '@superset-ui/core';
-import { FormDataProps } from '../components/Line/Line';
-
-type CombinedFormData = QueryFormData & FormDataProps;
-
-// eslint-disable-next-line no-undef
-export default CombinedFormData;
diff --git a/superset-frontend/plugins/preset-chart-xy/src/Line/buildQuery.ts b/superset-frontend/plugins/preset-chart-xy/src/Line/buildQuery.ts
deleted file mode 100644
index 788245126..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/Line/buildQuery.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { buildQueryContext } from '@superset-ui/core';
-import ChartFormData from './ChartFormData';
-import { lineEncoderFactory } from '../components/Line/Encoder';
-
-export default function buildQuery(formData: ChartFormData) {
- const queryContext = buildQueryContext(formData);
- const { encoding } = formData;
- const encoder = lineEncoderFactory.create(encoding);
-
- queryContext.queries.forEach(query => {
- const q = query;
- q.groupby = encoder.getGroupBys();
- // Enforce time-series mode
- q.is_timeseries = true;
- });
-
- return queryContext;
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/Line/createMetadata.ts b/superset-frontend/plugins/preset-chart-xy/src/Line/createMetadata.ts
deleted file mode 100644
index 1567210cf..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/Line/createMetadata.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { t, ChartMetadata } from '@superset-ui/core';
-import thumbnail from './images/thumbnail.png';
-
-export default function createMetadata(useLegacyApi = false) {
- return new ChartMetadata({
- description: '',
- name: t('Line Chart'),
- thumbnail,
- useLegacyApi,
- });
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/Line/images/thumbnail.png b/superset-frontend/plugins/preset-chart-xy/src/Line/images/thumbnail.png
deleted file mode 100644
index 67debacc6..000000000
Binary files a/superset-frontend/plugins/preset-chart-xy/src/Line/images/thumbnail.png and /dev/null differ
diff --git a/superset-frontend/plugins/preset-chart-xy/src/Line/images/thumbnailLarge.png b/superset-frontend/plugins/preset-chart-xy/src/Line/images/thumbnailLarge.png
deleted file mode 100644
index 67debacc6..000000000
Binary files a/superset-frontend/plugins/preset-chart-xy/src/Line/images/thumbnailLarge.png and /dev/null differ
diff --git a/superset-frontend/plugins/preset-chart-xy/src/Line/index.ts b/superset-frontend/plugins/preset-chart-xy/src/Line/index.ts
deleted file mode 100644
index d7d8fb7cd..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/Line/index.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { ChartPlugin } from '@superset-ui/core';
-import transformProps from './transformProps';
-import createMetadata from './createMetadata';
-import buildQuery from './buildQuery';
-import ChartFormData from './ChartFormData';
-
-export default class LineChartPlugin extends ChartPlugin {
- constructor() {
- super({
- buildQuery,
- loadChart: () => import('../components/Line/Line'),
- metadata: createMetadata(),
- transformProps,
- });
- }
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/Line/legacy/index.ts b/superset-frontend/plugins/preset-chart-xy/src/Line/legacy/index.ts
deleted file mode 100644
index 4b0ea28c8..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/Line/legacy/index.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { ChartPlugin } from '@superset-ui/core';
-import transformProps from './transformProps';
-import createMetadata from '../createMetadata';
-
-export default class LineChartPlugin extends ChartPlugin {
- constructor() {
- super({
- loadChart: () => import('../../components/Line/Line'),
- metadata: createMetadata(true),
- transformProps,
- });
- }
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/Line/legacy/transformProps.ts b/superset-frontend/plugins/preset-chart-xy/src/Line/legacy/transformProps.ts
deleted file mode 100644
index 8fbaaf4ce..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/Line/legacy/transformProps.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { ChartProps } from '@superset-ui/core';
-import { flatMap } from 'lodash';
-
-interface DataRow {
- key: string[];
- values: {
- x: number;
- y: number;
- }[];
-}
-
-export default function transformProps(chartProps: ChartProps) {
- const { width, height, formData, queriesData } = chartProps;
- const { colorScheme, xAxisLabel, xAxisFormat, yAxisLabel, yAxisFormat } =
- formData;
- const data = queriesData[0].data as DataRow[];
-
- return {
- data: flatMap(
- data.map((row: DataRow) =>
- row.values.map(v => ({
- ...v,
- name: row.key[0],
- })),
- ),
- ),
- width,
- height,
- encoding: {
- x: {
- field: 'x',
- type: 'temporal',
- format: xAxisFormat,
- scale: {
- type: 'time',
- },
- axis: {
- orient: 'bottom',
- title: xAxisLabel,
- },
- },
- y: {
- field: 'y',
- type: 'quantitative',
- format: yAxisFormat,
- scale: {
- type: 'linear',
- },
- axis: {
- orient: 'left',
- title: yAxisLabel,
- },
- },
- stroke: {
- field: 'name',
- type: 'nominal',
- scale: {
- scheme: colorScheme,
- },
- legend: true,
- },
- },
- };
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/Line/transformProps.ts b/superset-frontend/plugins/preset-chart-xy/src/Line/transformProps.ts
deleted file mode 100644
index 9a42617a6..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/Line/transformProps.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { pick } from 'lodash';
-import { ChartProps } from '@superset-ui/core';
-import { HookProps, FormDataProps } from '../components/Line/Line';
-
-export default function transformProps(chartProps: ChartProps) {
- const { width, height, queriesData } = chartProps;
- const { data } = queriesData[0];
- const formData = chartProps.formData as FormDataProps;
- const hooks = chartProps.hooks as HookProps;
-
- /**
- * Use type-check to make sure the field names are expected ones
- * and only pick these fields to pass to the chart.
- */
- const fieldsFromFormData: (keyof FormDataProps)[] = [
- 'encoding',
- 'margin',
- 'theme',
- ];
-
- const fieldsFromHooks: (keyof HookProps)[] = [
- 'TooltipRenderer',
- 'LegendRenderer',
- 'LegendGroupRenderer',
- 'LegendItemRenderer',
- 'LegendItemMarkRenderer',
- 'LegendItemLabelRenderer',
- ];
-
- return {
- data,
- width,
- height,
- ...pick(formData, fieldsFromFormData),
- ...pick(hooks, fieldsFromHooks),
- };
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/createMetadata.ts b/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/createMetadata.ts
deleted file mode 100644
index a4c0f717c..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/createMetadata.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { t, ChartMetadata } from '@superset-ui/core';
-import thumbnail from './images/thumbnail.png';
-
-export default function createMetadata(useLegacyApi = false) {
- return new ChartMetadata({
- description: '',
- name: t('Scatter Plot'),
- thumbnail,
- useLegacyApi,
- });
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/images/thumbnail.png b/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/images/thumbnail.png
deleted file mode 100644
index cd81fbd38..000000000
Binary files a/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/images/thumbnail.png and /dev/null differ
diff --git a/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/index.ts b/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/index.ts
deleted file mode 100644
index b9ac3ba5f..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/index.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { ChartPlugin } from '@superset-ui/core';
-import createMetadata from './createMetadata';
-import transformProps from './transformProps';
-
-export default class LineChartPlugin extends ChartPlugin {
- constructor() {
- super({
- loadChart: () => import('../components/ScatterPlot/ScatterPlot'),
- metadata: createMetadata(),
- transformProps,
- });
- }
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/legacy/index.ts b/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/legacy/index.ts
deleted file mode 100644
index a70f2a576..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/legacy/index.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { ChartPlugin } from '@superset-ui/core';
-import createMetadata from '../createMetadata';
-import transformProps from './transformProps';
-
-export default class LineChartPlugin extends ChartPlugin {
- constructor() {
- super({
- loadChart: () => import('../../components/ScatterPlot/ScatterPlot'),
- metadata: createMetadata(true),
- transformProps,
- });
- }
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/legacy/transformProps.ts b/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/legacy/transformProps.ts
deleted file mode 100644
index c60f03840..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/legacy/transformProps.ts
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { ChartProps } from '@superset-ui/core';
-import { flatMap } from 'lodash';
-
-interface Value {
- [key: string]: unknown;
-}
-
-type Key = keyof Value;
-
-interface DataRow {
- key: string[];
- values: Value[];
-}
-
-export default function transformProps(chartProps: ChartProps) {
- const { width, height, formData, queriesData } = chartProps;
- const {
- colorScheme,
- maxBubbleSize,
- showLegend,
- xAxisFormat,
- xAxisLabel,
- // TODO: These fields are not supported yet
- // xAxisShowminmax,
- // xLogScale,
- yAxisLabel,
- yAxisFormat,
- // TODO: These fields are not supported yet
- // yAxisShowminmax,
- // yLogScale,
- } = formData;
- const x = formData.x as Key;
- const y = formData.y as Key;
- const series = formData.series as Key;
- const size = formData.size as Key;
- const entity = formData.entity as Key;
- const data = queriesData[0].data as DataRow[];
-
- return {
- data: flatMap(
- data.map((row: DataRow) =>
- row.values.map(v => ({
- [x]: v[x],
- [y]: v[y],
- [series]: v[series],
- [size]: v[size],
- [entity]: v[entity],
- })),
- ),
- ),
- width,
- height,
- encoding: {
- x: {
- field: x,
- type: 'quantitive',
- format: xAxisFormat,
- scale: {
- type: 'linear',
- },
- axis: {
- orient: 'bottom',
- title: xAxisLabel,
- },
- },
- y: {
- field: y,
- type: 'quantitative',
- format: yAxisFormat,
- scale: {
- type: 'linear',
- },
- axis: {
- orient: 'left',
- title: yAxisLabel,
- },
- },
- size: {
- field: size,
- type: 'quantitative',
- scale: {
- type: 'linear',
- range: [0, maxBubbleSize],
- },
- },
- fill: {
- field: series,
- type: 'nominal',
- scale: {
- scheme: colorScheme,
- },
- legend: showLegend,
- },
- group: [{ field: entity }],
- },
- };
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/transformProps.ts b/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/transformProps.ts
deleted file mode 100644
index 727b88bfd..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/ScatterPlot/transformProps.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { pick } from 'lodash';
-import { ChartProps } from '@superset-ui/core';
-import { HookProps } from '../components/ScatterPlot/ScatterPlot';
-
-export default function transformProps(chartProps: ChartProps) {
- const { width, height, formData, queriesData } = chartProps;
- const { encoding, margin, theme } = formData;
- const { data } = queriesData[0];
- const hooks = chartProps.hooks as HookProps;
-
- const fieldsFromHooks: (keyof HookProps)[] = [
- 'TooltipRenderer',
- 'LegendRenderer',
- 'LegendGroupRenderer',
- 'LegendItemRenderer',
- 'LegendItemMarkRenderer',
- 'LegendItemLabelRenderer',
- ];
-
- return {
- data,
- width,
- height,
- encoding,
- margin,
- theme,
- ...pick(hooks, fieldsFromHooks),
- };
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/BoxPlot.tsx b/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/BoxPlot.tsx
deleted file mode 100644
index a6b99ed18..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/BoxPlot.tsx
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from 'react';
-import { BoxPlotSeries, XYChart } from '@data-ui/xy-chart';
-import { chartTheme, ChartTheme } from '@data-ui/theme';
-import { WithLegend, Margin, Dimension } from '@superset-ui/core';
-import { Dataset, PlainObject, isFieldDef } from 'encodable';
-import DefaultTooltipRenderer from './DefaultTooltipRenderer';
-import {
- BoxPlotEncodingConfig,
- BoxPlotEncoding,
- BoxPlotEncoder,
- boxPlotEncoderFactory,
-} from './Encoder';
-import createMarginSelector, {
- DEFAULT_MARGIN,
-} from '../../utils/createMarginSelector';
-import { BoxPlotDataRow } from './types';
-import convertScaleToDataUIScale from '../../utils/convertScaleToDataUIScaleShape';
-import createXYChartLayoutWithTheme from '../../utils/createXYChartLayoutWithTheme';
-import createRenderLegend from '../legend/createRenderLegend';
-import { LegendHooks } from '../legend/types';
-
-export interface TooltipProps {
- datum: BoxPlotDataRow;
- color: string;
- encoder: BoxPlotEncoder;
-}
-
-const defaultProps = {
- className: '',
- margin: DEFAULT_MARGIN,
- encoding: {},
- theme: chartTheme,
- TooltipRenderer: DefaultTooltipRenderer,
-} as const;
-
-export type HookProps = {
- TooltipRenderer?: React.ComponentType;
-} & LegendHooks;
-
-type Props = {
- className?: string;
- width: string | number;
- height: string | number;
- margin?: Margin;
- encoding?: Partial;
- data: Dataset;
- theme?: ChartTheme;
-} & HookProps &
- Readonly;
-
-export default class BoxPlot extends React.PureComponent {
- private createEncoder = boxPlotEncoderFactory(
- this.props.theme?.colors.darkGray,
- ).createSelector();
-
- private createMargin = createMarginSelector();
-
- static defaultProps = defaultProps;
-
- renderChart = (dim: Dimension) => {
- const { width, height } = dim;
- const { data, margin, theme, TooltipRenderer, encoding } = this.props;
- const encoder = this.createEncoder(encoding);
- const { channels } = encoder;
-
- const isHorizontal =
- isFieldDef(channels.y.definition) &&
- channels.y.definition.type === 'nominal';
-
- encoder.setDomainFromDataset(data);
-
- const layout = createXYChartLayoutWithTheme({
- width,
- height,
- margin: this.createMargin(margin),
- theme,
- xEncoder: channels.x,
- yEncoder: channels.y,
- });
-
- return layout.renderChartWithFrame((chartDim: Dimension) => (
- }
- theme={theme}
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- xScale={convertScaleToDataUIScale(channels.x.definition.scale as any)}
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- yScale={convertScaleToDataUIScale(channels.y.definition.scale as any)}
- >
- {layout.renderXAxis()}
- {layout.renderYAxis()}
- ({
- ...row,
- y: channels.y.getValueFromDatum(row),
- }))
- : data.map(row => ({
- ...row,
- x: channels.x.getValueFromDatum(row),
- }))
- }
- fill={(datum: PlainObject) =>
- channels.color.encodeDatum(datum, '#55acee')
- }
- fillOpacity={0.4}
- stroke={(datum: PlainObject) => channels.color.encodeDatum(datum)}
- strokeWidth={1}
- widthRatio={0.6}
- horizontal={isHorizontal}
- />
-
- ));
- };
-
- render() {
- const { className, data, encoding, width, height } = this.props;
-
- return (
-
- );
- }
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/DefaultTooltipRenderer.tsx b/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/DefaultTooltipRenderer.tsx
deleted file mode 100644
index 8585dd3bc..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/DefaultTooltipRenderer.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from 'react';
-import { isDefined, TooltipFrame, TooltipTable } from '@superset-ui/core';
-import { BoxPlotEncoder } from './Encoder';
-import { BoxPlotDataRow } from './types';
-
-export default function DefaultTooltipRenderer({
- datum,
- color,
- encoder,
-}: {
- datum: BoxPlotDataRow;
- color: string;
- encoder: BoxPlotEncoder;
-}) {
- const { label, min, max, median, firstQuartile, thirdQuartile, outliers } =
- datum;
- const { channels } = encoder;
-
- const { formatValue } = channels.y;
-
- const data: { key: string; valueColumn: number | string }[] = [];
- if (isDefined(min)) {
- data.push({ key: 'Min', valueColumn: formatValue(min) });
- }
- if (isDefined(max)) {
- data.push({ key: 'Max', valueColumn: formatValue(max) });
- }
- if (isDefined(median)) {
- data.push({ key: 'Median', valueColumn: formatValue(median) });
- }
- if (isDefined(firstQuartile)) {
- data.push({ key: '1st Quartile', valueColumn: formatValue(firstQuartile) });
- }
- if (isDefined(thirdQuartile)) {
- data.push({ key: '3rd Quartile', valueColumn: formatValue(thirdQuartile) });
- }
- if (isDefined(outliers) && outliers.length > 0) {
- data.push({ key: '# Outliers', valueColumn: outliers.length });
- }
-
- return (
-
-
- {label}
-
- {data.length > 0 && }
-
-
- );
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/Encoder.ts b/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/Encoder.ts
deleted file mode 100644
index 27cd33809..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/Encoder.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { createEncoderFactory, Encoder, DeriveEncoding } from 'encodable';
-
-export type BoxPlotEncodingConfig = {
- x: ['XBand', number];
- y: ['YBand', number];
- color: ['Color', string];
-};
-
-export const boxPlotEncoderFactory = (darkGray: string) =>
- createEncoderFactory({
- channelTypes: {
- x: 'XBand',
- y: 'YBand',
- color: 'Color',
- },
- defaultEncoding: {
- x: { field: 'x', type: 'nominal' },
- y: { field: 'y', type: 'quantitative' },
- color: { value: darkGray },
- },
- });
-
-export type BoxPlotEncoding = DeriveEncoding;
-
-export type BoxPlotEncoder = Encoder;
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/types.ts b/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/types.ts
deleted file mode 100644
index f4646661e..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/types.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-export interface RawBoxPlotDataRow {
- label: string;
- values: {
- Q1: number;
- Q2: number;
- Q3: number;
- outliers: number[];
- // eslint-disable-next-line camelcase
- whisker_high: number;
- // eslint-disable-next-line camelcase
- whisker_low: number;
- };
-}
-
-export interface BoxPlotDataRow {
- label: string;
- min: number;
- max: number;
- firstQuartile: number;
- median: number;
- thirdQuartile: number;
- outliers: number[];
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/Line/DefaultLegendItemMarkRenderer.tsx b/superset-frontend/plugins/preset-chart-xy/src/components/Line/DefaultLegendItemMarkRenderer.tsx
deleted file mode 100644
index 091cfa164..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/Line/DefaultLegendItemMarkRenderer.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React, { CSSProperties } from 'react';
-import { LegendItemMarkRendererProps } from '../legend/types';
-import { LineEncodingConfig } from './Encoder';
-
-const MARK_WIDTH = 12;
-const MARK_HEIGHT = 8;
-
-const MARK_STYLE: CSSProperties = { display: 'inline-block' };
-
-export default function DefaultLegendItemMarkRenderer({
- item,
-}: LegendItemMarkRendererProps) {
- return (
-
- );
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/Line/DefaultTooltipRenderer.tsx b/superset-frontend/plugins/preset-chart-xy/src/components/Line/DefaultTooltipRenderer.tsx
deleted file mode 100644
index ea061ec14..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/Line/DefaultTooltipRenderer.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from 'react';
-import { TooltipFrame, TooltipTable } from '@superset-ui/core';
-import { chartTheme } from '@data-ui/theme';
-import { TooltipProps } from './Line';
-
-const MARK_STYLE = { marginRight: 4 };
-
-export default function DefaultTooltipRenderer({
- allSeries,
- datum,
- encoder,
- series = {},
- theme = chartTheme,
-}: TooltipProps) {
- return (
-
- <>
-
- {encoder.channels.x.formatValue(datum.x)}
-
-
- {series && (
- series[key])
- .concat()
- .sort((a, b) => series[b.key].y - series[a.key].y)
- .map(({ key, stroke, strokeDasharray, strokeWidth }) => ({
- key,
- keyColumn: (
- <>
-
- {series[key] === datum ? {key} : key}
- >
- ),
- valueColumn: encoder.channels.y.formatValue(series[key].y),
- }))}
- />
- )}
- >
-
- );
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/Line/Encoder.ts b/superset-frontend/plugins/preset-chart-xy/src/components/Line/Encoder.ts
deleted file mode 100644
index 0efb2fcb7..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/Line/Encoder.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import Encoder from 'encodable/lib/encoders/Encoder';
-import createEncoderFactory from 'encodable/lib/encoders/createEncoderFactory';
-import {
- DeriveEncoding,
- DeriveChannelOutputs,
-} from 'encodable/lib/types/Encoding';
-
-export type LineEncodingConfig = {
- x: ['X', number];
- y: ['Y', number];
- fill: ['Category', boolean];
- stroke: ['Color', string];
- strokeDasharray: ['Category', string];
- strokeWidth: ['Numeric', number];
-};
-
-export const lineEncoderFactory = createEncoderFactory({
- channelTypes: {
- x: 'X',
- y: 'Y',
- fill: 'Category',
- stroke: 'Color',
- strokeDasharray: 'Category',
- strokeWidth: 'Numeric',
- },
- defaultEncoding: {
- x: { field: 'x', type: 'quantitative' },
- y: { field: 'y', type: 'quantitative' },
- fill: { value: false, legend: false },
- stroke: { value: '#222' }, // eslint-disable-line theme-colors/no-literal-colors
- strokeDasharray: { value: '' },
- strokeWidth: { value: 1 },
- },
-});
-
-export type LineEncoding = DeriveEncoding;
-
-export type LineEncoder = Encoder;
-
-export type LineChannelOutputs = DeriveChannelOutputs;
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/Line/Line.tsx b/superset-frontend/plugins/preset-chart-xy/src/components/Line/Line.tsx
deleted file mode 100644
index 465fae408..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/Line/Line.tsx
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React, { PureComponent } from 'react';
-import { kebabCase, groupBy, flatMap, uniqueId, values } from 'lodash';
-import {
- AreaSeries,
- LinearGradient,
- LineSeries,
- XYChart,
- CrossHair,
- WithTooltip,
-} from '@data-ui/xy-chart';
-import { chartTheme } from '@data-ui/theme';
-import { WithLegend, Margin, Dimension } from '@superset-ui/core';
-import { createSelector } from 'reselect';
-import { Dataset, PlainObject } from 'encodable';
-import DefaultTooltipRenderer from './DefaultTooltipRenderer';
-import createMarginSelector, {
- DEFAULT_MARGIN,
-} from '../../utils/createMarginSelector';
-import convertScaleToDataUIScale from '../../utils/convertScaleToDataUIScaleShape';
-import createXYChartLayoutWithTheme from '../../utils/createXYChartLayoutWithTheme';
-import createRenderLegend from '../legend/createRenderLegend';
-import { LegendHooks } from '../legend/types';
-import {
- lineEncoderFactory,
- LineEncoder,
- LineEncoding,
- LineEncodingConfig,
- LineChannelOutputs,
-} from './Encoder';
-import DefaultLegendItemMarkRenderer from './DefaultLegendItemMarkRenderer';
-
-export interface TooltipProps {
- encoder: LineEncoder;
- allSeries: Series[];
- datum: SeriesValue;
- series: {
- [key: string]: SeriesValue;
- };
- theme: typeof chartTheme;
-}
-
-const defaultProps = {
- className: '',
- encoding: {},
- LegendItemMarkRenderer: DefaultLegendItemMarkRenderer,
- margin: DEFAULT_MARGIN,
- theme: chartTheme,
- TooltipRenderer: DefaultTooltipRenderer,
-};
-
-/** Part of formData that is needed for rendering logic in this file */
-export type FormDataProps = {
- margin?: Margin;
- theme?: typeof chartTheme;
- encoding?: Partial;
-};
-
-export type HookProps = {
- TooltipRenderer?: React.ComponentType;
-} & LegendHooks;
-
-type Props = {
- className?: string;
- width: string | number;
- height: string | number;
- data: Dataset;
-} & HookProps &
- FormDataProps &
- Readonly;
-
-export interface Series {
- key: string;
- fill: LineChannelOutputs['fill'];
- stroke: LineChannelOutputs['stroke'];
- strokeDasharray: LineChannelOutputs['strokeDasharray'];
- strokeWidth: LineChannelOutputs['strokeWidth'];
- values: SeriesValue[];
-}
-
-export interface SeriesValue {
- x: number | Date;
- y: number;
- data: PlainObject;
- parent: Series;
-}
-
-const CIRCLE_STYLE = { strokeWidth: 1.5 };
-
-export default class LineChart extends PureComponent {
- private createEncoder = lineEncoderFactory.createSelector() as (
- encoding: Partial,
- ) => LineEncoder;
-
- private createAllSeries = createSelector(
- [
- (input: { encoder: LineEncoder; data: Dataset }) => input.encoder,
- input => input.data,
- ],
- (encoder, data) => {
- const { channels } = encoder;
- const fieldNames = encoder.getGroupBys();
-
- const groups = groupBy(data, row =>
- fieldNames.map(f => `${f}=${row[f]}`).join(','),
- );
-
- const allSeries = values(groups).map(seriesData => {
- const firstDatum = seriesData[0];
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
- const key = fieldNames.map(f => firstDatum[f]).join(',');
- const series: Series = {
- key: key.length === 0 ? channels.y.getTitle() : key,
- fill: channels.fill.encodeDatum(firstDatum, false),
- stroke: channels.stroke.encodeDatum(firstDatum, '#222'),
- strokeDasharray: channels.strokeDasharray.encodeDatum(firstDatum, ''),
- strokeWidth: channels.strokeWidth.encodeDatum(firstDatum, 1),
- values: [],
- };
-
- series.values = seriesData
- .map(v => ({
- x: channels.x.getValueFromDatum(v),
- y: channels.y.getValueFromDatum(v),
- data: v,
- parent: series,
- }))
- .sort((a: SeriesValue, b: SeriesValue) => {
- const aTime = a.x instanceof Date ? a.x.getTime() : a.x;
- const bTime = b.x instanceof Date ? b.x.getTime() : b.x;
-
- return aTime - bTime;
- });
-
- return series;
- });
-
- return allSeries;
- },
- );
-
- private createMargin = createMarginSelector();
-
- static defaultProps = defaultProps;
-
- // eslint-disable-next-line class-methods-use-this
- renderSeries(allSeries: Series[]) {
- const filledSeries = flatMap(
- allSeries
- .filter(({ fill }) => fill)
- .map(series => {
- const gradientId = uniqueId(kebabCase(`gradient-${series.key}`));
-
- return [
- ,
- ,
- ];
- }),
- );
-
- const unfilledSeries = allSeries
- .filter(({ fill }) => !fill)
- .map(series => (
-
- ));
-
- return filledSeries.concat(unfilledSeries);
- }
-
- renderChart = (dim: Dimension) => {
- const { width, height } = dim;
- const { data, margin, theme, TooltipRenderer, encoding } = this.props;
-
- const encoder = this.createEncoder(encoding);
- const { channels } = encoder;
-
- encoder.setDomainFromDataset(data);
-
- const allSeries = this.createAllSeries({ encoder, data });
-
- const layout = createXYChartLayoutWithTheme({
- width,
- height,
- margin: this.createMargin(margin),
- theme,
- xEncoder: channels.x,
- yEncoder: channels.y,
- });
-
- return layout.renderChartWithFrame((chartDim: Dimension) => (
- (
-
- )}
- >
- {({
- onMouseLeave,
- onMouseMove,
- tooltipData,
- }: {
- onMouseLeave: (...args: unknown[]) => void;
- onMouseMove: (...args: unknown[]) => void;
- tooltipData: { datum: { y?: number } };
- }) => (
-
- {layout.renderXAxis()}
- {layout.renderYAxis()}
- {this.renderSeries(allSeries)}
-
- d.y === tooltipData.datum.y ? d.parent.stroke : '#fff'
- }
- circleSize={(d: SeriesValue) =>
- d.y === tooltipData.datum.y ? 6 : 4
- }
- circleStroke={(d: SeriesValue) =>
- d.y === tooltipData.datum.y ? '#fff' : d.parent.stroke
- }
- circleStyles={CIRCLE_STYLE}
- stroke="#ccc"
- />
-
- )}
-
- ));
- };
-
- render() {
- const { className, data, width, height, encoding } = this.props;
-
- return (
-
- );
- }
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/DefaultTooltipRenderer.tsx b/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/DefaultTooltipRenderer.tsx
deleted file mode 100644
index 51cfdea25..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/DefaultTooltipRenderer.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from 'react';
-import { TooltipFrame, TooltipTable } from '@superset-ui/core';
-import { isFieldDef } from 'encodable';
-import { TooltipProps } from './ScatterPlot';
-
-export default function DefaultTooltipRenderer({
- datum,
- encoder,
-}: TooltipProps) {
- const { channels } = encoder;
- const { x, y, size, fill, stroke } = channels;
-
- const tooltipRows = [
- { key: 'x', keyColumn: x.getTitle(), valueColumn: x.formatDatum(datum) },
- { key: 'y', keyColumn: y.getTitle(), valueColumn: y.formatDatum(datum) },
- ];
-
- if (isFieldDef(fill.definition)) {
- tooltipRows.push({
- key: 'fill',
- keyColumn: fill.getTitle(),
- valueColumn: fill.formatDatum(datum),
- });
- }
- if (isFieldDef(stroke.definition)) {
- tooltipRows.push({
- key: 'stroke',
- keyColumn: stroke.getTitle(),
- valueColumn: stroke.formatDatum(datum),
- });
- }
- if (isFieldDef(size.definition)) {
- tooltipRows.push({
- key: 'size',
- keyColumn: size.getTitle(),
- valueColumn: size.formatDatum(datum),
- });
- }
- channels.group.forEach(g => {
- tooltipRows.push({
- key: `${g.name}`,
- keyColumn: g.getTitle(),
- valueColumn: g.formatDatum(datum),
- });
- });
- channels.tooltip.forEach(g => {
- tooltipRows.push({
- key: `${g.name}`,
- keyColumn: g.getTitle(),
- valueColumn: g.formatDatum(datum),
- });
- });
-
- return (
-
-
-
- );
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/Encoder.ts b/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/Encoder.ts
deleted file mode 100644
index 49d747603..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/Encoder.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import {
- createEncoderFactory,
- Encoder,
- DeriveEncoding,
- DeriveChannelOutputs,
-} from 'encodable';
-
-export type ScatterPlotEncodingConfig = {
- x: ['X', number];
- y: ['Y', number];
- fill: ['Color', string];
- group: ['Category', string, 'multiple'];
- size: ['Numeric', number];
- stroke: ['Color', string];
- tooltip: ['Text', string, 'multiple'];
-};
-
-export const scatterPlotEncoderFactory = (darkGray: string) =>
- createEncoderFactory({
- channelTypes: {
- x: 'X',
- y: 'Y',
- fill: 'Color',
- group: 'Category',
- size: 'Numeric',
- stroke: 'Color',
- tooltip: 'Text',
- },
- defaultEncoding: {
- x: { field: 'x', type: 'quantitative' },
- y: { field: 'y', type: 'quantitative' },
- fill: { value: darkGray },
- group: [],
- size: { value: 5 },
- stroke: { value: 'none' },
- tooltip: [],
- },
- });
-
-export type ScatterPlotEncoding = DeriveEncoding;
-
-export type ScatterPlotEncoder = Encoder;
-
-export type ScatterPlotChannelOutputs =
- DeriveChannelOutputs;
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/ScatterPlot.tsx b/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/ScatterPlot.tsx
deleted file mode 100644
index ddf259a83..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/ScatterPlot.tsx
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React, { PureComponent } from 'react';
-import { XYChart, PointSeries } from '@data-ui/xy-chart';
-import { chartTheme, ChartTheme } from '@data-ui/theme';
-import { WithLegend, Margin, Dimension } from '@superset-ui/core';
-import { isFieldDef, Dataset, PlainObject } from 'encodable';
-
-import {
- scatterPlotEncoderFactory,
- ScatterPlotEncoder,
- ScatterPlotEncodingConfig,
- ScatterPlotEncoding,
-} from './Encoder';
-import createMarginSelector, {
- DEFAULT_MARGIN,
-} from '../../utils/createMarginSelector';
-import DefaultTooltipRenderer from './DefaultTooltipRenderer';
-import convertScaleToDataUIScale from '../../utils/convertScaleToDataUIScaleShape';
-import createXYChartLayoutWithTheme from '../../utils/createXYChartLayoutWithTheme';
-import createRenderLegend from '../legend/createRenderLegend';
-import { LegendHooks } from '../legend/types';
-
-export interface TooltipProps {
- datum: PlainObject;
- encoder: ScatterPlotEncoder;
-}
-
-const defaultProps = {
- className: '',
- margin: DEFAULT_MARGIN,
- encoding: {},
- theme: chartTheme,
- TooltipRenderer: DefaultTooltipRenderer,
-} as const;
-
-export type HookProps = {
- TooltipRenderer?: React.ComponentType;
-} & LegendHooks;
-
-type Props = {
- className?: string;
- width: string | number;
- height: string | number;
- margin?: Margin;
- data: Dataset;
- encoding?: Partial;
- theme?: ChartTheme;
-} & HookProps &
- Readonly;
-
-export default class ScatterPlot extends PureComponent {
- private createEncoder = scatterPlotEncoderFactory(
- this.props.theme?.colors.darkGray,
- ).createSelector();
-
- private createMargin = createMarginSelector();
-
- static defaultProps = defaultProps;
-
- renderChart = (dim: Dimension) => {
- const { width, height } = dim;
- const { data, margin, theme, TooltipRenderer, encoding } = this.props;
- const encoder = this.createEncoder(encoding);
- const { channels } = encoder;
-
- encoder.setDomainFromDataset(data);
-
- const encodedData = data.map(d => ({
- x: channels.x.getValueFromDatum(d),
- y: channels.y.getValueFromDatum(d),
- ...d,
- }));
-
- const layout = createXYChartLayoutWithTheme({
- width,
- height,
- margin: this.createMargin(margin),
- theme,
- xEncoder: channels.x,
- yEncoder: channels.y,
- });
-
- return layout.renderChartWithFrame((chartDim: Dimension) => (
- (
-
- )}
- theme={theme}
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- xScale={convertScaleToDataUIScale(channels.x.definition.scale as any)}
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- yScale={convertScaleToDataUIScale(channels.y.definition.scale as any)}
- >
- {layout.renderXAxis()}
- {layout.renderYAxis()}
- channels.fill.encodeDatum(d)}
- fillOpacity={0.5}
- stroke={(d: PlainObject) => channels.stroke.encodeDatum(d)}
- size={(d: PlainObject) => channels.size.encodeDatum(d)}
- />
-
- ));
- };
-
- render() {
- const { className, data, width, height, encoding } = this.props;
-
- return (
-
- );
- }
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/legend/DefaultLegend.tsx b/superset-frontend/plugins/preset-chart-xy/src/components/legend/DefaultLegend.tsx
deleted file mode 100644
index 7cf623c5e..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/legend/DefaultLegend.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React, { CSSProperties, PureComponent } from 'react';
-import { EncodingConfig } from 'encodable';
-import { LegendRendererProps } from './types';
-import DefaultLegendGroup from './DefaultLegendGroup';
-
-const LEGEND_CONTAINER_STYLE: CSSProperties = {
- display: 'flex',
- flexBasis: 'auto',
- flexGrow: 1,
- flexShrink: 1,
- maxHeight: 100,
- overflowY: 'auto',
- position: 'relative',
-};
-
-export type Props = LegendRendererProps;
-
-export default class DefaultLegend<
- Config extends EncodingConfig,
-> extends PureComponent> {
- render() {
- const {
- groups,
- LegendGroupRenderer = DefaultLegendGroup,
- LegendItemRenderer,
- LegendItemMarkRenderer,
- LegendItemLabelRenderer,
- style,
- } = this.props;
-
- const combinedStyle =
- typeof style === 'undefined'
- ? LEGEND_CONTAINER_STYLE
- : { ...LEGEND_CONTAINER_STYLE, ...style };
-
- return (
-
- {groups
- .filter(group => 'items' in group && group.items.length > 0)
- .map(group => (
-
- ))}
-
- );
- }
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/legend/DefaultLegendGroup.tsx b/superset-frontend/plugins/preset-chart-xy/src/components/legend/DefaultLegendGroup.tsx
deleted file mode 100644
index e63ff9886..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/legend/DefaultLegendGroup.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React, { CSSProperties } from 'react';
-import { EncodingConfig } from 'encodable';
-import { LegendGroupRendererProps } from './types';
-import DefaultLegendItem from './DefaultLegendItem';
-
-const LEGEND_GROUP_STYLE: CSSProperties = {
- display: 'flex',
- flexBasis: 'auto',
- flexDirection: 'row',
- flexGrow: 1,
- flexShrink: 1,
- flexWrap: 'wrap',
- fontSize: '0.8em',
- justifyContent: 'flex-end',
- padding: 8,
-};
-
-export default function DefaultLegendGroupRenderer<
- Config extends EncodingConfig,
->({
- group,
- ItemRenderer = DefaultLegendItem,
- ItemMarkRenderer,
- ItemLabelRenderer,
- style,
-}: LegendGroupRendererProps) {
- const combinedStyle =
- typeof style === 'undefined'
- ? LEGEND_GROUP_STYLE
- : { ...LEGEND_GROUP_STYLE, ...style };
-
- return (
-
- {'items' in group &&
- group.items.map(item => (
-
- ))}
-
- );
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/legend/DefaultLegendItem.tsx b/superset-frontend/plugins/preset-chart-xy/src/components/legend/DefaultLegendItem.tsx
deleted file mode 100644
index 9d73ddea1..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/legend/DefaultLegendItem.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React, { CSSProperties } from 'react';
-import { LegendItem, LegendLabel } from '@vx/legend';
-import { EncodingConfig } from 'encodable';
-import { LegendItemRendererProps } from './types';
-
-const MARK_SIZE = 8;
-
-const MARK_STYLE: CSSProperties = { display: 'inline-block' };
-
-export default function DefaultLegendItem({
- group,
- item,
- MarkRenderer,
- LabelRenderer,
-}: LegendItemRendererProps) {
- return (
-
- {typeof MarkRenderer === 'undefined' ? (
-
- ) : (
-
- )}
- {typeof LabelRenderer === 'undefined' ? (
-
- {item.input}
-
- ) : (
-
- )}
-
- );
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/legend/createRenderLegend.tsx b/superset-frontend/plugins/preset-chart-xy/src/components/legend/createRenderLegend.tsx
deleted file mode 100644
index d1a45db97..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/legend/createRenderLegend.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from 'react';
-import { Encoder, EncodingConfig, Dataset } from 'encodable';
-import { LegendHooks } from './types';
-import DefaultLegend from './DefaultLegend';
-
-export default function createRenderLegend(
- encoder: Encoder,
- data: Dataset,
- props: LegendHooks,
-) {
- if (encoder.hasLegend()) {
- const {
- LegendRenderer = DefaultLegend,
- LegendGroupRenderer,
- LegendItemRenderer,
- LegendItemLabelRenderer,
- LegendItemMarkRenderer,
- } = props;
-
- return () => (
-
- );
- }
-
- return undefined;
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/legend/types.ts b/superset-frontend/plugins/preset-chart-xy/src/components/legend/types.ts
deleted file mode 100644
index 3d04d2037..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/components/legend/types.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { CSSProperties } from 'react';
-import {
- EncodingConfig,
- LegendGroupInformation,
- LegendItemInformation,
-} from 'encodable';
-
-export type LegendItemMarkRendererProps = {
- group: LegendGroupInformation;
- item: LegendItemInformation;
-};
-
-export type LegendItemMarkRendererType =
- React.ComponentType>;
-
-export type LegendItemLabelRendererProps =
- LegendItemMarkRendererProps;
-
-export type LegendItemLabelRendererType =
- React.ComponentType>;
-
-export type LegendItemRendererProps = {
- group: LegendGroupInformation;
- item: LegendItemInformation;
- MarkRenderer?: LegendItemMarkRendererType;
- LabelRenderer?: LegendItemLabelRendererType;
-};
-
-export type LegendItemRendererType =
- React.ComponentType>;
-
-export type LegendGroupRendererProps = {
- group: LegendGroupInformation;
- ItemRenderer?: LegendItemRendererType;
- ItemMarkRenderer?: LegendItemMarkRendererType;
- ItemLabelRenderer?: LegendItemLabelRendererType;
- style?: CSSProperties;
-};
-
-export type LegendGroupRendererType =
- React.ComponentType>;
-
-export type LegendRendererProps = {
- groups: LegendGroupInformation[];
- LegendGroupRenderer?: LegendGroupRendererType;
- LegendItemRenderer?: LegendItemRendererType;
- LegendItemMarkRenderer?: LegendItemMarkRendererType;
- LegendItemLabelRenderer?: LegendItemLabelRendererType;
- style?: CSSProperties;
-};
-
-export type LegendRendererType =
- React.ComponentType>;
-
-export type LegendHooks = {
- LegendRenderer?: LegendRendererType;
- LegendGroupRenderer?: LegendGroupRendererType;
- LegendItemRenderer?: LegendItemRendererType;
- LegendItemMarkRenderer?: LegendItemMarkRendererType;
- LegendItemLabelRenderer?: LegendItemLabelRendererType;
-};
diff --git a/superset-frontend/plugins/preset-chart-xy/src/configureEncodable.ts b/superset-frontend/plugins/preset-chart-xy/src/configureEncodable.ts
deleted file mode 100644
index 05a204128..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/configureEncodable.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import {
- Encodable,
- ColorSchemeResolver,
- TimeFormatResolver,
- CategoricalColorScaleResolver,
- defaultColorSchemeResolver,
- addPrefix,
-} from 'encodable';
-import {
- CategoricalColorNamespace,
- getCategoricalSchemeRegistry,
- getSequentialSchemeRegistry,
- getNumberFormatter,
- getTimeFormatter,
- LOCAL_PREFIX,
- getTimeFormatterRegistry,
-} from '@superset-ui/core';
-
-const timeFormat: TimeFormatResolver = ({
- format,
- formatInLocalTime = false,
-} = {}) => {
- const formatString = formatInLocalTime
- ? addPrefix(
- LOCAL_PREFIX,
- format ?? getTimeFormatterRegistry().getDefaultKey()!,
- )
- : format;
-
- return getTimeFormatter(formatString);
-};
-
-const colorSchemeResolver: ColorSchemeResolver = ({
- name,
- type = 'categorical',
-} = {}) => {
- if (type === 'sequential') {
- const scheme = getSequentialSchemeRegistry().get(name);
-
- return typeof scheme === 'undefined'
- ? scheme
- : { type: 'sequential', ...scheme };
- }
- if (type === 'categorical') {
- const scheme = getCategoricalSchemeRegistry().get(name);
-
- return typeof scheme === 'undefined'
- ? scheme
- : { type: 'categorical', ...scheme };
- }
- return defaultColorSchemeResolver({ name, type });
-};
-
-const colorScaleResolver: CategoricalColorScaleResolver = ({
- name,
- namespace,
-} = {}) => CategoricalColorNamespace.getScale(name, namespace);
-
-export default function configureEncodable() {
- Encodable.setNumberFormatResolver(getNumberFormatter)
- .setTimeFormatResolver(timeFormat)
- .setColorSchemeResolver(colorSchemeResolver)
- .setCategoricalColorScaleResolver(colorScaleResolver);
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/index.ts b/superset-frontend/plugins/preset-chart-xy/src/index.ts
deleted file mode 100644
index c20638948..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/index.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-export { default as BoxPlotChartPlugin } from './BoxPlot';
-export { default as LegacyBoxPlotChartPlugin } from './BoxPlot/legacy';
-export { default as ScatterPlotChartPlugin } from './ScatterPlot';
-export { default as LegacyScatterPlotChartPlugin } from './ScatterPlot/legacy';
-export { default as LineChartPlugin } from './Line';
-export { default as LegacyLineChartPlugin } from './Line/legacy';
-export { default as configureEncodable } from './configureEncodable';
diff --git a/superset-frontend/plugins/preset-chart-xy/src/utils/XYChartLayout.tsx b/superset-frontend/plugins/preset-chart-xy/src/utils/XYChartLayout.tsx
deleted file mode 100644
index 8b900bb31..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/utils/XYChartLayout.tsx
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React, { ReactNode, CSSProperties } from 'react';
-import { XAxis, YAxis } from '@data-ui/xy-chart';
-import { ChartFrame, Margin, mergeMargin, Dimension } from '@superset-ui/core';
-import {
- ChannelEncoder,
- PlainObject,
- Value,
- XFieldDef,
- YFieldDef,
-} from 'encodable';
-import createTickComponent from './createTickComponent';
-import computeAxisLayout, { AxisLayout } from './computeAxisLayout';
-
-export const DEFAULT_LABEL_ANGLE = 40;
-
-// Additional margin to avoid content hidden behind scroll bar
-const OVERFLOW_MARGIN = 8;
-
-export interface XYChartLayoutConfig<
- XOutput extends Value,
- YOutput extends Value,
-> {
- width: number;
- height: number;
- minContentWidth?: number;
- minContentHeight?: number;
- margin: Margin;
- xEncoder: ChannelEncoder, XOutput>;
- xTickSize?: number;
- xTickTextStyle?: CSSProperties;
- autoAdjustXMargin?: boolean;
- yEncoder: ChannelEncoder, YOutput>;
- yTickSize?: number;
- yTickTextStyle?: CSSProperties;
- autoAdjustYMargin?: boolean;
-}
-
-export default class XYChartLayout<
- XOutput extends Value,
- YOutput extends Value,
-> {
- chartWidth: number;
-
- chartHeight: number;
-
- containerWidth: number;
-
- containerHeight: number;
-
- margin: Margin;
-
- xEncoder: ChannelEncoder, XOutput>;
-
- xLayout?: AxisLayout;
-
- yEncoder: ChannelEncoder, YOutput>;
-
- yLayout?: AxisLayout;
-
- constructor(config: XYChartLayoutConfig) {
- const {
- width,
- height,
- minContentWidth = 0,
- minContentHeight = 0,
- margin,
- xEncoder,
- xTickSize,
- xTickTextStyle,
- autoAdjustXMargin = true,
- yEncoder,
- yTickSize,
- yTickTextStyle,
- autoAdjustYMargin = true,
- } = config;
-
- this.xEncoder = xEncoder;
- this.yEncoder = yEncoder;
-
- if (typeof yEncoder.axis !== 'undefined') {
- this.yLayout = computeAxisLayout(yEncoder.axis, {
- axisWidth: Math.max(height - margin.top - margin.bottom),
- defaultTickSize: yTickSize,
- tickTextStyle: yTickTextStyle,
- });
- }
-
- const secondMargin =
- this.yLayout && autoAdjustYMargin
- ? mergeMargin(margin, this.yLayout.minMargin)
- : margin;
- const innerWidth = Math.max(
- width - secondMargin.left - secondMargin.right,
- minContentWidth,
- );
-
- if (typeof xEncoder.axis !== 'undefined') {
- this.xLayout = computeAxisLayout(xEncoder.axis, {
- axisWidth: innerWidth,
- defaultTickSize: xTickSize,
- tickTextStyle: xTickTextStyle,
- });
- }
-
- const finalMargin =
- this.xLayout && autoAdjustXMargin
- ? mergeMargin(secondMargin, this.xLayout.minMargin)
- : secondMargin;
-
- const innerHeight = Math.max(
- height - finalMargin.top - finalMargin.bottom,
- minContentHeight,
- );
-
- const chartWidth = Math.round(
- innerWidth + finalMargin.left + finalMargin.right,
- );
- const chartHeight = Math.round(
- innerHeight + finalMargin.top + finalMargin.bottom,
- );
-
- const isOverFlowX = chartWidth > width;
- const isOverFlowY = chartHeight > height;
- if (isOverFlowX) {
- finalMargin.bottom += OVERFLOW_MARGIN;
- }
- if (isOverFlowY) {
- finalMargin.right += OVERFLOW_MARGIN;
- }
- this.chartWidth = isOverFlowX ? chartWidth + OVERFLOW_MARGIN : chartWidth;
- this.chartHeight = isOverFlowY
- ? chartHeight + OVERFLOW_MARGIN
- : chartHeight;
- this.containerWidth = width;
- this.containerHeight = height;
- this.margin = finalMargin;
- }
-
- renderChartWithFrame(renderChart: (input: Dimension) => ReactNode) {
- return (
-
- );
- }
-
- renderXAxis(props?: PlainObject) {
- const { axis } = this.xEncoder;
-
- return axis && this.xLayout ? (
-
- ) : null;
- }
-
- renderYAxis(props?: PlainObject) {
- const { axis } = this.yEncoder;
-
- return axis && this.yLayout ? (
-
- ) : null;
- }
-}
diff --git a/superset-frontend/plugins/preset-chart-xy/src/utils/computeAxisLayout.ts b/superset-frontend/plugins/preset-chart-xy/src/utils/computeAxisLayout.ts
deleted file mode 100644
index a74e40c73..000000000
--- a/superset-frontend/plugins/preset-chart-xy/src/utils/computeAxisLayout.ts
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { CSSProperties } from 'react';
-import { getTextDimension, Margin, Dimension } from '@superset-ui/core';
-import { AxisOrient, ChannelDef, Value } from 'encodable';
-
-import ChannelEncoderAxis from 'encodable/lib/encoders/ChannelEncoderAxis';
-
-export interface AxisLayout {
- axisWidth: number;
- labelAngle: number;
- labelFlush: number | boolean;
- labelOffset: number;
- labelOverlap: 'flat' | 'rotate';
- minMargin: Partial;
- orient: AxisOrient;
- tickLabelDimensions: Dimension[];
- tickLabels: string[];
- tickTextAnchor?: string;
-}
-
-export default function computeAxisLayout<
- Def extends ChannelDef