DamianPendrak commented on code in PR #38028: URL: https://github.com/apache/superset/pull/38028#discussion_r2874625566
########## superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/H3Hexagon/controlPanel.ts: ########## @@ -0,0 +1,140 @@ +/** + * 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, validateNonEmpty } from '@superset-ui/core'; +import { + ControlPanelConfig, + sections, + sharedControls, +} from '@superset-ui/chart-controls'; +import { + jsColumns, + jsDataMutator, + jsTooltip, + jsOnclickHref, + mapboxStyle, + viewport, + autozoom, + tooltipContents, + tooltipTemplate, +} from '../../utilities/Shared_DeckGL'; + +const config: ControlPanelConfig = { + controlPanelSections: [ + sections.legacyTimeseriesTime, + { + label: t('Query'), + expanded: true, + controlSetRows: [ + [ + { + name: 'h3_index', + config: { + ...sharedControls.groupby, + label: t('H3 Column'), + description: t('The column containing H3 hexagon indices'), + multi: false, + validators: [validateNonEmpty], + }, + }, + ], + [ + { + name: 'metric', + config: { + ...sharedControls.metric, + label: t('Metric'), + description: t('Metric for hexagon elevation/color'), + }, + }, + ], + ['adhoc_filters'], + ['row_limit'], + [jsColumns], + [tooltipContents], + [tooltipTemplate], + ], + }, + { + label: t('Map'), + expanded: true, + controlSetRows: [[mapboxStyle], [autozoom, viewport]], + }, + { + label: t('Visual'), + controlSetRows: [ + [ + { + name: 'extruded', + config: { + type: 'CheckboxControl', + label: t('Extruded (3D)'), + default: true, + description: t('Whether to extrude hexagons in 3D'), + }, + }, + ], + [ + { + name: 'coverage', + config: { + type: 'SliderControl', + label: t('Coverage'), + default: 1, + min: 0, + max: 1, + step: 0.05, + description: t('Hexagon size multiplier (0-1)'), + }, + }, + ], + [ + { + name: 'elevation_scale', + config: { + type: 'SliderControl', + label: t('Elevation Scale'), + default: 1, + min: 0, + max: 100, + step: 1, + description: t('Multiplier for hexagon elevation'), + }, + }, + ], + [ + { + name: 'fill_color_picker', + config: { + type: 'ColorPickerControl', + label: t('Fill Color'), + default: { r: 255, g: 140, b: 0, a: 0.8 }, Review Comment: There is `PRIMARY_COLOR` that's used in deck.gl layers as the default. There is also color scheme type select for most of the deckgl charts, that allows users to select from fixed color, categorical palette/linear palette, and color breakpoints. Is it possible to implement that here? There are utils like `deckGLCategoricalColorSchemeTypeSelect` and `deckGLFixedColor` in the `Shared_DeckGL.tsx` for color controls. You can check DeckGL Polygon chart as it also uses the `getFillColor` property -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
