

Bokeh – Interactive web visualization library in Python - trueduke
http://bokeh.pydata.org/

======
hhuuggoo
I wanted to point out one important distinction between Bokeh and anything
that's currently out there - we have a full blow python/js object bridge that
synchronizes client side models with objects you can interact with in python.
The significance of this, is that someone can select points on a scatter plot,
and then you can retrieve the indexes of those points on the python side, and
use that to further dive into your data.

It's worth mentioning that the IPython guys are implementing a similar
json/python bridge to support the new interactive tools in the IPython
notebook. Once that is up and running, we'll probably just piggy back off of
that bridge, when you're running in the notebook.

------
bsg75
As a "database guy" who uses Python for most things not bash, is this an
approach for viz apps that would eliminate (most) of the need to muck about in
JavaScript?

D3 and its children produce some awesome visualizations, but the bandwidth
does not exist for me to begin developing apps in a language I don't have much
experience in.

If something like Bokeh allows me to live mostly in Python, it becomes even
more interesting.

~~~
paddy_m
That is exactly the point of bokeh. It allows you to write python code and get
browser based plots. Currently we have a python interface, but we intend to
build interfaces in other langauges. Look at the examples gallery, which
include the code needed to generate the plots.
[http://bokeh.pydata.org/gallery.html](http://bokeh.pydata.org/gallery.html)

A relatively simple plot (scroll down to see the code):
[http://bokeh.pydata.org/plot_gallery/correlation.html](http://bokeh.pydata.org/plot_gallery/correlation.html)

The simplest example plot in the repo:
[https://github.com/ContinuumIO/bokeh/blob/master/examples/pl...](https://github.com/ContinuumIO/bokeh/blob/master/examples/plotting/file/line.py)

~~~
Dartanion7
This is really cool, but what about adding interactivity with the charts? My
first thought when I saw the headline was that this python library just
generates D3 code, but it seems to be generating some sort of a static SVG
object.

~~~
bigreddot
There are already some tools available, pan and wheel zoom, plot resizing,
selection (on some plot types). Many more tool types are planned.

As for the architecture, BokehJS is built entirely on top of HTML canvas. The
python bokeh library sends data and plot specifications to the browser, which
uses BokehJS to render the plot and handle interactive tools, etc.

~~~
Dartanion7
Gotcha, thanks.

------
beat
As a photographer, I gotta say I really love the name. :)

For those who aren't photography nerds, "bokeh" is a Japanese word that means
the out-of-focus areas in a photograph. Different lenses have different kinds
of bokeh, and beautiful or ugly bokeh is an important dividing line between
good and bad lenses.

~~~
slantyyz
As someone who likes photography and analytics, I disagree about the name.

As you say, bokeh is about out-of-focus blur. That's sort of the opposite
impression you want to present in a tool that's intended to give you "clarity"
via its visualizations.

~~~
pwang
Actual, bokeh is about the quality of the blur. Yes, blur can have quality. If
you simply removed everything that was not in focus, you lose context and
texture about the subject. If you use a pinhole camera and present everything
in sharp focus, you lose the insight.

This is actually mentioned in the documentation:
[http://bokeh.pydata.org/#technical-
vision](http://bokeh.pydata.org/#technical-vision)

""" Photographers use the Japanese word “bokeh” to describe the blurring of
the out-of-focus parts of an image. Its aesthetic quality can greatly enhance
a photograph, and photographers artfully use focus to draw attention to
subjects of interest. “Good bokeh” contributes visual interest to a photograph
and places its subjects in context.

In this vein of focusing on high-impact subjects while always maintaining a
relationship to the data background, the Bokeh project attempts to address
fundamental challenges of large dataset visualization... """

~~~
slantyyz
>> Actual, bokeh is about the quality of the blur.

Yes, you're right. But most people tend to treat out-of-focus blur
synonymously with bokeh (the quality of the blur) -- they're related but not
the same. In this particular library's case, I think they're talking about
out-of-focus blur, not bokeh.

~~~
beat
Yeah, I kinda glossed over that.

------
Demiurge
It's nice, I've heard of it a while ago. But I just had a crazy thought of
combining this with UTFGrid for interacting with data points, but that's
probably silly :)

~~~
hogu
No - that's not crazy at all.

In fact we are working on (and open sourcing) similar ideas

[http://www.youtube.com/watch?v=b0-4xtFeaT8](http://www.youtube.com/watch?v=b0-4xtFeaT8)

------
bsg75
Are mouse hover interactions in the timeline (display value of selected
point)? Don't see any references but otherwise this is a very interesting
project.

~~~
bigreddot
[Another bokeh dev chiming in] Additional tools like crosshair, data and color
inspectors, box zoom, more types of selections (point, lasso, etc), and
measurement tools are all planned.

------
rafeed
This is badass. I wish there were something like this or Seaborn [1] for
Matlab. Anyone know of anything similar that can make the ugly default Matlab
plots turn into beauties like these?

[1]
[http://stanford.edu/~mwaskom/software/seaborn/index.html](http://stanford.edu/~mwaskom/software/seaborn/index.html)

~~~
hhuuggoo
This doesn't directly answer your question, but in regards to seaborn, our
goal is to support enough of the mpl API so we can get seaborn to work with
bokeh. Either that or we would write our own ggplot interface. Which ever
approach ends up being easier

~~~
ngoldbaum
Yes! Is would be crazy awesome if I could do 'from bokeh import pyplot' or
something similar.

------
3327
I don't know if anyone else noticed but we owe DARPA's XDATA program a thank
you note too for funding this project.

~~~
pwang
They've been great supporters of this effort, as well as Blaze[1] and
Numba[2].

[1] [http://blaze.pydata.org](http://blaze.pydata.org)

[2] [http://numba.pydata.org](http://numba.pydata.org)

------
Keyframe
What does 'large datasets' mean here? We are building a visualization service
to abstract users from fiddling with d3 and other libraries. We want users to
be able to use all of viz libraries out there with just providing data input
and tweaking settings, so this looks interesting.

~~~
hhuuggoo
Part of the 0.4 release is to incorporate the concept of abstract rendering -
which means you render on the server, and then send the necessary information
over to the client on demand. For example, if someone tries to scatter a
billion points, instead of just drawing a useless point cloud, you would
figure out where all the points fit inside your 512x512 canvas (or whatever
size you have), figure out how all the points stack up, compute an alpha that
is meaningful for that number of points, and then send the heatmap to the
client.

You can easily imagine as similar approach for line plots which does
selectively downsampling of datapoints in order to preserve interesting
features in the plot.

And then we'll build interactors on top of that, so you can actually treat it
like a scatter plot, even though it's a heatmap that's being sent to your
browser.

So the answer is - large datasets, means, as large as our abstract rendering
algorithm can handle on your hardware, so those data sets should be pretty
big.

~~~
rcfox
I have a project involving multi-gigabyte datasets of line plot data. With
your 0.4 release, will it be possible to show down-sampled subsets of these
plots, with the ability to pan/zoom around and get more data on demand without
having it all held in memory?

~~~
hhuuggoo
Well, we'll be able to do that without sending the data to the client, not
sure if our implementation right now will work without loading the data into
memory, though long term that is definitely the plan (we will leverage
[http://blaze.pydata.org/](http://blaze.pydata.org/))

If you want to discuss further, please email bokeh@continuum.io

------
polskibus
Has anyone used it in production ? I would be very interested to hear about
interoperability potential with other platforms - some json-based protocol
perhaps? In D3 I can just point it to csv and do whatever I need to. Is it
just as easy in BokehJS?

~~~
paddy_m
We will be adding stream datasources (which allow pulling from 3rd party jsonp
feeds) for bokeh 0.4. We expect to release bokeh 0.4 in early 2014.

It is incredibly easy to use bokeh from python. The burtin example in the
gallery reads from CSV
[http://bokeh.pydata.org/plot_gallery/burtin_example.html](http://bokeh.pydata.org/plot_gallery/burtin_example.html)
. Scroll down a bit, and you can see the code.

I am a bokeh dev at Continuum Analytics.

------
taeric
I realize this is nitpicky, but it seems obnoxious to call these[1]
"candlesticks" when it would make much more sense to call the page box
plots[2]. Wouldn't it?

[1]
[http://bokeh.pydata.org/plot_gallery/candlestick.html](http://bokeh.pydata.org/plot_gallery/candlestick.html)

[2]
[http://en.wikipedia.org/wiki/Box_plot](http://en.wikipedia.org/wiki/Box_plot)

~~~
T-A
Nah:
[http://en.wikipedia.org/wiki/Candlestick_chart](http://en.wikipedia.org/wiki/Candlestick_chart)

~~~
taeric
Awesome! I fell for the superficial resemblance, clearly. :) (I even searched
for the term candlestick on the wikipedia page for box plots... )

------
liyanage
This is really awesome. I just added it to my IPython Notebook Mac app:
[https://github.com/liyanage/ipython-
notebook/wiki](https://github.com/liyanage/ipython-notebook/wiki)

~~~
pwang
Cool! Thanks!

Let us know if you ever have any problems with it.

------
bigreddot
Just for reference, here is the actual 0.3 announcement:
[http://continuum.io/blog/bokeh03](http://continuum.io/blog/bokeh03)

------
asselinpaul
Can someone comment on how this compares with matplotlib?

~~~
pwang
In the FAQ:
[http://bokeh.pydata.org/faq.html](http://bokeh.pydata.org/faq.html)

""" Q: Why did you start writing a new plotting library, instead of just
extending e.g. Matplotlib?

A: There are a number of reasons why we wrote a new Python library, but they
all hinge on maximizing flexibility for exploring new design spaces for
achieving our long-term visualization goals. (Please see Technical Vision[1]
for details about those.) """

[1]
[http://bokeh.pydata.org/index.html#technicalvision](http://bokeh.pydata.org/index.html#technicalvision)

