matplotlib/matplotlib — pull request #1878 by pelson (2013-04-02 10:07:07+00:00)
Title: Webagg changes

Some refactoring work on the WebAgg backend.

Key features:

* you can now run the backend with a url prefix (i.e. it is now possible to run the service under ```127.0.0.1/mpl/*```, if you so desired)
* objectified the JS figure (and associated web socket) so that more than one figure can exist on the same page
* there is an "all figures" landing page which handles keyboard & mouse focus appropriately
* the creation of the appropriate HTML elements is now easier due to the ```mpl_interface.js``` factory functions

I've been testing this out with the following code:

```
import matplotlib
matplotlib.use('webagg')

import matplotlib.pyplot as plt

plt.figure()
plt.plot(range(10))

plt.figure('wibble')
plt.bar(range(10), range(10))

plt.show()
```

I still have some other changes I'd like to make to the WebAgg architecture, but I think this is a reasonable first step which adds some nice, self contained, functionality.