You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/07/23 05:54:34 UTC
(superset) branch misc-charts-examples created (now ecb4aa93f6d)
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a change to branch misc-charts-examples
in repository https://gitbox.apache.org/repos/asf/superset.git
at ecb4aa93f6d feat(playwright): add a viz-picker thumbnail capture tool
This branch includes the following new commits:
new 4e1913d4365 feat(examples): add migrated legacy chart examples to the Misc Charts dashboard
new ecb4aa93f6d feat(playwright): add a viz-picker thumbnail capture tool
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(superset) 01/02: feat(examples): add migrated legacy chart examples to the Misc Charts dashboard
Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch misc-charts-examples
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 4e1913d436590d48d7020261d0ecbd67a45fa61f
Author: Claude Code <no...@anthropic.com>
AuthorDate: Wed Jul 22 22:51:56 2026 -0700
feat(examples): add migrated legacy chart examples to the Misc Charts dashboard
Adds example charts for every migrated legacy visualization that had no
example instance: calendar heatmap, nightingale rose, partition, paired
t-test, bullet, time-series period pivot, a percent-change line, and a
time table. Country map, parallel coordinates, chord, horizon and world
map already have examples in other dashboards.
Co-Authored-By: Claude Fable 5 <no...@anthropic.com>
---
.../charts/Population_Nightingale_Rose.yaml | 40 +++++
.../charts/Population_Paired_t_Test.yaml | 38 +++++
.../misc_charts/charts/Population_Partition.yaml | 44 ++++++
.../charts/Population_Percent_Change.yaml | 42 ++++++
.../charts/Region_Population_Time_Table.yaml | 70 +++++++++
.../misc_charts/charts/Sales_Calendar_Heatmap.yaml | 47 ++++++
.../misc_charts/charts/Sales_Period_Pivot.yaml | 43 ++++++
.../misc_charts/charts/Total_Sales_Bullet.yaml | 45 ++++++
superset/examples/misc_charts/dashboard.yaml | 168 +++++++++++++++++++++
9 files changed, 537 insertions(+)
diff --git a/superset/examples/misc_charts/charts/Population_Nightingale_Rose.yaml b/superset/examples/misc_charts/charts/Population_Nightingale_Rose.yaml
new file mode 100644
index 00000000000..2ddee354937
--- /dev/null
+++ b/superset/examples/misc_charts/charts/Population_Nightingale_Rose.yaml
@@ -0,0 +1,40 @@
+# 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.
+cache_timeout: null
+certification_details: null
+certified_by: null
+dataset_uuid: 69e9de42-fe7f-4948-946a-f7913227aee8
+description: World population by region, one ring of petals per year.
+params:
+ color_scheme: supersetColors
+ date_time_format: '%Y'
+ granularity_sqla: year
+ groupby:
+ - region
+ metrics:
+ - sum__SP_POP_TOTL
+ number_format: SMART_NUMBER
+ rich_tooltip: true
+ rose_area_proportion: false
+ row_limit: 50000
+ time_range: '2010-01-01 : 2015-01-01'
+ viz_type: rose
+query_context: null
+slice_name: Population Nightingale Rose
+uuid: 3bfacf28-5940-40f1-af24-60d24d5be57d
+version: 1.0.0
+viz_type: rose
diff --git a/superset/examples/misc_charts/charts/Population_Paired_t_Test.yaml b/superset/examples/misc_charts/charts/Population_Paired_t_Test.yaml
new file mode 100644
index 00000000000..7a05a411df5
--- /dev/null
+++ b/superset/examples/misc_charts/charts/Population_Paired_t_Test.yaml
@@ -0,0 +1,38 @@
+# 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.
+cache_timeout: null
+certification_details: null
+certified_by: null
+dataset_uuid: 69e9de42-fe7f-4948-946a-f7913227aee8
+description: Statistical significance of population trends between regions.
+params:
+ granularity_sqla: year
+ groupby:
+ - region
+ liftvalue_precision: 4
+ metrics:
+ - sum__SP_POP_TOTL
+ pvalue_precision: 6
+ row_limit: 50000
+ significance_level: '0.05'
+ time_range: '2000-01-01 : 2015-01-01'
+ viz_type: paired_ttest
+query_context: null
+slice_name: Population Paired t-Test
+uuid: a71ebf2f-338d-466f-a862-48d068832295
+version: 1.0.0
+viz_type: paired_ttest
diff --git a/superset/examples/misc_charts/charts/Population_Partition.yaml b/superset/examples/misc_charts/charts/Population_Partition.yaml
new file mode 100644
index 00000000000..a2198b8c489
--- /dev/null
+++ b/superset/examples/misc_charts/charts/Population_Partition.yaml
@@ -0,0 +1,44 @@
+# 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.
+cache_timeout: null
+certification_details: null
+certified_by: null
+dataset_uuid: 69e9de42-fe7f-4948-946a-f7913227aee8
+description: World population split by region, then country.
+params:
+ color_scheme: supersetColors
+ date_time_format: smart_date
+ equal_date_size: true
+ granularity_sqla: year
+ groupby:
+ - region
+ - country_name
+ log_scale: false
+ metrics:
+ - sum__SP_POP_TOTL
+ partition_limit: '5'
+ partition_threshold: '0.05'
+ rich_tooltip: true
+ row_limit: 50000
+ time_range: '2014-01-01 : 2014-01-02'
+ time_series_option: not_time
+ viz_type: partition
+query_context: null
+slice_name: Population Partition
+uuid: 1acf135b-2c1f-4ee6-8a11-e4b4be52d1ea
+version: 1.0.0
+viz_type: partition
diff --git a/superset/examples/misc_charts/charts/Population_Percent_Change.yaml b/superset/examples/misc_charts/charts/Population_Percent_Change.yaml
new file mode 100644
index 00000000000..bbd59ae8b2b
--- /dev/null
+++ b/superset/examples/misc_charts/charts/Population_Percent_Change.yaml
@@ -0,0 +1,42 @@
+# 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.
+cache_timeout: null
+certification_details: null
+certified_by: null
+dataset_uuid: 69e9de42-fe7f-4948-946a-f7913227aee8
+description: Regional population growth rebased to percent change from a draggable
+ baseline.
+params:
+ groupby:
+ - region
+ metrics:
+ - sum__SP_POP_TOTL
+ rebase_percent_change: true
+ rich_tooltip: true
+ row_limit: 50000
+ show_legend: true
+ time_grain_sqla: P1Y
+ time_range: No filter
+ viz_type: echarts_timeseries_line
+ x_axis: year
+ x_axis_time_format: smart_date
+ y_axis_format: SMART_NUMBER
+query_context: null
+slice_name: Population Percent Change
+uuid: 4152b06b-7302-4326-8139-d7e285008253
+version: 1.0.0
+viz_type: echarts_timeseries_line
diff --git a/superset/examples/misc_charts/charts/Region_Population_Time_Table.yaml b/superset/examples/misc_charts/charts/Region_Population_Time_Table.yaml
new file mode 100644
index 00000000000..9160a9530b7
--- /dev/null
+++ b/superset/examples/misc_charts/charts/Region_Population_Time_Table.yaml
@@ -0,0 +1,70 @@
+# 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.
+cache_timeout: null
+certification_details: null
+certified_by: null
+dataset_uuid: 69e9de42-fe7f-4948-946a-f7913227aee8
+description: Population metrics with a sparkline trend and a five-year percent change.
+params:
+ column_collection:
+ - bounds:
+ - null
+ - null
+ colType: spark
+ comparisonType: ''
+ d3format: ''
+ dateFormat: ''
+ height: ''
+ key: spark_trend
+ label: Trend
+ showYAxis: false
+ timeLag: 0
+ timeRatio: ''
+ tooltip: Time series of the metric
+ width: ''
+ yAxisBounds:
+ - null
+ - null
+ - bounds:
+ - null
+ - null
+ colType: time
+ comparisonType: perc_change
+ d3format: ''
+ dateFormat: ''
+ height: ''
+ key: five_year_change
+ label: 5-year change
+ showYAxis: false
+ timeLag: 5
+ timeRatio: ''
+ tooltip: Percent change versus five periods earlier
+ width: ''
+ yAxisBounds:
+ - null
+ - null
+ granularity_sqla: year
+ metrics:
+ - sum__SP_POP_TOTL
+ - sum__SP_RUR_TOTL_ZS
+ time_range: '1990-01-01 : 2015-01-01'
+ viz_type: time_table
+query_context: null
+slice_name: Region Population Time Table
+uuid: 55ad4f1d-debc-42c7-b359-f9bbdb569a10
+version: 1.0.0
+viz_type: time_table
diff --git a/superset/examples/misc_charts/charts/Sales_Calendar_Heatmap.yaml b/superset/examples/misc_charts/charts/Sales_Calendar_Heatmap.yaml
new file mode 100644
index 00000000000..ad8fbe0f09e
--- /dev/null
+++ b/superset/examples/misc_charts/charts/Sales_Calendar_Heatmap.yaml
@@ -0,0 +1,47 @@
+# 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.
+cache_timeout: null
+certification_details: null
+certified_by: null
+dataset_uuid: e8623bb9-5e00-f531-506a-19607f5f8005
+description: Daily sales intensity across a year, one cell per day.
+params:
+ cell_padding: 2
+ cell_radius: 0
+ cell_size: 12
+ domain_granularity: month
+ granularity_sqla: order_date
+ metrics:
+ - aggregate: SUM
+ column:
+ column_name: sales
+ expressionType: SIMPLE
+ label: SUM(sales)
+ optionName: metric_sales_calendar
+ show_legend: true
+ show_metric_name: true
+ show_values: false
+ steps: 10
+ subdomain_granularity: day
+ time_range: '2004-01-01 : 2005-01-01'
+ viz_type: cal_heatmap
+ x_axis_time_format: smart_date
+query_context: null
+slice_name: Sales Calendar Heatmap
+uuid: ef13dcad-c918-4367-ab17-a31d56e770e0
+version: 1.0.0
+viz_type: cal_heatmap
diff --git a/superset/examples/misc_charts/charts/Sales_Period_Pivot.yaml b/superset/examples/misc_charts/charts/Sales_Period_Pivot.yaml
new file mode 100644
index 00000000000..55ba7f32525
--- /dev/null
+++ b/superset/examples/misc_charts/charts/Sales_Period_Pivot.yaml
@@ -0,0 +1,43 @@
+# 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.
+cache_timeout: null
+certification_details: null
+certified_by: null
+dataset_uuid: e8623bb9-5e00-f531-506a-19607f5f8005
+description: Weekly sales overlaid one line per year, current period highlighted.
+params:
+ freq: AS
+ granularity_sqla: order_date
+ line_interpolation: linear
+ metric:
+ aggregate: SUM
+ column:
+ column_name: sales
+ expressionType: SIMPLE
+ label: SUM(sales)
+ optionName: metric_sales_pivot
+ show_legend: true
+ time_grain_sqla: P1W
+ time_range: No filter
+ viz_type: time_pivot
+ x_axis_format: smart_date
+ y_axis_format: SMART_NUMBER
+query_context: null
+slice_name: Sales Period Pivot
+uuid: 013d4dd9-de3b-49c2-8ad5-319330d7186e
+version: 1.0.0
+viz_type: time_pivot
diff --git a/superset/examples/misc_charts/charts/Total_Sales_Bullet.yaml b/superset/examples/misc_charts/charts/Total_Sales_Bullet.yaml
new file mode 100644
index 00000000000..0b9c1086c0b
--- /dev/null
+++ b/superset/examples/misc_charts/charts/Total_Sales_Bullet.yaml
@@ -0,0 +1,45 @@
+# 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.
+cache_timeout: null
+certification_details: null
+certified_by: null
+dataset_uuid: e8623bb9-5e00-f531-506a-19607f5f8005
+description: Total sales against qualitative ranges, a target marker and a goal line.
+params:
+ marker_labels: target
+ marker_line_labels: goal
+ marker_lines: '9000000'
+ markers: '10000000'
+ metric:
+ aggregate: SUM
+ column:
+ column_name: sales
+ expressionType: SIMPLE
+ label: SUM(sales)
+ optionName: metric_sales_bullet
+ range_labels: low,medium,high
+ ranges: 4000000,8000000,12000000
+ show_labels: true
+ show_legend: false
+ time_range: No filter
+ viz_type: bullet
+ y_axis_format: SMART_NUMBER
+query_context: null
+slice_name: Total Sales Bullet
+uuid: 5c4b004d-4326-45fa-a684-98072029fe30
+version: 1.0.0
+viz_type: bullet
diff --git a/superset/examples/misc_charts/dashboard.yaml b/superset/examples/misc_charts/dashboard.yaml
index a0fc727f188..00c332f91ec 100644
--- a/superset/examples/misc_charts/dashboard.yaml
+++ b/superset/examples/misc_charts/dashboard.yaml
@@ -31,6 +31,14 @@ metadata:
- 48bf196c-f5fe-4e6c-b8ed-166e36b6648b
- fe23db78-c168-4ce2-86b0-38d82bb37d88
- ed3032d8-7961-4576-8fc4-2a61639a38bf
+ - 4152b06b-7302-4326-8139-d7e285008253
+ - 3bfacf28-5940-40f1-af24-60d24d5be57d
+ - ef13dcad-c918-4367-ab17-a31d56e770e0
+ - 013d4dd9-de3b-49c2-8ad5-319330d7186e
+ - 5c4b004d-4326-45fa-a684-98072029fe30
+ - 1acf135b-2c1f-4ee6-8a11-e4b4be52d1ea
+ - a71ebf2f-338d-466f-a862-48d068832295
+ - 55ad4f1d-debc-42c7-b359-f9bbdb569a10
scope:
excluded: []
rootPath:
@@ -125,10 +133,126 @@ position:
- GRID_ID
- ROW-SytNzNA4X
type: CHART
+ CHART-misc-percent-change:
+ children: []
+ id: CHART-misc-percent-change
+ meta:
+ chartId: 90001
+ height: 69
+ sliceName: Population Percent Change
+ uuid: 4152b06b-7302-4326-8139-d7e285008253
+ width: 6
+ parents:
+ - ROOT_ID
+ - GRID_ID
+ - ROW-misc-migrated-1
+ type: CHART
+ CHART-misc-rose:
+ children: []
+ id: CHART-misc-rose
+ meta:
+ chartId: 90002
+ height: 69
+ sliceName: Population Nightingale Rose
+ uuid: 3bfacf28-5940-40f1-af24-60d24d5be57d
+ width: 6
+ parents:
+ - ROOT_ID
+ - GRID_ID
+ - ROW-misc-migrated-1
+ type: CHART
+ CHART-misc-calendar:
+ children: []
+ id: CHART-misc-calendar
+ meta:
+ chartId: 90003
+ height: 69
+ sliceName: Sales Calendar Heatmap
+ uuid: ef13dcad-c918-4367-ab17-a31d56e770e0
+ width: 6
+ parents:
+ - ROOT_ID
+ - GRID_ID
+ - ROW-misc-migrated-2
+ type: CHART
+ CHART-misc-time-pivot:
+ children: []
+ id: CHART-misc-time-pivot
+ meta:
+ chartId: 90004
+ height: 69
+ sliceName: Sales Period Pivot
+ uuid: 013d4dd9-de3b-49c2-8ad5-319330d7186e
+ width: 6
+ parents:
+ - ROOT_ID
+ - GRID_ID
+ - ROW-misc-migrated-2
+ type: CHART
+ CHART-misc-bullet:
+ children: []
+ id: CHART-misc-bullet
+ meta:
+ chartId: 90005
+ height: 69
+ sliceName: Total Sales Bullet
+ uuid: 5c4b004d-4326-45fa-a684-98072029fe30
+ width: 6
+ parents:
+ - ROOT_ID
+ - GRID_ID
+ - ROW-misc-migrated-3
+ type: CHART
+ CHART-misc-partition:
+ children: []
+ id: CHART-misc-partition
+ meta:
+ chartId: 90006
+ height: 69
+ sliceName: Population Partition
+ uuid: 1acf135b-2c1f-4ee6-8a11-e4b4be52d1ea
+ width: 6
+ parents:
+ - ROOT_ID
+ - GRID_ID
+ - ROW-misc-migrated-3
+ type: CHART
+ CHART-misc-paired-ttest:
+ children: []
+ id: CHART-misc-paired-ttest
+ meta:
+ chartId: 90007
+ height: 69
+ sliceName: Population Paired t-Test
+ uuid: a71ebf2f-338d-466f-a862-48d068832295
+ width: 6
+ parents:
+ - ROOT_ID
+ - GRID_ID
+ - ROW-misc-migrated-4
+ type: CHART
+ CHART-misc-time-table:
+ children: []
+ id: CHART-misc-time-table
+ meta:
+ chartId: 90008
+ height: 69
+ sliceName: Region Population Time Table
+ uuid: 55ad4f1d-debc-42c7-b359-f9bbdb569a10
+ width: 6
+ parents:
+ - ROOT_ID
+ - GRID_ID
+ - ROW-misc-migrated-4
+ type: CHART
DASHBOARD_VERSION_KEY: v2
GRID_ID:
children:
- ROW-SytNzNA4X
+ - ROW-misc-migrated-1
+ - ROW-misc-migrated-2
+ - ROW-misc-migrated-3
+ - ROW-misc-migrated-4
id: GRID_ID
parents:
- ROOT_ID
@@ -155,6 +279,50 @@ position:
- ROOT_ID
- GRID_ID
type: ROW
+ ROW-misc-migrated-1:
+ children:
+ - CHART-misc-percent-change
+ - CHART-misc-rose
+ id: ROW-misc-migrated-1
+ meta:
+ background: BACKGROUND_TRANSPARENT
+ parents:
+ - ROOT_ID
+ - GRID_ID
+ type: ROW
+ ROW-misc-migrated-2:
+ children:
+ - CHART-misc-calendar
+ - CHART-misc-time-pivot
+ id: ROW-misc-migrated-2
+ meta:
+ background: BACKGROUND_TRANSPARENT
+ parents:
+ - ROOT_ID
+ - GRID_ID
+ type: ROW
+ ROW-misc-migrated-3:
+ children:
+ - CHART-misc-bullet
+ - CHART-misc-partition
+ id: ROW-misc-migrated-3
+ meta:
+ background: BACKGROUND_TRANSPARENT
+ parents:
+ - ROOT_ID
+ - GRID_ID
+ type: ROW
+ ROW-misc-migrated-4:
+ children:
+ - CHART-misc-paired-ttest
+ - CHART-misc-time-table
+ id: ROW-misc-migrated-4
+ meta:
+ background: BACKGROUND_TRANSPARENT
+ parents:
+ - ROOT_ID
+ - GRID_ID
+ type: ROW
published: false
slug: misc_charts
uuid: b388a396-cbca-4299-a443-3e41e870e2c2
(superset) 02/02: feat(playwright): add a viz-picker thumbnail capture tool
Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch misc-charts-examples
in repository https://gitbox.apache.org/repos/asf/superset.git
commit ecb4aa93f6d139b5c47669474d4881e9e8d516a5
Author: Claude Code <no...@anthropic.com>
AuthorDate: Wed Jul 22 22:53:57 2026 -0700
feat(playwright): add a viz-picker thumbnail capture tool
A CAPTURE_THUMBNAILS-gated Playwright spec that renders each migrated
legacy chart's example standalone at 512x512 and overwrites the plugin's
gallery thumbnail, plus an npm run playwright:thumbnails entry point.
Covers the Misc Charts examples and the existing chord, horizon,
parallel coordinates, country map and world map examples; the Line
percent-change capture lands as a new gallery image to be registered in
the plugin metadata after capture.
Co-Authored-By: Claude Fable 5 <no...@anthropic.com>
---
superset-frontend/package.json | 1 +
.../tests/tools/capture-viz-thumbnails.spec.ts | 169 +++++++++++++++++++++
2 files changed, 170 insertions(+)
diff --git a/superset-frontend/package.json b/superset-frontend/package.json
index faff57480cb..f861246e8fd 100644
--- a/superset-frontend/package.json
+++ b/superset-frontend/package.json
@@ -78,6 +78,7 @@
"playwright:debug": "playwright test --debug",
"playwright:report": "playwright show-report",
"docs:screenshots": "playwright test --config=playwright/generators/playwright.config.ts docs/",
+ "playwright:thumbnails": "CAPTURE_THUMBNAILS=1 playwright test tests/tools/capture-viz-thumbnails.spec.ts --project chromium",
"prettier": "npm run _prettier -- --write",
"prettier-check": "npm run _prettier -- --check",
"prod": "npm run build",
diff --git a/superset-frontend/playwright/tests/tools/capture-viz-thumbnails.spec.ts b/superset-frontend/playwright/tests/tools/capture-viz-thumbnails.spec.ts
new file mode 100644
index 00000000000..92308e472f9
--- /dev/null
+++ b/superset-frontend/playwright/tests/tools/capture-viz-thumbnails.spec.ts
@@ -0,0 +1,169 @@
+/**
+ * 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.
+ */
+/**
+ * Captures viz-picker gallery thumbnails from live example charts.
+ *
+ * This is a maintenance tool, not a test: it renders each example chart
+ * standalone and overwrites the target plugin image with a fresh 512x512
+ * screenshot. It only runs when CAPTURE_THUMBNAILS=1 is set, so the
+ * regular Playwright suites never execute it.
+ *
+ * Usage (requires a running Superset with examples loaded):
+ * CAPTURE_THUMBNAILS=1 npx playwright test tests/tools/capture-viz-thumbnails.spec.ts --project chromium
+ *
+ * Notes:
+ * - Only light-theme images are captured; `thumbnail-dark.png` variants
+ * are left untouched.
+ * - New gallery images (e.g. the Line percent-change example) still need
+ * to be registered in the plugin's metadata before they render in the
+ * gallery; the capture logs a reminder for any non-thumbnail output.
+ */
+import * as fs from 'fs';
+import * as path from 'path';
+import { test, expect } from '@playwright/test';
+
+const THUMBNAIL_SIZE = 512;
+const RENDERED_CHART_SELECTOR =
+ '[data-test="chart-container"]:has(svg, canvas, table):not(:has([data-test="loading-indicator"]))';
+
+/** superset-frontend root, resolved from this spec's location. */
+const FRONTEND_ROOT = path.resolve(__dirname, '..', '..', '..');
+
+interface CaptureTarget {
+ /** slice_name of the example chart to render */
+ sliceName: string;
+ /** output path relative to superset-frontend */
+ output: string;
+}
+
+const TARGETS: CaptureTarget[] = [
+ // Charts from the Misc Charts example dashboard
+ {
+ sliceName: 'Total Sales Bullet',
+ output: 'plugins/plugin-chart-echarts/src/Bullet/images/thumbnail.png',
+ },
+ {
+ sliceName: 'Sales Period Pivot',
+ output: 'plugins/plugin-chart-echarts/src/TimePivot/images/thumbnail.png',
+ },
+ {
+ sliceName: 'Population Nightingale Rose',
+ output: 'plugins/plugin-chart-rose/src/images/thumbnail.png',
+ },
+ {
+ sliceName: 'Sales Calendar Heatmap',
+ output: 'plugins/plugin-chart-calendar/src/images/thumbnail.png',
+ },
+ {
+ sliceName: 'Population Partition',
+ output: 'plugins/plugin-chart-partition/src/images/thumbnail.png',
+ },
+ {
+ sliceName: 'Population Paired t-Test',
+ output: 'plugins/plugin-chart-paired-t-test/src/images/thumbnail.png',
+ },
+ {
+ sliceName: 'Region Population Time Table',
+ output: 'src/visualizations/TimeTable/images/thumbnail.png',
+ },
+ {
+ // Gallery example for the Line chart's percent-change mode; register
+ // it in the Line plugin metadata after capturing.
+ sliceName: 'Population Percent Change',
+ output:
+ 'plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/images/Line3.png',
+ },
+ // Migrated charts whose examples live on other dashboards
+ {
+ sliceName: 'Parallel Coordinates',
+ output:
+ 'plugins/plugin-chart-parallel-coordinates/src/images/thumbnail.png',
+ },
+ {
+ sliceName: 'Birth in France by department in 2016',
+ output: 'plugins/plugin-chart-country-map/src/images/thumbnail.png',
+ },
+ {
+ sliceName: 'Cross Channel Relationship',
+ output: 'plugins/plugin-chart-chord/src/images/thumbnail.png',
+ },
+ {
+ sliceName: 'Seasonality of Revenue (per Product Line)',
+ output: 'plugins/plugin-chart-horizon/src/images/thumbnail.png',
+ },
+ {
+ sliceName: '% Rural',
+ output: 'plugins/plugin-chart-world-map/src/images/thumbnail.png',
+ },
+];
+
+test.describe('capture viz thumbnails', () => {
+ test.skip(
+ !process.env.CAPTURE_THUMBNAILS,
+ 'Thumbnail capture only runs with CAPTURE_THUMBNAILS=1',
+ );
+
+ for (const target of TARGETS) {
+ test(`captures ${target.sliceName}`, async ({ page }) => {
+ test.setTimeout(90_000);
+
+ // Look up the slice id by name via the chart API
+ const query = encodeURIComponent(
+ `(filters:!((col:slice_name,opr:eq,value:'${target.sliceName.replace(
+ /'/g,
+ "''",
+ )}')))`,
+ );
+ const response = await page.request.get(`/api/v1/chart/?q=${query}`);
+ expect(response.ok()).toBeTruthy();
+ const { result } = await response.json();
+ expect(
+ result.length,
+ `example chart "${target.sliceName}" not found — are examples loaded?`,
+ ).toBeGreaterThan(0);
+ const sliceId = result[0].id;
+
+ // Render the chart alone at thumbnail size and wait for real content
+ await page.setViewportSize({
+ width: THUMBNAIL_SIZE,
+ height: THUMBNAIL_SIZE,
+ });
+ await page.goto(`/explore/?slice_id=${sliceId}&standalone=1`);
+ await page
+ .locator(RENDERED_CHART_SELECTOR)
+ .first()
+ .waitFor({ state: 'visible', timeout: 60_000 });
+ // Give animations/tiles a moment to settle before the still
+ await page.waitForTimeout(2_000);
+
+ const outputPath = path.join(FRONTEND_ROOT, target.output);
+ fs.mkdirSync(path.dirname(outputPath), { recursive: true });
+ await page.screenshot({ path: outputPath });
+
+ // eslint-disable-next-line no-console
+ console.log(`captured ${target.sliceName} -> ${target.output}`);
+ if (!target.output.endsWith('thumbnail.png')) {
+ // eslint-disable-next-line no-console
+ console.log(
+ `NOTE: ${target.output} is a new gallery image — register it in the plugin metadata (exampleGallery) to surface it.`,
+ );
+ }
+ });
+ }
+});