jakevdp/mpld3 — pull request #9 by hadim (2013-12-21 14:48:20+00:00)
Title: Allow to popup new window with d3 figure

Not currently working so don't merge it

What the PR do:

- add "Open in a new window" button below current figure
- save temp file with figure html code (without button) when self.html is called
- when the button is clicked a new window open on temp file

It actually does not work. Which mean when the window is open, url is "about:blank". But when I manually open the temp file in the browser, it works. I don't why...

Anyway saving html code in a temp file is not good in my opinion for two things:

- temp file is created each time self.html and never closed, it should be only called when user click on button and close when user close window
- figure html code of the new window should be served by ipython kernel with something like that : http://127.0.0.1:8888/notebooks/test.ipynb/show_figure6f27767e1b0b4f0abb883870a2edc693/ but I don't wether it is possible to serve simple html file with ipython notebook.

If someone know how to do it I will be glade to add it to the PR.

TODO: dynamically resize figure to window size (maybe add small border too). See http://stackoverflow.com/questions/14265112/d3-js-map-svg-auto-fit-into-parent-container-and-resize-with-window and http://eyeseast.github.io/visible-data/2013/08/28/responsive-charts-with-d3/