Add removeConfigs to perspective-select for explicit filter removal#3133
Merged
texodus merged 1 commit intoperspective-dev:masterfrom Mar 9, 2026
Conversation
e3c474e to
105ea6e
Compare
removeConfigs to perspective-select for explicit filter removal
removeConfigs to perspective-select for explicit filter removalremoveConfigs to perspective-select for explicit filter removal
Add removeConfigs support to perspective-select for off-candidates filter removal The workspace's global filter propagation could not remove filters applied to columns outside the master viewer's group_by/split_by/filter candidates set. Once such a filter was applied it was permanently stuck on slave viewers. Introduces removeConfigs: ViewConfigUpdate[] on the perspective-select event detail, which explicitly removes filters from slave viewers by column regardless of the candidates set. Also replaces the untyped event detail object with a typed PerspectiveSelectDetail class exported from @perspective-dev/viewer. Breaking change: the config field on perspective-select event details is replaced by insertConfigs and removeConfigs. viewer-datagrid and viewer-d3fc are updated accordingly. Signed-off-by: Davis Silverman <davis@thedav.is>
105ea6e to
db9bb67
Compare
texodus
approved these changes
Mar 9, 2026
Member
texodus
left a comment
There was a problem hiding this comment.
Thanks for the PR! Looks good!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The workspace's global filter propagation had no mechanism to remove a filter applied to a column outside the master viewer's
group_by,split_by, orfilterconfig.When a master viewer fires a
perspective-selectevent,_filterViewerbuilds acandidatesset from those three fields and uses it to decide which slave filters to overwrite on the next event. Any filter applied to a column not incandidateswas permanently stuck on slave viewers — no UI action or subsequent event dispatch could remove it.This PR changes the API of the
perspective-selectevent, it is a BREAKING CHANGE for the API. Before, the detail in the event took aconfigthat was aViewConfigUpdatewhich lead to this confusing behavior. This PR replaces this object with a class and removes the field while introducingremoveConfigs: ViewConfigUpdate[], insertConfigs: ViewConfigUpdate[]to make the new behavior explicit.The
removeConfigsexplicitly removes filters from slave viewers by the filter, bypassing the candidates check. It also replaces the untyped event detail object with a typedPerspectiveSelectDetailclass (moved to and then exported from@perspective-dev/viewer), which is a breaking change for any consumers reading theconfigfield fromperspective-selectevents.The old
configsfield is now calledinsertConfigs, and is applied afterremoveConfigsremoves the relevant fields.Breaking change: the
configfield onperspective-selectevent details is replaced byinsertConfigs: ViewConfigUpdate[]andremoveConfigs: ViewConfigUpdate[]. Bothviewer-datagridandviewer-d3fchave been updated accordingly.PerspectiveWorkspacePropsin the React package is also exported (it was previously unexported).Testing
To test this functionality I have verified it via the following manual test, but there are also automated tests in the commit.
Step 1 — Go to the Movies blocks example:
http://localhost:8080/src/movies/index.htmlStep 2 — Click "Warner Bros." in the master datagrid to select it.
Slaves filter to
Distributor == "Warner Bros.". Standard behavior.Step 3 — Stack an
MPAA Ratingfilter on top (paste in console):Slaves now show only Warner Bros. PG-13 films.
Step 4 — Click "Warner Bros." again to deselect.
Distributor clears as expected. But MPAA Rating == "PG-13" is stuck — it is not in the master's group_by/split_by/filter, so the candidates mechanism cannot reach it. There is no UI action that can remove it with the old behavior.
Step 5 — Use removeConfigs to clear it (new behavior):
Slaves return to fully unfiltered. The heatmap should show the complete dataset again.
This PR was initially written with AI assistance, but was reviewed, edited (adding better types and fixing problems that the AI was unable to work out), and manually tested by me.