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 graph

  • optimizer_kwargs (Optional[dict]) – configuration of sankey optimizer (no optimization if absent) it consists the keyworded arguments fed to dyn.drawing.sankey_optimization.SankeyOptimizer

  • colormap (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 graph

  • optimizer_kwargs (Optional[dict]) – configuration of sankey optimizer (no optimization if absent) it consists the keyworded arguments fed to dyn.drawing.sankey_optimization.SankeyOptimizer

  • colormap (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 graph

  • output_file (str) –

  • optimizer_kwargs (Optional[dict]) – configuration of sankey optimizer (no optimization if absent) it consists the keyworded arguments fed to dyn.drawing.sankey_optimization.SankeyOptimizer

  • colormap (str) –

Note

Remaining positional and key-worded arguments are supplied to plotly.graph_objects.Figure.save_html() (for a html file) or plotly.graph_objects.Figure.save_image() (for an image file).