From 4de4fc37fc84cad5aa4bae7dcd27efb380b2966c Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Fri, 13 Aug 2021 18:01:19 +0100 Subject: [PATCH] fix: add advanced analytics to all of timeseries viz (#1308) * feat: add advanced analytics to all of timeseries viz * fix namespace --- .../src/sections/advancedAnalytics.tsx | 2 +- .../src/sections/annotationsAndLayers.tsx | 40 ++++++ .../src/sections/forecastInterval.tsx | 125 ++++++++++++++++++ .../src/sections/index.ts | 2 + .../src/Timeseries/Area/controlPanel.tsx | 124 +---------------- .../src/Timeseries/Regular/controlPanel.tsx | 124 +---------------- .../src/Timeseries/Step/controlPanel.tsx | 125 +----------------- .../src/Timeseries/controlPanel.tsx | 125 +----------------- .../src/Timeseries/types.ts | 15 ++- 9 files changed, 192 insertions(+), 490 deletions(-) create mode 100644 superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/annotationsAndLayers.tsx create mode 100644 superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/forecastInterval.tsx diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/advancedAnalytics.tsx b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/advancedAnalytics.tsx index d29f61e787b8..26fd7d870b99 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/advancedAnalytics.tsx +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/advancedAnalytics.tsx @@ -21,7 +21,7 @@ import { t, RollingType, ComparisionType } from '@superset-ui/core'; import { ControlPanelSectionConfig } from '../types'; import { formatSelectOptions } from '../utils'; -export const advancedAnalytics: ControlPanelSectionConfig = { +export const advancedAnalyticsControls: ControlPanelSectionConfig = { label: t('Advanced analytics'), tabOverride: 'data', description: t( diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/annotationsAndLayers.tsx b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/annotationsAndLayers.tsx new file mode 100644 index 000000000000..9fffbb578e4d --- /dev/null +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/annotationsAndLayers.tsx @@ -0,0 +1,40 @@ +/** + * 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 { t } from '@superset-ui/core'; +import { ControlPanelSectionConfig } from '../types'; + +export const annotationLayers = []; + +export const annotationsAndLayersControls: ControlPanelSectionConfig = { + label: t('Annotations and Layers'), + expanded: false, + controlSetRows: [ + [ + { + name: 'annotation_layers', + config: { + type: 'AnnotationLayerControl', + label: '', + default: annotationLayers, + description: t('Annotation Layers'), + }, + }, + ], + ], +}; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/forecastInterval.tsx b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/forecastInterval.tsx new file mode 100644 index 000000000000..6a9bdd913260 --- /dev/null +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/forecastInterval.tsx @@ -0,0 +1,125 @@ +/** + * 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 { legacyValidateInteger, legacyValidateNumber, t } from '@superset-ui/core'; +import { ControlPanelSectionConfig } from '../types'; + +export const FORECAST_DEFAULT_DATA = { + forecastEnabled: false, + forecastInterval: 0.8, + forecastPeriods: 10, + forecastSeasonalityDaily: null, + forecastSeasonalityWeekly: null, + forecastSeasonalityYearly: null, +}; + +export const forecastIntervalControls: ControlPanelSectionConfig = { + label: t('Predictive Analytics'), + expanded: false, + controlSetRows: [ + [ + { + name: 'forecastEnabled', + config: { + type: 'CheckboxControl', + label: t('Enable forecast'), + renderTrigger: false, + default: FORECAST_DEFAULT_DATA.forecastEnabled, + description: t('Enable forecasting'), + }, + }, + ], + [ + { + name: 'forecastPeriods', + config: { + type: 'TextControl', + label: t('Forecast periods'), + validators: [legacyValidateInteger], + default: FORECAST_DEFAULT_DATA.forecastPeriods, + description: t('How many periods into the future do we want to predict'), + }, + }, + ], + [ + { + name: 'forecastInterval', + config: { + type: 'TextControl', + label: t('Confidence interval'), + validators: [legacyValidateNumber], + default: FORECAST_DEFAULT_DATA.forecastInterval, + description: t('Width of the confidence interval. Should be between 0 and 1'), + }, + }, + { + name: 'forecastSeasonalityYearly', + config: { + type: 'SelectControl', + freeForm: true, + label: 'Yearly seasonality', + choices: [ + [null, 'default'], + [true, 'Yes'], + [false, 'No'], + ], + default: FORECAST_DEFAULT_DATA.forecastSeasonalityYearly, + description: t( + 'Should yearly seasonality be applied. An integer value will specify Fourier order of seasonality.', + ), + }, + }, + ], + [ + { + name: 'forecastSeasonalityWeekly', + config: { + type: 'SelectControl', + freeForm: true, + label: 'Weekly seasonality', + choices: [ + [null, 'default'], + [true, 'Yes'], + [false, 'No'], + ], + default: FORECAST_DEFAULT_DATA.forecastSeasonalityWeekly, + description: t( + 'Should weekly seasonality be applied. An integer value will specify Fourier order of seasonality.', + ), + }, + }, + { + name: 'forecastSeasonalityDaily', + config: { + type: 'SelectControl', + freeForm: true, + label: 'Daily seasonality', + choices: [ + [null, 'default'], + [true, 'Yes'], + [false, 'No'], + ], + default: FORECAST_DEFAULT_DATA.forecastSeasonalityDaily, + description: t( + 'Should daily seasonality be applied. An integer value will specify Fourier order of seasonality.', + ), + }, + }, + ], + ], +}; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/index.ts b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/index.ts index a67ca219e149..ae8b4cad83e4 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/index.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-chart-controls/src/sections/index.ts @@ -19,3 +19,5 @@ export * from './sections'; export * from './advancedAnalytics'; +export * from './annotationsAndLayers'; +export * from './forecastInterval'; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx index 3179cf872384..bbe96e2527d5 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { legacyValidateInteger, legacyValidateNumber, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; import { ControlPanelConfig, ControlPanelsContainerProps, @@ -35,14 +35,7 @@ import { import { legendSection, showValueControl } from '../../controls'; const { - annotationLayers, contributionMode, - forecastEnabled, - forecastInterval, - forecastPeriods, - forecastSeasonalityDaily, - forecastSeasonalityWeekly, - forecastSeasonalityYearly, logAxis, markerEnabled, markerSize, @@ -100,118 +93,9 @@ const config: ControlPanelConfig = { ['row_limit'], ], }, - { - label: t('Annotations and Layers'), - expanded: false, - controlSetRows: [ - [ - { - name: 'annotation_layers', - config: { - type: 'AnnotationLayerControl', - label: '', - default: annotationLayers, - description: t('Annotation Layers'), - }, - }, - ], - ], - }, - { - label: t('Predictive Analytics'), - expanded: false, - controlSetRows: [ - [ - { - name: 'forecastEnabled', - config: { - type: 'CheckboxControl', - label: t('Enable forecast'), - renderTrigger: false, - default: forecastEnabled, - description: t('Enable forecasting'), - }, - }, - ], - [ - { - name: 'forecastPeriods', - config: { - type: 'TextControl', - label: t('Forecast periods'), - validators: [legacyValidateInteger], - default: forecastPeriods, - description: t('How many periods into the future do we want to predict'), - }, - }, - ], - [ - { - name: 'forecastInterval', - config: { - type: 'TextControl', - label: t('Confidence interval'), - validators: [legacyValidateNumber], - default: forecastInterval, - description: t('Width of the confidence interval. Should be between 0 and 1'), - }, - }, - { - name: 'forecastSeasonalityYearly', - config: { - type: 'SelectControl', - freeForm: true, - label: 'Yearly seasonality', - choices: [ - [null, 'default'], - [true, 'Yes'], - [false, 'No'], - ], - default: forecastSeasonalityYearly, - description: t( - 'Should yearly seasonality be applied. An integer value will specify Fourier order of seasonality.', - ), - }, - }, - ], - [ - { - name: 'forecastSeasonalityWeekly', - config: { - type: 'SelectControl', - freeForm: true, - label: 'Weekly seasonality', - choices: [ - [null, 'default'], - [true, 'Yes'], - [false, 'No'], - ], - default: forecastSeasonalityWeekly, - description: t( - 'Should weekly seasonality be applied. An integer value will specify Fourier order of seasonality.', - ), - }, - }, - { - name: 'forecastSeasonalityDaily', - config: { - type: 'SelectControl', - freeForm: true, - label: 'Daily seasonality', - choices: [ - [null, 'default'], - [true, 'Yes'], - [false, 'No'], - ], - default: forecastSeasonalityDaily, - description: t( - 'Should daily seasonality be applied. An integer value will specify Fourier order of seasonality.', - ), - }, - }, - ], - ], - }, + sections.advancedAnalyticsControls, + sections.annotationsAndLayersControls, + sections.forecastIntervalControls, { label: t('Chart Options'), expanded: true, diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Regular/controlPanel.tsx b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Regular/controlPanel.tsx index a520e9698b34..285ca561a702 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Regular/controlPanel.tsx +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Regular/controlPanel.tsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { legacyValidateInteger, legacyValidateNumber, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; import { ControlPanelConfig, ControlPanelsContainerProps, @@ -31,14 +31,7 @@ import { DEFAULT_FORM_DATA, EchartsTimeseriesContributionType } from '../types'; import { legendSection, showValueControl } from '../../controls'; const { - annotationLayers, contributionMode, - forecastEnabled, - forecastInterval, - forecastPeriods, - forecastSeasonalityDaily, - forecastSeasonalityWeekly, - forecastSeasonalityYearly, logAxis, markerEnabled, markerSize, @@ -94,118 +87,9 @@ const config: ControlPanelConfig = { ['row_limit'], ], }, - { - label: t('Annotations and Layers'), - expanded: false, - controlSetRows: [ - [ - { - name: 'annotation_layers', - config: { - type: 'AnnotationLayerControl', - label: '', - default: annotationLayers, - description: t('Annotation Layers'), - }, - }, - ], - ], - }, - { - label: t('Predictive Analytics'), - expanded: false, - controlSetRows: [ - [ - { - name: 'forecastEnabled', - config: { - type: 'CheckboxControl', - label: t('Enable forecast'), - renderTrigger: false, - default: forecastEnabled, - description: t('Enable forecasting'), - }, - }, - ], - [ - { - name: 'forecastPeriods', - config: { - type: 'TextControl', - label: t('Forecast periods'), - validators: [legacyValidateInteger], - default: forecastPeriods, - description: t('How many periods into the future do we want to predict'), - }, - }, - ], - [ - { - name: 'forecastInterval', - config: { - type: 'TextControl', - label: t('Confidence interval'), - validators: [legacyValidateNumber], - default: forecastInterval, - description: t('Width of the confidence interval. Should be between 0 and 1'), - }, - }, - { - name: 'forecastSeasonalityYearly', - config: { - type: 'SelectControl', - freeForm: true, - label: 'Yearly seasonality', - choices: [ - [null, 'default'], - [true, 'Yes'], - [false, 'No'], - ], - default: forecastSeasonalityYearly, - description: t( - 'Should yearly seasonality be applied. An integer value will specify Fourier order of seasonality.', - ), - }, - }, - ], - [ - { - name: 'forecastSeasonalityWeekly', - config: { - type: 'SelectControl', - freeForm: true, - label: 'Weekly seasonality', - choices: [ - [null, 'default'], - [true, 'Yes'], - [false, 'No'], - ], - default: forecastSeasonalityWeekly, - description: t( - 'Should weekly seasonality be applied. An integer value will specify Fourier order of seasonality.', - ), - }, - }, - { - name: 'forecastSeasonalityDaily', - config: { - type: 'SelectControl', - freeForm: true, - label: 'Daily seasonality', - choices: [ - [null, 'default'], - [true, 'Yes'], - [false, 'No'], - ], - default: forecastSeasonalityDaily, - description: t( - 'Should daily seasonality be applied. An integer value will specify Fourier order of seasonality.', - ), - }, - }, - ], - ], - }, + sections.advancedAnalyticsControls, + sections.annotationsAndLayersControls, + sections.forecastIntervalControls, { label: t('Chart Options'), expanded: true, diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx index 8b63418bc3f4..3da963876c1e 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { legacyValidateInteger, legacyValidateNumber, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; import { ControlPanelConfig, ControlPanelsContainerProps, @@ -36,14 +36,7 @@ import { legendSection, showValueControl } from '../../controls'; const { area, - annotationLayers, contributionMode, - forecastEnabled, - forecastInterval, - forecastPeriods, - forecastSeasonalityDaily, - forecastSeasonalityWeekly, - forecastSeasonalityYearly, logAxis, markerEnabled, markerSize, @@ -100,119 +93,9 @@ const config: ControlPanelConfig = { ['row_limit'], ], }, - sections.advancedAnalytics, - { - label: t('Annotations and Layers'), - expanded: false, - controlSetRows: [ - [ - { - name: 'annotation_layers', - config: { - type: 'AnnotationLayerControl', - label: '', - default: annotationLayers, - description: t('Annotation Layers'), - }, - }, - ], - ], - }, - { - label: t('Predictive Analytics'), - expanded: false, - controlSetRows: [ - [ - { - name: 'forecastEnabled', - config: { - type: 'CheckboxControl', - label: t('Enable forecast'), - renderTrigger: false, - default: forecastEnabled, - description: t('Enable forecasting'), - }, - }, - ], - [ - { - name: 'forecastPeriods', - config: { - type: 'TextControl', - label: t('Forecast periods'), - validators: [legacyValidateInteger], - default: forecastPeriods, - description: t('How many periods into the future do we want to predict'), - }, - }, - ], - [ - { - name: 'forecastInterval', - config: { - type: 'TextControl', - label: t('Confidence interval'), - validators: [legacyValidateNumber], - default: forecastInterval, - description: t('Width of the confidence interval. Should be between 0 and 1'), - }, - }, - { - name: 'forecastSeasonalityYearly', - config: { - type: 'SelectControl', - freeForm: true, - label: 'Yearly seasonality', - choices: [ - [null, 'default'], - [true, 'Yes'], - [false, 'No'], - ], - default: forecastSeasonalityYearly, - description: t( - 'Should yearly seasonality be applied. An integer value will specify Fourier order of seasonality.', - ), - }, - }, - ], - [ - { - name: 'forecastSeasonalityWeekly', - config: { - type: 'SelectControl', - freeForm: true, - label: 'Weekly seasonality', - choices: [ - [null, 'default'], - [true, 'Yes'], - [false, 'No'], - ], - default: forecastSeasonalityWeekly, - description: t( - 'Should weekly seasonality be applied. An integer value will specify Fourier order of seasonality.', - ), - }, - }, - { - name: 'forecastSeasonalityDaily', - config: { - type: 'SelectControl', - freeForm: true, - label: 'Daily seasonality', - choices: [ - [null, 'default'], - [true, 'Yes'], - [false, 'No'], - ], - default: forecastSeasonalityDaily, - description: t( - 'Should daily seasonality be applied. An integer value will specify Fourier order of seasonality.', - ), - }, - }, - ], - ], - }, + sections.advancedAnalyticsControls, + sections.annotationsAndLayersControls, + sections.forecastIntervalControls, { label: t('Chart Options'), expanded: true, diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/controlPanel.tsx b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/controlPanel.tsx index a1cf7b6a89bd..53e70fc1ea7d 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/controlPanel.tsx +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/controlPanel.tsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { legacyValidateInteger, legacyValidateNumber, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; import { ControlPanelConfig, ControlPanelsContainerProps, @@ -36,14 +36,7 @@ import { legendSection, showValueControl } from '../controls'; const { area, - annotationLayers, contributionMode, - forecastEnabled, - forecastInterval, - forecastPeriods, - forecastSeasonalityDaily, - forecastSeasonalityWeekly, - forecastSeasonalityYearly, logAxis, markerEnabled, markerSize, @@ -101,119 +94,9 @@ const config: ControlPanelConfig = { ['row_limit'], ], }, - sections.advancedAnalytics, - { - label: t('Annotations and Layers'), - expanded: false, - controlSetRows: [ - [ - { - name: 'annotation_layers', - config: { - type: 'AnnotationLayerControl', - label: '', - default: annotationLayers, - description: t('Annotation Layers'), - }, - }, - ], - ], - }, - { - label: t('Predictive Analytics'), - expanded: false, - controlSetRows: [ - [ - { - name: 'forecastEnabled', - config: { - type: 'CheckboxControl', - label: t('Enable forecast'), - renderTrigger: false, - default: forecastEnabled, - description: t('Enable forecasting'), - }, - }, - ], - [ - { - name: 'forecastPeriods', - config: { - type: 'TextControl', - label: t('Forecast periods'), - validators: [legacyValidateInteger], - default: forecastPeriods, - description: t('How many periods into the future do we want to predict'), - }, - }, - ], - [ - { - name: 'forecastInterval', - config: { - type: 'TextControl', - label: t('Confidence interval'), - validators: [legacyValidateNumber], - default: forecastInterval, - description: t('Width of the confidence interval. Should be between 0 and 1'), - }, - }, - { - name: 'forecastSeasonalityYearly', - config: { - type: 'SelectControl', - freeForm: true, - label: 'Yearly seasonality', - choices: [ - [null, 'default'], - [true, 'Yes'], - [false, 'No'], - ], - default: forecastSeasonalityYearly, - description: t( - 'Should yearly seasonality be applied. An integer value will specify Fourier order of seasonality.', - ), - }, - }, - ], - [ - { - name: 'forecastSeasonalityWeekly', - config: { - type: 'SelectControl', - freeForm: true, - label: 'Weekly seasonality', - choices: [ - [null, 'default'], - [true, 'Yes'], - [false, 'No'], - ], - default: forecastSeasonalityWeekly, - description: t( - 'Should weekly seasonality be applied. An integer value will specify Fourier order of seasonality.', - ), - }, - }, - { - name: 'forecastSeasonalityDaily', - config: { - type: 'SelectControl', - freeForm: true, - label: 'Daily seasonality', - choices: [ - [null, 'default'], - [true, 'Yes'], - [false, 'No'], - ], - default: forecastSeasonalityDaily, - description: t( - 'Should daily seasonality be applied. An integer value will specify Fourier order of seasonality.', - ), - }, - }, - ], - ], - }, + sections.advancedAnalyticsControls, + sections.annotationsAndLayersControls, + sections.forecastIntervalControls, { label: t('Chart Options'), expanded: true, diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/types.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/types.ts index c7fb15c21819..9c0af522861a 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/types.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-chart-echarts/src/Timeseries/types.ts @@ -23,6 +23,7 @@ import { QueryFormData, TimeGranularity, } from '@superset-ui/core'; +import { sections } from '@superset-ui/chart-controls'; import { DEFAULT_LEGEND_FORM_DATA, EchartsLegendFormData, EChartTransformedProps } from '../types'; export enum EchartsTimeseriesContributionType { @@ -80,14 +81,14 @@ export type EchartsTimeseriesFormData = QueryFormData & { // @ts-ignore export const DEFAULT_FORM_DATA: EchartsTimeseriesFormData = { ...DEFAULT_LEGEND_FORM_DATA, - annotationLayers: [], + annotationLayers: sections.annotationLayers, area: false, - forecastEnabled: false, - forecastInterval: 0.8, - forecastPeriods: 10, - forecastSeasonalityDaily: null, - forecastSeasonalityWeekly: null, - forecastSeasonalityYearly: null, + forecastEnabled: sections.FORECAST_DEFAULT_DATA.forecastEnabled, + forecastInterval: sections.FORECAST_DEFAULT_DATA.forecastInterval, + forecastPeriods: sections.FORECAST_DEFAULT_DATA.forecastPeriods, + forecastSeasonalityDaily: sections.FORECAST_DEFAULT_DATA.forecastSeasonalityDaily, + forecastSeasonalityWeekly: sections.FORECAST_DEFAULT_DATA.forecastSeasonalityWeekly, + forecastSeasonalityYearly: sections.FORECAST_DEFAULT_DATA.forecastSeasonalityYearly, logAxis: false, markerEnabled: false, markerSize: 6,