From 8efda4f704cb243816e71fe61772a03ccff3720c Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Thu, 14 May 2026 19:05:22 -0700 Subject: [PATCH] feat(glyph): consolidate deckgl Multi layer to defineChart() Collapse the Multi composer's index.ts + controlPanel.ts into a single index.tsx. Multi continues to delegate to ../transformProps (the preset-level transformProps that handles slice composition). The Multi.tsx component and its imports of each layer's getPoints stay intact. This completes the deckgl single-file consolidation: all 10 layers plus Multi now use defineChart(). Co-Authored-By: Claude Sonnet 4.6 --- .../preset-chart-deckgl/src/Multi/index.ts | 49 ------------------- .../src/Multi/{controlPanel.ts => index.tsx} | 32 ++++++++++-- 2 files changed, 29 insertions(+), 52 deletions(-) delete mode 100644 superset-frontend/plugins/preset-chart-deckgl/src/Multi/index.ts rename superset-frontend/plugins/preset-chart-deckgl/src/Multi/{controlPanel.ts => index.tsx} (72%) diff --git a/superset-frontend/plugins/preset-chart-deckgl/src/Multi/index.ts b/superset-frontend/plugins/preset-chart-deckgl/src/Multi/index.ts deleted file mode 100644 index 84069b4d978..00000000000 --- a/superset-frontend/plugins/preset-chart-deckgl/src/Multi/index.ts +++ /dev/null @@ -1,49 +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 '@apache-superset/core/translation'; -import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; -import thumbnail from './images/thumbnail.png'; -import thumbnailDark from './images/thumbnail-dark.png'; -import example from './images/example.png'; -import exampleDark from './images/example-dark.png'; -import transformProps from '../transformProps'; -import controlPanel from './controlPanel'; - -const metadata = new ChartMetadata({ - category: t('Map'), - credits: ['https://uber.github.io/deck.gl'], - description: t('Compose multiple layers together to form complex visuals.'), - exampleGallery: [{ url: example, urlDark: exampleDark }], - name: t('deck.gl Multiple Layers'), - thumbnail, - thumbnailDark, - useLegacyApi: true, - tags: [t('deckGL'), t('Multi-Layers')], -}); - -export default class MultiChartPlugin extends ChartPlugin { - constructor() { - super({ - loadChart: () => import('./Multi'), - controlPanel, - metadata, - transformProps, - }); - } -} diff --git a/superset-frontend/plugins/preset-chart-deckgl/src/Multi/controlPanel.ts b/superset-frontend/plugins/preset-chart-deckgl/src/Multi/index.tsx similarity index 72% rename from superset-frontend/plugins/preset-chart-deckgl/src/Multi/controlPanel.ts rename to superset-frontend/plugins/preset-chart-deckgl/src/Multi/index.tsx index 8379345ad16..ea731d34e0b 100644 --- a/superset-frontend/plugins/preset-chart-deckgl/src/Multi/controlPanel.ts +++ b/superset-frontend/plugins/preset-chart-deckgl/src/Multi/index.tsx @@ -18,6 +18,9 @@ */ import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; +import { defineChart } from '@superset-ui/glyph-core'; +import MultiComponent from './Multi'; +import transformProps from '../transformProps'; import { viewport, mapboxStyle, @@ -25,9 +28,27 @@ import { mapProvider, autozoom, } from '../utilities/Shared_DeckGL'; +import thumbnail from './images/thumbnail.png'; +import thumbnailDark from './images/thumbnail-dark.png'; +import example from './images/example.png'; +import exampleDark from './images/example-dark.png'; -export default { - controlPanelSections: [ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export default defineChart, any>({ + metadata: { + name: t('deck.gl Multiple Layers'), + description: t('Compose multiple layers together to form complex visuals.'), + category: t('Map'), + credits: ['https://uber.github.io/deck.gl'], + tags: [t('deckGL'), t('Multi-Layers')], + thumbnail, + thumbnailDark, + exampleGallery: [{ url: example, urlDark: exampleDark }], + useLegacyApi: true, + }, + arguments: {}, + suppressQuerySection: true, + prependSections: [ { label: t('Map'), expanded: true, @@ -87,4 +108,9 @@ export default { controlSetRows: [['adhoc_filters']], }, ], -}; + transform: chartProps => transformProps(chartProps), + render: ({ transformedProps }) => ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + + ), +});