Conversation
de3e623 to
6701a3d
Compare
# Conflicts: # src/interactions/brush.d.ts # src/interactions/brush.js # test/plots/brush.ts
|
An issue: what if a facet's value is |
|
Nice! This works as expected for me. One thought I had was what happens here if we add an option for free x/y scales in faceted charts. |
|
Not specific to the cross-facet brushing: one thing I noticed is that the opaque brush border is a bit distracting with the line mark. I think it'd be rare that a person would want to brush in the x and y direction on a line chart (instead of just brushing over time in the x direction, for example), but sharing in any case. brush-border.mp4 |
|
It's not an opaque border: the discontinuities you're seeing on the edges of the brush are because the line is segmented between elements that are outside (context), and elements that are inside (focus) — and they're not connected. A way to avoid this is to draw a ghost line (complete), with the focus line on top (and no "context" line). I don't think we can do better by default. |
Yes, it will be tricky. Most probably it just doesn't make sense to support syncing in that case? Ref. #8 |
Ah this makes sense! |
|
For a line chart I wouldn't recommend using context like we do for individual dots, but instead would draw a (complete, greyed out) "ghost" line, and the selected line on top. |
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
filterfunction's facet arguments are now optional: omittingfxorfy(or passingundefined) 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.