Skip to main content

Display Sankey diagrams in Jupyter

Project description

ipysankeywidget Binder Conda Version

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

Installation

pip install ipysankeywidget

or with uv:

uv add ipysankeywidget

or with 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.

uv run jupyter lab examples/Simple\ example.ipynb

You can also try these online using Binder, or follow the links to static versions on nbviewer:

Changelog

Unreleased

Updated to use anywidget for simpler packaging.

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipysankeywidget-0.6.0.tar.gz (208.9 kB view details)

Uploaded Source

Built Distribution

ipysankeywidget-0.6.0-py2.py3-none-any.whl (210.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ipysankeywidget-0.6.0.tar.gz.

File metadata

  • Download URL: ipysankeywidget-0.6.0.tar.gz
  • Upload date:
  • Size: 208.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.9

File hashes

Hashes for ipysankeywidget-0.6.0.tar.gz
Algorithm Hash digest
SHA256 214ea1487d0d99e2cdc6bf214c69c9b3f87e782ff6dd6c3f8fd02177d1c5e920
MD5 c42e65cff953ebbb385546146358e69f
BLAKE2b-256 01393c262ab98b00f89c0f54d7662b31e918a4fcdf99c10ca229f2194c8c8964

See more details on using hashes here.

File details

Details for the file ipysankeywidget-0.6.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for ipysankeywidget-0.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f6df8ea8a07164627760a06c90dfb54fc3d26c9574e975f5ab7da7ab3d9a2604
MD5 2c5cd2b01a30e7425aa7c6d0e3d63014
BLAKE2b-256 ac57908a8be2b042924bada4baab70a55fe13dc8f461374cea7d000537afb4bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page