Makie.jl icon indicating copy to clipboard operation
Makie.jl copied to clipboard

expand rectzoom to y or x if rectangle is very narrow

Open jkrumbiegel opened this issue 2 years ago • 4 comments

Description

Changes the rectangle zoom behavior in Axis such that at very narrow rectangle selections, the narrow side is expanded to full width. This makes it much easier to narrow the field of view in one direction and is a common behavior in comparable tools.

Type of change

Delete options that do not apply:

  • [x] New feature (non-breaking change which adds functionality.

jkrumbiegel avatar Jul 08 '22 07:07 jkrumbiegel

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(display(fig))
using create display create display
GLMakie 14.46s (13.12, 15.93) 1.10+- 26.09s (24.35, 28.32) 1.48+- 21.78s (19.83, 23.59) 1.52+- 26.50ms (23.43, 28.59) 2.24+- 101.24ms (90.12, 105.39) 5.49+-
master 15.16s (13.46, 16.12) 0.98+- 26.20s (23.87, 28.52) 1.58+- 21.85s (19.80, 23.55) 1.31+- 27.25ms (23.38, 29.15) 2.17+- 99.29ms (90.20, 108.66) 7.70+-
evaluation -4.79%, -0.69s invariant (-0.66d, 0.24p, 1.04std) -0.41%, -0.11s invariant (-0.07d, 0.90p, 1.53std) -0.36%, -0.08s invariant (-0.05d, 0.92p, 1.42std) -2.83%, -0.75ms invariant (-0.34d, 0.54p, 2.20std) +1.93%, 1.95ms invariant (0.29d, 0.60p, 6.59std)
CairoMakie 11.22s (11.17, 11.28) 0.04+- 23.70s (23.48, 24.31) 0.29+- 3.43s (3.41, 3.48) 0.02+- 18.47ms (18.38, 18.67) 0.11+- 24.74ms (24.57, 25.07) 0.17+-
master 11.20s (11.16, 11.25) 0.04+- 23.64s (23.44, 24.20) 0.26+- 3.43s (3.41, 3.51) 0.04+- 18.50ms (18.46, 18.55) 0.04+- 24.64ms (24.56, 24.71) 0.06+-
evaluation +0.15%, 0.02s invariant (0.40d, 0.47p, 0.04std) +0.28%, 0.07s invariant (0.24d, 0.66p, 0.27std) +0.12%, 0.0s invariant (0.13d, 0.81p, 0.03std) -0.17%, -0.03ms invariant (-0.38d, 0.50p, 0.08std) +0.39%, 0.1ms invariant (0.78d, 0.18p, 0.11std)
WGLMakie 18.65s (18.09, 19.10) 0.42+- 42.56s (41.64, 43.94) 0.72+- 70.91s (69.68, 73.93) 1.52+- 37.60ms (36.58, 39.04) 0.76+- 1.94s (1.91, 1.97) 0.02+-
master 18.60s (18.10, 18.98) 0.29+- 42.92s (42.07, 44.14) 0.69+- 70.78s (69.43, 71.83) 0.80+- 38.91ms (37.92, 40.79) 1.12+- 1.96s (1.86, 2.02) 0.05+-
evaluation +0.25%, 0.05s invariant (0.13d, 0.82p, 0.36std) -0.84%, -0.36s invariant (-0.50d, 0.36p, 0.71std) +0.19%, 0.13s invariant (0.11d, 0.84p, 1.16std) -3.50%, -1.31ms faster ✓ (-1.37d, 0.03p, 0.94std) -1.09%, -0.02s invariant (-0.51d, 0.37p, 0.04std)

MakieBot avatar Jul 08 '22 07:07 MakieBot

Anyone with a non-retina screen wants to test whether the threshold of 25 px feels ok on their monitor? @ffreyer or @SimonDanisch? As long as we can't rescale for hidpi monitors I can't really test user experience for normal sizes :)

jkrumbiegel avatar Jul 08 '22 19:07 jkrumbiegel

I don't like this as an always-on feature. I've had cases where I want to zoom into narrow regions, which would get more annoying with this. (For example a large data set where I'm interested in convergence on a large scale and variance/periodicity on a small scale. Or data that falls into groups, where the difference between groups is much larger than within.)

ffreyer avatar Jul 13 '22 15:07 ffreyer

Interesting, I felt the other way around that I almost never want to select super narrow slices, but often want to simply zoom only in x or y, and the keyboard shortcuts for that are a bit cumbersome. Plotly has similar behavior.

jkrumbiegel avatar Jul 13 '22 18:07 jkrumbiegel

Will close for now, might return later.

jkrumbiegel avatar Sep 23 '22 06:09 jkrumbiegel