Due to security concerns there is currently no easy way to execute Javascript in a cell. With this script you can create the d3 code from within (I)Python but render them later on with PhantomJs. Becasue of that one can easily switch between producing interactive SVG visualisations by just copying the resulting HTML code from the rendered script file, or saving a static version in PNG, PDF, etc.

The main ingredients are coded as a class in Python

Dependencies: