Image Widget Persisted with Export to HTML?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Image Widget Persisted with Export to HTML?

Pierre Villeneuve
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

_______________________________________________
IPython-dev mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-dev
Reply | Threaded
Open this post in threaded view
|

Re: Image Widget Persisted with Export to HTML?

Jonathan Frederic
Hi Pierre,

Unfortunately such a thing doesn't exist right now.  I'm taking note of your use case, for the output area work that Kyle and I will be doing, and the static widget work I plan on doing later.

Sorry,
Jon

On Fri, Jul 10, 2015 at 6:16 PM, Pierre Villeneuve <[hidden email]> wrote:
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

_______________________________________________
IPython-dev mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-dev



_______________________________________________
IPython-dev mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-dev
Reply | Threaded
Open this post in threaded view
|

Re: Image Widget Persisted with Export to HTML?

Pierre Villeneuve

Jon,

Thanks for replying!  At least now that I know there isn't an easy hack solution, I can stop looking for it.

Pierre V. Villeneuve

On Jul 23, 2015 5:47 PM, "Jonathan Frederic" <[hidden email]> wrote:
Hi Pierre,

Unfortunately such a thing doesn't exist right now.  I'm taking note of your use case, for the output area work that Kyle and I will be doing, and the static widget work I plan on doing later.

Sorry,
Jon

On Fri, Jul 10, 2015 at 6:16 PM, Pierre Villeneuve <[hidden email]> wrote:
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

_______________________________________________
IPython-dev mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-dev



_______________________________________________
IPython-dev mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-dev


_______________________________________________
IPython-dev mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-dev