Repository navigation
fix(echarts): emit no cross-filter for clicks that are not categories - #43192
Conversation
Code Review Agent Run #22dc8aActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #43192 +/- ##
=======================================
Coverage 77.05% 77.05%
=======================================
Files 2944 2944
Lines 176466 176467 +1
Branches 40928 40929 +1
=======================================
+ Hits 135977 135979 +2
+ Misses 37695 37694 -1
Partials 2794 2794
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rusackas
left a comment
There was a problem hiding this comment.
Thanks for tracking this down, @bikash-barnwal! The fix and the added test cases look right, and CI's green. Just needs a rebase to clear the conflict with master (attempting now) then I'm happy to merge.
getCrossFilterDataMask built a data mask from any clicked name, including ones with no labelMap entry: a pie's Total graphic text when showTotal is on, the aggregated "Other" slice, or a sector with an empty name. The resolved groupbyValues came out empty while values stayed non-empty, so the `values.length === 0` guard did not fire, and because `[].every(...)` is true every groupby column was emitted as `IS NULL` -- downstream charts filtered on nothing. Return undefined for a name that is empty, or absent from labelMap and not currently selected, which is what contextMenuEventHandler already does when labelMap has no entry. Deselection is unaffected, since a selected value was resolvable when it was selected. The filter branch also treats empty groupbyValues as "no filters" so a stale selection cannot rebuild the same bogus mask. Fixes apache#42340 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
fdcce81 to
4bfa41f
Compare
|
Rebased onto current One real conflict in Ready to merge once CI's green. |
|
Bito Automatic Review Skipped – PR Already Merged |
…#43192) Co-authored-by: bikashJMV <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]> (cherry picked from commit 92482f0)
SUMMARY
Clicking a pie's Total text, its aggregated Other slice, or an unnamed sector emitted a cross-filter with no dimension values, so downstream charts filtered on nothing.
getCrossFilterDataMaskbuilt a mask from whatever name was clicked. For a name with nolabelMapentry:groupbyValuescame out empty whilevaluesstayed non-empty, so thevalues.length === 0guard never fired. The mask was still built, and since[].every(...)istrue, every groupby column was emitted asIS NULL.The fix returns
undefinedwhen the clicked name is empty, or absent fromlabelMapand not currently selected. That is already howcontextMenuEventHandlerbehaves whenlabelMaphas no entry, andcrossFilteris an optional field onContextMenuFilters, soundefinedis the shape callers expect —clickEventHandleralready guards with?.dataMask.Deselection is untouched: a value present in
selectedValueswas resolvable when it was selected, so it still takes the deselect path. The filter branch additionally treats emptygroupbyValuesas "no filters", so a stale selection cannot rebuild the same bogus mask.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: clicking Total applied
IS NULLon every groupby column to the dashboard.After: the click is inert; only real sectors emit filters.
TESTING INSTRUCTIONS
776 tests across 69 suites pass. Four new cases name #42340; two of them fail on unpatched source (
Total: 1234andOtherclicks, and the empty-name click). The other two — the context-menu path and clearing the last selected value — already behaved correctly and are included as regression guards so the new early return cannot break them.Manually: dashboard with cross-filtering on, a Pie chart with Show Total (and optionally Threshold for Other), plus a second chart. Click the total text and the Other slice; no filter should be applied, while clicking a real sector still filters.
ADDITIONAL INFORMATION
🤖 Generated with Claude Code