You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know it is early days for marquee, but could I ask that the xDetails() and yDetails() grid methods be implemented for marquee grobs? It is not of a very high priority.
The main reason I'm asking is because it might allow integration with {ggrepel}, which I think would be exciting.
I've an open PR (slowkow/ggrepel#249) that allows one to swap out the grob generating function, but the grobX() and grobY() functions, which are fed by the xDetails()/yDetails() methods should give reasonable coordinates for it to work.
Basically, what one would like these functions to do is to give the coordinates of the bounding box given an angle theta in degrees.
For textGrob() this works as follows:
library(grid)
library(marquee)
theta<- seq(0, 315, by=15)
label<-"Lorem ipsum dolor sit amet, consectetur adipiscing elit. In hendrerit metus quam, sed rutrum nulla feugiat consequat. Sed eu pulvinar purus, vel placerat metus."txt<- textGrob(label, rot=45)
grid.newpage()
grid.draw(txt)
x<- grobX(txt, theta)
y<- grobY(txt, theta)
grid.points(x=x, y=y, gp= gpar(col='red'))
For marquee_grob(), it just yields central points.
I imagine the easiest way is to calculate the 4 corner points of the bounding box of the grob and then use something like the following to reuse the xDetails.points method:
Hi Thomas,
I know it is early days for marquee, but could I ask that the
xDetails()
andyDetails()
grid methods be implemented for marquee grobs? It is not of a very high priority.The main reason I'm asking is because it might allow integration with {ggrepel}, which I think would be exciting.
I've an open PR (slowkow/ggrepel#249) that allows one to swap out the grob generating function, but the
grobX()
andgrobY()
functions, which are fed by thexDetails()
/yDetails()
methods should give reasonable coordinates for it to work.Basically, what one would like these functions to do is to give the coordinates of the bounding box given an angle
theta
in degrees.For
textGrob()
this works as follows:For
marquee_grob()
, it just yields central points.Created on 2024-04-30 with reprex v2.1.0
I imagine the easiest way is to calculate the 4 corner points of the bounding box of the grob and then use something like the following to reuse the
xDetails.points
method:The text was updated successfully, but these errors were encountered: