These are chat archives for sandialabs/toyplot

Aug 2015
Pierre V. Villeneuve
Aug 11 2015 15:43
Hello all, I'm really impressed with how easy it's been to generate interactive graphics in the Jupyter notebook. I have two quick question: 1) is there support for Python callback functions to respond to mouse events on a canvas? 2) is there support for dynamically updating the displayed canvas when axes content or properties are modified in Python?
Timothy M. Shead
Aug 11 2015 20:44
@Who8MyLunch - Happy to hear it! There isn’t any way to do what you’re describing today, but it’s clearly technically feasible. My research focus for Toyplot is on creating interactive plots that can be shared across multiple media, not just notebooks, so I doubt that I’ll get around to this. If someone else wants to explore, I’d suggest looking at how Jupyter widgets are implemented, then attach the necessary Jupiter-specific stuff to the content generated by Toyplot’s HTML backend (which is what we use to embed figures in notebooks). toyplot.html.render() returns the figure in the form of a DOM tree, so you could add additional markup and Javascript code relatively easy.