PlotlyJS.jl icon indicating copy to clipboard operation
PlotlyJS.jl copied to clipboard

pop window exits after loadind animation displayed

Open zhufengning opened this issue 1 year ago • 11 comments

Describe the bug running from shell and it pops a window but exits before plot shows. 深度截图_选择区域_20220823210727.png running in vscode can normally display plots

Version info

julia> versioninfo()
Julia Version 1.8.0
Commit 5544a0fab76 (2022-08-17 13:38 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 9 5900HS with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, znver3)
  Threads: 1 on 16 virtual cores

zhufengning avatar Aug 23 '22 13:08 zhufengning

Can you post the code?

mzaffalon avatar Aug 23 '22 14:08 mzaffalon

Can you post the code?

using PlotlyJS, CSV, DataFrames

df = dataset(DataFrame, "iris")

plt = plot(

    df,

    x=:sepal_length, y=:sepal_width, z=:petal_width, color=:species,

    type="scatter3d", mode="markers"

)
display(plt)

and there is no output in the terminal

zhufengning avatar Aug 24 '22 03:08 zhufengning

Maybe you may need a backend for plotting, e.g. using WebIO?

mzaffalon avatar Aug 24 '22 03:08 mzaffalon

Maybe you may need a backend for plotting, e.g. using WebIO?

WebIO is installed, and there is no difference after added using WebIO. I think it's a electron problem, the electron process starts and shows the window and loading animation before exits. The exported html file using PlotlyBase.to_html works well.

zhufengning avatar Aug 24 '22 05:08 zhufengning

Does the following work?

using WebIO, PlotlyJS
plot(scatter(y=randn(100)))

mzaffalon avatar Aug 24 '22 05:08 mzaffalon

using WebIO, PlotlyJS
p=plot(scatter(y=randn(100)))
display(p)

when using display to show the gui, it still crash.

zhufengning avatar Aug 24 '22 06:08 zhufengning

Could it be a WebIO issue? What happens if you pin the package to v0.8.17 as in https://github.com/JuliaGizmos/WebIO.jl/issues/493#issuecomment-1175841764?

mzaffalon avatar Aug 24 '22 06:08 mzaffalon

still the same

zhufengning avatar Aug 24 '22 06:08 zhufengning

What is the output of import Pkg; Pkg.status()?

mzaffalon avatar Aug 24 '22 06:08 mzaffalon

Status `~/repos/fast/Project.toml`
  [336ed68f] CSV v0.10.4
  [a93c6f00] DataFrames v1.3.4
  [28b8d3ca] GR v0.66.2
  [f0f68f2c] PlotlyJS v0.18.8
  [d330b81b] PyPlot v2.11.0
⌃ [0f1e0344] WebIO v0.8.17 ⚲
Info Packages marked with ⌃ have new versions available

i found more about this bug. if i run julia --project=. a.jl, the window will crash. if i run julia --project=. and then run include("a.jl") in the repl, the window won't crash. 深度截图_plasmashell_20220824144146.png

zhufengning avatar Aug 24 '22 06:08 zhufengning

You need to put a readline() or similar at the end of your script to prevent the julia process from shutting down immediately

BeastyBlacksmith avatar Aug 25 '22 12:08 BeastyBlacksmith