Skip to content

Commit

Permalink
Rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje committed Mar 18, 2023
1 parent 2c8d003 commit 9b4a0e8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
seriesOrderSection,
percentageThresholdControl,
} from '../../controls';
import { AreaChartExtraControlsOptions } from '../../constants';
import { AreaChartStackControlOptions } from '../../constants';

const {
logAxis,
Expand Down Expand Up @@ -110,7 +110,7 @@ const config: ControlPanelConfig = {
type: 'SelectControl',
label: t('Stacked Style'),
renderTrigger: true,
choices: AreaChartExtraControlsOptions,
choices: AreaChartStackControlOptions,
default: null,
description: t('Stack series on top of each other'),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
RadioButtonOption,
sharedControlComponents,
} from '@superset-ui/chart-controls';
import { AreaChartExtraControlsOptions } from '../constants';
import { AreaChartStackControlOptions } from '../constants';

const { RadioButtonControl } = sharedControlComponents;

Expand Down Expand Up @@ -53,7 +53,7 @@ export function useExtraControl<

const extraControlsOptions = useMemo(() => {
if (area) {
return AreaChartExtraControlsOptions;
return AreaChartStackControlOptions;
}
return [];
}, [area]);
Expand Down
11 changes: 3 additions & 8 deletions superset-frontend/plugins/plugin-chart-echarts/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export enum StackControlsValue {
Expand = 'Expand',
}

export const ExtraControlsOptions: [
export const StackControlOptions: [
JsonValue,
Exclude<ReactNode, null | undefined | boolean>,
][] = [
Expand All @@ -86,15 +86,10 @@ export const ExtraControlsOptions: [
[StackControlsValue.Stream, t('Stream')],
];

export const AreaChartExtraControlsOptions: [
export const AreaChartStackControlOptions: [
JsonValue,
Exclude<ReactNode, null | undefined | boolean>,
][] = [
[null, t('None')],
[StackControlsValue.Stack, t('Stack')],
[StackControlsValue.Stream, t('Stream')],
[StackControlsValue.Expand, t('Expand')],
];
][] = [...StackControlOptions, [StackControlsValue.Expand, t('Expand')]];

export const TIMEGRAIN_TO_TIMESTAMP = {
[TimeGranularity.HOUR]: 3600 * 1000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
import {
DEFAULT_LEGEND_FORM_DATA,
DEFAULT_SORT_SERIES_DATA,
ExtraControlsOptions,
StackControlOptions,
} from './constants';
import { DEFAULT_FORM_DATA } from './Timeseries/constants';
import { SortSeriesType } from './types';
Expand Down Expand Up @@ -123,7 +123,7 @@ export const stackControl: ControlSetItem = {
type: 'SelectControl',
label: t('Stacked Style'),
renderTrigger: true,
choices: ExtraControlsOptions,
choices: StackControlOptions,
default: null,
description: t('Stack series on top of each other'),
},
Expand Down

0 comments on commit 9b4a0e8

Please sign in to comment.