refactor: Removes the deprecated GENERIC_CHART_AXES feature flag (#26372)

This commit is contained in:
Michael S. Molina
2024-01-31 09:45:57 -05:00
committed by GitHub
parent d8f7e2ce5e
commit 8a2f7d378a
99 changed files with 363 additions and 1115 deletions

View File

@@ -23,13 +23,11 @@ import {
D3_TIME_FORMAT_OPTIONS,
Dataset,
getStandardizedControls,
sections,
} from '@superset-ui/chart-controls';
import { headerFontSize, subheaderFontSize } from '../sharedControls';
export default {
controlPanelSections: [
sections.legacyRegularTime,
{
label: t('Query'),
expanded: true,

View File

@@ -16,14 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
import { hasGenericChartAxes, smartDateFormatter, t } from '@superset-ui/core';
import { smartDateFormatter, t } from '@superset-ui/core';
import {
ControlPanelConfig,
ControlSubSectionHeader,
D3_FORMAT_DOCS,
D3_TIME_FORMAT_OPTIONS,
getStandardizedControls,
sections,
temporalColumnMixin,
} from '@superset-ui/chart-controls';
import React from 'react';
@@ -31,13 +30,12 @@ import { headerFontSize, subheaderFontSize } from '../sharedControls';
const config: ControlPanelConfig = {
controlPanelSections: [
sections.genericTime,
{
label: t('Query'),
expanded: true,
controlSetRows: [
[hasGenericChartAxes ? 'x_axis' : null],
[hasGenericChartAxes ? 'time_grain_sqla' : null],
['x_axis'],
['time_grain_sqla'],
['metric'],
['adhoc_filters'],
],

View File

@@ -39,7 +39,6 @@ import {
const config: ControlPanelConfig = {
controlPanelSections: [
sections.legacyRegularTime,
{
label: t('Query'),
expanded: true,

View File

@@ -26,7 +26,6 @@ import {
D3_FORMAT_OPTIONS,
D3_NUMBER_FORMAT_DESCRIPTION_VALUES_TEXT,
getStandardizedControls,
sections,
sharedControls,
} from '@superset-ui/chart-controls';
import {
@@ -44,7 +43,6 @@ funnelLegendSection.splice(2, 1);
const config: ControlPanelConfig = {
controlPanelSections: [
sections.legacyRegularTime,
{
label: t('Query'),
expanded: true,

View File

@@ -23,14 +23,12 @@ import {
ControlPanelConfig,
ControlSubSectionHeader,
D3_FORMAT_OPTIONS,
sections,
getStandardizedControls,
} from '@superset-ui/chart-controls';
import { DEFAULT_FORM_DATA } from './types';
const config: ControlPanelConfig = {
controlPanelSections: [
sections.legacyRegularTime,
{
label: t('Query'),
expanded: true,

View File

@@ -22,7 +22,6 @@ import {
ControlPanelConfig,
ControlSubSectionHeader,
getStandardizedControls,
sections,
sharedControls,
} from '@superset-ui/chart-controls';
import { DEFAULT_FORM_DATA } from './types';
@@ -41,7 +40,6 @@ const optionalEntity = {
const controlPanel: ControlPanelConfig = {
controlPanelSections: [
sections.legacyRegularTime,
{
label: t('Query'),
expanded: true,

View File

@@ -17,7 +17,7 @@
* under the License.
*/
import React from 'react';
import { ensureIsArray, hasGenericChartAxes, t } from '@superset-ui/core';
import { ensureIsArray, t } from '@superset-ui/core';
import { cloneDeep } from 'lodash';
import {
ControlPanelConfig,
@@ -284,14 +284,11 @@ function createAdvancedAnalyticsSection(
const config: ControlPanelConfig = {
controlPanelSections: [
sections.genericTime,
hasGenericChartAxes
? {
label: t('Shared query fields'),
expanded: true,
controlSetRows: [['x_axis'], ['time_grain_sqla']],
}
: null,
{
label: t('Shared query fields'),
expanded: true,
controlSetRows: [['x_axis'], ['time_grain_sqla']],
},
createQuerySection(t('Query A'), ''),
createAdvancedAnalyticsSection(t('Advanced analytics Query A'), ''),
createQuerySection(t('Query B'), '_b'),

View File

@@ -16,12 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import {
AnnotationType,
Behavior,
hasGenericChartAxes,
t,
} from '@superset-ui/core';
import { AnnotationType, Behavior, t } from '@superset-ui/core';
import buildQuery from './buildQuery';
import controlPanel from './controlPanel';
import transformProps from './transformProps';
@@ -60,13 +55,9 @@ export default class EchartsTimeseriesChartPlugin extends EchartsChartPlugin<
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],
description: hasGenericChartAxes
? t(
'Visualize two different series using the same x-axis. Note that both series can be visualized with a different chart type (e.g. 1 using bars and 1 using a line).',
)
: t(
'Visualize two different time series using the same x-axis. Note that each time series can be visualized differently (e.g. 1 using bars and 1 using a line).',
),
description: t(
'Visualize two different series using the same x-axis. Note that both series can be visualized with a different chart type (e.g. 1 using bars and 1 using a line).',
),
supportedAnnotationTypes: [
AnnotationType.Event,
AnnotationType.Formula,
@@ -74,7 +65,7 @@ export default class EchartsTimeseriesChartPlugin extends EchartsChartPlugin<
AnnotationType.Timeseries,
],
exampleGallery: [{ url: example }],
name: hasGenericChartAxes ? t('Mixed Chart') : t('Mixed Time-Series'),
name: t('Mixed Chart'),
thumbnail,
tags: [
t('Advanced-Analytics'),

View File

@@ -26,7 +26,6 @@ import {
D3_NUMBER_FORMAT_DESCRIPTION_VALUES_TEXT,
D3_FORMAT_OPTIONS,
D3_TIME_FORMAT_OPTIONS,
sections,
getStandardizedControls,
} from '@superset-ui/chart-controls';
import { DEFAULT_FORM_DATA } from './types';
@@ -45,7 +44,6 @@ const {
const config: ControlPanelConfig = {
controlPanelSections: [
sections.legacyRegularTime,
{
label: t('Query'),
expanded: true,

View File

@@ -31,7 +31,6 @@ import {
D3_NUMBER_FORMAT_DESCRIPTION_VALUES_TEXT,
D3_FORMAT_OPTIONS,
D3_TIME_FORMAT_OPTIONS,
sections,
sharedControls,
ControlFormItemSpec,
getStandardizedControls,
@@ -60,7 +59,6 @@ const radarMetricMaxValue: { name: string; config: ControlFormItemSpec } = {
const config: ControlPanelConfig = {
controlPanelSections: [
sections.legacyRegularTime,
{
label: t('Query'),
expanded: true,

View File

@@ -27,7 +27,6 @@ import {
D3_FORMAT_OPTIONS,
D3_TIME_FORMAT_OPTIONS,
getStandardizedControls,
sections,
} from '@superset-ui/chart-controls';
import { DEFAULT_FORM_DATA } from './types';
@@ -35,7 +34,6 @@ const { labelType, numberFormat, showLabels } = DEFAULT_FORM_DATA;
const config: ControlPanelConfig = {
controlPanelSections: [
sections.legacyRegularTime,
{
label: t('Query'),
expanded: true,

View File

@@ -58,7 +58,6 @@ const {
} = DEFAULT_FORM_DATA;
const config: ControlPanelConfig = {
controlPanelSections: [
sections.genericTime,
sections.echartsTimeSeriesQueryWithXAxisSort,
sections.advancedAnalyticsControls,
sections.annotationsAndLayersControls,

View File

@@ -16,12 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import {
t,
AnnotationType,
Behavior,
hasGenericChartAxes,
} from '@superset-ui/core';
import { t, AnnotationType, Behavior } from '@superset-ui/core';
import buildQuery from '../buildQuery';
import controlPanel from './controlPanel';
import transformProps from '../transformProps';
@@ -56,13 +51,9 @@ export default class EchartsAreaChartPlugin extends EchartsChartPlugin<
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],
description: hasGenericChartAxes
? t(
'Area charts are similar to line charts in that they represent variables with the same scale, but area charts stack the metrics on top of each other.',
)
: t(
'Time-series Area chart are similar to line chart in that they represent variables with the same scale, but area charts stack the metrics on top of each other. An area chart in Superset can be stream, stack, or expand.',
),
description: t(
'Area charts are similar to line charts in that they represent variables with the same scale, but area charts stack the metrics on top of each other.',
),
exampleGallery: [{ url: example1 }],
supportedAnnotationTypes: [
AnnotationType.Event,
@@ -70,9 +61,7 @@ export default class EchartsAreaChartPlugin extends EchartsChartPlugin<
AnnotationType.Interval,
AnnotationType.Timeseries,
],
name: hasGenericChartAxes
? t('Area Chart')
: t('Time-series Area Chart'),
name: t('Area Chart'),
tags: [
t('ECharts'),
t('Predictive'),

View File

@@ -255,7 +255,6 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
const config: ControlPanelConfig = {
controlPanelSections: [
sections.genericTime,
sections.echartsTimeSeriesQueryWithXAxisSort,
sections.advancedAnalyticsControls,
sections.annotationsAndLayersControls,

View File

@@ -16,12 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import {
AnnotationType,
Behavior,
hasGenericChartAxes,
t,
} from '@superset-ui/core';
import { AnnotationType, Behavior, t } from '@superset-ui/core';
import {
EchartsTimeseriesChartProps,
EchartsTimeseriesFormData,
@@ -62,11 +57,9 @@ export default class EchartsTimeseriesBarChartPlugin extends EchartsChartPlugin<
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],
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.',
),
description: t(
'Bar Charts are used to show metrics as a series of bars.',
),
exampleGallery: [
{ url: example1 },
{ url: example2 },
@@ -78,7 +71,7 @@ export default class EchartsTimeseriesBarChartPlugin extends EchartsChartPlugin<
AnnotationType.Interval,
AnnotationType.Timeseries,
],
name: hasGenericChartAxes ? t('Bar Chart') : t('Time-series Bar Chart'),
name: t('Bar Chart'),
tags: [
t('ECharts'),
t('Predictive'),

View File

@@ -59,7 +59,6 @@ const {
} = DEFAULT_FORM_DATA;
const config: ControlPanelConfig = {
controlPanelSections: [
sections.genericTime,
sections.echartsTimeSeriesQueryWithXAxisSort,
sections.advancedAnalyticsControls,
sections.annotationsAndLayersControls,

View File

@@ -16,12 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import {
AnnotationType,
Behavior,
hasGenericChartAxes,
t,
} from '@superset-ui/core';
import { AnnotationType, Behavior, t } from '@superset-ui/core';
import {
EchartsTimeseriesChartProps,
EchartsTimeseriesFormData,
@@ -61,13 +56,9 @@ export default class EchartsTimeseriesLineChartPlugin extends EchartsChartPlugin
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],
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.',
)
: t(
'Time-series line chart is used to visualize repeated measurements taken over regular time intervals. 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.',
),
description: 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.',
),
exampleGallery: [{ url: example1 }, { url: example2 }],
supportedAnnotationTypes: [
AnnotationType.Event,
@@ -75,9 +66,7 @@ export default class EchartsTimeseriesLineChartPlugin extends EchartsChartPlugin
AnnotationType.Interval,
AnnotationType.Timeseries,
],
name: hasGenericChartAxes
? t('Line Chart')
: t('Time-series Line Chart'),
name: t('Line Chart'),
tags: [
t('ECharts'),
t('Predictive'),

View File

@@ -55,7 +55,6 @@ const {
} = DEFAULT_FORM_DATA;
const config: ControlPanelConfig = {
controlPanelSections: [
sections.genericTime,
sections.echartsTimeSeriesQueryWithXAxisSort,
sections.advancedAnalyticsControls,
sections.annotationsAndLayersControls,

View File

@@ -16,12 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import {
AnnotationType,
Behavior,
hasGenericChartAxes,
t,
} from '@superset-ui/core';
import { AnnotationType, Behavior, t } from '@superset-ui/core';
import {
EchartsTimeseriesChartProps,
EchartsTimeseriesFormData,
@@ -60,13 +55,9 @@ export default class EchartsTimeseriesScatterChartPlugin extends EchartsChartPlu
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],
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.',
)
: t(
'Time-series Scatter Plot has time on the horizontal axis in linear units, and the points are connected in order. It shows a statistical relationship between two variables.',
),
description: 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.',
),
exampleGallery: [{ url: example1 }],
supportedAnnotationTypes: [
AnnotationType.Event,
@@ -74,9 +65,7 @@ export default class EchartsTimeseriesScatterChartPlugin extends EchartsChartPlu
AnnotationType.Interval,
AnnotationType.Timeseries,
],
name: hasGenericChartAxes
? t('Scatter Plot')
: t('Time-series Scatter Plot'),
name: t('Scatter Plot'),
tags: [
t('ECharts'),
t('Predictive'),

View File

@@ -55,7 +55,6 @@ const {
} = DEFAULT_FORM_DATA;
const config: ControlPanelConfig = {
controlPanelSections: [
sections.genericTime,
sections.echartsTimeSeriesQueryWithXAxisSort,
sections.advancedAnalyticsControls,
sections.annotationsAndLayersControls,

View File

@@ -16,12 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import {
AnnotationType,
Behavior,
hasGenericChartAxes,
t,
} from '@superset-ui/core';
import { AnnotationType, Behavior, t } from '@superset-ui/core';
import {
EchartsTimeseriesChartProps,
EchartsTimeseriesFormData,
@@ -60,13 +55,9 @@ export default class EchartsTimeseriesSmoothLineChartPlugin extends EchartsChart
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],
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.',
)
: t(
'Time-series Smooth-line is a variation of the line chart. Without angles and hard edges, Smooth-line sometimes looks smarter and more professional.',
),
description: t(
'Smooth-line is a variation of the line chart. Without angles and hard edges, Smooth-line sometimes looks smarter and more professional.',
),
exampleGallery: [{ url: example1 }],
supportedAnnotationTypes: [
AnnotationType.Event,
@@ -74,9 +65,7 @@ export default class EchartsTimeseriesSmoothLineChartPlugin extends EchartsChart
AnnotationType.Interval,
AnnotationType.Timeseries,
],
name: hasGenericChartAxes
? t('Smooth Line')
: t('Time-series Smooth Line'),
name: t('Smooth Line'),
tags: [
t('ECharts'),
t('Predictive'),

View File

@@ -55,7 +55,6 @@ const {
} = DEFAULT_FORM_DATA;
const config: ControlPanelConfig = {
controlPanelSections: [
sections.genericTime,
sections.echartsTimeSeriesQueryWithXAxisSort,
sections.advancedAnalyticsControls,
sections.annotationsAndLayersControls,

View File

@@ -16,12 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import {
AnnotationType,
Behavior,
hasGenericChartAxes,
t,
} from '@superset-ui/core';
import { AnnotationType, Behavior, t } from '@superset-ui/core';
import {
EchartsTimeseriesChartProps,
EchartsTimeseriesFormData,
@@ -51,13 +46,9 @@ export default class EchartsTimeseriesStepChartPlugin extends EchartsChartPlugin
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],
description: hasGenericChartAxes
? t(
'Stepped-line graph (also called step chart) is a variation of line chart but with the line forming a series of steps between data points. A step chart can be useful when you want to show the changes that occur at irregular intervals.',
)
: t(
'Time-series Stepped-line graph (also called step chart) is a variation of line chart but with the line forming a series of steps between data points. A step chart can be useful when you want to show the changes that occur at irregular intervals.',
),
description: t(
'Stepped-line graph (also called step chart) is a variation of line chart but with the line forming a series of steps between data points. A step chart can be useful when you want to show the changes that occur at irregular intervals.',
),
exampleGallery: [{ url: example1 }, { url: example2 }],
supportedAnnotationTypes: [
AnnotationType.Event,
@@ -65,9 +56,7 @@ export default class EchartsTimeseriesStepChartPlugin extends EchartsChartPlugin
AnnotationType.Interval,
AnnotationType.Timeseries,
],
name: hasGenericChartAxes
? t('Stepped Line')
: t('Time-series Stepped Line'),
name: t('Stepped Line'),
tags: [
t('ECharts'),
t('Predictive'),

View File

@@ -16,12 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import {
AnnotationType,
Behavior,
hasGenericChartAxes,
t,
} from '@superset-ui/core';
import { AnnotationType, Behavior, t } from '@superset-ui/core';
import buildQuery from './buildQuery';
import controlPanel from './Regular/Line/controlPanel';
import transformProps from './transformProps';
@@ -50,13 +45,9 @@ export default class EchartsTimeseriesChartPlugin extends EchartsChartPlugin<
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],
description: hasGenericChartAxes
? t(
'Swiss army knife for visualizing data. Choose between step, line, scatter, and bar charts. This viz type has many customization options as well.',
)
: t(
'Swiss army knife for visualizing time series data. Choose between step, line, scatter, and bar charts. This viz type has many customization options as well.',
),
description: t(
'Swiss army knife for visualizing data. Choose between step, line, scatter, and bar charts. This viz type has many customization options as well.',
),
exampleGallery: [{ url: example }],
supportedAnnotationTypes: [
AnnotationType.Event,
@@ -64,7 +55,7 @@ export default class EchartsTimeseriesChartPlugin extends EchartsChartPlugin<
AnnotationType.Interval,
AnnotationType.Timeseries,
],
name: hasGenericChartAxes ? t('Generic Chart') : t('Time-series Chart'),
name: t('Generic Chart'),
tags: [
t('Advanced-Analytics'),
t('Aesthetic'),

View File

@@ -22,7 +22,6 @@ import {
ControlPanelConfig,
ControlSubSectionHeader,
getStandardizedControls,
sections,
sharedControls,
} from '@superset-ui/chart-controls';
import { DEFAULT_FORM_DATA } from './constants';
@@ -39,7 +38,6 @@ const optionalEntity = {
const controlPanel: ControlPanelConfig = {
controlPanelSections: [
sections.legacyRegularTime,
{
label: t('Query'),
expanded: true,

View File

@@ -25,7 +25,6 @@ import {
D3_NUMBER_FORMAT_DESCRIPTION_VALUES_TEXT,
D3_FORMAT_OPTIONS,
D3_TIME_FORMAT_OPTIONS,
sections,
getStandardizedControls,
} from '@superset-ui/chart-controls';
import { DEFAULT_FORM_DATA } from './types';
@@ -35,7 +34,6 @@ const { labelType, numberFormat, showLabels, showUpperLabels, dateFormat } =
const config: ControlPanelConfig = {
controlPanelSections: [
sections.legacyRegularTime,
{
label: t('Query'),
expanded: true,

View File

@@ -17,27 +17,25 @@
* under the License.
*/
import React from 'react';
import { hasGenericChartAxes, t } from '@superset-ui/core';
import { t } from '@superset-ui/core';
import {
ControlPanelConfig,
ControlSubSectionHeader,
D3_TIME_FORMAT_DOCS,
DEFAULT_TIME_FORMAT,
formatSelectOptions,
sections,
sharedControls,
} from '@superset-ui/chart-controls';
import { showValueControl } from '../controls';
const config: ControlPanelConfig = {
controlPanelSections: [
sections.genericTime,
{
label: t('Query'),
expanded: true,
controlSetRows: [
[hasGenericChartAxes ? 'x_axis' : null],
[hasGenericChartAxes ? 'time_grain_sqla' : null],
['x_axis'],
['time_grain_sqla'],
['groupby'],
['metric'],
['adhoc_filters'],