vega / vega-lite

A concise grammar of interactive graphics, built on Vega.
https://vega.github.io/vega-lite/
BSD 3-Clause "New" or "Revised" License
4.69k stars 613 forks source link

Ability to decouple selection trigger from selection storage #4319

Open kanitw opened 5 years ago

kanitw commented 5 years ago

Currently we have single/multi/interval selection that leads to different types of predicate stored.

However, it is impossible to have brush interaction that stores all the points (rather than range predicate).

This might be useful if we want to enable an application where you can (1) click to select a point (2) brush to select a collection of points and then cmd/shift+click to select/deselect additional point like in Tableau.

tableau-selection-decouple

mattijn commented 5 years ago

+1

kanitw commented 5 years ago

This would be useful for implementing brush on the Vega-Lite parallel coordinate example (https://github.com/vega/vega-lite/pull/4638).

If there is a multi selection with brush, one can apply it to this example by projecting on the line index.

kanitw commented 5 years ago

Note that one would want to support both clicking and brush to select data (not only one of them).

kanitw commented 5 years ago

@arvind -- I'm wondering if your team would be able to include this feature in 4.0 (or at least help outline what are the steps to achieve this)?

arvind commented 5 years ago

It's a good question. The refactoring we did in v3 with how selections are represented in their stores helps make this possible. However, I think it would require a non-trivial rewriting of the compiler logic to get us there and would likely involve some backwards-incompatible changes to the language design -- i.e., decoupling input modality (discrete vs. continuous) from data representation.

The most viable path forward I see is first starting with adding support for interval selections over geo projections. Doing so shifts interval selections to be less dependent on range predicates via the intersection hit testing that we added in vega/vega#1571. Once that is solid, we can think about what language-level changes are necessary, and then what the knock-on effects would be to other selection components (e.g., the toggle transform does not currently expect to be used with an interval selection).