There have been many examples of useful and exciting data visualizations for a variety of topics and applications.
from IPython.display import IFrame, HTML
from IPython.core.display import display
display(IFrame("http://demographics.coopercenter.org/DotMap/index.html", '800px', '600px'))
display(IFrame("http://www.nytimes.com/interactive/2014/07/31/world/africa/ebola-virus-outbreak-qa.html", '800px', '600px'))
Most of these invlove directly coding JavaScript.
Not everyone enjoys writing JavaScript.
Bokeh is a Python package for creating interactive, browser-based visualizations, and is well-suited for "big data" applications.
Bokeh allows users to create interactive html visualizations without using JS.
Bokeh is a language-based visualization system. This allows for:
Bokeh philosophy:
Make a smart choice when it is possible to do so automatically, and expose low-level capabilities when it is not.
Bokeh writes to a custom-built HTML5 Canvas library, which affords it high performance. This allows it to integrate with other web tools, such as Google Maps.
Bokeh plots are based on visual elements called glyphs that are bound to data objects.
First we'll import the bokeh.plotting module, which defines the graphical functions and primitives.
import bokeh.plotting as bk
Next, we'll tell Bokeh to display its plots directly into the notebook. This will cause all of the Javascript and data to be embedded directly into the HTML of the notebook itself. (Bokeh can output straight to HTML files, or use a server, which we'll look at later.)
bk.output_notebook()