Bokeh or HoloViews multiple depended dropdowns

2019-08-26 01:33发布

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条回答
地球回转人心会变
2楼-- · 2019-08-26 02:05

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:

enter image description here

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...

查看更多
登录 后发表回答