Open corybrunson opened 7 years ago
Interpolation is not incorporated into xsplineGrob
, so this would take a great deal of either learning or work. I welcome help but will not be pursuing this option for now. : (
I am wondering if this is what I am after (though your comments seem to imply it is not doable).
I have figured out how to vary the width of a flow from one node to the next; and to adjust the beginning and end to allow for strata with varying widths (width of strata proportional to sample size):
What I wish to do next is to have the colour of the ends of the flows match the colour of the stratum it abutts to. I have seen this in Riverplot but I have not been able to manage the width variations in Riverplot. Can this colour change be accomplished in ggalluvial? Or is this what you are referring to by the 'aes.flow="interpolate" option?
Must say that I am having a grand old time with ggalluvial - great package. Thank you.
I'm very glad to hear that you're enjoying it. : )
You're right — having the colors of the flows gradually change from the colors of their incident (abutting) strata is exactly what i'd like to be able to do but don't know how. Currently, the splines are rendered using grid::xsplineGrob()
, which has no such functionality. An alternative approach would be to construct the splines from smaller segments and polygons and have their colors vary depending on their x
position. But this seemed like a poor trade-off to me. Though, if both implementations were done, it might make sense to have a parameter available to the user to choose between them. Does that sound like a good idea to you? (I don't have the bandwidth to work on it right now, but i'd welcome suggestions as well as contributions.)
Imitation is the sincerest of flattery - Colton How does Riverplot achieve the effect?
I am little more than an R user at best - I fudge the numbers until someone else's clever programming does what I want. Got the want ... don't have the how.
Expertise is relative; i don't know how riverplot works myself. The place to begin tinkering is the source code, which is on GitHub: https://github.com/cran/riverplot Good to have the link on this thread, in case anyone reading it wants to give it a try in the meantime. (I may come back to this, but it will be some time.)
Interpolate aesthetics along flows (between adjacent axes). The aesthetics should interpolate along the splines at the same rate as the vertical positions.