Skip to content

cross-facet brushing#2369

Draft
Fil wants to merge 8 commits intofil/brush-datalessfrom
fil/brush-across-facets
Draft

cross-facet brushing#2369
Fil wants to merge 8 commits intofil/brush-datalessfrom
fil/brush-across-facets

Conversation

@Fil
Copy link
Contributor

@Fil Fil commented Feb 20, 2026

Plot.brush({sync: true}) synchronizes the brush selection across all facets — when the user brushes in one facet, the same rectangle appears in all panes and reactive marks update across all facets.

The filter function's facet arguments are now optional: omitting fx or fy (or passing undefined) skips the facet check, selecting points across all values of that facet.

This resolves @allisonhorst 's suggestions #2364 (comment) and #2364 (comment).

I'm keeping this as a separate PR for now (against #2360) to make the logic more apparent. Ideally if we merge this I would migrate the tests and examples to brushX on parallel time series, rather a 2D brush on penguins.

Disclaimer: I used @claude to generate the tests.

@Fil Fil requested a review from allisonhorst February 20, 2026 10:53
@Fil Fil mentioned this pull request Feb 20, 2026
@Fil Fil mentioned this pull request Feb 20, 2026
@Fil Fil force-pushed the fil/brush-across-facets branch from de3e623 to 6701a3d Compare February 20, 2026 11:22
# Conflicts:
#	src/interactions/brush.d.ts
#	src/interactions/brush.js
#	test/plots/brush.ts
@Fil Fil mentioned this pull request Feb 24, 2026
@Fil Fil requested a review from mbostock February 24, 2026 17:23
@Fil Fil marked this pull request as draft February 25, 2026 15:07
@Fil
Copy link
Contributor Author

Fil commented Feb 25, 2026

An issue: what if a facet's value is undefined? I might need to revise this PR so that the facet filter happens with an explicit object {fx: undefined}, which would mean "filter on the undefined facet", vs. {} or null which would mean “ignore facet when filtering”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant