bokeh/bokeh — pull request #1387 by fpliger (2014-11-10 16:27:33+00:00)
Title: Feature/normalize charts inputs

This PR addressed #1309

Introduces a new DataAdapter class that can be used by Charts to normalize different inputs and used the same interface to access data. Supported input types:

* Dataframe
* Dict/OrderedDict
*List
* Array

It's interface is not good enough now and mixes dict and dataframe api (specially regarding names like: columns, index, keys, values, etc...), but it's a start

Here's the DataAdapter design summary for now:

- Implements columns and keys attributes that are used to map series name. Maps to list of indexes in case of List or Array.
- Implements values attribute that basically behaves like dict values.
- Implements index attribute that behaves returning the indexes (or keys) of the first items of values.
- Implements support for explicit columns and index aliases so if user have a pure matrix of values (np.array or list of lists) it can pass one list of column aliases and another of index aliases to be used for axes.

NOTE: Boxplot, CategoryHeatMap, Histogram and Bar expect a "1 level" iterable to be consumed for the plot (that can be seen as a list of lists (of values)). Scatter and TimeSeries expect a "2 levels" iterable (a list of lists that elements are points (with x and y coordinates). I.e.: timeseries expects a datetime and a number as tuple elements). Is this separation in 2 groups ok? Can we simplify it?