Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to display a plot with Mux.jl #329

Open
robsmith11 opened this issue May 29, 2020 · 3 comments
Open

Document how to display a plot with Mux.jl #329

robsmith11 opened this issue May 29, 2020 · 3 comments

Comments

@robsmith11
Copy link

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?

@robsmith11
Copy link
Author

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.

@sglyon
Copy link
Member

sglyon commented May 30, 2020

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 ?

@sglyon
Copy link
Member

sglyon commented May 30, 2020

Also going to ping @shashi in case he knows!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants