Denisty fill
Hello! Thank you for this incredible package. I was wondering if it would be possible to be able to add the fill aesthetic to density plots? It doesn't appear to work presently.
library(geomtextpath)
#> Loading required package: ggplot2
ggplot(iris, aes(Sepal.Length)) +
geom_textdensity(aes(fill = Species, label = Species),
hjust = "ymax", vjust = -0.2)

Created on 2022-02-04 by the reprex package (v2.0.1)
Also, just to add to this, I realize I could do a workaround like the below (which is what I'm doing currently). Maybe that's sufficient? I had just expected the above to work.
library(geomtextpath)
#> Loading required package: ggplot2
ggplot(iris, aes(Sepal.Length)) +
geom_density(aes(fill = Species), alpha = 0.3) +
geom_textdensity(aes(color = Species, label = Species),
hjust = "ymax", vjust = -0.2) +
guides(fill = "none", color = "none")

Created on 2022-02-04 by the reprex package (v2.0.1)
Hi Daniel - thanks for taking the time to write.
Currently we haven't implemented the fill because the aesthetic name would clash with the fill for the textbox-flavoured variety of labelled density curve. Obviously the work-around, as you show, is to plot a normal geom_density first.
In future iterations we might change the textbox fill to its own aesthetic to avoid this kind of thing - we do aim to try to have things "just work" as users expect, so I'll leave this open so that Teun and I can mull this over.
Thanks again.
I've found myself looking for a ribbon or polygon geom with text on the edges at some point, so I do see some merit to this. But there wasn't anything that couldn't be fixed by putting a polygon underneath the textpath geom, so it hasn't been strictly necessary. The thing I have a small worry about, is that when we opt to support polygons, it creates the expectation that specialised filled geoms such as violin plots, ribbons, area, rectangles, tiles, maybe even boxplots will also be supported. I don't have anything against this per se, but it does become a lot to maintain.
Yes, I had wondered about geom_textpoint too which is almost pointless, apart from the polar coordinate transformation, and (more saliently) people will just expect it to exist. You and I both know from Stack Overflow that it doesn't matter how well you document things - the casual user will just expect things to work "out the box", and they get stuck if it doesn't.
With regards to rectangular and polygon-based geoms, I do think people would like directly labelled versions, and I have considered this. I think it probably depends on getting more feature requests like this one, and seeing how the package is used in the wild.
Knowing that you and I are both tinkerers, it almost seems inevitable that one or both of us will attempt to implement this at some point, but I'm happy at the moment to wait for a bit more feedback.
Thank you both, I'm totally happy with things as they are and the workaround is not a big deal. But I really appreciate you taking the time to consider it.
Heh, 'pointless point geom'! I think the wait and see approach is a sensible one.