Execute each of these cells in order, such as with

First, load SankeyWidget:

In [1]:
from ipysankeywidget import SankeyWidget

Then, create an instance of SankeyWidget:

In [2]:
links = [
    {'source': 'start', 'target': 'A', 'value': 2},
    {'source': 'A', 'target': 'B', 'value': 2},
    {'source': 'C', 'target': 'A', 'value': 2},
    {'source': 'A', 'target': 'C', 'value': 2},
In [3]:
w = SankeyWidget(links=links, margins=dict(top=0, bottom=0, left=50, right=100))

Display the widget:

In [4]:

You should see a simple Sankey diagram with 4 nodes and 4 flows

Now, you can update the value of a link:

In [5]:
w.links[0]['value'] = 1

You should see the diagram change.

See the other notebooks linked above for more examples.