From 6cf1c918c3c05d090e701f822c376e77a2b5c92b Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Fri, 8 Jul 2022 13:48:34 +0800 Subject: [PATCH 1/3] chore: remove legacy Area and TreeMap from Superset --- superset-frontend/src/visualizations/presets/MainPreset.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/superset-frontend/src/visualizations/presets/MainPreset.js b/superset-frontend/src/visualizations/presets/MainPreset.js index 837cd98a7aa5..3194b746cbf2 100644 --- a/superset-frontend/src/visualizations/presets/MainPreset.js +++ b/superset-frontend/src/visualizations/presets/MainPreset.js @@ -33,11 +33,9 @@ import RoseChartPlugin from '@superset-ui/legacy-plugin-chart-rose'; import SankeyChartPlugin from '@superset-ui/legacy-plugin-chart-sankey'; import SunburstChartPlugin from '@superset-ui/legacy-plugin-chart-sunburst'; import TableChartPlugin from '@superset-ui/plugin-chart-table'; -import TreemapChartPlugin from '@superset-ui/legacy-plugin-chart-treemap'; import { WordCloudChartPlugin } from '@superset-ui/plugin-chart-word-cloud'; import WorldMapChartPlugin from '@superset-ui/legacy-plugin-chart-world-map'; import { - AreaChartPlugin, BarChartPlugin, BubbleChartPlugin, BulletChartPlugin, @@ -94,7 +92,6 @@ export default class MainPreset extends Preset { name: 'Legacy charts', presets: [new DeckGLChartPreset()], plugins: [ - new AreaChartPlugin().configure({ key: 'area' }), new BarChartPlugin().configure({ key: 'bar' }), new BigNumberChartPlugin().configure({ key: 'big_number' }), new BigNumberTotalChartPlugin().configure({ key: 'big_number_total' }), @@ -135,7 +132,6 @@ export default class MainPreset extends Preset { new TableChartPlugin().configure({ key: 'table' }), new TimePivotChartPlugin().configure({ key: 'time_pivot' }), new TimeTableChartPlugin().configure({ key: 'time_table' }), - new TreemapChartPlugin().configure({ key: 'treemap' }), new WordCloudChartPlugin().configure({ key: 'word_cloud' }), new WorldMapChartPlugin().configure({ key: 'world_map' }), new EchartsAreaChartPlugin().configure({ From 6cfcd8b1adc9aa8585d55fa0b6419eba66ee59ae Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Sat, 9 Jul 2022 00:09:03 +0800 Subject: [PATCH 2/3] fix cypress --- superset/examples/birth_names.py | 8 ++++---- superset/examples/world_bank.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/superset/examples/birth_names.py b/superset/examples/birth_names.py index 6b37fe9d08dc..c1da195d5ce4 100644 --- a/superset/examples/birth_names.py +++ b/superset/examples/birth_names.py @@ -352,7 +352,7 @@ def create_slices(tbl: SqlaTable, admin_owner: bool) -> Tuple[List[Slice], List[ Slice( **slice_props, slice_name="Top 10 Girl Name Share", - viz_type="area", + viz_type="echarts_area", params=get_slice_json( defaults, adhoc_filters=[gen_filter("gender", "girl")], @@ -361,7 +361,7 @@ def create_slices(tbl: SqlaTable, admin_owner: bool) -> Tuple[List[Slice], List[ limit=10, stacked_style="expand", time_grain_sqla="P1D", - viz_type="area", + viz_type="echarts_area", x_axis_forma="smart_date", metrics=metrics, ), @@ -369,7 +369,7 @@ def create_slices(tbl: SqlaTable, admin_owner: bool) -> Tuple[List[Slice], List[ Slice( **slice_props, slice_name="Top 10 Boy Name Share", - viz_type="area", + viz_type="echarts_area", params=get_slice_json( defaults, adhoc_filters=[gen_filter("gender", "boy")], @@ -378,7 +378,7 @@ def create_slices(tbl: SqlaTable, admin_owner: bool) -> Tuple[List[Slice], List[ limit=10, stacked_style="expand", time_grain_sqla="P1D", - viz_type="area", + viz_type="echarts_area", x_axis_forma="smart_date", metrics=metrics, ), diff --git a/superset/examples/world_bank.py b/superset/examples/world_bank.py index 39b982aa5246..a39bf542fcac 100644 --- a/superset/examples/world_bank.py +++ b/superset/examples/world_bank.py @@ -313,14 +313,14 @@ def create_slices(tbl: BaseDatasource) -> List[Slice]: ), Slice( slice_name="World's Pop Growth", - viz_type="area", + viz_type="echarts_area", datasource_type=DatasourceType.TABLE, datasource_id=tbl.id, params=get_slice_json( defaults, since="1960-01-01", until="now", - viz_type="area", + viz_type="echarts_area", groupby=["region"], metrics=metrics, ), @@ -343,14 +343,14 @@ def create_slices(tbl: BaseDatasource) -> List[Slice]: ), Slice( slice_name="Treemap", - viz_type="treemap", + viz_type="treemap_v2", datasource_type=DatasourceType.TABLE, datasource_id=tbl.id, params=get_slice_json( defaults, since="1960-01-01", until="now", - viz_type="treemap", + viz_type="treemap_v2", metrics=["sum__SP_POP_TOTL"], groupby=["region", "country_code"], ), From b6d2f08e1960aaca716e3da1b1696424d7b00430 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Sat, 9 Jul 2022 10:23:09 +0800 Subject: [PATCH 3/3] fix cypress --- .../cypress/integration/explore/visualizations/area.test.js | 2 +- .../integration/explore/visualizations/treemap.test.js | 4 ++-- superset-frontend/spec/fixtures/mockSliceEntities.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/area.test.js b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/area.test.js index 59b8beabe38b..898839e8aff8 100644 --- a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/area.test.js +++ b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/area.test.js @@ -19,7 +19,7 @@ describe('Visualization > Area', () => { const AREA_FORM_DATA = { datasource: '2__table', - viz_type: 'area', + viz_type: 'echarts_area', slice_id: 48, granularity_sqla: 'year', time_grain_sqla: 'P1D', diff --git a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/treemap.test.js b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/treemap.test.js index 1be85e9e4cdf..2c9177676ec0 100644 --- a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/treemap.test.js +++ b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/treemap.test.js @@ -19,12 +19,12 @@ describe('Visualization > Treemap', () => { const TREEMAP_FORM_DATA = { datasource: '2__table', - viz_type: 'treemap', + viz_type: 'treemap_v2', slice_id: 10, granularity_sqla: 'year', time_grain_sqla: 'P1D', time_range: 'No filter', - metrics: ['sum__SP_POP_TOTL'], + metric: 'sum__SP_POP_TOTL', adhoc_filters: [], groupby: ['country_code'], row_limit: 50000, diff --git a/superset-frontend/spec/fixtures/mockSliceEntities.js b/superset-frontend/spec/fixtures/mockSliceEntities.js index 69570c5c8f87..f049755ed510 100644 --- a/superset-frontend/spec/fixtures/mockSliceEntities.js +++ b/superset-frontend/spec/fixtures/mockSliceEntities.js @@ -161,7 +161,7 @@ export const sliceEntitiesForDashboard = { slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%20134%7D', slice_name: "World's Pop Growth", form_data: {}, - viz_type: 'area', + viz_type: 'echarts_area', datasource: '2__table', description: null, description_markeddown: '', @@ -185,7 +185,7 @@ export const sliceEntitiesForDashboard = { slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%20136%7D', slice_name: 'Treemap', form_data: {}, - viz_type: 'treemap', + viz_type: 'treemap_v2', datasource: '2__table', description: null, description_markeddown: '',