Bokeh 0.12.3 Released

by Luke Canavan on Sunday, October 9, 2016

We're pleased to announce the release of Bokeh 0.12.3! This minor update adds a few small features and several bug fixes including:

  • New categorical color mapper
  • Tap tool and tooltips working for VBar and HBar
  • BokehJS reduced in size by twenty percent
  • Support for generating legends from a DataSource column
  • Better hover tool support for some Charts

We'd also like to highlight that we now package and upload examples for each Bokeh release to our CDN. Click here to download. This should resolve the issue of examples in our source repository not being compatible with older Bokeh releases.

Finally, project lead Bryan Van de Ven gave a great talk at PyBay 2016 about building interactive applications with Bokeh. It can be viewed on YouTube.


For full details, see the CHANGELOG and Release Notes.

This release can most easily be installed from the Bokeh channel on Anaconda.org via conda install -c bokeh bokeh if you are using Anaconda or pip install bokeh otherwise.


Categorical Color Mapping

Support for color mapping scalar data was added in the 0.12.2 release. Thanks to Sarah Bird, this feature has been extended to make it possible to use a CategoricalColorMapper object to map a categorical data column to a color palette.

Here's an example excerpted from the Gapminder demo, where the country bubbles are colored mapped by region:

...

# Add the circle
color_mapper = CategoricalColorMapper(palette=Spectral6, factors=regions_list)
renderer_source = sources['_%s' % years[0]]
circle_glyph = Circle(
    x='fertility', y='life', size='population',
    fill_color={'field': 'region', 'transform': color_mapper},
    fill_alpha=0.8,
    line_color='#7c7e71', line_width=0.5, line_alpha=0.5)
circle_renderer = plot.add_glyph(renderer_source, circle_glyph)

...

See the working Gapminder application and source code in the example gallery to see the full implementation.

Support for generating legends from a DataSource column

We've also added support for creating custom legends in a concise, explicit manner. Legends now have an item argument that accepts a list of LegendItem objects.

LegendItem labels can be a single value or a field that corresponds to a column name in a DataSource and a list of renderers (in order to know how the legend key should match the glyph).

Here's an example of the former in the Bokeh daylight demo:

...

legend = Legend(items=[
    LegendItem(label=value('sunrise'), renderers=[sunrise_line_renderer]),
    LegendItem(label=value('sunset'), renderers=[sunset_line_renderer])
])
plot.add_layout(legend)

...

Here's the legend that is created:

In the Gapminder demo, the legend was created using the field string method:

...

plot.add_layout(Legend(items=[LegendItem(label=field('region'), renderers=[circle_renderer])]))

...

The resulting legend contains entries for each unique value in the column labeled 'region' in the data source attached to circle_renderer. Again, you can view the live application in the example gallery.


As we're nearing in on the Bokeh 1.0 release, I'd like to thank the nearly 200 total contributors who have helped make Bokeh such an amazing project. As always, for questions, technical assistance or if you're interested in contributing, please ask the Bokeh mailing list or join the chat on Gitter.

Thanks,

Luke Canavan