-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
Add projection space
option as a generic attribute
#1596
Conversation
I think I got all combinations of space and markerspace to work with text and scatter now fig = Figure(resolution = (700, 700))
ax = Axis(fig[1, 1], width = 600, height = 600)
spaces = (:data, :pixel, :relative, :clip)
xs = [
[0.1, 0.35, 0.6, 0.85],
[0.1, 0.35, 0.6, 0.85] * 600,
[0.1, 0.35, 0.6, 0.85],
2 .* [0.1, 0.35, 0.6, 0.85] .- 1
]
for (i, space) in enumerate(spaces)
for (mspace, j, scale) in zip(spaces, 1:4, (0.02, 12, 0.02, 0.04))
scatter!(
ax, Point2f(xs[i][i], xs[i][j]),
markersize = 5scale, space = space, markerspace = mspace
)
text!(
ax, "$space\n$mspace", position = Point2f(xs[i][i], xs[i][j]),
textsize = scale, space = space, markerspace = mspace,
align = (:center, :center)
)
end
end
xlims!(ax, 0, 1)
ylims!(ax, 0, 1)
fig |
The depth shift test should fail here because I changed some things back to how they were when the test was added:
|
I checked a bunch of the lower scoring tests. In GLMakie:
I also checked a few of the worst cases in CairoMakie. Most of them are just 3D plots |
#1632 moves the the preprojection math into shaders in GLMakie and WGLMakie. I kept it separate to make it a bit easier to review (though it ended up being very little work in shaders) |
Tests are still fine |
* remove overly eager optimizations (#1713) * small clean ups * clean up implementation a bit, use only one name for space * address review
Another TODO:
|
I checked a couple of rectangles in the example above. Seems like it's generally a bit better centered after the pr. Before the offsets of the centers of text bounding boxes to centers of heatmap rectangles at the corners are
pixel and after it's (-0.5, +0.5) with some rectangle inside being (-0.5, +0.5). I'd say it's better now. |
Ok, I fixed the |
This appears to have broken GeoMakie:
|
Ah, nevermind, I hadn't dev-ed MakieCore. |
Description
This pr adds
space
as a general attribute to switch between camera space, pixel space, unit space (0..1) and maybe clip space (-1..1). That way you can adjust the units of the plot without creating another scene or messing with camera matrices.Currently works in GLMakie:
Type of change
Breaking change because the
space
attribute intext
has been renamed tomarkerspace
andspace
now means something else.Checklist
Works in RPRMakieI don't know how to make it workmarkerspace
in all combinations (scatter, text)everythingpoly - I think for most recipes there isn't really a point in addingspace
as an attributeRelated issues
scatter
+Axis3
+GLMakie
does not work #994 (somehow)project
?)