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

Handle multiple inflows #13

Closed
Hveemos opened this issue Apr 21, 2023 · 2 comments
Closed

Handle multiple inflows #13

Hveemos opened this issue Apr 21, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Hveemos
Copy link

Hveemos commented Apr 21, 2023

Thank you for a great package!

However I struggle with multiple inflows: I have three cohorts (inflows): 2010, 2014, 2018. Each cohort goes through one or two phases untill it might reach the final phase 3. Thus, I want some sort of stacked sankey plot. Here is my data:

* Example generated by -dataex-. For more info, type help dataex
clear
input str17(source destination) float layer double value
"Phase 1"        "Phase 2"        1 63
"Phase 1"        "Phase 3"        1  2
"Phase 2"        "Phase 2"        1 31
"Phase 2"        "Phase 2"        2 52
"Phase 2"        "Phase 2"        3 31
"Phase 2"        "Phase 3"        1 40
"Phase 2"        "Phase 3"        2 28
"Phase 2"        "Phase 3"        3 16
"Phase 2 (2014)" "Phase 2 (2014)" 2 44
"Phase 2 (2014)" "Phase 2 (2014)" 3 30
"Phase 2 (2014)" "Phase 3 (2014)" 2  8
"Phase 2 (2014)" "Phase 3 (2014)" 3 10
"Phase 2 (2018)" "Phase 2 (2018)" 3 45
"Phase 2 (2018)" "Phase 3 (2018)" 3 13
end

The command works pretty well when I only use the two first cohorts:
sankey value in 1/12, from(source) to(destination) by(layer)

gh_example1

But when I use all three there is some ugly overlap

sankey value, from(source) to(destination) by(layer)

gh_example2

I don't know if this is a bugg or a request for enhancement though.

And also, it would be nice to be able to add some xlabels indicating the name of each layer.

/Hveemos

@asjadnaqvi
Copy link
Owner

This is definitely a bug. Will fix it over the weekend.

@asjadnaqvi asjadnaqvi self-assigned this Apr 21, 2023
@asjadnaqvi asjadnaqvi added the bug Something isn't working label Apr 21, 2023
@asjadnaqvi asjadnaqvi transferred this issue from asjadnaqvi/stata-alluvial Apr 21, 2023
@asjadnaqvi
Copy link
Owner

fixed v1.4

@asjadnaqvi asjadnaqvi moved this from High priority to Done in StataViz issue tracker Apr 24, 2023
asjadnaqvi added a commit that referenced this issue Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants