Merge branch 'master' into msyavuz/chore/react-18

This commit is contained in:
Mehmet Salih Yavuz
2025-09-13 02:35:38 +03:00
128 changed files with 3586 additions and 1821 deletions

View File

@@ -158,6 +158,7 @@ const config: ControlPanelConfig = {
},
},
],
['zoomable'],
],
},
],

View File

@@ -73,6 +73,7 @@ export default function transformProps(
yAxisTitleMargin,
yAxisTitlePosition,
sliceId,
zoomable,
} = formData as BoxPlotQueryFormData;
const refs: Refs = {};
const colorFn = CategoricalColorNamespace.getScale(colorScheme as string);
@@ -284,6 +285,26 @@ export default function transformProps(
},
},
series,
toolbox: {
show: zoomable,
feature: {
dataZoom: {
title: {
zoom: 'zoom area',
back: 'restore zoom',
},
},
},
},
dataZoom: zoomable
? [
{
type: 'inside',
zoomOnMouseWheel: false,
moveOnMouseWheel: true,
},
]
: [],
};
return {

View File

@@ -42,6 +42,7 @@ import {
xAxisBounds,
xAxisLabelRotation,
xAxisLabelInterval,
forceMaxInterval,
} from '../controls';
const {
@@ -358,6 +359,7 @@ const config: ControlPanelConfig = {
['x_axis_time_format'],
[xAxisLabelRotation],
[xAxisLabelInterval],
[forceMaxInterval],
[<ControlSubSectionHeader>{t('Tooltip')}</ControlSubSectionHeader>],
[
{

View File

@@ -214,6 +214,7 @@ export default function transformProps(
sortSeriesAscending,
sortSeriesAscendingB,
timeGrainSqla,
forceMaxInterval,
percentageThreshold,
showQueryIdentifiers = false,
metrics = [],
@@ -583,11 +584,17 @@ export default function transformProps(
},
minorTick: { show: minorTicks },
minInterval:
xAxisType === AxisType.Time && timeGrainSqla
xAxisType === AxisType.Time && timeGrainSqla && !forceMaxInterval
? TIMEGRAIN_TO_TIMESTAMP[
timeGrainSqla as keyof typeof TIMEGRAIN_TO_TIMESTAMP
]
: 0,
maxInterval:
xAxisType === AxisType.Time && timeGrainSqla && forceMaxInterval
? TIMEGRAIN_TO_TIMESTAMP[
timeGrainSqla as keyof typeof TIMEGRAIN_TO_TIMESTAMP
]
: undefined,
...getMinAndMaxFromBounds(
xAxisType,
truncateXAxis,

View File

@@ -57,6 +57,7 @@ export type EchartsMixedTimeseriesFormData = QueryFormData & {
truncateYAxis: boolean;
truncateYAxisSecondary: boolean;
timeGrainSqla?: TimeGranularity;
forceMaxInterval?: boolean;
tooltipTimeFormat?: string;
zoomable: boolean;
richTooltip: boolean;

View File

@@ -41,6 +41,7 @@ import {
truncateXAxis,
xAxisBounds,
minorTicks,
forceMaxInterval,
} from '../../controls';
import { AreaChartStackControlOptions } from '../../constants';
@@ -185,6 +186,7 @@ const config: ControlPanelConfig = {
],
[xAxisLabelRotation],
[xAxisLabelInterval],
[forceMaxInterval],
...richTooltipSection,
// eslint-disable-next-line react/jsx-key
[<ControlSubSectionHeader>{t('Y Axis')}</ControlSubSectionHeader>],

View File

@@ -39,6 +39,7 @@ import {
xAxisBounds,
xAxisLabelRotation,
xAxisLabelInterval,
forceMaxInterval,
} from '../../../controls';
import { OrientationType } from '../../types';
@@ -364,6 +365,7 @@ const config: ControlPanelConfig = {
...createAxisControl('x'),
[truncateXAxis],
[xAxisBounds],
[forceMaxInterval],
...richTooltipSection,
[<ControlSubSectionHeader>{t('Y Axis')}</ControlSubSectionHeader>],
...createAxisControl('y'),

View File

@@ -42,6 +42,7 @@ import {
xAxisBounds,
xAxisLabelRotation,
xAxisLabelInterval,
forceMaxInterval,
} from '../../../controls';
const {
@@ -173,6 +174,7 @@ const config: ControlPanelConfig = {
],
[xAxisLabelRotation],
[xAxisLabelInterval],
[forceMaxInterval],
...richTooltipSection,
// eslint-disable-next-line react/jsx-key
[<ControlSubSectionHeader>{t('Y Axis')}</ControlSubSectionHeader>],

View File

@@ -41,6 +41,7 @@ import {
xAxisBounds,
xAxisLabelRotation,
xAxisLabelInterval,
forceMaxInterval,
} from '../../../controls';
const {
@@ -116,6 +117,7 @@ const config: ControlPanelConfig = {
],
[xAxisLabelRotation],
[xAxisLabelInterval],
[forceMaxInterval],
// eslint-disable-next-line react/jsx-key
...richTooltipSection,
// eslint-disable-next-line react/jsx-key

View File

@@ -41,6 +41,7 @@ import {
xAxisBounds,
xAxisLabelRotation,
xAxisLabelInterval,
forceMaxInterval,
} from '../../../controls';
const {
@@ -115,6 +116,7 @@ const config: ControlPanelConfig = {
],
[xAxisLabelRotation],
[xAxisLabelInterval],
[forceMaxInterval],
// eslint-disable-next-line react/jsx-key
...richTooltipSection,
// eslint-disable-next-line react/jsx-key

View File

@@ -39,6 +39,7 @@ import {
xAxisBounds,
xAxisLabelRotation,
xAxisLabelInterval,
forceMaxInterval,
} from '../../controls';
const {
@@ -167,6 +168,7 @@ const config: ControlPanelConfig = {
],
[xAxisLabelRotation],
[xAxisLabelInterval],
[forceMaxInterval],
...richTooltipSection,
// eslint-disable-next-line react/jsx-key
[<ControlSubSectionHeader>{t('Y Axis')}</ControlSubSectionHeader>],

View File

@@ -168,6 +168,7 @@ export default function transformProps(
sortSeriesType,
sortSeriesAscending,
timeGrainSqla,
forceMaxInterval,
timeCompare,
timeShiftColor,
stack,
@@ -510,11 +511,17 @@ export default function transformProps(
},
minorTick: { show: minorTicks },
minInterval:
xAxisType === AxisType.Time && timeGrainSqla
xAxisType === AxisType.Time && timeGrainSqla && !forceMaxInterval
? TIMEGRAIN_TO_TIMESTAMP[
timeGrainSqla as keyof typeof TIMEGRAIN_TO_TIMESTAMP
]
: 0,
maxInterval:
xAxisType === AxisType.Time && timeGrainSqla && forceMaxInterval
? TIMEGRAIN_TO_TIMESTAMP[
timeGrainSqla as keyof typeof TIMEGRAIN_TO_TIMESTAMP
]
: undefined,
...getMinAndMaxFromBounds(
xAxisType,
truncateXAxis,

View File

@@ -85,6 +85,7 @@ export type EchartsTimeseriesFormData = QueryFormData & {
xAxisForceCategorical?: boolean;
xAxisTimeFormat?: string;
timeGrainSqla?: TimeGranularity;
forceMaxInterval?: boolean;
xAxisBounds: [number | undefined | null, number | undefined | null];
yAxisBounds: [number | undefined | null, number | undefined | null];
zoomable: boolean;

View File

@@ -338,6 +338,21 @@ export const xAxisLabelInterval = {
},
};
export const forceMaxInterval = {
name: 'force_max_interval',
config: {
type: 'CheckboxControl',
label: t('Force Time Grain as Max Interval'),
renderTrigger: true,
default: false,
description: t(
'Forces selected Time Grain as the maximum interval for X Axis Labels',
),
visibility: ({ controls }: ControlPanelsContainerProps) =>
Boolean(controls?.time_grain_sqla?.value),
},
};
export const seriesOrderSection: ControlSetRow[] = [
[<ControlSubSectionHeader>{t('Series Order')}</ControlSubSectionHeader>],
[sortSeriesType],

View File

@@ -54,7 +54,9 @@ const getCrossFilterDataMask =
values = [value];
}
const groupbyValues = values.map(value => labelMap[value]);
const groupbyValues = values
.map(value => labelMap[value])
.filter(Boolean) as string[][];
return {
dataMask: {
@@ -122,6 +124,9 @@ export const contextMenuEventHandler =
const drillFilters: BinaryQueryObjectFilterClause[] = [];
if (groupby.length > 0) {
const values = labelMap[e.name];
if (!values) {
return;
}
groupby.forEach((dimension, i) => {
drillFilters.push({
col: dimension,