wrobstory/vincent — pull request #35 by dnmiller (2013-06-02 20:40:23+00:00)
Title: Vega API update

Time for an update. Apologies up front for the length.

I decided to go and implement a full Vega API with object-relational classes. Most of the Vega spec is there. It's still lacking tests and more sophisticated validation. It's big, but it's mostly just doc strings paraphrasing the Vega wiki. It's actually pretty flexible, so changes to the Vega spec shouldn't mess things up much.

Included is a `Vega Bar Tutorial.ipynb` that re-does the original bar tutorial in the Vega wiki.

Still a ways from alpha, but it's coming along.

Also, there's a new file, `factories.py`, which is just a proof-of-concept for a factories idea. As an example, a bar-chart factory would look something like

```python
bar = BarFactory()
bar(x, y).display()
```

which would then show a bar chart in ipython nb. The most common style elements could be changed with properties, i.e.

```python
bar.color = 'red' # The bars for new charts are now red
bar(x, y).display() # All calls to bar now generate charts with red bars
```

There would be a default `bar` pre-defined for users who just want to plot and not worry about the style. Ideally, they'd be interchangeable, so it'd be trivial to recreate figures for web, print, presentations, etc.

I'm in no way dedicated to this approach. It's a bit different than what's out there, and there might be something I'm overlooking. I'm eager for feedback.

I'm going to polish the Vega API a bit while I let the factories idea percolate.

Some additional changes:
- I renamed `core.py` to `vega.py` to better reflect its content.
- I added some Sphinx source files, but that's still very much a work in progress and I wouldn't worry about it now.