ggfx
ggfx copied to clipboard
Unexpected behavior with_mask and with_shadow output
Hi, I found what I think is a bug when you combine with_mask and with_shadow. I think the shadow is being put on top of the used path.
# Suspected bug
ggplot(df) +
geom_path(aes(x,y),
color="#4bc4ff",linewidth=20,lineend="round" ) +
with_shadow(
geom_path(data=df[-3,],aes(x,y),
color="blue",linewidth=20,lineend="round" ),
stack=TRUE,x_offset = 0,y_offset = 0,sigma = 20,id="bar") +
with_mask(
geom_path(data=df,
aes(x,y),
linewidth=20,lineend='round'),
mask=ch_alpha('bar')
)
# Desired output
ggplot(df) +
geom_path(aes(x,y),
color="#4bc4ff",linewidth=20,lineend="round" ) +
with_shadow(
geom_path(data=df[-3,],aes(x,y),
color="blue",linewidth=20,lineend="round" ),
stack=FALSE,x_offset = 0,y_offset = 0,sigma = 20,id="bar") +
with_mask(
geom_path(data=df,
aes(x,y),
linewidth=20,lineend='round'),
mask=ch_alpha('bar')
) +
geom_path(data=df[-3,],aes(x,y),
color="blue",linewidth=20,lineend="round" )
Expected output:
Actual output: