Integration with Genie/Stipple #4213
Replies: 11 comments
-
Hi, I'm working on a refactor of JSServe which should make this quite easy. |
Beta Was this translation helpful? Give feedback.
-
Thanks @SimonDanisch and @essenciary for opening this here. |
Beta Was this translation helpful? Give feedback.
-
Yeah I would love to see this. This would help overcome some of the challenges with application portability using GTK. Plus the stipple controls look so nice. Definitely upvoting this. |
Beta Was this translation helpful? Give feedback.
-
Bumping this -- what is the status here out of curiosity? |
Beta Was this translation helpful? Give feedback.
-
I've opened a new issue on the Stipple repo about this (link) as I would like to use BioMakie with Stipple. So far I've had some success with these three methods:
Here's the code: using JSServe, WGLMakie
using GenieFramework
n = 10
volume = rand(n, n, n)
fig = Figure()
ax, cplot = contour(fig[1, 1], volume)
rectplot = linesegments!(ax, Rect(-1, -1, 12, 12), linewidth=2, color=:red)
idx = 3
translate!(rectplot, 0, 0, idx)
plotcontent = DOM.div(fig)
app = App() do session::Session
plotcontent
end
server = JSServe.Server(app, "127.0.0.1", 8081)
JSServe.HTTPServer.start(server)
@app begin
@in z = 1
@onchange z begin
translate!(rectplot, 0, 0, z)
end
end
ui() = [
slider(1:10, :z),
Html.div(style="display:flex", [
Html.div(style="width:33%", plotcontent),
iframe(src="http://localhost:8081", width="33%", height="500px"),
iframe(src="http://localhost:9384/browser-display", width="33%", height="500px")])
]
@page("/", ui)
up()
The first method stops working after a page reload, see the linked issue for more details. The other two methods work fine. |
Beta Was this translation helpful? Give feedback.
-
@SimonDanisch I'd love to revive this topic. As Genie has its own server I wonder how Bonito is supposed to work with it together. |
Beta Was this translation helpful? Give feedback.
-
Would it not be easier to take the iframe approach @hhaensel? Then, only two things you might have to do are:
I'm not sure what the plotting model for Genie looks like now, but I imagine that the plot is re-generated every time a slider value changes. This would be pretty suboptimal for Makie, because the whole point is that you don't have to re-create the plot every time a value changes, but can update only the values you want to and have the changes reflect. That would probably be a bit of a pain point there... Maybe you could also take advantage of the SpecAPI and its diffing capability for this? |
Beta Was this translation helpful? Give feedback.
-
Maybe we find some time during JuliaCon to work on this? |
Beta Was this translation helpful? Give feedback.
-
any updates? |
Beta Was this translation helpful? Give feedback.
-
During JuliaCon hackathon I got some inspiring help by @SimonDanisch and have setup StippleMakie. |
Beta Was this translation helpful? Give feedback.
-
Hi Makie team!
I'd like to tackle out-of-the-box integration of Makie plots into Genie/Stipple apps. We're using HTTP.jl together with WebSockets and Ajax for exchanging data payloads between the Julia backend and the client frontend. Can you please point me to docs/relevant bits of code on how to achieve the integration? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions