lumen
lumen copied to clipboard
Make it possible to programmatically unselect/reset widget filter in a Notebook Pipeline
Once a widget filter has been selected in a Lumen Pipeline within a notebook, there is no way to programmatically unselect or reset the filter.
ALL software version info
lumen: 0.5.0a64
Description of expected behavior and the observed behavior
A way to programmatically unselect options in a widget filter.
@Hoxbro suggested: pipeline.reset_filters()
Complete, minimal, self-contained example code that reproduces the issue
import lumen
from lumen.views import Table
from lumen.pipeline import Pipeline
import panel as pn
pn.extension('tabulator', template='fast')
data_url = 'https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-07-28/penguins.csv'
pipeline = Pipeline.from_spec({
'source': {
'type': 'file',
'tables': {
'penguins': data_url
}
},
'filters': [
{'type': 'widget', 'field': 'species'},
{'type': 'widget', 'field': 'island'},
{'type': 'widget', 'field': 'sex'},
{'type': 'widget', 'field': 'year'}
],
'transforms': [
{'type': 'aggregate', 'method': 'mean', 'by': ['sex', 'year']}
]
})
pn.Row(pipeline.control_panel, Table(pipeline=pipeline, pagination='remote'))
Screenshots or screencasts of the bug in action
@droumis Doesn't pressing CTRL while clicking on a selected item unselect it?
ahA! holding cmd (on mac) and clicking allows for unselection.. I thought I tried that on a call with Philip and Simon and it didn't work then, but now it does!
Just to note, there is no programmatic way to reset your filters. Functionality like pipeline.reset_filters()
could be nice to have.
@Hoxbro, you are right! I edited this issue to make it reflect that a programmatic approach is requested