mirror of
https://github.com/apache/superset.git
synced 2026-05-29 20:29:34 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -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<Record<string, never>, 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
|
||||
<MultiComponent {...(transformedProps as any)} />
|
||||
),
|
||||
});
|
||||
Reference in New Issue
Block a user