-
Notifications
You must be signed in to change notification settings - Fork 115
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
Issues with running the Editor #50
Comments
Hmm, or I could insert a check to see if the file can be found on the filesystem, and if not it defaults to the online copy. |
So the original problem was with using the online copy. Adding the d3 file locally was my solution to this. |
I still don't understand this bug. Forcing PyZX to use the online copy at https://d3js.org/d3.v5.min.js works fine for me. Which browser are you using, and which version of Jupyter? |
Hello, How do I "force PyZX to use the online copy at https://d3js.org/d3.v5.min.js" ? Thanks ! |
Go into pyzx/utils.py and comment out the block of lines 95-104 (the try-except block). |
I tried to modify utils.py but it didn't work. (tested with chrome and
firefox)
I've attached the log from the browser console.
There is an "Uncaught ReferenceError: require is not defined" it seems that
the import of d3js didn't succeed...
Maybe a hint here ?
https://stackoverflow.com/questions/19059580/client-on-node-uncaught-referenceerror-require-is-not-defined
…On Tue, Aug 25, 2020 at 2:56 AM John van de Wetering < ***@***.***> wrote:
Go into pyzx/utils.py and comment out the block of lines 95-104 (the
try-except block).
What browser are you using?
Seeing as this is a problem for more people I think I'm just gonna bite
the bullet and include a copy of d3 with pyzx.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#50 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFH53H2N4HK5JFBRSVKCGDSCKZVPANCNFSM4PNTBX4A>
.
|
I found the bug: It works with "jupyter notebook" it fails with "jupyter
labs"
On Tue, Aug 25, 2020 at 11:09 AM Joaquín Keller <joaquin.keller@gmail.com>
wrote:
… I tried to modify utils.py but it didn't work. (tested with chrome and
firefox)
I've attached the log from the browser console.
There is an "Uncaught ReferenceError: require is not defined" it seems
that the import of d3js didn't succeed...
Maybe a hint here ?
https://stackoverflow.com/questions/19059580/client-on-node-uncaught-referenceerror-require-is-not-defined
On Tue, Aug 25, 2020 at 2:56 AM John van de Wetering <
***@***.***> wrote:
> Go into pyzx/utils.py and comment out the block of lines 95-104 (the
> try-except block).
> What browser are you using?
> Seeing as this is a problem for more people I think I'm just gonna bite
> the bullet and include a copy of d3 with pyzx.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#50 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAFH53H2N4HK5JFBRSVKCGDSCKZVPANCNFSM4PNTBX4A>
> .
>
|
Ah yes. It doesn't work me either if I try it with jupyterlab. So it turns out that for jupyterlab you have to manually enable extensions (https://ipywidgets.readthedocs.io/en/latest/user_install.html#installing-the-jupyterlab-extension), which also requires installing node.js. But even after following the instructions I still get the javascript error that 'require' is not defined. I think this has to do with jupyterlab being a bit more strict about how you can execute javascript in a cell. To solve this would require making a separate PyZX extension to jupyterlab, which I am not going to do any time soon. So my suggestion is to use the classic notebook interface (i.e. in jupyterlab go to Help -> Launch classic notebook) |
@RDPEast were you also using jupyterlab? |
No I'm using the notebook, though I still rely on the hard copy of the file. I believe others (i.e Nick) have also encountered problems with just the notebook and downloading the d3 file. |
What does it say in the javascript console when you try it with using the online copy? |
Hmm, I find it interesting that you get a script error before it says "Loading extension: jupyter-js-widgets/extension". That seems to me like an error in your jupyter server, but I really don't understand enough of this to be sure. |
So another thing I encountered that might explain this: If you have a Jupyter notebook with some cells loaded that include javascript, then that javascript remains when you reload the notebook. The way to get it to be "clean" so that it can find the d3 library again is to go Kernel -> Restart and Clear Output. |
I found I had the same issue (d3 not loading) and in my case it was caused by Edit to add: My python virtual environment is held in a folder called |
I think the d3 loading issues have now all been fixed, so I'm closing this issue. Please create a new issue if new problems have arisen. |
It may be an idea to include the d3 file locally which was the hacky solution I've used.
The text was updated successfully, but these errors were encountered: