-
-
Notifications
You must be signed in to change notification settings - Fork 62
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 compatible with JupyterLab #17
Comments
Thanks for reporting the issue. I can't reproduce the issue you are seeing. Do any of the other examples work? Can you try in a fresh python virtual environment? You can setup a new virtualenv with the following commands: pip3 install virtualenv
virtualenv -p python3 debug-venv
source debug-venv/bin/activate
pip install drawSvg hyperbolic jupyter
pip freeze >packages.txt
jupyter notebook
# Try running "Interactive Widget" in the new notebook Let me know if this works. If it doesn't, please tell me which OS, browser version and python version you are using, and the contents of |
Thank you for the quick response! ResultsI ran each example from the same "Implementing other SVG tags"In JupyterLab, the SVG is displayed but there is no hyperlink. "Asynchronous Animation in Jupyter"In JupyterLab, nothing is outputted since a definition for "Interactive Widget"Jupyter Notebook outputs:
JupyterLab outputs:
Environment InformationOS: macOS Catalina 10.15.5
|
Thanks. I can reproduce it now. The issue is with JupyterLab (I was trying to reproduce in Jupyter Notebook). drawSvg has only been tested in Jupyter Notebook (although I assumed the API would behave the same). This will take a bit of work to fix the JavaScript component of the widgets in drawSvg. For now I suggest using a Jupyter Notebook if possible. |
Also, the hyperlink example isn't working because JupyterLab embeds the SVG in the page as an image instead of directly in the HTML. |
Hi, |
I have not had time to look into this issue yet. If you make progress, please reply here with what you find. |
I don't think SVG is displayed as image in Jupyter Lab(I use SVG there, didn't test your code yet though). It could be because of a little different widget register mechanism in Lab. I would like that to be working so I can build a little drawing pad application there based on this package. It's really a little outstanding package. |
|
Thanks for the update @massgh. drawSvg currently uses Jupyter documentation suggest following https://github.com/jupyter-widgets/widget-ts-cookiecutter to write a compatible widget but this requires publishing a node package, which is not technically required. drawSvg's JavaScript is very simple so I do not want to introduce the complexity of node's package compilation to the project. Instead, I plan to simply add a Jupyter Lab configuration JSON somewhere in the published package but I need to learn how this works. Please share here if you have experience with this. Additionally, the install instructions will change from |
Jupyter Lab appears to have changed the way objects with the method A possible fix could remove Alternatively, use |
Oh no, that's why my SVGs do not span to available space, just remain small there. Thanks for pointing it out. |
Sorry to ping on this issue, but out of interest, does this problem seem fixable using @cduck's suggestion? |
I appreciate your interest in this, @ChrisJefferson. Are you referring to the hyperlink example not being clickable or the interactive widget not running? This GitHub issue is focused on the interactive widget. I plan to get to this but I need to find a large chunk of time to reverse engineer the Jupyter Lab widget API (since I haven't found sufficient documentation). The hyperlink example should work now in drawsvg 2.0 with the new |
Did you try anywidget? This may be an easy way to add this functionality. I am very interested in the Jupyter Lab integration possibility. |
I did in other cases but not |
Thank you @mbclarkengineering for pointing me to anywidget! This might not have exited last time I looked. |
This error appears when attempting to execute the "Interactive Widget" example found in the repository-level
README.md
. I ran the code within a code cell in the latest version of JupyterLab and the output was:The following image shows what is outputted to the JavaScript console after executing the example:
The text was updated successfully, but these errors were encountered: