order: int,
sources: str,
targets: str,
values: str,
data: List[Dict],
option_modifications: Optional[Dict]
title: Optional[str]
padding: Optional[List[int]]
rows_size: Optional[int]
cols_size: Optional[int]
Video demonstration of the Sankey diagram
data = [
{
"source": "a",
"target": "a1",
"value": 5
},
{
"source": "a",
"target": "a2",
"value": 3
},
{
"source": "a",
"target": "b1",
"value": 8
},
{
"source": "b",
"target": "b1",
"value": 6
},
{
"source": "b1",
"target": "a1",
"value": 1
},
{
"source": "b1",
"target": "c",
"value": 2
}
]
s.plt.sankey(
data=data, order=0,
sources='source', targets='target', values='value',
rows_size=2, cols_size=12,
)
2. Customization And Context
data = [
{
"source": "Chemical energy",
"target": "light",
"value": 15
},
{
"source": "Chemical energy",
"target": "electricity",
"value": 3
},
{
"source": "Chemical energy",
"target": "heat",
"value": 8
},
{
"source": "Geothermal energy",
"target": "heat",
"value": 6
},
{
"source": "heat",
"target": "light",
"value": 1
},
{
"source": "heat",
"target": "movement",
"value": 2
}
]
s.plt.sankey(
data=data, order=0,
sources='source', targets='target', values='value',
rows_size=2, cols_size=9, padding='0,0,0,2',
title='Chemical x Geothermal energies conversion',
)