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

Pattern #23

Merged
merged 4 commits into from
Oct 26, 2024
Merged

Pattern #23

merged 4 commits into from
Oct 26, 2024

Conversation

yutannihilation
Copy link
Owner

@yutannihilation yutannihilation commented Oct 26, 2024

@yutannihilation yutannihilation changed the title Add debug functions for pattern Pattern Oct 26, 2024
@yutannihilation
Copy link
Owner Author

liner gradient

This works

grid.rect(gp=gpar(fill=linearGradient()))

image

extend = "none" doesn't work because there's no such option on vello.

# expected the bottom 1 inch is not filled
grid.rect(gp=gpar(fill=linearGradient(c("red", "yellow", "red"),
                                      c(0, .5, 1),
                                      x1=.5, y1=unit(1, "in"),
                                      x2=.5, y2=1,
                                      extend="none")))

image

radial gradient

This works.

grid.rect(gp=gpar(fill=radialGradient(c("white", "black"),
                                      cx1=.8, cy1=.8)))

image

other

This doesn't work for some reason.

library(ggplot2)

ggplot(mtcars) +
    geom_point(aes(x=disp, y=mpg)) +
    theme_bw()
grid.force()
grid.edit("panel.background", grep=TRUE,
          gp=gpar(fill=linearGradient(c("grey", "white"), x1=.5, x2=.5)))

image

@yutannihilation
Copy link
Owner Author

Regarding the last problem

  • The points and lines disappear on grid.edit() of gradient. However, it displays fine with a plain color.
  • The points and polylines drawn after ggplot() are not affected.
  • If I disable the clipping (so push_layer() and pop_layer()), the result is the same.
vellogd-20241026.mp4

@yutannihilation
Copy link
Owner Author

Hmm, let's merge this for now.

@yutannihilation yutannihilation merged commit 50263cd into main Oct 26, 2024
@yutannihilation yutannihilation deleted the pattern branch October 26, 2024 05:22
@yutannihilation yutannihilation mentioned this pull request Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant