hrbrmstr / streamgraph

:wavy_dash: htmlwidget for creating streamgraph visualizations in R
http://hrbrmstr.github.io/streamgraph/
Other
148 stars 49 forks source link

controlling order in streamgraph #15

Open anobel opened 8 years ago

anobel commented 8 years ago

This is a fantastic widget, thank you for developing it. I had a question regarding order of the categories. Currently, it is controlled by the ordering of the factor levels, as far as I can see. Is it possible to control the order using an order= option, like in ggplot?

jrounds commented 8 years ago

Haha,

I just googled streamgraph github to ask this same question. It makes the streamgraph look conspicuously sloppy compared to published streamgraphs to not be able to bundle the minor factors together. Otherwise though a very easy to use widget!

Edit: What I ended up doing was prepending (a), (b), (c), etc to the factor level names. Extra notation, but an alpha sorting then gives you control over the order