msyavuz commented on code in PR #37135:
URL: https://github.com/apache/superset/pull/37135#discussion_r2693733131
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:
##########
@@ -289,21 +291,34 @@ export default function transformProps(
const array = ensureIsArray(chartProps.rawFormData?.time_compare);
const inverted = invert(verboseMap);
- let patternIncrement = 0;
+ const offsetLineWidths: { [key: string]: number } = {};
rawSeries.forEach(entry => {
const derivedSeries = isDerivedSeries(entry, chartProps.rawFormData);
+ const entryName = String(entry.name || '');
+ const seriesName = inverted[entryName] || entryName;
+ // Check if this is a time comparison series:
+ // 1. hasTimeOffset checks for patterns like "metric__1 day ago" or "1 day
ago, groupby"
+ // 2. array.includes checks if the series name exactly matches a time
offset value
+ const isTimeCompare =
+ hasTimeOffset(entry, array) || array.includes(seriesName);
Review Comment:
`isDerivedSeries` function does almost the same thing. Are we duplicating
logic here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]