codeant-ai-for-open-source[bot] commented on code in PR #40967:
URL: https://github.com/apache/superset/pull/40967#discussion_r3623725743


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:
##########
@@ -321,7 +326,7 @@ export default function transformProps(
     seriesType,
   );
 
-  const [rawSeries, sortedTotalValues, minPositiveValue] = extractSeries(
+  const [allRawSeries, sortedTotalValues, minPositiveValue] = extractSeries(

Review Comment:
   **Suggestion:** `sortedTotalValues` and `minPositiveValue` are still 
computed from `allRawSeries`, which now includes the hidden size-metric series; 
this can incorrectly inflate axis bounds/log tick calculations using data that 
is not rendered. Recompute these aggregates from the filtered render series (or 
exclude size series before extracting totals) so only visible value series 
affect axis scaling. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Scatter value axis scaled by hidden size metric.
   - ⚠️ Log-axis lower tick misaligned with visible data.
   - ⚠️ Auto axis bounds distorted for sized scatter charts.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. In Superset, create a chart using the ECharts Time-series Scatter plugin, 
which calls
   `transformProps` in
   
`superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:220`
 as
   part of the chart’s `transformProps` pipeline.
   
   2. Configure the chart with `seriesType = 
EchartsTimeseriesSeriesType.Scatter` and set
   both a value metric in `metrics` and a distinct dot size metric in `size` 
(form data
   consumed at `transformProps` destructuring around lines 220–247).
   
   3. Ensure the size metric has a different scale than the value metric and 
enable axis
   features that rely on `sortedTotalValues` / `minPositiveValue` (e.g. 
`logAxis` and
   automatic bounds, imported at lines 74–77 via `calculateLowerLogTick` and 
related helpers
   in `../utils/series`).
   
   4. When `transformProps` runs, `extractSeries` at line 329 produces 
`allRawSeries`,
   `sortedTotalValues`, and `minPositiveValue` using **all** series (including 
the
   size-metric-only series); later, size series are filtered out into 
`rawSeries` at lines
   398–400, but `sortedTotalValues` and `minPositiveValue` still reflect hidden 
size-series
   data, causing axis scaling and log tick computation to be driven partly by 
non-rendered
   size values rather than visible value-series points.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=c36f044115e5407e8927725e3b8cc3f1&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=c36f044115e5407e8927725e3b8cc3f1&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** 
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts
   **Line:** 329:329
   **Comment:**
        *Logic Error: `sortedTotalValues` and `minPositiveValue` are still 
computed from `allRawSeries`, which now includes the hidden size-metric series; 
this can incorrectly inflate axis bounds/log tick calculations using data that 
is not rendered. Recompute these aggregates from the filtered render series (or 
exclude size series before extracting totals) so only visible value series 
affect axis scaling.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40967&comment_hash=3f14b0cc3f1385a77f1e87fef7900b98c0f24469553bfdccfdcd5c1b585b1bd6&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40967&comment_hash=3f14b0cc3f1385a77f1e87fef7900b98c0f24469553bfdccfdcd5c1b585b1bd6&reaction=dislike'>👎</a>



-- 
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]

Reply via email to