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
Sf/vscode resizing #3044
Sf/vscode resizing #3044
Conversation
This implements basic resizing support for WGLMakie figures. This has primarily been tested in the VSCode plot pane and the JSServe auto-launched browser window (using Chrome and Safari). The implementation creates a new `resize` event that the javascript frontend can send back to the Julia backend, with a computed size (in pixels) that the backend should resize to. Additionally, the javascript `throttle()` function is altered to no longer drop the last few events when throttled, it instead delays the last event until the end of the throttling period, which is important when resizing quickly so that the final size is faithfully recorded.
Compile Times benchmarkNote, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running: using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(display(fig))
|
And test if CI hangs like in #3044
And test if CI hangs like in #3044
FTR, I think this is approach is fine. I just put |
@kbarros, the aspect ratio for LScene should be fixed now! (btw, you need to do |
I agree that locking to the minimum dimension is likely the ideal solution, but should probably be implemented in a follow-on PR. |
Also good to keep in mind that Jupyter notebooks tend to have short wide panels -- so we can't only look at the panel width in that use case. |
Actually, I accidently achieved the plots.jl behaviour by using the wrappers div function resize_callback() {
comm.notify({ resize: [wrapper.offsetWidth, wrapper.offsetHeight] });
} |
Interesting. I'd be happy to test that change in VSCode and Jupyter if you put it on a branch. |
Continue #3042 and make it optional!