How to obtain html from an instance of an ipywidget?

29 views
Skip to first unread message

Paul A

unread,
Aug 10, 2016, 11:27:54 AM8/10/16
to Project Jupyter
Given an instance of a widget, how difficult is it to obtain its css/js/divs?

Jason Grout

unread,
Aug 10, 2016, 1:20:31 PM8/10/16
to Project Jupyter
What are you trying to do?  You can get the div via widgetInstance.el. I'm not sure that it makes sense to get the other things, hence the question about what you are trying to do.

Thanks,

Jason


On Wed, Aug 10, 2016 at 11:28 AM Paul A <rootsum...@gmail.com> wrote:
Given an instance of a widget, how difficult is it to obtain its css/js/divs?

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/d7e80320-236d-4fff-babd-5d65840c1889%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason Grout

unread,
Aug 10, 2016, 1:21:16 PM8/10/16
to Project Jupyter
(Note that widgetInstance.el may not be a div if the widget has changed its default element)

Jonathan Frederic

unread,
Aug 10, 2016, 10:57:50 PM8/10/16
to jup...@googlegroups.com
Paul,

The easiest thing to do is to setup a kernel-less widget manager, import the widget's class, and reconstruct it using state exported from your notebook.

There is no one-size fits all solution for widget->html+css_js because some widgets may choose to not even be represented by any one of those three.

Cheers,
Jon

On Wed, Aug 10, 2016 at 10:21 AM, Jason Grout <ja...@jasongrout.org> wrote:
(Note that widgetInstance.el may not be a div if the widget has changed its default element)
On Wed, Aug 10, 2016 at 1:20 PM Jason Grout <ja...@jasongrout.org> wrote:
What are you trying to do?  You can get the div via widgetInstance.el. I'm not sure that it makes sense to get the other things, hence the question about what you are trying to do.

Thanks,

Jason


On Wed, Aug 10, 2016 at 11:28 AM Paul A <rootsum...@gmail.com> wrote:
Given an instance of a widget, how difficult is it to obtain its css/js/divs?

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/d7e80320-236d-4fff-babd-5d65840c1889%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages