From 18c05701ddc366bc51424674e09f478230cef01e Mon Sep 17 00:00:00 2001 From: Yaozong Liu <750188453@qq.com> Date: Mon, 23 Aug 2021 15:49:56 +0800 Subject: [PATCH] fix(plugin-chart-echarts): [scatter-plot] remove contribution mode (#1325) --- .../Regular/Scatter/controlPanel.tsx | 260 ++++++++++++++++++ .../src/Timeseries/Regular/Scatter/index.ts | 2 +- 2 files changed, 261 insertions(+), 1 deletion(-) create mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx new file mode 100644 index 000000000000..292f6451509f --- /dev/null +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx @@ -0,0 +1,260 @@ +/** + * 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 React from 'react'; +import { t } from '@superset-ui/core'; +import { + ControlPanelConfig, + ControlPanelsContainerProps, + D3_TIME_FORMAT_DOCS, + emitFilterControl, + sections, + sharedControls, +} from '@superset-ui/chart-controls'; + +import { DEFAULT_FORM_DATA } from '../../types'; +import { legendSection, showValueSection } from '../../../controls'; + +const { + logAxis, + markerEnabled, + markerSize, + minorSplitLine, + rowLimit, + tooltipTimeFormat, + truncateYAxis, + yAxisBounds, + zoomable, + xAxisLabelRotation, +} = DEFAULT_FORM_DATA; +const config: ControlPanelConfig = { + controlPanelSections: [ + sections.legacyTimeseriesTime, + { + label: t('Query'), + expanded: true, + controlSetRows: [ + ['metrics'], + ['groupby'], + ['adhoc_filters'], + emitFilterControl, + ['limit'], + ['timeseries_limit_metric'], + [ + { + name: 'order_desc', + config: { + type: 'CheckboxControl', + label: t('Sort Descending'), + default: true, + description: t('Whether to sort descending or ascending'), + }, + }, + ], + ['row_limit'], + ], + }, + sections.advancedAnalyticsControls, + sections.annotationsAndLayersControls, + sections.forecastIntervalControls, + { + label: t('Chart Options'), + expanded: true, + controlSetRows: [ + ['color_scheme', 'label_colors'], + ...showValueSection, + [ + { + name: 'markerEnabled', + config: { + type: 'CheckboxControl', + label: t('Marker'), + renderTrigger: true, + default: markerEnabled, + description: t('Draw a marker on data points. Only applicable for line types.'), + }, + }, + ], + [ + { + name: 'markerSize', + config: { + type: 'SliderControl', + label: t('Marker Size'), + renderTrigger: true, + min: 0, + max: 100, + default: markerSize, + description: t('Size of marker. Also applies to forecast observations.'), + visibility: ({ controls }: ControlPanelsContainerProps) => + Boolean(controls?.markerEnabled?.value), + }, + }, + ], + [ + { + name: 'zoomable', + config: { + type: 'CheckboxControl', + label: t('Data Zoom'), + default: zoomable, + renderTrigger: true, + description: t('Enable data zooming controls'), + }, + }, + ], + ...legendSection, + [