Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bokeh: Using python for interactive data visualization

Bokeh: Using python for interactive data visualization

ernestoarbitrio

April 21, 2018
Tweet

More Decks by ernestoarbitrio

Other Decks in Technology

Transcript

  1. PyCon Nove - Florence 19th - 22nd April 2018 BOKEH:

    USING PYTHON FOR INTERACTIVE DATA VISUALISATION Ernesto Arbitrio @__pamaron__ github.com/ernestoarbitrio PyCon Italia Apr 21, 2018
  2. Agenda •What is Bokeh •Why Bokeh? •Basic Viz •ColumnDataSource •Js

    callbacks, widgets and toolYps •Embedding charts •Mapping Geo Data •Bokeh server •AddiYonal Features
  3. What is Bokeh? [1] h4ps:/ /en.wikipedia.org/wiki/Bokeh Bokeh is the aesthe;c

    quality of the blur produced in the out-of-focus parts of an image produced by a lens. [1]
  4. What is Bokeh? “allows users the flexibility to focus on

    the most important data without losing track of the rich context that allows it to be understood” - bokeh.pydata.org [1] h4ps:/ /en.wikipedia.org/wiki/Bokeh Bokeh is the aesthe;c quality of the blur produced in the out-of-focus parts of an image produced by a lens. [1]
  5. so Bokeh is …. • is a data viz library

    • not unlike matplotlib, ggplot2 or d3.js • built also for the web • has strong ;es to data science and integra;on
  6. Bokeh is …. To offer both simplicity and the powerful

    and flexible features needed for advanced customiza;ons, Bokeh exposes two interface levels to users: bokeh.models A low-level interface that provides the most flexibility to applica;on developers. bokeh.plo\ng A higher-level interface centered around composing visual glyphs.
  7. ColumnDataSource ColumnDataSource is the object where the data of a

    Bokeh graph is stored. You can feed your graph directly with Python dic;onaries, pandas dataframes, etc, but for certain features such as having a popup window showing data informa;on when the user hovers the mouse on glyphs, you are forced to use a ColumnDataSource. Other uses would be when streaming data.
  8. JS Callbacks, widgets and Tool;ps Bokeh provides different ways for

    users to supply custom JavaScript when necessary, so that users may add custom or specialized behaviours in response to property changes and other events.
  9. Bokeh: Embedding Charts Bokeh provides a variety of ways to

    embed plots and data into HTML documents. Html files Components
  10. Mapping Geo Data Bokeh has started adding support for working

    with Geographical data. - Over mercator projection - Over google maps
  11. Bokeh Server The Bokeh server is an op;onal component that

    can be used for sharing and publishing Bokeh plots and apps, for handling streaming of large data sets, or for enabling sophis;cated user interac;ons based off of widgets and selec;ons.
  12. So … how does bokeh works? • Dynamic plo\ng engine

    • Consumes JSON to produce visualizaYons • Can use websockets get/send updates
  13. So … how does bokeh works? BokehJS is not actually

    JS • Wri4en primarily in CoffeeScript • Bokeh Roadmap lists migra;on to TypeScript as a core improvement