Perhaps we should support a multi-select input binding. Selected options could populate as an array.
A motivating use case is being able to bind Vega-Lite's multi selection to an input as well (vega/vega-lite#3722).
I like this idea. However, we need to articulate a specific implementation. Here's a starting point:
UI: there is insufficient browser support for multiple selection in HTML input elements, though there is a W3C spec. Fortunately select elements _do_ support multiple selection, and alternatively we could generate a set of radio buttons or checkboxes that can be independently toggled.
Signal value: we need to pick a representation of selected values. It seems an array of values makes sense for multiple-choice inputs, with a one-element array for a single selection (not just the value), and an empty array (not null) if no values are selected. Is this compatible with VL multi selection?
Vega spec: would this involve brand new "input" types, or would we extend existing types, for example adding a "multiple": true option. I'm a bit uncertain on this point.
Is there some progress or plan for this feature?
I would love to see multi-select being supported for bindings! In terms of the user experience, I think Dash has nice features in their multi-select dropdowns where you can both search for values and unclick current selections easily. When there are many selection elements, a searchable dropdown is often the best solution as it saves space while making it easy to find the options.
In terms of item number 2 above from @jheer, could this be handled the same way multiple selections are currently implemented in in plots and legends such as in https://vega.github.io/vega/examples/interactive-legend/?
I like that Vega binds to standard html input elements so I would prefer to use a standard select with the multiple attribute. A consumer an still wrap the multi select in a fancy dropdown with search but by sticking to the native element we guarantee accessibility and reduce code size.
The Bokeh-based Python package Panel appears to have taken the approach of using the standard select with the multiple attribute (at least it seems so based on the look of the widget). Not sure if looking at their approach can be helpful at least conceptually, or if it is too unrelated to how it would be implemented in vega.
Most helpful comment
I like that Vega binds to standard html input elements so I would prefer to use a standard select with the multiple attribute. A consumer an still wrap the multi select in a fancy dropdown with search but by sticking to the native element we guarantee accessibility and reduce code size.