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

Support cycles in graph #6

Open
soxofaan opened this issue May 28, 2015 · 4 comments
Open

Support cycles in graph #6

soxofaan opened this issue May 28, 2015 · 4 comments

Comments

@soxofaan
Copy link
Owner

related to #4 and d3/d3-plugins#1

@soxofaan
Copy link
Owner Author

demo of current implementation: http://bl.ocks.org/soxofaan/7c96560677ead0425fe7

screen shot 2015-05-29 at 02 09 49

@androidkencai
Copy link

the cycles support is very cool. Thanks soxofaan for the great work! However, I need some help as got into performance issues when cycles path included in links. the data size is not huge, with 23 nodes and about 126 links. The UI didn't render. If all the cycle path removed, it rendered right away. Attaching the test data below. Thanks!

[ {"name": "0"},
{"name": "1"},
{"name": "2"},
{"name": "3"},
{"name": "4"},
{"name": "5"},
{"name": "6"},
{"name": "7"},
{"name": "8"},
{"name": "9"},
{"name": "10"},
{"name": "11"},
{"name": "12"},
{"name": "13"},
{"name": "14"},
{"name": "15"},
{"name": "16"},
{"name": "17"},
{"name": "18"},
{"name": "19"},
{"name": "20"},
{"name": "21"},
{"name": "22"}]

//links
[{"source": 8, "target": 9,"value": 1},
{"source": 9, "target": 20,"value": 1},
{"source": 20, "target": 14,"value": 1},
{"source": 14, "target": 12,"value": 1},
{"source": 12, "target": 13,"value": 1},
{"source": 13, "target": 15,"value": 1},
{"source": 15, "target": 10,"value": 1},
{"source": 10, "target": 18,"value": 1},
{"source": 18, "target": 19,"value": 1},
{"source": 19, "target": 11,"value": 1},
{"source": 11, "target": 16,"value": 1},
{"source": 16, "target": 18,"value": 1},
{"source": 18, "target": 19,"value": 1},
{"source": 19, "target": 17,"value": 1},
{"source": 17, "target": 21,"value": 1},
{"source": 21, "target": 4,"value": 1},
{"source": 4, "target": 0,"value": 1},
{"source": 0, "target": 2,"value": 1},
{"source": 2, "target": 22,"value": 1},
{"source": 22, "target": 3,"value": 1},
{"source": 3, "target": 1,"value": 1},
{"source": 1, "target": 5,"value": 1},
{"source": 5, "target": 6,"value": 1},
{"source": 6, "target": 7,"value": 1},
{"source": 8, "target": 9,"value": 1},
{"source": 9, "target": 20,"value": 1},
{"source": 20, "target": 14,"value": 1},
{"source": 14, "target": 15,"value": 1},
{"source": 15, "target": 10,"value": 1},
{"source": 10, "target": 18,"value": 1},
{"source": 18, "target": 19,"value": 1},
{"source": 19, "target": 11,"value": 1},
{"source": 11, "target": 16,"value": 1},
{"source": 16, "target": 18,"value": 1},
{"source": 18, "target": 19,"value": 1},
{"source": 19, "target": 17,"value": 1},
{"source": 17, "target": 21,"value": 1},
{"source": 21, "target": 4,"value": 1},
{"source": 4, "target": 0,"value": 1},
{"source": 0, "target": 2,"value": 1},
{"source": 2, "target": 22,"value": 1},
{"source": 22, "target": 3,"value": 1},
{"source": 3, "target": 1,"value": 1},
{"source": 1, "target": 5,"value": 1},
{"source": 5, "target": 6,"value": 1},
{"source": 6, "target": 7,"value": 1},
{"source": 8, "target": 9,"value": 1},
{"source": 9, "target": 20,"value": 1},
{"source": 20, "target": 14,"value": 1},
{"source": 14, "target": 15,"value": 1},
{"source": 15, "target": 10,"value": 1},
{"source": 10, "target": 18,"value": 1},
{"source": 18, "target": 19,"value": 1},
{"source": 19, "target": 11,"value": 1},
{"source": 11, "target": 16,"value": 1},
{"source": 16, "target": 18,"value": 1},
{"source": 18, "target": 19,"value": 1},
{"source": 19, "target": 17,"value": 1},
{"source": 17, "target": 21,"value": 1},
{"source": 21, "target": 4,"value": 1},
{"source": 4, "target": 0,"value": 1},
{"source": 0, "target": 2,"value": 1},
{"source": 2, "target": 3,"value": 1},
{"source": 3, "target": 1,"value": 1},
{"source": 1, "target": 5,"value": 1},
{"source": 5, "target": 6,"value": 1},
{"source": 6, "target": 7,"value": 1},
{"source": 8, "target": 9,"value": 1},
{"source": 9, "target": 20,"value": 1},
{"source": 20, "target": 21,"value": 1},
{"source": 21, "target": 4,"value": 1},
{"source": 4, "target": 5,"value": 1},
{"source": 5, "target": 6,"value": 1},
{"source": 6, "target": 7,"value": 1},
{"source": 8, "target": 9,"value": 1},
{"source": 9, "target": 20,"value": 1},
{"source": 20, "target": 21,"value": 1},
{"source": 21, "target": 4,"value": 1},
{"source": 4, "target": 22,"value": 1},
{"source": 22, "target": 5,"value": 1},
{"source": 5, "target": 6,"value": 1},
{"source": 6, "target": 7,"value": 1},
{"source": 8, "target": 9,"value": 1},
{"source": 9, "target": 20,"value": 1},
{"source": 20, "target": 14,"value": 1},
{"source": 14, "target": 15,"value": 1},
{"source": 15, "target": 10,"value": 1},
{"source": 10, "target": 18,"value": 1},
{"source": 18, "target": 19,"value": 1},
{"source": 19, "target": 11,"value": 1},
{"source": 11, "target": 16,"value": 1},
{"source": 16, "target": 18,"value": 1},
{"source": 18, "target": 19,"value": 1},
{"source": 19, "target": 17,"value": 1},
{"source": 17, "target": 21,"value": 1},
{"source": 21, "target": 4,"value": 1},
{"source": 4, "target": 0,"value": 1},
{"source": 0, "target": 2,"value": 1},
{"source": 2, "target": 22,"value": 1},
{"source": 22, "target": 3,"value": 1},
{"source": 3, "target": 1,"value": 1},
{"source": 1, "target": 5,"value": 1},
{"source": 5, "target": 6,"value": 1},
{"source": 6, "target": 7,"value": 1},
{"source": 8, "target": 9,"value": 1},
{"source": 9, "target": 20,"value": 1},
{"source": 20, "target": 14,"value": 1},
{"source": 14, "target": 15,"value": 1},
{"source": 15, "target": 10,"value": 1},
{"source": 10, "target": 18,"value": 1},
{"source": 18, "target": 19,"value": 1},
{"source": 19, "target": 11,"value": 1},
{"source": 11, "target": 16,"value": 1},
{"source": 16, "target": 18,"value": 1},
{"source": 18, "target": 19,"value": 1},
{"source": 19, "target": 17,"value": 1},
{"source": 17, "target": 21,"value": 1},
{"source": 21, "target": 4,"value": 1},
{"source": 4, "target": 0,"value": 1},
{"source": 0, "target": 2,"value": 1},
{"source": 2, "target": 22,"value": 1},
{"source": 22, "target": 3,"value": 1},
{"source": 3, "target": 1,"value": 1},
{"source": 1, "target": 5,"value": 1},
{"source": 5, "target": 6,"value": 1},
{"source": 6, "target": 7,"value": 1}]

@soxofaan
Copy link
Owner Author

soxofaan commented Nov 2, 2015

hi @androidkencai, thanks for you feedback

did you try that on the master branch, or on the feature branch of this issue?
https://github.com/soxofaan/d3-plugin-captain-sankey/tree/issue-6-cycle-handling

I also noticed you have a lot of duplicates in your links. There are only 29 unique links:

{"source": 0, "target": 2,"value": 1},
{"source": 1, "target": 5,"value": 1},
{"source": 10, "target": 18,"value": 1},
{"source": 11, "target": 16,"value": 1},
{"source": 12, "target": 13,"value": 1},
{"source": 13, "target": 15,"value": 1},
{"source": 14, "target": 12,"value": 1},
{"source": 14, "target": 15,"value": 1},
{"source": 15, "target": 10,"value": 1},
{"source": 16, "target": 18,"value": 1},
{"source": 17, "target": 21,"value": 1},
{"source": 18, "target": 19,"value": 1},
{"source": 19, "target": 11,"value": 1},
{"source": 19, "target": 17,"value": 1},
{"source": 2, "target": 22,"value": 1},
{"source": 2, "target": 3,"value": 1},
{"source": 20, "target": 14,"value": 1},
{"source": 20, "target": 21,"value": 1},
{"source": 21, "target": 4,"value": 1},
{"source": 22, "target": 3,"value": 1},
{"source": 22, "target": 5,"value": 1},
{"source": 3, "target": 1,"value": 1},
{"source": 4, "target": 0,"value": 1},
{"source": 4, "target": 22,"value": 1},
{"source": 4, "target": 5,"value": 1},
{"source": 5, "target": 6,"value": 1},
{"source": 6, "target": 7,"value": 1},
{"source": 8, "target": 9,"value": 1},
{"source": 9, "target": 20,"value": 1},

Is there any reason for having all these duplicates?

If I eliminate all or some duplicates, the rendering goes a lot faster and renders this:
screen shot 2015-11-02 at 23 57 03

@androidkencai
Copy link

Hi @soxofaan, sorry for the late reply. right, those duplicates should be combined. regardless when having large set of links. there are performance issues.

just FYI, I found that this version has better performance. Thanks!
http://sankey.csaladen.es/

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

No branches or pull requests

2 participants