You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "imad-hl (via GitHub)" <gi...@apache.org> on 2026/02/10 17:10:55 UTC
[I] Cross-filters acting oddly after #37625 : no highlights, right-click retriggers animations [superset]
imad-hl opened a new issue, #37853:
URL: https://github.com/apache/superset/issues/37853
### Bug description
After PR #37625 (commit `fc5506e466`), cross-filtering behavior is broken across charts:
1. **No visual highlights** when cross-filters are applied
2. **Right-clicking retriggers chart animations** instead of showing the context menu properly
3. Cross-filter interactions feel broken/unresponsive, and reclicking on selected data doesn't undo the cross-filter
## Reproduction Steps
0. On latest master branch
1. Create a dashboard with any charts that support cross-filtering
2. Enable cross-filtering
3. Click on a data point to apply a cross-filter
4. Right-click on a data point
5. Observe the broken behavior
## Expected Behavior
- Cross-filter should highlight selected data
- Right-click should open context menu without retriggering animations
## Actual Behavior
- No visual feedback when cross-filtering is applied
- Right-clicking causes charts to re-animate
- Reclicking selected data doesn't toggle off the cross-filter
## Bisect Results
- ✅ **Working:** commit `e9ae212c1c` (before PR #37625)
- ❌ **Broken:** commit `fc5506e466` (PR #37625)
See attached GIFs showing the difference.
### Screenshots/recordings
Before PR : #37625

After PR : #37625

### Superset version
master / latest-dev
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
**Note:** I discovered this issue while working on my PR #35859 to add cross-filter support to the Country Map chart. During testing on the latest master branch, I noticed cross-filters weren't working as expected across all charts, which led me to bisect and identify this regression.
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
--
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.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: [I] Cross-filters acting oddly after #37625 : no highlights, right-click retriggers animations [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe closed issue #37853: Cross-filters acting oddly after #37625 : no highlights, right-click retriggers animations
URL: https://github.com/apache/superset/issues/37853
--
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: [I] Cross-filters acting oddly after #37625 : no highlights, right-click retriggers animations [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #37853:
URL: https://github.com/apache/superset/issues/37853#issuecomment-3993951114
Resolved on the PR now :D
--
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: [I] Cross-filters acting oddly after #37625 : no highlights, right-click retriggers animations [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #37853:
URL: https://github.com/apache/superset/issues/37853#issuecomment-3986039720
@dosu any thoughts on how to resolve this?
--
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: [I] Cross-filters acting oddly after #37625 : no highlights, right-click retriggers animations [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #37853:
URL: https://github.com/apache/superset/issues/37853#issuecomment-3986133177
<!-- Answer -->
Based on my research, the actual culprit appears to be [PR #37407 "Enable cross-filter on bar charts without dimensions"](https://github.com/apache/superset/pull/37407), not PR #37625 (which was a TypeScript quality improvement that didn't modify chart rendering code).
**Root Causes:**
1. **No visual highlights**: The highlighting logic in `transformers.ts` skips series-level dimming when `hasDimensions` is false. When cross-filtering by X-axis values, `selectedValues` contains X-axis category values instead of series names, and the mapping to ECharts `dataIndex` wasn't properly implemented.
2. **Right-click retriggers animations**: [Event handlers in `EchartsTimeseries.tsx`](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/EchartsTimeseries.tsx#L144-L233) are **not memoized**, causing them to be recreated on every render. When [Echart.tsx re-attaches handlers](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx#L219-L261), it calls `setOption` which retriggers animations.
3. **Toggle doesn't work**: The `clickTimer` ref state gets lost when handlers are constantly re-attached due to missing memoization.
**Key Fix - Memoize Event Handlers:**
```typescript
const eventHandlers: EventHandlers = useMemo(() => ({
click: props => {
if (!hasDimensions && !canCrossFilterByXAxis) return;
if (clickTimer.current) clearTimeout(clickTimer.current);
clickTimer.current = setTimeout(() => {
if (hasDimensions) handleChange(props.seriesName);
else if (canCrossFilterByXAxis && props.data?.[0] != null) handleXAxisChange(props.data[0]);
}, TIMER_DURATION);
},
// ... other handlers
}), [hasDimensions, canCrossFilterByXAxis, handleChange, handleXAxisChange]);
```
**Immediate Workaround**: Add an explicit groupby column to your charts to force the original dimension-based cross-filtering code path that doesn't have this regression.
Similar issues were fixed in [PR #37284](https://github.com/apache/superset/pull/37284), [PR #38030](https://github.com/apache/superset/pull/38030), and [PR #37716](https://github.com/apache/superset/pull/37716), suggesting this is a known pattern.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/5f6228d9-fca2-4e6c-beb5-0464780cb219?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/5f6228d9-fca2-4e6c-beb5-0464780cb219?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/5f6228d9-fca2-4e6c-beb5-0464780cb219?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/5f6228d9-fca2-4e6c-beb5-0464780cb219?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5f6228d9-fca2-4e6c-beb5-0464780cb219?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/5f6228d9-fca2-4e6c-beb5-0464780cb219?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5f6228d9-fca2-4e6c-beb5-0464780cb219?feedback_type=other)</sup>
[](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=Based%20on%20my%20research%2C%20the%20actual%20culprit%20appears%20to%20be%20%5BPR%20%2337407%20%22Enable%20cross-filter%20on%20bar%20charts%20without%20dimensions%22%5D%28https%3A//github.com/apache/superset/pull/37407%29%2C%20not%20PR%20%2337625%20%28which%20was%20a%20TypeScript%20quality%20improvement%20that%20didn%27t%20modify%20chart%20rendering%20code%29.%0A%0A%2A%2ARoot%20Causes%3A%2A%2A%0A%0A1.%20%2A%2ANo%20visual%20highlights%2A%2A%3A%20The%20highlighting%20logic%20in%20%60transformers.ts%60%20skips%20series-level%20dimming%20when%20%60hasDimensions%60%20is%20false.%20When%20cross-filtering%20by%20X-axis%20values%2C%20%60selectedValues%60%20contains%20X-axis%20category%20values%20instead%20of%20series%20names%2C%20and%20the%20mapping%20to%
20ECharts%20%60dataIndex%60%20wasn%27t%20properly%20implemented.%0A%0A2.%20%2A%2ARight-click%20retriggers%20animations%2A%2A%3A%20%5BEvent%20handlers%20in%20%60EchartsTimeseries.tsx%60%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/EchartsTimeseries.tsx%23L144-L233%29%20are%20%2A%2Anot%20memoized%2A%2A%2C%20causing%20them%20to%20be%20recreated%20on%20every%20render.%20When%20%5BEchart.tsx%20re-attaches%20handlers%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx%23L219-L261%29%2C%20it%20calls%20%60setOption%60%20which%20retriggers%20animations.%0A%0A3.%20%2A%2AToggle%20doesn%27t%20work%2A%2A%3A%20The%20%60clickTimer%60%20ref%20state%20gets%20lost%20when%20handlers%20are%20constantly%20re-attached%20due%20to%20missing%20memoization.%0A%0A%2A%2AKey%20Fix%20-%20Memoize%20Even
t%20Handlers%3A%2A%2A%0A%0A%60%60%60typescript%0Aconst%20eventHandlers%3A%20EventHandlers%20%3D%20useMemo%28%28%29%20%3D%3E%20%28%7B%0A%20%20click%3A%20props%20%3D%3E%20%7B%0A%20%20%20%20if%20%28%21hasDimensions%20%26%26%20%21canCrossFilterByXAxis%29%20return%3B%0A%20%20%20%20if%20%28clickTimer.current%29%20clearTimeout%28clickTimer.current%29%3B%0A%20%20%20%20clickTimer.current%20%3D%20setTimeout%28%28%29%20%3D%3E%20%7B%0A%20%20%20%20%20%20if%20%28hasDimensions%29%20handleChange%28props.seriesName%29%3B%0A%20%20%20%20%20%20else%20if%20%28canCrossFilterByXAxis%20%26%26%20props.data%3F.%5B0%5D%20%21%3D%20null%29%20handleXAxisChange%28props.data%5B0%5D%29%3B%0A%20%20%20%20%7D%2C%20TIMER_DURATION%29%3B%0A%20%20%7D%2C%0A%20%20//%20...%20other%20handlers%0A%7D%29%2C%20%5BhasDimensions%2C%20canCrossFilterByXAxis%2C%20handleChange%2C%20handleXAxisChange%5D%29%3B%0A%60%60%60%0A%0A%2A%2AImmediate%20Workaround%2A%2A%3A%20Add%20an%20explicit%20groupby%20column%20to%20your%20charts%20to%20force
%20the%20original%20dimension-based%20cross-filtering%20code%20path%20that%20doesn%27t%20have%20this%20regression.%0A%0ASimilar%20issues%20were%20fixed%20in%20%5BPR%20%2337284%5D%28https%3A//github.com/apache/superset/pull/37284%29%2C%20%5BPR%20%2338030%5D%28https%3A//github.com/apache/superset/pull/38030%29%2C%20and%20%5BPR%20%2337716%5D%28https%3A//github.com/apache/superset/pull/37716%29%2C%20suggesting%20this%20is%20a%20known%20pattern.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/37853)
--
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: [I] Cross-filters acting oddly after #37625 : no highlights, right-click retriggers animations [superset]
Posted by "imad-hl (via GitHub)" <gi...@apache.org>.
imad-hl commented on issue #37853:
URL: https://github.com/apache/superset/issues/37853#issuecomment-3991871998
> PR opened... please review and see if it fixes the issue. This fix is different and addresses the actual root cause. Dosu's suggestion is about memoizing eventHandlers in EchartsTimeseries to prevent unnecessary setOption calls. That could be a performance optimization, but it doesn't fix the core problem.
>
> The real issue is simpler and more fundamental: filterState (which carries selectedValues) was completely dropped from the prop chain during the JSX→TSX conversion. Without it, chart plugins never receive any cross-filter selection state at all — no amount of event handler memoization can fix that.
>
> To put it concretely:
>
> * Dosu's fix: Stabilizes event handler references to avoid extra re-renders
> * PR fix: Restores the missing data pipe (filterState) that tells charts which values are selected
You're right about the root cause.
However, there's a TypeScript error in the PR #38349.
The added Line 764 in
**_superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx_** passes **filterState** to ChartContainer,
but it's not defined in **ChartProps** in **_superset-frontend/src/components/Chart/Chart.tsx_**.
--
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: [I] Cross-filters acting oddly after #37625 : no highlights, right-click retriggers animations [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #37853:
URL: https://github.com/apache/superset/issues/37853#issuecomment-3986545077
PR opened... please review and see if it fixes the issue.
--
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: [I] Cross-filters acting oddly after #37625 : no highlights, right-click retriggers animations [superset]
Posted by "imad-hl (via GitHub)" <gi...@apache.org>.
imad-hl commented on issue #37853:
URL: https://github.com/apache/superset/issues/37853#issuecomment-4003913298
> Resolved on the PR now :D
Cross-filters are working properly again, well done 💯
--
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