Display Sankey diagrams in Jupyter
Project description
IPython Sankey diagram widget
![Conda Version](https://pypi-camo.freetls.fastly.net/796cfcd68627b90bc719a582816c061fa56b7bf9/68747470733a2f2f696d672e736869656c64732e696f2f636f6e64612f766e2f636f6e64612d666f7267652f69707973616e6b65797769646765742e737667)
Display Sankey diagrams in IPython / Jupyter notebook using d3-sankey-diagram.
Installation
To install use pip:
$ pip install ipysankeywidget
Alternatively, to install using conda:
$ conda install -c conda-forge ipysankeywidget
For a development install, see DEVELOPING.md.
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 attributes of the SankeyWidget
are the same as the properties of 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.5.0 (16 December 2022)
- Compatible with Jupyter Lab as well as Jupyter notebook.
v0.4.2 (29 April 2022)
- Expose d3-sankey-diagram nodePositions() option to allow for custom node layout.
v0.4.1 (18 February 2021)
- Experimental support for link "markers"
- Experimental support for showing HTML info for links
v0.4.0 (19 November 2020)
- Update to d3-sankey-diagram v0.8.0
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 thanlinkLabelMinWidth
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
andon_link_clicked
. These replace theon_selected
event.
Contributors
- Rick Lupton
- Nicholas Bollweg
- Ali Alsabbah
- Remi Bois
- Miguel Mendez
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ipysankeywidget-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23dc1953b5749312874ab3cfbc6bdc9ad2604be7d09dddee9c6367bb5e7c43b5 |
|
MD5 | d7b9163f859e80f1106ff50c0a70443e |
|
BLAKE2b-256 | 34e4353ec63cbaddbdc53bbb41dcf124604e6e20e66c3effac4698be4e81c2f9 |