Closed SimonDanisch closed 4 years ago
Any chance of export to svg? Reading through the Three.js docs they don't seem to support much...
i wouldtn try to support svg via threejs...
Layouting, subscenes and all cameras work now: https://nextjournal.com/sdanisch/wglmakie
When I try it locally nothing is displayed - in Jupyter and Juno.
did you activate the plot pane?
Another thing - is there a possibility of a Blink display backend? (For those of us who use the REPL)
yeah that should just work ;)
Can’t seem to figure out how to use Blink as a display backend for WGLMakie. I think that it boils down to something like:
using AbstractPlotting, WGLMakie
sc = lines(rand(10))
using Blink
w = Window()
body!(w, show(MIME"text/html", sc))
but that doesn't seem to work.
EDIT: To use Blink, this works:
using Blink
w = Window()
using WebIO
n = node(:div, "hi")
body!(w, n)
using AbstractPlotting, WGLMakie
scene = scatter(rand(4))
body!(w, WGLMakie.three_scene(scene))
I tried the above:
using Blink; w = Window(); using WebIO; n = WebIO.node(:div, "hi"); body!(w, n); using AbstractPlotting, WGLMakie; scene = scatter(rand(4)); body!(w, WGLMakie.three_scene(scene));
I get the following error (on the last line):
body!(w, WGLMakie.three_scene(scene)) ERROR: MethodError: no method matching JSModule(::getfield(WGLMakie, Symbol("##9#10")){Int64,Int64}, ::Symbol, ::String) Stacktrace: [1] three_scene(::Scene) at C:\Users\Berlin\.julia\packages\WGLMakie\Ysuil\src\WGLMakie.jl:174 [2] top-level scope at none:0
Do you have any suggested solutions?
Setup is a bit complicated ATM: https://nextjournal.com/sdanisch/wglmakie
Great, thanks for the speedy reply, got it working after running the pkg add command from the top line of your next journal (used the default WebIO not WebIO#sd-httpheader): e.g. plotting a mesh:
using Blink, WebIO;
using AbstractPlotting, WGLMakie, MakieGallery;
w = Window();
n = WebIO.node(:div, "hi"); body!(w, n);
scene=run_example("Colored Mesh");
body!(w, WGLMakie.three_scene(scene));
A long shot but have you tested this with PackageComplier?
Not yet... The problem is, how to get it to display while snooping... Would need to have some fake display code somewhere.
Ok, cool, if you get it working it would be good to know.
Tim
This feels almost fully functional! Playing with it, I noticed two more features that are missing here but work well in GLMakie:
mouse_selection
always returns nothing
, even when being on a plotlinewidth
attribute is ignored in line plotsI'm trying the Blink
option above , but body!(w, WGLMakie.three_scene(scene));
tells me that WGLMakie.three_scene
is undefined. Would you mind pointing me to the latest way to do this? Thanks!
Hi, i have the same problem, i cannot render a Makie plot into Blink using : body!(w, WGLMakie.three_scene(scene)). I get following message : "LoadError: UndefVarError: three_scene not defined"
Could you please help?
Thank you in advance !
I'm trying the
Blink
option above , butbody!(w, WGLMakie.three_scene(scene));
tells me thatWGLMakie.three_scene
is undefined. Would you mind pointing me to the latest way to do this? Thanks!
I am also having this issue:
julia> body!(w, WGLMakie.three_scene(scene))
ERROR: UndefVarError: three_scene not defined
Stacktrace:
[1] getproperty(::Module, ::Symbol) at ./Base.jl:26
[2] top-level scope at REPL[103]:1
This works pretty well by now:
using Blink
s = scatter(1:4)
w = Window()
body!(w, s)
Only problem: the resolution isn't really synced, so it comes out as too big!
@SimonDanisch Thanks! Just complementing your code snippet to make it an MWE:
using Blink, AbstractPlotting, WGLMakie
s = scatter(1:4)
w = Window()
body!(w, s)
Package info:
(@v1.5) pkg> st Makie
[ee78f7c6] Makie v0.11.1
(@v1.5) pkg> st WGLMakie
[276b4fcb] WGLMakie v0.2.9
(@v1.5) pkg> st Blink
[ad839575] Blink v0.12.3
(@v1.5) pkg> st AbstractPlotting
[537997a7] AbstractPlotting v0.12.15
There is actually not that much to do anymore until this is fully functioning: