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

Sankey diagram #1123

Closed
jbednar opened this issue Feb 11, 2017 · 11 comments
Closed

Sankey diagram #1123

jbednar opened this issue Feb 11, 2017 · 11 comments
Assignees
Milestone

Comments

@jbednar
Copy link
Member

@jbednar jbednar commented Feb 11, 2017

It would be nice to offer a Sankey diagram. MPL offers one (http://matplotlib.org/api/sankey_api.html), but a Bokeh-based one could work like the d3 sankey, where being interactive makes it much easier to follow.

image

@philippjfr philippjfr added this to the v2.0 milestone Mar 15, 2017
@philippjfr philippjfr added this to the Post v2.0 milestone Jun 27, 2017
@philippjfr philippjfr removed this from the v2.0 milestone Jun 27, 2017
@philippjfr philippjfr added this to the v2.0 milestone Jun 27, 2017
@philippjfr philippjfr removed this from the Post v2.0 milestone Jun 27, 2017
@slamer59
Copy link

@slamer59 slamer59 commented Sep 5, 2017

d3.js has plenty of example.
I'm using this combined with django:
d3-sankey-diagram

To play with some data

And I have note tested yet but there is
jupyter widget

@MatthewSteen
Copy link

@MatthewSteen MatthewSteen commented Oct 13, 2017

👍

@philippjfr
Copy link
Member

@philippjfr philippjfr commented Dec 7, 2017

Here is my initial effort at porting d3-Sankey to HoloViews: https://anaconda.org/philippjfr/sankey/notebook

The remaining bits should be easy once the TriMesh and Chord PRs have been merged.

@jbednar
Copy link
Member Author

@jbednar jbednar commented Dec 7, 2017

Cool!!

@philippjfr
Copy link
Member

@philippjfr philippjfr commented Dec 8, 2017

Now with labels:

screen shot 2017-12-08 at 3 56 08 pm

@philippjfr philippjfr removed this from the v2.0 milestone Dec 8, 2017
@philippjfr philippjfr added this to the v1.10 milestone Dec 8, 2017
@slamer59
Copy link

@slamer59 slamer59 commented Dec 8, 2017

@jlstevens
Copy link
Contributor

@jlstevens jlstevens commented Dec 11, 2017

At a glance the approach Philipp uses in that notebooks looks reasonable (Sankey being a type of graph) so I would be happy to see a PR and maybe this new element can make it into the next release.

@philippjfr philippjfr self-assigned this Feb 9, 2018
@philippjfr philippjfr mentioned this issue Feb 10, 2018
3 tasks
@philippjfr philippjfr closed this Apr 8, 2018
@dizhu1991
Copy link

@dizhu1991 dizhu1991 commented Aug 17, 2018

@philippjfr Hi, I was trying to draw a sankey graph of visitor paths' starts and ends in a museum. So the left and right labels will come from the same set of elements (there will be edges like a to b and b to a at the same time). I tried holoview and there was an error "Sankey diagram only supports acyclic graphs". How should I solve this problem?

@denson
Copy link

@denson denson commented Nov 5, 2018

@dizhu1991 Sankey is not for visualizing two way relationships as you describe.

You could try loading it into a networkx MultiDiGraph and then draw the MultiDiGraph.

There is work being done to attempt to create something similar to Sankey that does allow cycles:

http://data-analytics.net/cep/References_files/Enabling%20Loops%20in%20Sankey%20Diagrams.html

http://bl.ocks.org/soxofaan/bb6f91d57dc4b6afe91d

@TizianoGC
Copy link

@TizianoGC TizianoGC commented Sep 7, 2019

@denson: Actually, plotting Sankey cyclic graphs are quite useful!
There are many examples which show cycles; even Sankey himself used them.

Holoviews developers, could you please add this new feature? It would be a pity having to switch to another library just for that!

Thanks

@jbednar
Copy link
Member Author

@jbednar jbednar commented Sep 7, 2019

HoloViews users, please feel free to implement cyclic support and submit a PR! :-) If you find another library with an appropriate open-source license, maybe you can find the code involved and see if it can guide your implementation. I don't currently know of a need for cyclic Sankey from any of the core developers any time soon, and otherwise this is definitely a case where a user contribution would be able to make it happen!

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

Successfully merging a pull request may close this issue.

None yet
8 participants