Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive widgets not working anymore in recent Jupyter notebook #80

Closed
delaere opened this issue Nov 22, 2022 · 4 comments
Closed

Interactive widgets not working anymore in recent Jupyter notebook #80

delaere opened this issue Nov 22, 2022 · 4 comments

Comments

@delaere
Copy link

delaere commented Nov 22, 2022

As commented already in #78, I observe an issue similar to #17, but here in a standard Jupyter notebook. The javascript error message also looks different.

While it was working perfectly a few months ago, I am now unable to use the drawingWidget in Jupyter. I guess that this is related to the update of python and/or Jupyter.
I now get the following error message:

Failed to create view for 'DrawingView' from module 'drawingview' with model 'DOMWidgetModel' from module '@jupyter-widgets/base'
TypeError: Class constructor O cannot be invoked without 'new'

I just confirmed the problem in a clean virtualenv following the recipe below and running the interactive widget demo.

virtualenv -p python3 debug-venv
source debug-venv/bin/activate
pip install drawSvg hyperbolic jupyter
pip freeze >packages.txt
jupyter notebook

I am running Python 3.10.8 on Fedora Linux 36. The issue appears both with the chrome-based Vivaldi browser 5.5.2805.44
and in Firefox 106.0.4 . The packages list is there: packages.txt

Thanks for your help!

@cduck
Copy link
Owner

cduck commented Nov 27, 2022

Thanks for reporting this. I also see this issue. It looks like Jupyter notebook removed support for classic widgets.

I'll look into rewriting DrawingWidget for the new API.

@cduck
Copy link
Owner

cduck commented Nov 27, 2022

@cduck
Copy link
Owner

cduck commented Nov 28, 2022

Fixed and published version 1.9.0. Re-open this issue if it doesn't work.

The issue turned out to be related to JavaScript ES6 classes and unrelated to #17. The latest Jupyter notebook front-end no longer works with the old DOMWidgetView.extend(...) style. I had to update it to class DrawingView extends DOMWidgetView {...}.

@cduck cduck closed this as completed Nov 28, 2022
@delaere
Copy link
Author

delaere commented Nov 29, 2022

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants