[IPython-dev] Image Widget Persisted with Export to HTML?

Pierre Villeneuve pierre.villeneuve at gmail.com
Fri Jul 10 21:16:15 EDT 2015


Hello all,

First, here is the context of my question to the group: I'm currently
developing an image widget based on the HTML Canvas element, versus the
IPython built-in widget based on the Image element.  For simple cases the
differences seen by a user may not be noticeable, but in my case I
specifically wish to propagate the canvas' JavaScript mouse events to
Python callback functions. Another difference is my widget can be
initialized directly from a Numpy array.

My question applies to my canvas image widget as well as the built-in image
widget.  When I export my notebook to HTML the widget's displayed image is
not present.  This is the opposite behaviour from an image displayed using
IPython.display.Image().  I know that widgets are displayed to the frontend
in an area separate from the cell's standard output area, and that
persisting widget's is in itself a huge topic.  I simply want a pretty
picture to survive the export to HTML.

I'm curious to know if a near-term solution is possible whereby I might
temporarily replace each of my displayed widget's images with an instance
of IPython.display.Image().  I can mentally visualize a path to a solution
if only there was a place where I could define a callback function to be
called just prior to HTML export.  Does sch a thing exist?

Pierre

*Pierre Villeneuve*
pierre.villeneuve at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150710/a3790904/attachment.html>


More information about the IPython-dev mailing list