MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.38k stars 302 forks source link

WGLMakie + Pluto #811

Closed j-fu closed 3 years ago

j-fu commented 3 years ago

Hi thanks for all the work you are putting into this! I just tried out the new WGLMakie, it so far is not yet perfect...

Thus is what I am seeing in pluto:

Here is the notebook with the MWE

https://gist.github.com/j-fu/6213665e0c0043e8e97bb2e3b4292e5a

... the single scatter plot is messed up, and it is not clear what to show for a scene...

EDIT: @fonsp

SimonDanisch commented 3 years ago

Sorry, 0.3 is a breaking release, since it now works a bit different. I added a Page mode to JSServe for Pluto, which still needs full documentation etc. The very first cell in your notebook now needs to be:

begin
    using JSServe
        port = 8449 # the port you want
    JSServe.JSSERVE_CONFIGURATION.listen_port[] = port 
    JSServe.JSSERVE_CONFIGURATION.external_url[] = "http://localhost:$(port)"
    JSServe.JSSERVE_CONFIGURATION.content_delivery_url[] = "http://localhost:$(port)"
    JSServe.Page() # needs to get displayed by Pluto
end

The docs + UI still needs to be cleaned up and then I'll prepare docs + blogpost.

j-fu commented 3 years ago

Ah now this works. Great!

Also mixing 2D and 3D + updating Nodes works:

https://gist.github.com/j-fu/efe75cc057d4d8643464b196bbce0eb7

Seems I am running into #805 when I run the rendering cell a second time.

I wonder about the CPU usage: I see 300% during interaction which is not the case with GLMakie.

SimonDanisch commented 3 years ago

You should try to use this for sliders:

 n = JSServe.Slider(3:100)
data = map(x-> ..., n) # the slider works just like an observable
j-fu commented 3 years ago

Is see, thank you - need to carve out some time for following these recent developments...

woolstar commented 3 years ago

Is port 8449 fixed? I tried putting a different number in arbitrarily and it didn't seem to work, but I am not sure if I did the experiment correctly. Seems like it might limit having multiple notebooks open at once if so.

SimonDanisch commented 3 years ago

Each notebook needs its own port!

woolstar commented 3 years ago

I repeated the experiment, and it is working with other port numbers. So operator error on my part before. However I am getting this warning on the console as I go along:

┌ Warning: session closed and not ready └ @ JSServe ~/.julia/packages/JSServe/a4Ibj/src/session.jl:112

SimonDanisch commented 3 years ago

Ah forgot to remove that one...you can ignore that!

woolstar commented 3 years ago

It looks like with WLGMakie 0.3.2 and Julia 1.5.3, the work-around no longer works around the problem. I am back to nothing being displayed again.

SimonDanisch commented 3 years ago

http://juliaplots.org/WGLMakie.jl/dev/

VarLad commented 3 years ago

@SimonDanisch Any idea what I can do for the low DPI?