PlotlyJS.jl
PlotlyJS.jl copied to clipboard
Document how to display a plot with Mux.jl
I've read through the tutorial, but am struggling to get a plot to display in my browser. I run Julia on a remote server, so I'd like it to be served via an HTTP server. The documentation for PlotlyJS.jl mentions that this should be easy to do with WebIO and Mux, but doesn't say how.
From googling, it looks like I should use the webio_serve function, but the function doesn't have any documentation and its signature doesn't specify the argument type. How do I take a Plot or SyncPlot and wrap it in something that Mux can serve?
I've managed to get a plot displayed by following an Interact.jl example:
julia> ui = @manipulate for x in 1:10
plot(1:x, rand(x))
end;
julia> t = webio_serve(page("/", req->ui), 8002)
ui has the type of Widget. So is there a way to create a Widget from a Plot/SyncPlot without going through Interact.jl? I don't want any controls in the browser, just the plot drawn using the full screen.
It's also not obvious to me how to tell webio/mux to serve another plot. Calling that function again complains that the port is already in use.
I think an example of this in the documentation would help clueless newcomers like me.
Hey @robsmith11 great question. I'll try to find time to look into this within the next few days
For starters... SyncPlot is displayed via a WebIO.Scope so perhaps you could follow the mux example here https://juliagizmos.github.io/WebIO.jl/stable/gettingstarted/#Mux-1 ?
Also going to ping @shashi in case he knows!