corybrunson / ggalluvial

ggplot2 extension for alluvial plots
http://corybrunson.github.io/ggalluvial/
GNU General Public License v3.0
497 stars 34 forks source link

Tracking Flows between Axes #17

Closed cenuno closed 6 years ago

cenuno commented 6 years ago

Overview

The alluvial below uses the vaccinations data set to demonstrate the transitions between adjacent axes. PNG of Vaccinations Alluvial Flow

However, in the vignette you make a clear a limitation in tracking cohorts across all axes:

This diagram ignores any continuity between the flows between axes. This “memoryless” plot produces a less cluttered diagram, in which at most one flow proceeds from each stratum at one axis to each stratum at the next, but at the cost of being able to track each cohort across the entire diagram.

Question

Would it be possible to store the "memories" between axes to allow for the tracking of each cohort across the entire alluvial diagram? I pose this as a question because I'm interested in any cases for why this would or would not be a good idea. Any opinions, examples, or literature are welcome!

corybrunson commented 6 years ago

The example preceding this one in the vignette provides the contrast i had in mind. Originally the package only included the *_alluvium() layers, which generate one alluvium, spanning the entire length of the diagram, for each subject. This is how the individual students are represented in the curriculum example. Based on user feedback, i added the *_flow() layers, which instead aggregate subjects within each "gap" between axes, i.e. all subjects labeled Never at ms153_NSA and Missing at ms432_NSA are bundled into one flow. This makes the diagram a lot simpler. The "memory" is stored in what i started calling the "lodes"—the horizontal strips of the alluvia through the strata that connect the flows from one gap to the next. So, in a diagram using *_alluvium(), you can follow a single subject from one flow to the next; in a *_flow() diagram, you can't.

My language isn't all that clear on this, so i'd also welcome some suggestions there. : )

cenuno commented 6 years ago

Thank you @corybrunson! Student Curricular across semesters This is helping me build useful context. As always, I appreciate the quick response!