refactor: preparation for time section migration (#21766)

This commit is contained in:
Yongjie Zhao
2022-10-12 08:38:30 +08:00
committed by GitHub
parent bd3166b603
commit 8f61e3c5d9
43 changed files with 416 additions and 377 deletions

View File

@@ -21,8 +21,7 @@ import {
Behavior,
ChartMetadata,
ChartPlugin,
FeatureFlag,
isFeatureEnabled,
hasGenericChartAxes,
t,
} from '@superset-ui/core';
import {
@@ -60,7 +59,7 @@ export default class EchartsTimeseriesBarChartPlugin extends ChartPlugin<
behaviors: [Behavior.INTERACTIVE_CHART],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],
description: isFeatureEnabled(FeatureFlag.GENERIC_CHART_AXES)
description: hasGenericChartAxes
? t('Bar Charts are used to show metrics as a series of bars.')
: t(
'Time-series Bar Charts are used to show the changes in a metric over time as a series of bars.',
@@ -76,7 +75,7 @@ export default class EchartsTimeseriesBarChartPlugin extends ChartPlugin<
AnnotationType.Interval,
AnnotationType.Timeseries,
],
name: isFeatureEnabled(FeatureFlag.GENERIC_CHART_AXES)
name: hasGenericChartAxes
? t('Bar Chart v2')
: t('Time-series Bar Chart v2'),
tags: [

View File

@@ -21,8 +21,7 @@ import {
Behavior,
ChartMetadata,
ChartPlugin,
FeatureFlag,
isFeatureEnabled,
hasGenericChartAxes,
t,
} from '@superset-ui/core';
import {
@@ -59,7 +58,7 @@ export default class EchartsTimeseriesLineChartPlugin extends ChartPlugin<
behaviors: [Behavior.INTERACTIVE_CHART],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],
description: isFeatureEnabled(FeatureFlag.GENERIC_CHART_AXES)
description: hasGenericChartAxes
? t(
'Line chart is used to visualize measurements taken over a given category. Line chart is a type of chart which displays information as a series of data points connected by straight line segments. It is a basic type of chart common in many fields.',
)
@@ -73,7 +72,7 @@ export default class EchartsTimeseriesLineChartPlugin extends ChartPlugin<
AnnotationType.Interval,
AnnotationType.Timeseries,
],
name: isFeatureEnabled(FeatureFlag.GENERIC_CHART_AXES)
name: hasGenericChartAxes
? t('Line Chart v2')
: t('Time-series Line Chart'),
tags: [

View File

@@ -21,8 +21,7 @@ import {
Behavior,
ChartMetadata,
ChartPlugin,
FeatureFlag,
isFeatureEnabled,
hasGenericChartAxes,
t,
} from '@superset-ui/core';
import {
@@ -58,7 +57,7 @@ export default class EchartsTimeseriesScatterChartPlugin extends ChartPlugin<
behaviors: [Behavior.INTERACTIVE_CHART],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],
description: isFeatureEnabled(FeatureFlag.GENERIC_CHART_AXES)
description: hasGenericChartAxes
? t(
'Scatter Plot has the horizontal axis in linear units, and the points are connected in order. It shows a statistical relationship between two variables.',
)
@@ -72,7 +71,7 @@ export default class EchartsTimeseriesScatterChartPlugin extends ChartPlugin<
AnnotationType.Interval,
AnnotationType.Timeseries,
],
name: isFeatureEnabled(FeatureFlag.GENERIC_CHART_AXES)
name: hasGenericChartAxes
? t('Scatter Plot')
: t('Time-series Scatter Plot'),
tags: [

View File

@@ -21,8 +21,7 @@ import {
Behavior,
ChartMetadata,
ChartPlugin,
FeatureFlag,
isFeatureEnabled,
hasGenericChartAxes,
t,
} from '@superset-ui/core';
import {
@@ -58,7 +57,7 @@ export default class EchartsTimeseriesSmoothLineChartPlugin extends ChartPlugin<
behaviors: [Behavior.INTERACTIVE_CHART],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],
description: isFeatureEnabled(FeatureFlag.GENERIC_CHART_AXES)
description: hasGenericChartAxes
? t(
'Smooth-line is a variation of the line chart. Without angles and hard edges, Smooth-line sometimes looks smarter and more professional.',
)
@@ -72,7 +71,7 @@ export default class EchartsTimeseriesSmoothLineChartPlugin extends ChartPlugin<
AnnotationType.Interval,
AnnotationType.Timeseries,
],
name: isFeatureEnabled(FeatureFlag.GENERIC_CHART_AXES)
name: hasGenericChartAxes
? t('Smooth Line')
: t('Time-series Smooth Line'),
tags: [