Execute each of these cells in order, such as with

First, load SankeyWidget:

In [6]:
from ipysankeywidget import SankeyWidget

Then, create an instance of SankeyWidget:

In [7]:
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 [8]:
w = SankeyWidget(links=links, margins=dict(top=0, bottom=0, left=50, right=100))

Display the widget:

In [9]:

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

Now, you can update the value of a link:

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

You should see the diagram change.

See the other notebooks linked above for more examples.