We are excited to announce the release of version 0.7 of Bokeh, an interactive web plotting library for Python! This release includes many major new features:

  • IPython widgets and animations without a Bokeh server
  • Touch UI working for tools on mobile devices
  • Vastly improved linked data table
  • More new (and improving) bokeh.charts (high level charting interface)
  • Color mappers on the python side
  • Improved toolbar
  • Many new tools: lasso, poly, and point selection, crosshair inspector

We would also like to mention that the Github Organization for Bokeh is growing! This organization was already home to bokeh-scala and bokeh.jl, and now the Bokeh project itself has a new home there as well, located at https://github.com/bokeh/bokeh. Anyone interested in developing new language bindings for Bokeh is encouraged to contact us about hosting your project under this organization.

Get It Now!

If you are using Anaconda, you can install with conda:

    conda install bokeh

Alternatively, you can install with pip:

    pip install bokeh

Developer builds are also now made available to get features in the hands of interested users more quickly. See the section Developer Builds of the documentation for more details.

BokehJS is also available by CDN for use in standalone Javascript applications:

Finally, BokehJS is also installable with the Node Package Manager.

IPython integration

One often-requested feature is closer integration with IPython widgets. While some integration has been possible quite a while, it either required using the Bokeh server, or re-creating the plot on every widget event (which looked clunky). Now it is possible to trigger updates to just data sources from IPython widget events, resulting in a very smooth interaction:

 
 
 

 
 

On the left is an example of image processing using Numba to compile a python smoothing kernel into efficient machine code. The slider controls the blur level and the plot is immediately updated as soon as the slider is changed. On the right is a basic example that shows a trig function explorer. A drop down menu lets you choose what function to plot and sliders control the function parameters.

All this is made possible by a new push_notebook method on data sources. It is simple to use in conjunction with IPython interact:

def update(f, w=1, A=1, phi=0):
    source.data['y'] = A * sin(w * x + phi)
    source.push_notebook()
 
from IPython.html.widgets import interact
interact(update, w=(0,100), A=(1,10), phi=(0, 10, 0.1))

 

Python

This method can also be used in a loop to update streaming or animated visualizations in the notebook, and we will be adding more convenience functions to make these cases even easier in future releases.

Improved toolbar and tools

We have made a number of improvements to the tools system in Bokeh. As you can see below the styling of the toolbar itself has undergone an iteration, and looks better than ever:

You might also notice there many new buttons! We are happy to have added several new tools. In addition to the existing box selection tool we now how lasso and polygon selection tools, as well as a point (click) selection tool. A crosshair inspector is also now available. Note that it is now possible to remove or grey out the toolbar logo, using the logo attribute on plots.

One of the best new features, though, is that all these tools are now more easily usable at the same time. Any tools with different gestures (drag, click, etc) can be active and available together. So for example, there is no need to click or activate the zoom and pan tools separately, they both “just work”. You can use the toolbar to set what what tool is currently active for each gesture, and the active tool for each gesture is indicated with the visual underline in the toolbar.

Lots of exciting features are still planned for tools and inspectors, so keep checking for new dev builds and upcoming releases.

Touch UI Support

Another long desired and requested feature is support for touch interfaces. Thanks to the lovely hammer.js library, we have been able to incorporate touch support for almost all tools available on Bokeh plots.

 
 

Here we see the pan and pinch zoom tools in action. Note that both are available together by default without any additional action, and this is also true of the pan and wheel zoom tools in non-touch interfaces.

All the new selection tools also work with touch interfaces. If we had multiple plots sharing a data source, we could see linked brushing of the selections as always. If this plot was loaded from a server we could pull selections back to running applications as well.

 
 
 

 
 
 

Finally we see that the reset and resize tools work smoothly on touch interfaces as well. More tools are coming, as are ways to configure tool behaviors, directly on the plot. All of this future work will support touch interfaces form the start.

Linked Data Table

After a few attempts evaluating different JavaScript table libraries, we finally came upon the lovely SlickGrid library. You can see it in action below, with table and plot selections easily linked together, including multiple and disjoint selections:

 
 

SlickGrid has a ton of amazing features and we have only just scratched the surface. Together with Bokeh widgets and the Bokeh server, powerful dashboard capabilities become possible. Expect continuous improvements to data table interactions with Bokeh in the future.

The Rest

New charts

The bokeh.charts API continues to get expansion and improvements. A vigorous discussion around BEP3 helped to further refine and standardize the data interface to for Bokeh charts. Now most charts accept a larger, standard set of inputs: lists, dicts, OrderedDicts, NumPy arrays and Pandas DataFrames. Several new chart types were also added as well:

Stacked areas and lines, dot plots, step charts and donut plots are all now available! Check them out in the charts examples directory.

API deprecations

We are constantly working to smooth out and improve Bokeh APIs. While it is true that Bokeh is still at a 0.x stage, it is now popular enough that we must be concerned with maintaining compatibility where possible. When breakage is unavoidable, we intend to provide a clear deprecation path. The first such example of this is in the bokeh.plotting module. Originally intended as a “Matlab” style API with implicit current plots, this style of interface has proved problematic and confusing, especially in the notebook and when embedding Bokeh plots in web apps.

Using the old API will result in a DeprecationWarning. The new API is more in line with the Zen of Python (“Explicit is better than implicit”) and migration basically amounts to changing things like:

figure()
hold()
line()
circle()
show()

 

Python

into:

p = figure()
p.line()
p.circle()
show(p)

 

Python

Note that python does not display deprecation warning by default! To turn on printing of deprecation warnings, make sure to run python -Wd.

What’s Next?

The release of Bokeh 0.8 should happen in early 2015. Some notable features we intend to work on are:

  • Simplifying production and multi-user Bokeh server deployments
  • Colorbar axis and axis location inspectors
  • Better support for maps and projections

How to get involved

Issues, enhancement requests, and pull requests can be made on the Bokeh Github page: https://github.com/continuumio/bokeh

Questions can be directed to the Bokeh mailing list: [email protected]

If you would like some help incorporating Bokeh into your Notebooks, apps, or dashboards, please send an email to [email protected] to inquire about Continuum’s training and consulting services—not just for Bokeh, but for anything in the full NumPy/SciPy/PyData stack.


About the Author

Mr. Van de Ven received undergraduate degrees in Computer Science and Mathematics from UT Austin, and a Master’s degree in physics from UCLA. He has worked at the Applied Research Labs, developing software for sonar feature detection and cl …

Read more

Join the Disucssion