pyganja
pyganja copied to clipboard
pyganja in Jupyterlab - by ext only?
Finding pyganja works superbly in Jupyter notebooks, but Jupyterlab places restriction against unmediated javascript. Option is to write an extension, but thought to ask if you have recommendation in this direction. Thank you for your incredibly good work! -ae-
Same question here. Thx
Hi both, sorry for the slow reply on this, things have been pretty busy! We currently don't have plans to write a jupyterlab extension but it should be very possible to get around the javascript issue in pyganja by using the other keywords to the draw command: https://github.com/pygae/pyganja/blob/2e56893a841417b5370e21fb7457167b32559e6d/pyganja/script_api.py#L241
I think the new_window flag should be able to help you out, eg:
from clifford.tools.g3c import *
from pyganja import *
draw([random_line() for i in range(10)], new_window=True)
This will hopefully pop up a new window with your visualisation in it. If you want the visualisations inline in the notebook then you might have to have a search around for a jupyterlab extension which allows the javascript to run as normal. If you happen to come across an extension like that then let us know as other people might be in a similar position!
Many thanks, as always. Yes, this flag works fine! Jupyter Lab extensibility seems a deeper dive. Also, Lab and Notebook "servers" seem indistinguishable, at least through IPython core (e.g., get_ipython()). But Lab gives easy access to "old" "notebook format". : )
many thx 👌
Am Fr., 28. Aug. 2020 um 17:18 Uhr schrieb ae1234567 < [email protected]>:
Many thanks, as always. Yes, this flag works fine! Jupyter Lab extensibility seems a deeper dive. Also, Lab and Notebook "servers" seem indistinguishable, at least through IPython core (e.g., get_ipython()). But Lab gives easy access to "old" "notebook format". : )
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pygae/pyganja/issues/49#issuecomment-682330321, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDL4VK2NSBHMWAKXRDSIGTSC442BANCNFSM4PQ3BKVQ .
I guess this issue is the cause of "Javascript Error: context is undefined" errors in jupyterlab. Adding new_window=True
hides the error but doesn't actually display anything for me (Firefox 101, popup blocking disabled)