JuliaPlots / JuliaPlots/PlotlyJS.jl
On() event handling not working in Jupyter notebook on both Windows and Linux
- Dominant language
- Julia
- Stars
- 444
- Forks
- 86
- PR merge metrics
- No merged PRs in 30d
Description
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:
```
using PlotlyJS,WebIO
p1=plot(rand(10));
on(p1["click"]) do data
global bp1 += 1
end;
bp1 = 0
0
display(p1);
# when the plot launches in Blink/Electron, click a couple of times on data points
#(actually anywhere in the plot as long as a hover cursor is showing that a data point is being tracked)
# now look at the content of the global variable
bp1
2
```
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 final `bp1` 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
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.