Bokeh 0.12.0 Released
Tags: Data Science, Python, Data Visualization, Bokeh, Open Source

I’m pleased to announce that Bokeh Version 0.12 has been released! This is a major update with many new improvements. Before getting into the details, I’d first like to also announce:

0.12.x is the last line of releases before Bokeh 1.0

There will be more to say in a separate blog post about the roadmap to 1.0 later this year, but for now I’ll mention that the primary focus will be: bugfixes, performance and optimization, build and test automation to support API stability and semantic versioning, and a few high-priority remaining features.

The 0.12 release cycle was longer than most Bokeh release cycles. We plan to move to a time-based schedule in the near future, with more incremental releases, more often. But this release represents a giant step forward.

Here are just a few of the things that are new:

Responsive layout and styling improvements throughout

First-class BokehJS APIs for plotting and charts

Legends can be placed outside / next to the central plot area

New color palettes: Viridis, Magma, Inferno, and Plasma

Expanded WebGL support to all markers and fixed WebGL bugs

New annotations: Arrow, Title, Label, LogColorMapper, FuncTickFormatter

Support for computed transforms (e.g. Jitter) on data columns

Server features for threading and simpler deployments

New hosted demos at https://demo.bokeh.org

And as usual, many bugfixes and documentation additions. For full details, see the CHANGELOG and Release Notes.

This release can most easily be installed in the usual ways: conda install -c bokeh bokeh if you are using Anaconda or pip install bokeh otherwise.

Here are some details about a few of these areas of improvement.

Layout and Styling

One of the primary focus areas of this release cycle was a major overhaul to the way Bokeh lays out documents and components. Some of the new capabilities include:

Titles can be laid out on any side of a plot

Plot axes and widget extents align automatically, when possible

New responsive sizing modes scale_width, stretch_both, and others

Toolbars can be “sticky” and adhere closer to the plot.

In addition to the layout improvements, Bokeh also got a style refresh. Here are the major changes in appearance: Titles are also bold, closer to the plot, and left-aligned by default. Axes labels are smaller and italic. For individual plots, toolbars are now on the right side. Finally, Bokeh widget appearance is more “flat” in general.

Putting all this together, we can see a nice example below with the styling changes as well as the nice layout

The extensive work on layout and styling is still fresh, and there are some specific use-cases and issues to hammer out. We will be making incremental improvements consistently with micro point releases in the coming weeks and months.

NOTE: In order to accomplish this undertaking, some old interfaces had to be deprecated and two small breaking changes introduced. For full details, consult the Migration Guide.

Bokeh App Improvements and Examples

In addition to the layout improvements, a number of fixes and features directly related the the Bokeh server were made. This includes better support for using threads with Bokeh apps, a new default index page, the ability to configure multiple processes easily with --num-procs , as well as bugfixes and performance improvements. Together, all of these made it simple to create new compelling example applications. Many of these can be viewed at https://demo.bokeh.org, including the new crossfilter example, embedded live below:

Select different fields from the dropdowns to query the data along different dimensions.

BokehJS APIs

Until recently, BokehJS has mostly been an internal implementation detail to support the Python (and other language) bindings for Bokeh. But there has been interest in developing a BokehJS as a compelling JavaScript library in its own right. With the 0.12 release, BokehJS gains its own set of APIs: Bokeh.Models and Bokeh.Plotting, which largely follow the corresponding Python APIs, and Bokeh.Charts which is a new API for high-level charts unique to BokehJS.

Below is a small example using Bokeh.Plotting and the streaming interface:

The code for creating the plot is similar to the Python code for creating a comparable plot:

var plot = plt.figure({

tools: "pan,wheel_zoom,save,reset",

title: "Streaming Stocks",

plot_width: 600,

plot_height: 400,

background_fill_color: "#eeeeff",

x_axis_label: "time",

x_axis_type: "datetime",

y_axis_label: "price",

});

As is the code for streaming data to a data source:

var t = 8;

var period = 0.5; // seconds

function new_data() {

t += period;

var d = {

t: [t * 1000],

corp_a: [Math.sin(t * 0.3 + 0) * 2 + Math.random() + 3.0],

corp_b: [Math.sin(t * 0.5 + 1) * 2 + Math.random() + 3.4],

corp_c: [Math.sin(t * 0.7 + 2) * 2 + Math.random() + 3.8],

};

source.stream(d, 50);

}

setInterval(new_data, period * 1000);

Besides the new User’s Guide section on the BokehJS APIs, there is also a new section on Extending Bokeh that contains more information about using BokehJS directly, from the perspective of building custom user extensions.

Finally, I would just like to say Thank You to all the core contributors, new contributors, and the Bokeh community at large. Bokeh is the success that it is today only because of the tremendous work and feedback from so many individuals.

Thanks,

Bryan Van de Ven