block by bollwyvl c0a3bd28d9fff11b8914

IPython Livecoding Hack with Inlet.js

While widgets provide the best way to enable bidirectional communication between the Notebook and the kernel this approach, borrowed from Bret Victor’s talk Inventing on Principal and implemented with Ian Johnson’s Inlet.js is kind of fun.

Once this is installed, clicking on a number (int, float… or scientific notation!) or a hex/hsl color, and a visual tool (slider or color picker) will show up.

Installation

You can copy and paste the ipython-inlet.js file in a Notebook cell with %%javascript uncommented, it should take care of everything. You could probably also do some kind of magic with requirejs, but I don’t know the URL yet…

ipython-inlet.js