-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
On() event handling not working in Jupyter notebook on both Windows and Linux #296
Comments
Thanks for reporting and providing a clear example and good writeup! I'm not sure exactly what happened. I'm afraid I won't be a lot of help on this one... I don't have a windows installation that I can use for testing and nothing in this library changed. Perhaps @travigd would know if something on the WebIO side changed? |
Thanks Spencer for the quick reply and may I add a special thanks for this great tool. I am doing magic things with PlotlyJS and Julia thanks to you. Yes, I thought that would be your reply and yes, I will report this at WebIO as you suggest. Unfortunately Travigd has much the same problem - no Windows to test on. I, on the other hand, have no JavaScript experience. I am willing to help track this down with a bit of coaching. I agree that it is probably a WebIO problem and I hope Travigd can give some guidance. You can decide if you want to keep this issue open or close it until there is progress to report. |
Thanks @kobussch ! It's always gratifying to hear positive feedback on open source projects. Also very cool that you are doing "magic" :) I wish I could be more helpful, but I haven't had a ton of time lately to keep up with changes in WebIO and friends. Because of how julia and jupyter are written and packaged, it would surprise me that this would be a windows only issue. Have you tried on another operating system? I just checked on my linux machine and it did not work for me in jupyterlab, but did work in the standard notebook |
I did some more tests and it is becoming quite interesting. Even though this may turn out to be a WebIO problem as previously suggested, I will post my results here in case it triggers some bright ideas somewhere. I did an install of Julia 1.3 rc1.4 on a Linux machine on which I have previously set up Julia 1.2, PlotlyJS, IJulia and nothing else at all. This did not go smoothly (miniconda issues, missing WebIO, the usual shebang), but I will skip the nasty details for a later discussion. Eventually I got it going. The surprising outcome is that my test code worked in a Jupyter notebook, but only once. I have a test notebook previously set up with the code as per my first post. After sorting out the install issues, I opened this notebook (with Jupyter launched from the REPL) and it worked perfectly in all aspects. The graphics of the previous run displayed immediately and the click event capture worked. Then I closed the notebook and shut down the Jupyter server and repeated the exercise. This time, the saved graphics display did not work and neither did the event capture. This state is now permanent. This may be what happened in your labbook test as well. The first time (in labbook) was successful but the second time (in notebook) not. It would be interesting to know if your labbook test still gives the same results. I am starting to think that it may have something to do with how the note/labbook is saved. I would have ascribed this whole bizarre sequence to finger trouble, but I distinctly remember the same thing happening when I did my original Windows upgrade. It worked once. I am planning to set up a virtual box with a completely virgin Linux install where I can record some snapshots and try out various sequences. Will keep you posted on the results. Kobus |
very interseting. do keep up updated |
I can now confirm that everything in my previous comment is valid and repeatable (and broken) in both WIndows and Linux. I created a brand new VirtualBox with Linux Mint Cinnamon 19.2 and then installed Julia, PlotlyJS, etc. (latest versions as per julia Pkg system). I then created a Jupyter notebook containing the code of my first post, but did not run this notebook - only saved it and made an additional backup as reference. Now I opened this notebook again in Jupyter and executed the cells. Evrything works - the plot renders and the clicks update the global variable. If I close the notebook quickly to avoid the autosave feature, I can do this multiple times in a row and everything keeps on working. When I hit the I can also mention that running the My next step in cracking this nut will be to create clean VirtualBox installs of older versions of Julia, pinning both PlotlyJS and WebIO package versions and then creep forward one update at a time to see if I can find the code change that causes the problem. Unfortunately the Julia package system has no control over the Conda, Electron and ZMQ binaries installed in the process, so this approach may not be successful. Any other ideas? |
I am trapping the on-click event on a plotlyjs graph. In the REPL everything works fine, but in n Jupyter notebook there is no sign of an event happening. The plot renders correctly in Jupyter and all the built-in interactive functions work correctly (zoom, hover display etc.). It is only my own custom on-click function that never gets called.
Context
The following code was used:
The global gp1 should update with each click. Running the above code in REPL works fine. In Jupyter I have split the code into three cells with the
using
statement in the 1st, everything else in the 2nd cell except for the finalbp1
which goes in the 3rd cell. Then I run the first two cells, The plot correctly renders, but no matter how many time I click in the plot area, when executing the 3rd cell,bp1
always returns 0.This used to work, but after upgrading packages it stopped working
Versions
Windows 10 Home
Julia V1.3.0-rc4
[f0f68f2c] PlotlyJS v0.13.0
[0f1e0344] WebIO v0.8.11
[7073ff75] IJulia v1.20.0
conda 4.7.12 (miniconda installed via WebIO/IJulia)
jupyter:
jupyter core : 4.6.0
jupyter-notebook : 6.0.1
qtconsole : 4.5.5
ipython : 7.8.0
ipykernel : 5.1.2
jupyter client : 5.3.4
jupyter lab : not installed
nbconvert : 5.6.0
ipywidgets : 7.5.1
nbformat : 4.4.0
traitlets : 4.3.3
The text was updated successfully, but these errors were encountered: