ipywidgets_server icon indicating copy to clipboard operation
ipywidgets_server copied to clipboard

Handle clear output messages

Open mozzhorin opened this issue 7 years ago • 3 comments

(Sorry, I don't have any experience with JS and HTML) I've built a plotting widget in a Jupyter Notebook using bqplot. It uses IPython.display.clear_output() to redraw everything, which doesn't work on ipywidgets_server. Is there any other way clear the output? And is it possible to embed a widget from ipywidgets_server in a web page?

mozzhorin avatar Jun 05 '18 16:06 mozzhorin

At the moment, we don't catch the clear_output messages on the frontend, but that sounds like something we should do.

PRs welcome! If anyone wants to tackle this, shout out here and I can try to come up with more detail.

As a work-around, I suggest embedding your widget in a container (like an HBox or a VBox) and changing that container's children instead of clearing the output.

pbugnion avatar Jun 06 '18 05:06 pbugnion

I replied to your second question in a separate issue (issue #40) for greater discoverability.

pbugnion avatar Jun 06 '18 05:06 pbugnion

Thanks, I've tried it before but haven't succeeded. I'll try more and if I manage that I'll write here my solution.

mozzhorin avatar Jun 06 '18 10:06 mozzhorin