library(ggplot2)
#install.packages("ggfx")
library(ggfx)
ggplot(mtcars, aes(mpg, disp)) +
with_shadow(geom_point(colour = 'red', size = 3), sigma = 3)

##########
df <- data.frame(
group = c("Male", "Female", "Child"),
value = c(25, 25, 50)
)
head(df)
## group value
## 1 Male 25
## 2 Female 25
## 3 Child 50
# Barplot
bp<- ggplot(df, aes(x="", y=value, fill=group))+
geom_bar(width = 1, stat = "identity")
bp

pie <- bp + coord_polar("y", start=0)
pie

ggplot(df, aes(x="", y=value, fill=group))+
with_shadow(geom_bar(width = 1, stat = "identity")) +
coord_polar("y", start=0)

####################
df <- data.frame(value = c(10, 23, 15, 18),
group = paste0("G", 1:4))
ggplot(df, aes(x = "", y = value, fill = group)) +
geom_col(color = "black") +
coord_polar(theta = "y")

ggplot(df, aes(x = "", y = value, fill = group)) +
with_shadow(geom_col(color = "red")) +
coord_polar(theta = "y")

ggplot(df, aes(x="", y=value, fill=group)) +
with_shadow(geom_bar(stat="identity", width=1, color="red")) +
coord_polar("y", start=0)

ggplot(df, aes(x="", y=value, fill=group)) +
with_outer_glow(geom_bar(stat="identity", width=1, colour="dodgerblue", alpha = 0.8)) +
coord_polar("y", start=0)

with_inner_glow
## function (x, colour = "black", sigma = 3, expand = 0, ...)
## {
## UseMethod("with_inner_glow")
## }
## <bytecode: 0x0000000016062288>
## <environment: namespace:ggfx>
#https://r-charts.com/part-whole/pie-chart-ggplot2/
#http://lenkiefer.com/2021/03/17/watch-your-charts-glow-up-with-r-and-ggfx/