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

Allow plots to move between scenes in SpecApi #4478

Merged
merged 31 commits into from
Nov 4, 2024
Merged

Conversation

SimonDanisch
Copy link
Member

@SimonDanisch SimonDanisch commented Oct 14, 2024

  • Introduces API to move plots between scenes
  • Use that in SpecApi to move plots from one axes to another
  • Fix some DataInspector issue
  • Refactor WGLMakie Javascript Plot type to be a class, which supports updating attributes together (already working towards [WIP] Observable update refactor  #4360)

This isn't perfect yet, since it needs quite a few features from #4360 to work properly for all backends.
The introduced move_to! will stay an internal API for now, that are only used for WGLMakie right now inside SpecApi when it's safe to use.
I expect to implement this cleanly for all backends in #4360.

@MakieBot
Copy link
Collaborator

MakieBot commented Oct 14, 2024

Compile Times benchmark

Note, 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(fig)
using create display create display
GLMakie 6.56s (6.23, 6.74) 0.12+- 181.21ms (163.59, 197.97) 9.10+- 502.98ms (470.55, 533.25) 15.07+- 7.35ms (6.80, 7.99) 0.30+- 26.62ms (26.19, 26.81) 0.15+-
master 6.74s (6.56, 7.01) 0.10+- 184.75ms (163.99, 201.57) 7.61+- 510.44ms (482.30, 532.45) 14.27+- 7.51ms (6.93, 8.16) 0.34+- 26.65ms (26.08, 26.93) 0.18+-
evaluation 1.03x faster ✓, -0.18s (-1.55d, 0.00p, 0.11std) 1.02x invariant, -3.54ms (-0.42d, 0.19p, 8.35std) 1.01x invariant, -7.46ms (-0.51d, 0.12p, 14.67std) 1.02x invariant, -0.16ms (-0.50d, 0.12p, 0.32std) 1.00x invariant, -0.02ms (-0.15d, 0.64p, 0.16std)
CairoMakie 6.06s (5.93, 6.48) 0.13+- 164.62ms (158.62, 197.53) 8.58+- 202.07ms (192.08, 241.77) 10.52+- 6.82ms (6.68, 7.89) 0.27+- 1.08ms (1.05, 1.12) 0.02+-
master 6.03s (5.94, 6.38) 0.10+- 164.72ms (157.82, 179.58) 5.10+- 200.85ms (192.66, 214.14) 5.91+- 6.85ms (6.71, 7.12) 0.11+- 1.09ms (1.06, 1.13) 0.02+-
evaluation 1.00x invariant, 0.02s (0.21d, 0.51p, 0.11std) 1.00x invariant, -0.1ms (-0.01d, 0.96p, 6.84std) 0.99x invariant, 1.22ms (0.14d, 0.65p, 8.21std) 1.00x invariant, -0.03ms (-0.16d, 0.61p, 0.19std) 1.00x invariant, -0.0ms (-0.25d, 0.43p, 0.02std)
WGLMakie 7.09s (6.86, 7.33) 0.15+- 182.71ms (169.40, 209.73) 9.50+- 5.98s (5.84, 6.18) 0.10+- 11.49ms (10.75, 12.46) 0.50+- 149.52ms (147.23, 156.93) 2.04+-
master 7.12s (6.93, 7.27) 0.11+- 182.53ms (171.09, 197.06) 7.56+- 6.34s (6.12, 6.60) 0.14+- 11.56ms (10.83, 12.16) 0.40+- 149.71ms (145.43, 152.02) 1.53+-
evaluation 1.00x invariant, -0.02s (-0.18d, 0.58p, 0.13std) 1.00x invariant, 0.17ms (0.02d, 0.95p, 8.53std) 1.06x faster✅, -0.36s (-3.03d, 0.00p, 0.12std) 1.01x invariant, -0.07ms (-0.14d, 0.65p, 0.45std) 1.00x invariant, -0.19ms (-0.11d, 0.74p, 1.78std)

@MakieBot
Copy link
Collaborator

MakieBot commented Oct 31, 2024

Benchmark Results

SHA: 46f73d1926dca187403c95ba012d5399e616e2d3

Warning

These results are subject to substantial noise because GitHub's CI runs on shared machines that are not ideally suited for benchmarking.

GLMakie
CairoMakie
WGLMakie

@SimonDanisch SimonDanisch reopened this Nov 1, 2024
@SimonDanisch SimonDanisch merged commit 0f4b02d into master Nov 4, 2024
22 checks passed
@SimonDanisch SimonDanisch deleted the sd/move-plots branch November 4, 2024 14:07
bjarthur pushed a commit to bjarthur/Makie.jl that referenced this pull request Nov 4, 2024
* refactor JS Plot object to be movable

* allow to move plots between scenes

* correctly close channel

* re-use plots, that got moved between axes

* remove lock

* fix specapi

* fix makie tests

* fix CairoMakie

* Update CHANGELOG.md

* try showing more infos

* implement moveto! correctly for GLMakie and test for all backends

* test & fix move_to!

* add another test

* make move_to optional

* revert GLMakie changes

* revert more changes

* fix WGLMakie move_to

* rename test

* improve tests

* clean up test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

2 participants