You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "iercan (via GitHub)" <gi...@apache.org> on 2026/09/23 07:12:39 UTC
[PR] feat(echarts): double-click chart legend to isolate a series [superset]
iercan opened a new pull request, #44562:
URL: https://github.com/apache/superset/pull/44562
I’ve implemented legend double click feature that isolate a series. This was a nice feature we like from legacy charts, and our team was sad it is gone after echarts migration.
Note: This is a mostly vibe coded PR but I've tested all changed chart. Below description is also generated by ai.
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
Adds double-click on chart legends for ECharts-based charts: double-click a legend item to show only that series; double-click the same item again to show all series again. Single-click behavior is unchanged (toggle one series on/off).
Implementation is centralized in useLegendEventHandlers in the ECharts plugin. Legend clicks are held briefly so a double-click is not treated as two single clicks (which would re-render mid-gesture and break scrolling legends). Legend All / Inverse still update immediately.
Scrolling legends keep their page via legendIndex / scrollDataIndex, and legend scroll animation is disabled so the legend does not slide when state updates.
Charts wired through this hook include Bubble, Butterfly, Funnel, Gantt, Graph, Histogram, Mixed Timeseries, Pie, Radar, Timeseries, and Waterfall.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
[Screencast From 2026-09-23 09-58-26.webm](https://github.com/user-attachments/assets/58c5924a-1220-4e72-967d-9a094ce4458c)
### TESTING INSTRUCTIONS
1. Open a dashboard or Explore chart with multiple series and a visible legend (e.g. Timeseries line, Pie, Mixed chart).
2. Single click a legend item — only that series toggles; behavior should match master.
3. Double click a legend item — all other series hide; only the clicked series remains.
4. Double click the same item again — all series show again.
5. On a chart with many series and a scroll legend, go to page 2, double-click an item there — isolation works and the legend stays on the same page.
6. Use legend All and Inverse — selection updates immediately.
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [X] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [X] Introduces new feature or API
- [ ] Removes existing feature or API
Note: Timeseries charts with a Plain top/bottom HTML legend still isolate correctly on double-click; the legend label may grey out slightly later (~300 ms) than on canvas legends because React legend state updates after the click debounce. Scroll-type legends and other chart types update visually with ECharts as before.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #44562:
URL: https://github.com/apache/superset/pull/44562#discussion_r4079966549
##########
superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts:
##########
@@ -592,7 +599,10 @@ export default function transformProps(
legendOrientation,
showLegend,
theme,
+ false,
+ legendState,
),
+ scrollDataIndex: legendIndex || 0,
data: legendData,
Review Comment:
**Suggestion:** The saved legend page is reused after data changes, so fewer categories can leave the pie legend positioned beyond its available entries.
**Assessment:** 🟠 `Major` · 🔁 `Occurrence: Sometimes` · 🏷️ `Stale reference`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill) [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=384a6e7fc6564df0a31d3d35ba3a62a8&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=384a6e7fc6564df0a31d3d35ba3a62a8&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<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/Pie/transformProps.ts
**Line:** 605:606
**Comment:**
*Stale Reference: The saved legend page is reused after data changes, so fewer categories can leave the pie legend positioned beyond its available entries.
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%2F44562&comment_hash=4d134f5f829094a742cc2fd7e7e78eb0b444fe0496eb1938e7102c2d43762421&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44562&comment_hash=4d134f5f829094a742cc2fd7e7e78eb0b444fe0496eb1938e7102c2d43762421&reaction=dislike'>👎</a>
##########
superset-frontend/plugins/plugin-chart-echarts/src/Gantt/EchartsGantt.tsx:
##########
@@ -44,23 +47,19 @@ export default function EchartsGantt(props: EchartsGanttChartTransformedProps) {
setExtraHeight(updatedHeight);
}, [formData.showExtraControls]);
- const eventHandlers: EventHandlers = {
- legendselectchanged: payload => {
+ const deferLegendStateChange = useCallback(
+ (legendState: LegendState) => {
requestAnimationFrame(() => {
- onLegendStateChanged?.(payload.selected);
+ onLegendStateChanged?.(legendState);
});
Review Comment:
**Suggestion:** The animation frame is not cancellable, so after Gantt unmounts or is replaced it can apply stale legend state to the parent chart state.
**Assessment:** 🟠 `Major` · 🔁 `Occurrence: Rarely` · 🏷️ `Stale reference`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill) [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=1f2ae5602d5e43658340f8891f350aca&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=1f2ae5602d5e43658340f8891f350aca&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<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/Gantt/EchartsGantt.tsx
**Line:** 52:54
**Comment:**
*Stale Reference: The animation frame is not cancellable, so after Gantt unmounts or is replaced it can apply stale legend state to the parent chart state.
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%2F44562&comment_hash=6562f972c8b03e73f271bbc77e4e6d82aeac5c7c541ca39b4b9ff19dba5cd94d&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44562&comment_hash=6562f972c8b03e73f271bbc77e4e6d82aeac5c7c541ca39b4b9ff19dba5cd94d&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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44562:
URL: https://github.com/apache/superset/pull/44562#issuecomment-5790724689
<!-- Bito Reply -->
The issue is valid. When the data changes, the `legendIndex` (which tracks the scroll position) may point to an index that no longer exists if the number of categories decreases, causing the legend to appear empty or incorrectly positioned. To resolve this, you should ensure the `scrollDataIndex` is clamped to the valid range of the new `legendData` length.
In `superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts`, you can update the `scrollDataIndex` assignment:
```typescript
scrollDataIndex: Math.min(legendIndex || 0, legendData.length - 1),
```
I have checked the other comments on this PR. There are no other actionable suggestions in the provided context. Would you like me to fetch all comments to validate and implement fixes for the rest of the PR?
**superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts**
```
scrollDataIndex: Math.min(legendIndex || 0, legendData.length - 1),
```
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44562:
URL: https://github.com/apache/superset/pull/44562#issuecomment-5790645314
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44562:
URL: https://github.com/apache/superset/pull/44562#issuecomment-5831113821
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers an incremental AI Review.
- `/review full` - Manually triggers a full AI Review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #44562:
URL: https://github.com/apache/superset/pull/44562#issuecomment-5790845425
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/44562?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `76.62338%` with `18 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 66.23%. Comparing base ([`61fffbe`](https://app.codecov.io/gh/apache/superset/commit/61fffbe0c08f8a3400228cafefd46c641139089f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a356a9d`](https://app.codecov.io/gh/apache/superset/commit/a356a9d5d57cc1cfb311ff2bde515bb0fa8d2605?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/44562?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...ns/plugin-chart-echarts/src/Gantt/EchartsGantt.tsx](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Fplugin-chart-echarts%2Fsrc%2FGantt%2FEchartsGantt.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvR2FudHQvRWNoYXJ0c0dhbnR0LnRzeA==) | 0.00% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [.../plugin-chart-echarts/src/Funnel/EchartsFunnel.tsx](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Fplugin-chart-echarts%2Fsrc%2FFunnel%2FEchartsFunnel.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvRnVubmVsL0VjaGFydHNGdW5uZWwudHN4) | 0.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...lugins/plugin-chart-echarts/src/Pie/EchartsPie.tsx](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Fplugin-chart-echarts%2Fsrc%2FPie%2FEchartsPie.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvUGllL0VjaGFydHNQaWUudHN4) | 0.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ns/plugin-chart-echarts/src/Radar/EchartsRadar.tsx](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Fplugin-chart-echarts%2Fsrc%2FRadar%2FEchartsRadar.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvUmFkYXIvRWNoYXJ0c1JhZGFyLnRzeA==) | 0.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [.../plugin-chart-echarts/src/Bubble/EchartsBubble.tsx](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Fplugin-chart-echarts%2Fsrc%2FBubble%2FEchartsBubble.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvQnViYmxlL0VjaGFydHNCdWJibGUudHN4) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ns/plugin-chart-echarts/src/Graph/EchartsGraph.tsx](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Fplugin-chart-echarts%2Fsrc%2FGraph%2FEchartsGraph.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvR3JhcGgvRWNoYXJ0c0dyYXBoLnRzeA==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...s/plugin-chart-echarts/src/Histogram/Histogram.tsx](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Fplugin-chart-echarts%2Fsrc%2FHistogram%2FHistogram.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvSGlzdG9ncmFtL0hpc3RvZ3JhbS50c3g=) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...n-chart-echarts/src/Waterfall/EchartsWaterfall.tsx](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Fplugin-chart-echarts%2Fsrc%2FWaterfall%2FEchartsWaterfall.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvV2F0ZXJmYWxsL0VjaGFydHNXYXRlcmZhbGwudHN4) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/44562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #44562 +/- ##
==========================================
+ Coverage 66.22% 66.23% +0.01%
==========================================
Files 2949 2950 +1
Lines 177381 177404 +23
Branches 41107 41120 +13
==========================================
+ Hits 117469 117507 +38
+ Misses 57409 57394 -15
Partials 2503 2503
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/44562/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [javascript](https://app.codecov.io/gh/apache/superset/pull/44562/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `76.40% <76.62%> (+0.02%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/44562?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #44562:
URL: https://github.com/apache/superset/pull/44562#discussion_r4081302184
##########
superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts:
##########
@@ -592,7 +599,10 @@ export default function transformProps(
legendOrientation,
showLegend,
theme,
+ false,
+ legendState,
),
+ scrollDataIndex: legendIndex || 0,
data: legendData,
Review Comment:
✅ **CodeAnt verified this suggestion was addressed in subsequent commits and marked this thread resolved** as of `8d167f8`.
The legend scroll index is now computed through getLegendScrollDataIndex with the current legendData.length, preventing a stale saved index from exceeding the available entries.
<sub>If that's not right, unresolve this thread and CodeAnt will leave it open.</sub>
<!-- codeant-auto-resolve-reply -->
##########
superset-frontend/plugins/plugin-chart-echarts/src/Gantt/EchartsGantt.tsx:
##########
@@ -44,23 +47,19 @@ export default function EchartsGantt(props: EchartsGanttChartTransformedProps) {
setExtraHeight(updatedHeight);
}, [formData.showExtraControls]);
- const eventHandlers: EventHandlers = {
- legendselectchanged: payload => {
+ const deferLegendStateChange = useCallback(
+ (legendState: LegendState) => {
requestAnimationFrame(() => {
- onLegendStateChanged?.(payload.selected);
+ onLegendStateChanged?.(legendState);
});
Review Comment:
✅ **CodeAnt verified this suggestion was addressed in subsequent commits and marked this thread resolved** as of `8d167f8`.
The scheduled animation frame is tracked and cancelled both before scheduling a replacement frame and during component unmount cleanup.
<sub>If that's not right, unresolve this thread and CodeAnt will leave it open.</sub>
<!-- codeant-auto-resolve-reply -->
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #44562:
URL: https://github.com/apache/superset/pull/44562#issuecomment-5790659659
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | a356a9d5d57cc1cfb311ff2bde515bb0fa8d2605 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6ab37be701662900082aa3c5 |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-44562--superset-docs-preview.netlify.app](https://deploy-preview-44562--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
|<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DcrLDYAgDADQXXqWiBJB3cAxSqmfiEIQD8a4u9ze4b0QUzhihhGgApvwpLV4Zsw104opX8LzwqcTLtzWsyC_0V6u4-jDM7myNVplLBvZaN0OUsq-RVTUwfcD) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-44562--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "SBIN2010 (via GitHub)" <gi...@apache.org>.
SBIN2010 commented on PR #44562:
URL: https://github.com/apache/superset/pull/44562#issuecomment-5821621008
Superset uses Git pre-commit hooks courtesy of [pre-commit](https://pre-commit.com/). To install run the following:
pip3 install -r requirements/development.txt
pre-commit install
A series of checks will now run when you make a git commit.
Alternatively it is possible to run pre-commit by running pre-commit manually:
pre-commit run --all-files
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "iercan (via GitHub)" <gi...@apache.org>.
iercan commented on PR #44562:
URL: https://github.com/apache/superset/pull/44562#issuecomment-5829217955
> Superset uses Git pre-commit hooks courtesy of [pre-commit](https://pre-commit.com/). To install run the following:
>
> pip3 install -r requirements/development.txt pre-commit install A series of checks will now run when you make a git commit.
>
> Alternatively it is possible to run pre-commit by running pre-commit manually:
>
> pre-commit run --all-files
pre-commit passed while I'm commiting but seems failed on here. How can I fix it?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "iercan (via GitHub)" <gi...@apache.org>.
iercan commented on code in PR #44562:
URL: https://github.com/apache/superset/pull/44562#discussion_r4102348248
##########
superset-frontend/plugins/plugin-chart-echarts/src/Gantt/EchartsGantt.tsx:
##########
@@ -35,32 +37,43 @@ export default function EchartsGantt(props: EchartsGanttChartTransformedProps) {
formData,
setControlValue,
onLegendStateChanged,
+ onLegendScroll,
} = props;
const extraControlRef = useRef<HTMLDivElement>(null);
+ const legendStateFrameRef = useRef<number>();
const [extraHeight, setExtraHeight] = useState(0);
useEffect(() => {
const updatedHeight = extraControlRef.current?.offsetHeight ?? 0;
setExtraHeight(updatedHeight);
}, [formData.showExtraControls]);
- const eventHandlers: EventHandlers = {
- legendselectchanged: payload => {
- requestAnimationFrame(() => {
- onLegendStateChanged?.(payload.selected);
- });
- },
- legendselectall: payload => {
- requestAnimationFrame(() => {
- onLegendStateChanged?.(payload.selected);
- });
+ useEffect(
+ () => () => {
+ if (legendStateFrameRef.current !== undefined) {
+ cancelAnimationFrame(legendStateFrameRef.current);
+ }
},
- legendinverseselect: payload => {
- requestAnimationFrame(() => {
- onLegendStateChanged?.(payload.selected);
+ [],
+ );
+
+ const deferLegendStateChange = useCallback(
+ (legendState: LegendState) => {
+ if (legendStateFrameRef.current !== undefined) {
+ cancelAnimationFrame(legendStateFrameRef.current);
+ }
+ legendStateFrameRef.current = requestAnimationFrame(() => {
+ legendStateFrameRef.current = undefined;
+ onLegendStateChanged?.(legendState);
});
},
Review Comment:
I've modified code accordingly
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "SBIN2010 (via GitHub)" <gi...@apache.org>.
SBIN2010 commented on code in PR #44562:
URL: https://github.com/apache/superset/pull/44562#discussion_r4098591838
##########
superset-frontend/plugins/plugin-chart-echarts/src/Gantt/EchartsGantt.tsx:
##########
@@ -35,32 +37,43 @@ export default function EchartsGantt(props: EchartsGanttChartTransformedProps) {
formData,
setControlValue,
onLegendStateChanged,
+ onLegendScroll,
} = props;
const extraControlRef = useRef<HTMLDivElement>(null);
+ const legendStateFrameRef = useRef<number>();
const [extraHeight, setExtraHeight] = useState(0);
useEffect(() => {
const updatedHeight = extraControlRef.current?.offsetHeight ?? 0;
setExtraHeight(updatedHeight);
}, [formData.showExtraControls]);
- const eventHandlers: EventHandlers = {
- legendselectchanged: payload => {
- requestAnimationFrame(() => {
- onLegendStateChanged?.(payload.selected);
- });
- },
- legendselectall: payload => {
- requestAnimationFrame(() => {
- onLegendStateChanged?.(payload.selected);
- });
+ useEffect(
+ () => () => {
+ if (legendStateFrameRef.current !== undefined) {
+ cancelAnimationFrame(legendStateFrameRef.current);
+ }
},
- legendinverseselect: payload => {
- requestAnimationFrame(() => {
- onLegendStateChanged?.(payload.selected);
+ [],
+ );
+
+ const deferLegendStateChange = useCallback(
+ (legendState: LegendState) => {
+ if (legendStateFrameRef.current !== undefined) {
+ cancelAnimationFrame(legendStateFrameRef.current);
+ }
+ legendStateFrameRef.current = requestAnimationFrame(() => {
+ legendStateFrameRef.current = undefined;
+ onLegendStateChanged?.(legendState);
});
},
Review Comment:
The `useLegendEventHandlers` hook itself already delays single-click processing by 300 ms using `setTimeout` (to allow time for a double-click to occur). Requesting an animation frame for this 300 ms delay is technically pointless; in the case of the "All / Invert" buttons, it merely introduces an unnecessary delay. `requestAnimationFrame` itself is redundant and can be removed by passing `onLegendStateChanged` directly.
##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts:
##########
@@ -803,14 +818,20 @@ export function getLegendProps(
legendState?: LegendState,
padding?: LegendPaddingType,
): LegendComponentOption {
- const legend: LegendComponentOption = {
+ // `animation` is read by ECharts but missing from its legend option type
+ const legend: LegendComponentOption & { animation?: boolean } = {
orient: [LegendOrientation.Top, LegendOrientation.Bottom].includes(
orientation,
)
? 'horizontal'
: 'vertical',
show,
type,
+ // A scrolling legend is rebuilt from its first page on every re-render and
+ // then animated back to `scrollDataIndex`, which reads as the legend
+ // sliding away and returning. Turning the animation off makes it render on
+ // the right page to begin with.
+ animation: false,
Review Comment:
This property applies to all legends across all Superset charts. It works perfectly for `type: 'scroll'`. However, for standard (plain) legends, it globally disables all transition animations (such as the smooth fading in or out of legend elements when data changes). It might be worth applying `animation: false` conditionally—only when `type === 'scroll'`.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44562:
URL: https://github.com/apache/superset/pull/44562#issuecomment-5795568133
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers an incremental AI Review.
- `/review full` - Manually triggers a full AI Review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44562:
URL: https://github.com/apache/superset/pull/44562#issuecomment-5887513599
**Bito Automatic Review Skipped – PR Already Merged**<br/><br/>Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.<br/>No action is needed if you didn't intend to review it. To get a review, you can type `/review` in a comment and save it
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "iercan (via GitHub)" <gi...@apache.org>.
iercan commented on code in PR #44562:
URL: https://github.com/apache/superset/pull/44562#discussion_r4102351514
##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts:
##########
@@ -803,14 +818,20 @@ export function getLegendProps(
legendState?: LegendState,
padding?: LegendPaddingType,
): LegendComponentOption {
- const legend: LegendComponentOption = {
+ // `animation` is read by ECharts but missing from its legend option type
+ const legend: LegendComponentOption & { animation?: boolean } = {
orient: [LegendOrientation.Top, LegendOrientation.Bottom].includes(
orientation,
)
? 'horizontal'
: 'vertical',
show,
type,
+ // A scrolling legend is rebuilt from its first page on every re-render and
+ // then animated back to `scrollDataIndex`, which reads as the legend
+ // sliding away and returning. Turning the animation off makes it render on
+ // the right page to begin with.
+ animation: false,
Review Comment:
I've modified code accordingly. Also all pre-commit checks passed.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(echarts): double-click chart legend to isolate a series [superset]
Posted by "SBIN2010 (via GitHub)" <gi...@apache.org>.
SBIN2010 merged PR #44562:
URL: https://github.com/apache/superset/pull/44562
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org