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
Sankey diagrams/transition plots as a ggplot2 extension #6
Comments
I do love sankey charts - I wonder if we need to consider a data-preprocessing step here as well, to get things into the right format? @dicook any thoughts? |
Yes, for a Sankey extension to ggplot2, an important issue is how it fits into the whole tidy data/dplyr functional programming paradigm, and whether it might be useful to add some helper functions to, say, the purrr package to make pipelined data preparation easier, as you suggest. The transitionPlot() in the Gmisc package requires the data to be transformed into a transition matrix, as a matrix object. Not difficult, but it feels out-of-step when doing everything else with ggplot2 and data frames/tibbles. |
By chance there has been some discussion on Twitter about Sankey charts: https://twitter.com/Md_Harris/status/915388811185721344 Might be of use! |
Ah, OK, I didn't know about ggalluvial, and or geom_parallel_sets in ggforce. Looks like Sankey diagrams in ggplot2 is a solved problem. But I'm now reminded how useful ggforce is. Maybe there are some other ggplot2 customisations or extensions that could be considered? More thinking... |
I didn't have any success with the geom_parallel_sets() geom in the ggforce package, but perhaps that's because it seems to be set up for true Sankey diagrams, whereas what I wanted was actually an alluvial diagram, as above. Anyway, I'll submit an issue report regarding the flaws in the ggalluvial output, but it is nonetheless good enough, and the package easy enough to use, to declare this a solved problem, I think. |
@timchurches it sounds like this is wrapped up, are you happy to close this? |
Port or re-implement static Sankey diagrams/Parallel Co-ordinate Plots (see https://cran.r-project.org/web/packages/alluvial/vignettes/alluvial.html ) and/or transition plots (see https://cran.r-project.org/web/packages/Gmisc/vignettes/transitionPlot.html ) to the ggplot2 environment as an extension geom.
See p37 onwards in this report for examples of transition plots in use: http://www.acornregistry.org/images/Acorn-Annual-Report-2016-v12.pdf
There are also the riverplot and sankey packages (see https://cran.r-project.org/web/packages/riverplot/riverplot.pdf and https://cran.r-project.org/web/packages/sankey/sankey.pdf), and gvisSankey in the googleVis package (see https://www.rdocumentation.org/packages/googleVis/versions/0.6.0/topics/gvisSankey). None of these work with the ggplot2 ecosystem.
The text was updated successfully, but these errors were encountered: