jupyter-widgets / widget-cookiecutter

A cookiecutter template for creating a custom Jupyter widget project.
BSD 3-Clause "New" or "Revised" License
258 stars 72 forks source link

widget renders only after restart of the kernel #60

Closed Nic30 closed 4 years ago

Nic30 commented 4 years ago

Hello,

I used this repo to generate a jupyter widget extension https://github.com/Nic30/jupyter_widget_hwt It is working just fine, but I would like to ask if this behaviour is expected:

I made this extension to simplify the debugging process of some lib, but the current behaviour + installation makes it even more complicated, is there any way how to solve mentioned issues?

I am new to Jupyter, I would be glad for any hint.

Nic30 commented 4 years ago

need to restart a kernel to render

vidartf commented 4 years ago

jupyter nbextension enable --py widgetsnbextension is incredibly slow

If it was a jupyter labextension install ... step, that would be expected as lab would need to install all its dependencies (cacheable) and repack its entire JS bundle. For nbextension enable it should just be flipping a value in a JSON file....

Nic30 commented 4 years ago

@vidartf yes, enable triggers install in my case and npm based js recking is very slow and I am using elk which has around 4.5MB which makes situation even worse.

Also I found out that the examples for plotly and other widgets works in same way. In order to render the widgets by default, it is required to save notebook with state and make it trusted, all widgets have to be installed and enabled etc. One thing which probably irritates me the most is that if the widget js is not installed or there is an error, no error appears and widget is just not rendered. This makes it impossible for someone to guess that something is not working as it should.

From my (user) point of view this is just additional complication which confuses potential visitors of my jupyter based examples. I am not satisfied with current behavior but I do not think this is solvable on widget level, that is why I am closing this issue.