mirror of
https://github.com/apache/superset.git
synced 2026-04-27 20:14:54 +00:00
feat: add Advanced Analytics into mixed time series chart (#19851)
This commit is contained in:
@@ -18,10 +18,12 @@
|
||||
*/
|
||||
import React from 'react';
|
||||
import { t } from '@superset-ui/core';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import {
|
||||
ControlPanelConfig,
|
||||
ControlPanelSectionConfig,
|
||||
ControlSetRow,
|
||||
CustomControlItem,
|
||||
emitFilterControl,
|
||||
sections,
|
||||
sharedControls,
|
||||
@@ -253,11 +255,33 @@ function createCustomizeSection(
|
||||
];
|
||||
}
|
||||
|
||||
function createAdvancedAnalyticsSection(
|
||||
label: string,
|
||||
controlSuffix: string,
|
||||
): ControlPanelSectionConfig {
|
||||
const aaWithSuffix = cloneDeep(sections.advancedAnalyticsControls);
|
||||
aaWithSuffix.label = label;
|
||||
if (!controlSuffix) {
|
||||
return aaWithSuffix;
|
||||
}
|
||||
aaWithSuffix.controlSetRows.forEach(row =>
|
||||
row.forEach((control: CustomControlItem) => {
|
||||
if (control?.name) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
control.name = `${control.name}${controlSuffix}`;
|
||||
}
|
||||
}),
|
||||
);
|
||||
return aaWithSuffix;
|
||||
}
|
||||
|
||||
const config: ControlPanelConfig = {
|
||||
controlPanelSections: [
|
||||
sections.legacyTimeseriesTime,
|
||||
createQuerySection(t('Query A'), ''),
|
||||
createAdvancedAnalyticsSection(t('Advanced analytics Query A'), ''),
|
||||
createQuerySection(t('Query B'), '_b'),
|
||||
createAdvancedAnalyticsSection(t('Advanced analytics Query B'), '_b'),
|
||||
{
|
||||
label: t('Annotations and Layers'),
|
||||
expanded: false,
|
||||
|
||||
Reference in New Issue
Block a user