ipy

ipysankeywidget

IPython / Jupyter Sankey diagram widget

Showing:

Popularity

Downloads/wk

0

GitHub Stars

135

Maintenance

Last Commit

3mos ago

Contributors

9

Package

Dependencies

1

License

Categories

Readme

IPython Sankey diagram widget Binder Conda Version

Display Sankey diagrams in IPython / Jupyter notebook using d3-sankey-diagram.

Installation

Option 1: to install using pip:

$ pip install ipysankeywidget

Then, if using the classic Jupyter Notebook:

$ jupyter nbextension enable --py --sys-prefix ipysankeywidget
$ jupyter nbextension enable --py --sys-prefix widgetsnbextension   # <-- you might have already done this,
                                                                    #     but it's safe to do again

Or, if using Jupyterlab:

$ jupyter labextension install jupyter-sankey-widget @jupyter-widgets/jupyterlab-manager

Option 2: to install using conda:

$ conda install -c conda-forge ipysankeywidget                # (that's it, nbextensions enabled automatically)

Browser support

Tested in Firefox and Chrome. There have been reports that it's not working in Safari.

Documentation

See the d3-sankey-diagram API docs: the value of the SankeyWidget is exactly the same as the sankey object described there.

To change the figure size, use the ipywidgets Layout object:

layout = Layout(width="1000", height="1200")
SankeyWidget(links=data, layout=layout)

Examples

See notebooks in examples folder for usage examples. You can try these online using Binder, or follow the links to static versions on nbviewer:

Changelog

v0.3.0

  • Now supports Jupyterlab

v0.2.5

  • You can now show link values as SVG text elements. Set linkLabelFormat to a d3-format string; links whose value is more than linkLabelMinWidth will have a label using that format.
  • Upgrade to d3-sankey-diagram version 0.7.3
  • ipysankeywidget can now be installed using conda (thanks to Ali Alsabbah #33)
  • Add a check for duplicate links (thanks to Remi Bois #23)

v0.2.4

  • Add events for clicking on nodes and links: on_node_clicked and on_link_clicked. These replace the on_selected event.

Contributors

  • Nicholas Bollweg
  • Ali Alsabbah
  • Remi Bois
  • Miguel Mendez

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100