This is an automated email from the ASF dual-hosted git repository. michaelsmolina pushed a commit to branch 3.0 in repository https://gitbox.apache.org/repos/asf/superset.git
commit 9a63b6b32dd9adc05f542bda4918290af7891bbd Author: Michael S. Molina <[email protected]> AuthorDate: Wed Dec 20 08:34:27 2023 -0300 chore: Disables minor ticks by default (#26310) (cherry picked from commit eb65cea971c9c7a184350827ebf37765b4b49863) --- .../plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx | 2 ++ .../src/MixedTimeseries/transformProps.ts | 6 ++++-- .../plugins/plugin-chart-echarts/src/MixedTimeseries/types.ts | 1 + .../plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx | 2 ++ .../src/Timeseries/Regular/Bar/controlPanel.tsx | 2 ++ .../src/Timeseries/Regular/Line/controlPanel.tsx | 2 ++ .../src/Timeseries/Regular/Scatter/controlPanel.tsx | 2 ++ .../src/Timeseries/Regular/SmoothLine/controlPanel.tsx | 2 ++ .../plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx | 2 ++ .../plugin-chart-echarts/src/Timeseries/transformProps.ts | 4 +++- .../plugins/plugin-chart-echarts/src/Timeseries/types.ts | 1 + .../plugins/plugin-chart-echarts/src/controls.tsx | 11 +++++++++++ 12 files changed, 34 insertions(+), 3 deletions(-) diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx index 8161b32167..1f59af3d1d 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx @@ -34,6 +34,7 @@ import { DEFAULT_FORM_DATA } from './types'; import { EchartsTimeseriesSeriesType } from '../Timeseries/types'; import { legendSection, + minorTicks, richTooltipSection, truncateXAxis, xAxisBounds, @@ -316,6 +317,7 @@ const config: ControlPanelConfig = { }, }, ], + [minorTicks], ...legendSection, [<ControlSubSectionHeader>{t('X Axis')}</ControlSubSectionHeader>], ['x_axis_time_format'], diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts index 763bbd1f95..8709286aee 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts @@ -158,6 +158,7 @@ export default function transformProps( opacity, opacityB, minorSplitLine, + minorTicks, seriesType, seriesTypeB, showLegend, @@ -497,6 +498,7 @@ export default function transformProps( formatter: xAxisFormatter, rotate: xAxisLabelRotation, }, + minorTick: { show: minorTicks }, minInterval: xAxisType === 'time' && timeGrainSqla ? TIMEGRAIN_TO_TIMESTAMP[timeGrainSqla] @@ -518,7 +520,7 @@ export default function transformProps( type: logAxis ? 'log' : 'value', min: yAxisMin, max: yAxisMax, - minorTick: { show: true }, + minorTick: { show: minorTicks }, minorSplitLine: { show: minorSplitLine }, axisLabel: { formatter: getYAxisFormatter( @@ -539,7 +541,7 @@ export default function transformProps( type: logAxisSecondary ? 'log' : 'value', min: minSecondary, max: maxSecondary, - minorTick: { show: true }, + minorTick: { show: minorTicks }, splitLine: { show: false }, minorSplitLine: { show: minorSplitLine }, axisLabel: { diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/types.ts b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/types.ts index 2e9ba641aa..c027ed7ac4 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/types.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/types.ts @@ -45,6 +45,7 @@ export type EchartsMixedTimeseriesFormData = QueryFormData & { annotationLayers: AnnotationLayer[]; // shared properties minorSplitLine: boolean; + minorTicks: boolean; logAxis: boolean; logAxisSecondary: boolean; yAxisFormat?: string; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx index 018038772c..1a5704d20a 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx @@ -39,6 +39,7 @@ import { percentageThresholdControl, truncateXAxis, xAxisBounds, + minorTicks, } from '../../controls'; import { AreaChartStackControlOptions } from '../../constants'; @@ -169,6 +170,7 @@ const config: ControlPanelConfig = { }, }, ], + [minorTicks], [ { name: 'zoomable', diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx index c3002a2498..6ab3f64097 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx @@ -32,6 +32,7 @@ import { } from '@superset-ui/chart-controls'; import { legendSection, + minorTicks, richTooltipSection, seriesOrderSection, showValueSection, @@ -312,6 +313,7 @@ const config: ControlPanelConfig = { ...seriesOrderSection, ['color_scheme'], ...showValueSection, + [minorTicks], [ { name: 'zoomable', diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx index 5c5f7a0ab1..7409098a84 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx @@ -35,6 +35,7 @@ import { } from '../../constants'; import { legendSection, + minorTicks, richTooltipSection, seriesOrderSection, showValueSection, @@ -169,6 +170,7 @@ const config: ControlPanelConfig = { }, }, ], + [minorTicks], ...legendSection, [<ControlSubSectionHeader>{t('X Axis')}</ControlSubSectionHeader>], [ diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx index 6701647694..d6e2cda533 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx @@ -34,6 +34,7 @@ import { } from '../../constants'; import { legendSection, + minorTicks, richTooltipSection, seriesOrderSection, showValueSection, @@ -111,6 +112,7 @@ const config: ControlPanelConfig = { }, }, ], + [minorTicks], ...legendSection, [<ControlSubSectionHeader>{t('X Axis')}</ControlSubSectionHeader>], diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx index 0c6623f216..aedc538969 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx @@ -34,6 +34,7 @@ import { } from '../../constants'; import { legendSection, + minorTicks, richTooltipSection, seriesOrderSection, showValueSectionWithoutStack, @@ -111,6 +112,7 @@ const config: ControlPanelConfig = { }, }, ], + [minorTicks], ...legendSection, [<ControlSubSectionHeader>{t('X Axis')}</ControlSubSectionHeader>], [ diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx index 021c306d05..99f304da78 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx @@ -32,6 +32,7 @@ import { EchartsTimeseriesSeriesType } from '../../types'; import { DEFAULT_FORM_DATA, TIME_SERIES_DESCRIPTION_TEXT } from '../constants'; import { legendSection, + minorTicks, richTooltipSection, seriesOrderSection, showValueSection, @@ -163,6 +164,7 @@ const config: ControlPanelConfig = { }, }, ], + [minorTicks], ...legendSection, [<ControlSubSectionHeader>{t('X Axis')}</ControlSubSectionHeader>], [ diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts index cc89ff30c7..63a4cb9373 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts @@ -144,6 +144,7 @@ export default function transformProps( markerSize, metrics, minorSplitLine, + minorTicks, onlyTotal, opacity, orientation, @@ -454,6 +455,7 @@ export default function transformProps( formatter: xAxisFormatter, rotate: xAxisLabelRotation, }, + minorTick: { show: minorTicks }, minInterval: xAxisType === AxisType.time && timeGrainSqla ? TIMEGRAIN_TO_TIMESTAMP[timeGrainSqla] @@ -472,7 +474,7 @@ export default function transformProps( type: logAxis ? AxisType.log : AxisType.value, min: yAxisMin, max: yAxisMax, - minorTick: { show: true }, + minorTick: { show: minorTicks }, minorSplitLine: { show: minorSplitLine }, axisLabel: { formatter: getYAxisFormatter( diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/types.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/types.ts index 65da981e49..751f262ec1 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/types.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/types.ts @@ -68,6 +68,7 @@ export type EchartsTimeseriesFormData = QueryFormData & { markerSize: number; metrics: QueryFormMetric[]; minorSplitLine: boolean; + minorTicks: boolean; opacity: number; orderDesc: boolean; rowLimit: number; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx index 093617446a..e87b68d9ce 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx @@ -279,3 +279,14 @@ export const xAxisBounds: ControlSetItem = { Boolean(controls?.truncateXAxis?.value), }, }; + +export const minorTicks: ControlSetItem = { + name: 'minorTicks', + config: { + type: 'CheckboxControl', + label: t('Minor ticks'), + default: false, + renderTrigger: true, + description: t('Show minor ticks on axes.'), + }, +};
