Bokeh or HoloViews multiple depended dropdowns

2019-08-26 01:31发布

问题:

I have a data set with 3 of the columns having categorical values. I want to create 3 drop downs in Bokeh or HoloViews in which the first drop down selection determines the values of the list in the other 2 drop downs. Can anyone point me to any of the tutorials or blog or docs that show how to this. I don't seem to fine any.​ I appreciate your time. Thanks!

回答1:

If you are working in a Jupyter notebook, you can use paramnb to do this, taking advantage of the way a notebook separates code into different cells:

Here I did "Run all", then selected c3 in the first widget, which re-runs the two cells below it to update them. I then selected a "high" value in the second set of widgets, which re-runs the plot to update it.

This pattern will let you do arbitrary chaining like this if you have notebooks, and if Jupyter Dashboards is an option for you then you can string these cells together to make an application. But this is just one approach...