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 band to pass the alpha
attribute to its mesh
#3613
base: master
Are you sure you want to change the base?
Conversation
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(fig)
|
src/basic_recipes/band.jl
Outdated
@@ -54,6 +54,7 @@ function Makie.plot!(plot::Band) | |||
end | |||
attr = Attributes(plot) | |||
attr[:color] = meshcolor | |||
attr[:alpha] = plot.alpha |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't Attributes(plot)
already be doing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can check, but it wasn't before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I'm not sure what the intention was here - this calls Attributes
the constructor, which I think makes sense, but there's an attributes
method which gives plot.attributes
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't an issue of attribute pass through. It's probably
Makie.jl/CairoMakie/src/overrides.jl
Line 216 in fe320c0
color = to_cairo_color(band.color[], band) |
calculated_colors
. (Those probably need to be generated in the backend.) This may also apply to the other override. Would be good to check.
This uses the `calculated_color` components of the mesh of poly and band as the actual color, to allow `alpha` etc to be respected.
b8d73db
to
20c576e
Compare
Huh, you're right @ffreyer...thing is that I've pushed a commit which handles this for all CairoMakie overrides - let's see if it works! |
It decomposes into a flat vector of color per vertex, even with vectors of polygons, or multipolygons.
Yea, the other backends rely on calculated colors of the primitive plots. CairoMakie should more or less repeat that work in whatever way it needs. We should check that after this pr the following work:
On master only alpha + flat color seems to be broken. |
Description
Fixes #3356
Just forwards the attribute to
mesh
called internally inplot!(band)
.Type of change
Delete options that do not apply:
Checklist