Holoviews: Sankey diagram

Created on 11 Feb 2017  Â·  11Comments  Â·  Source: holoviz/holoviews

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

feature

Most helpful comment

Now with labels:

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

All 11 comments

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

:+1:

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.

Cool!!

Now with labels:

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

Really nice ! Tanks for your effort !

Le ven. 8 déc. 2017 16:57, Philipp Rudiger notifications@github.com a
écrit :

Now with labels:

[image: screen shot 2017-12-08 at 3 56 08 pm]
https://user-images.githubusercontent.com/1550771/33773611-63ecd5e8-dc30-11e7-962d-48a510ddafb7.png

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/ioam/holoviews/issues/1123#issuecomment-350298530,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AYHKyJUuJoqcL8SkBZ8hNq0wH48aWAvYks5s-VxTgaJpZM4L-FVm
.

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 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?

@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

@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

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Forander picture Forander  Â·  6Comments

CurtLH picture CurtLH  Â·  3Comments

ceh-creare picture ceh-creare  Â·  5Comments

rabernat picture rabernat  Â·  4Comments

ahuang11 picture ahuang11  Â·  5Comments