jakevdp/mpld3 — pull request #83 by jakevdp (2014-03-02 01:50:06+00:00)
Title: MRG: Complete Rewrite of MPD3

Lots of stuff here, but basically a response to Issue #69

A few highlights

- mpld3 is now a stand-alone javascript library. Before merging this, we should put this on http://mpld3.github.io and change mpld3/urls.py to reflect the location
- there's now a small toolbar in the lower-left by default, with a reset button and a button to turn on/off the zoom behavior.
- matplotlib figure crawling based on the [mplexporter](http://github.com/mpld3/mplexporter) package. This way, the crawling utilities can be used by other packages
- Python-side is mostly the same, except I've renamed a few functions (``show_d3`` ->``show``, ``display_d3`` -> ``display``, ``fig_to_d3`` -> ``fig_to_html``) and added a few convenience routines (``save_html``, ``fig_to_dict``, ``save_json``).
- ``show()`` command has a more sophisticated server and will use local copies of the JS libraries by default.
- And, obviously, the JS is entirely different. I think it's nicely extensible now: you can take a look at the rewritten examples to see how plugins are defined. Basically, you create a plugin class and register it with mpld3, then pass the metadata via the JSON spec. The figure draws it during the draw() phase.

I think it all works; I've been testing it as I wrote it. But it would be nice if folks could take a look and try to break some things! Thanks