codeant-ai-for-open-source[bot] commented on code in PR #42477:
URL: https://github.com/apache/superset/pull/42477#discussion_r3657793244
##########
superset-frontend/plugins/plugin-chart-echarts/src/Sankey/transformProps.ts:
##########
@@ -105,25 +180,51 @@ export default function transformProps(
const { source, target } = data as Link;
if (source && target) {
rows.push([
- `% (${source})`,
+ `% (${displayName(source)})`,
percentFormatter.format(value / nodeValues.get(source)!),
]);
rows.push([
- `% (${target})`,
+ `% (${displayName(target)})`,
percentFormatter.format(value / nodeValues.get(target)!),
]);
+ const title = isMultiLevel
+ ? `${displayName(source)} โ ${displayName(target)}`
+ : name;
+ return tooltipHtml(rows, title);
}
- return tooltipHtml(rows, name);
+ return tooltipHtml(rows, displayName(name));
};
const echartOptions: EChartsOption = {
series: {
animation: false,
data: seriesData,
+ emphasis: {
+ focus: 'adjacency',
+ },
+ label: {
+ formatter: params => displayName(params.name),
+ // Long category values (cloud service names, product SKUs) otherwise
+ // push the flow area off the canvas; the full value stays in the
+ // tooltip.
+ width: LABEL_MAX_WIDTH,
+ overflow: 'truncate',
+ },
lineStyle: {
- color: 'source',
+ color: 'gradient',
+ curveness: 0.5,
+ opacity: 0.5,
},
links,
+ nodeAlign: nodeAlignment ?? 'justify',
+ // nodeGap is a fixed pixel budget: nodeGap * (nodes in the tallest
+ // column) competes with the canvas height, and ECharts drops the whole
+ // column once the gaps no longer fit. Keep its default rather than a
+ // larger value so high-cardinality levels still render.
+ nodeWidth: 12,
Review Comment:
**Suggestion:** The comment describes configuring `nodeGap`, but this code
configures `nodeWidth`. This makes the documented layout behavior incorrect and
can mislead future changes; either update the comment to describe node width or
configure the intended `nodeGap` property. [comment mismatch]
<details>
<summary><b>Severity Level:</b> Minor ๐งน</summary>
```mdx
- โ ๏ธ Only maintainers reading Sankey layout documentation are affected.
- โ ๏ธ Chart rendering uses `nodeWidth`, not the misleading comment.
- โ ๏ธ Suggestion addresses documentation accuracy, not runtime behavior.
```
</details>
<details>
<summary><b>Steps of Reproduction โ
</b></summary>
```mdx
1. Render a Sankey chart through `transformProps()` at
`superset-frontend/plugins/plugin-chart-echarts/src/Sankey/transformProps.ts:49`.
2. The function constructs the ECharts series options at lines 198-229.
3. The explanatory comment at lines 220-223 discusses `nodeGap`, but the only
corresponding option configured at line 224 is `nodeWidth: 12`; no runtime
code reads or
sets `nodeGap` in this hunk.
4. The chart therefore behaves according to ECharts' default `nodeGap` and
the configured
`nodeWidth`; the mismatch can mislead maintainers but does not reproduce a
functional
failure for chart users.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=818f39b532784c9f8546c3b143c496d1&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=818f39b532784c9f8546c3b143c496d1&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/Sankey/transformProps.ts
**Line:** 220:224
**Comment:**
*Comment Mismatch: The comment describes configuring `nodeGap`, but
this code configures `nodeWidth`. This makes the documented layout behavior
incorrect and can mislead future changes; either update the comment to describe
node width or configure the intended `nodeGap` property.
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%2F42477&comment_hash=e6c582125d7f48f583e053a5ea1d02f8bd6d074ac5b389b33bb252fc1cb0307b&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42477&comment_hash=e6c582125d7f48f583e053a5ea1d02f8bd6d074ac5b389b33bb252fc1cb0307b&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]