Session Ready
Exercise

Add a single slider

In the previous exercise, you added a single plot to the "current document" of your application. In this exercise, you'll practice adding a layout to your current document.

Your job here is to create a single slider, use it to create a widgetbox layout, and then add this layout to the current document.

The slider you create here cannot be used for much, but in the later exercises, you'll use it to update your plots!

Instructions
100 XP
  • Import curdoc from bokeh.io, widgetbox from bokeh.layouts, and Slider from bokeh.models.
  • Create a slider called slider by using the Slider() function and specifying the parameters title, start, end, step, and value.
  • Use the slider to create a widgetbox layout called layout.
  • Add the layout to the current document using curdoc().add_root(). It needs to be passed in as an argument to add_root().