sankey_drawing
This module defines the utilities needed to draw a sankey diagram.
It is based on module plotly.graph_objects.
- dyn.drawing.sankey_drawing.draw_sankey(graph, optimizer_kwargs=None, colormap='jet')
Draw sankey and return it.
- Parameters
graph (
Tcommlist|EvolvingCommunitiesGraph) – either a tcommlist or a community flow graphoptimizer_kwargs (
Optional[dict]) – configuration of sankey optimizer (no optimization if absent) it consists the keyworded arguments fed todyn.drawing.sankey_optimization.SankeyOptimizercolormap (
str) –
- Return type
Figure- Returns
drawn sankey image
- dyn.drawing.sankey_drawing.plot_sankey(graph, optimizer_kwargs=None, colormap='jet')
Plot sankey.
- Parameters
graph (
Tcommlist|EvolvingCommunitiesGraph) – either a tcommlist or a community flow graphoptimizer_kwargs (
Optional[dict]) – configuration of sankey optimizer (no optimization if absent) it consists the keyworded arguments fed todyn.drawing.sankey_optimization.SankeyOptimizercolormap (
str) –
- dyn.drawing.sankey_drawing.save_sankey(graph, output_file, *args, optimizer_kwargs=None, colormap='jet', **kwargs)
Draw and save sankey to an image or html file.
- Parameters
graph (
Tcommlist|EvolvingCommunitiesGraph) – either a tcommlist or a community flow graphoutput_file (
str) –optimizer_kwargs (
Optional[dict]) – configuration of sankey optimizer (no optimization if absent) it consists the keyworded arguments fed todyn.drawing.sankey_optimization.SankeyOptimizercolormap (
str) –
Note
Remaining positional and key-worded arguments are supplied to
plotly.graph_objects.Figure.save_html()(for a html file) orplotly.graph_objects.Figure.save_image()(for an image file).