Skip to content

geom_GeomAlluvium() has yet to be implemented in plotly #1614

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

Closed
nguyenkhoa0209 opened this issue Sep 5, 2019 · 2 comments · Fixed by #2061
Closed

geom_GeomAlluvium() has yet to be implemented in plotly #1614

nguyenkhoa0209 opened this issue Sep 5, 2019 · 2 comments · Fixed by #2061
Assignees

Comments

@nguyenkhoa0209
Copy link

I currently used the package ggalluvial to create alluvial diagram.
And It would be nice to see geom_GeomAlluvium() supported by ggplotly().
Here is an example that I used the code pulished on https://cran.r-project.org/web/packages/ggalluvial/vignettes/ggalluvial.html

library(plotly)
library(ggalluvial)

p = ggplot(as.data.frame(Titanic),
       aes(y = Freq,
           axis1 = Survived, axis2 = Sex, axis3 = Class)) +
  geom_alluvium(aes(fill = Class),
                width = 0, knot.pos = 0, reverse = FALSE) +
  guides(fill = FALSE) +
  geom_stratum(width = 1/8, reverse = FALSE) +
  geom_text(stat = "stratum", label.strata = TRUE, reverse = FALSE) +
  scale_x_continuous(breaks = 1:3, labels = c("Survived", "Sex", "Class")) +
  coord_flip() +
  ggtitle("Titanic survival by class and sex")

ggplotly(p)
@cpsievert
Copy link
Collaborator

Thanks for the example code, I've added to the list in #566

@moutikabdessabour moutikabdessabour self-assigned this Oct 12, 2021
@moutikabdessabour
Copy link
Contributor

I implemented a to_basic method for both geom_stratum and geom_alluvium. Will be running tests and adding a pr in the next hours

moutikabdessabour added a commit to moutikabdessabour/plotly that referenced this issue Oct 12, 2021
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 a pull request may close this issue.

3 participants