Display Sankey diagrams in Jupyter
Project description
IPython Sankey diagram widget
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
File details
Details for the file ipysankeywidget-0.5.0.tar.gz
.
File metadata
- Download URL: ipysankeywidget-0.5.0.tar.gz
- Upload date:
- Size: 475.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed868df0b68ed9c14ad6372a4cec5db99eb43f441b3b4050bc1b454fb817902f |
|
MD5 | c5b5511900726ba997be55f915443721 |
|
BLAKE2b-256 | f4c56d0946a26e634334d1bcf09ce7d4ac6a03bd8199aed3303a32a57276a6c7 |
File details
Details for the file ipysankeywidget-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: ipysankeywidget-0.5.0-py3-none-any.whl
- Upload date:
- Size: 330.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23dc1953b5749312874ab3cfbc6bdc9ad2604be7d09dddee9c6367bb5e7c43b5 |
|
MD5 | d7b9163f859e80f1106ff50c0a70443e |
|
BLAKE2b-256 | 34e4353ec63cbaddbdc53bbb41dcf124604e6e20e66c3effac4698be4e81c2f9 |