Now there is only a single widget which allows multiple selection - selection list. Often toggle buttons suit better, but in ipywidgets they allow to select single item only. While it's not that difficult to make a similar widget manually using a box and separate ToggleButtons (+ a bit of custom CSS), having this out of the box would be great!
While it's not that difficult to make a similar widget manually using a box and separate ToggleButtons (+ a bit of custom CSS), having this out of the box would be great!
can you say more about this, like why 'great' (just curious).
@hainm I mean that such a widget is of very general use, and in some common cases better (e.g. takes less vertical space - just a single line - compared to selection list, which is currently the only multiple selection widget; also can be operated with mouse only - through that's a minor thing). And there are single-selection ToggleButtons already, so why not include such an obvious generalization?
And as for implementing it on top of ipywidgets see here for my version (in pure python, I don't feel like messing with widgets templates).
thanks.
@aplavin We invite you to submit a PR to add a ToggleButtons widget!
@gnestor as I understand, the widgets in ipywidgets are implemented with javascript (custom templates), not python-only. I haven't wrapped my head around this, so I can't implement the widget the same way as existing widgets are.
If that's OK, I can clean up my code a bit and add it to widget_selection.py.
@aplavin I will help with this. Feel free to submit an initial PR with the Python code. If you do, check the "Allow maintainers to edit" checkbox and I will work on the Javascript side.
Hi all,
came across this while trying to find the feature - has this been implemented?
What ever happened here? Would love this feature built in
@jtdowdall - It looks like @maartenbreddels is starting up some conversation at #2228 inspired by this.
Most helpful comment
@hainm I mean that such a widget is of very general use, and in some common cases better (e.g. takes less vertical space - just a single line - compared to selection list, which is currently the only multiple selection widget; also can be operated with mouse only - through that's a minor thing). And there are single-selection
ToggleButtonsalready, so why not include such an obvious generalization?And as for implementing it on top of
ipywidgetssee here for my version (in pure python, I don't feel like messing with widgets templates).