Skip to content
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

aes.flow = "interpolate" option for geom_flow() #5

Open
corybrunson opened this issue Apr 30, 2017 · 5 comments
Open

aes.flow = "interpolate" option for geom_flow() #5

corybrunson opened this issue Apr 30, 2017 · 5 comments

Comments

@corybrunson
Copy link
Owner

Interpolate aesthetics along flows (between adjacent axes). The aesthetics should interpolate along the splines at the same rate as the vertical positions.

@corybrunson
Copy link
Owner Author

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. : (

@caston60
Copy link

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):
image

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.

@corybrunson
Copy link
Owner Author

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.)

@caston60
Copy link

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.

@corybrunson
Copy link
Owner Author

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants