-
Notifications
You must be signed in to change notification settings - Fork 52
Support Waterfall plot type #583
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks! Could you please also add a panel with a stacked version at the bottom of the first reftest? |
|
I am not sure if I understand correctly. Do you mean adding a second plot with data(df) * visual(Waterfall, show_direction=true) * mapping(:x, :y, color=:group, dodge=:group, stack=:group)? |
|
Yeah just so all aesthetics appear somewhere in the reference tests. I often put multiple in the same plot to save storage space. |
|
Hm I don't really see the stacking :) maybe I'm not sure what a stacked waterfall plot should even look like but I imagined the bars going on top of each other |
|
Waterfall plots are stacked anyway - in the sense that a next item starts where the previous one ends. The default stacking group for Waterfall is the same as dodge, so that an item starts, where the item left of it ends. The stack attribute here can be used to choose different stacking groups. I don't know whether there is really a real life use case for this, though :) |
|
Ah ok that does not sound like the typical stack though. That's just a cumsum transformation of sorts on your input data, without that the plot wouldn't be a waterfall at all. Maybe it's best to just leave out that option then. |
|
Huh when I looked at it again just now I noticed that the |
|
It only has x axis values of 1 and 2. The second plot is one-arg (without x) and hence uses 1 to n as x. |
|
Ah ok then I just got confused for a bit, that sounds OK :) Edit: No on second thought, it's still weird. Normally when you split by categorical color it's as if you do the same plot multiple times, one per color. Dodging is then used to move each plot so that they can all be seen. But here the colored groups actually interact, the waterfall in the first bin moves across the colors. And then the summary poly goes from the first entry of group 1 to the first of group 5. |
|
The way it is was actually the way I intended it when implementing the Waterfall recipe, because this is one of my most used applications of the waterfall plot. However, I see your point that this is not standard |
Before these changes
resulted in
Now it produces