7.1.1.12. plotΒΆ

Dispatcher.plot(workflow=None, view=True, depth=-1, name=none, comment=none, format=none, engine=none, encoding=none, graph_attr=none, node_attr=none, edge_attr=none, body=none, node_styles=none, node_data=none, node_function=none, edge_data=none, max_lines=none, max_width=none, directory=None, sites=None, index=False)

Plots the Dispatcher with a graph in the DOT language with Graphviz.

Parameters:
  • workflow (bool, optional) – If True the latest solution will be plotted, otherwise the dmap.
  • view (bool, optional) – Open the rendered directed graph in the DOT language with the sys default opener.
  • edge_data (tuple[str], optional) – Edge attributes to view.
  • node_data (tuple[str], optional) – Data node attributes to view.
  • node_function (tuple[str], optional) – Function node attributes to view.
  • node_styles (dict[str|Token, dict[str, str]]) – Default node styles according to graphviz node attributes.
  • depth (int, optional) – Depth of sub-dispatch plots. If negative all levels are plotted.
  • name (str) – Graph name used in the source code.
  • comment (str) – Comment added to the first line of the source.
  • directory (str, optional) – (Sub)directory for source saving and rendering.
  • format (str, optional) – Rendering output format (‘pdf’, ‘png’, ...).
  • engine (str, optional) – Layout command used (‘dot’, ‘neato’, ...).
  • encoding (str, optional) – Encoding for saving the source.
  • graph_attr (dict, optional) – Dict of (attribute, value) pairs for the graph.
  • node_attr (dict, optional) – Dict of (attribute, value) pairs set for all nodes.
  • edge_attr (dict, optional) – Dict of (attribute, value) pairs set for all edges.
  • body (dict, optional) – Dict of (attribute, value) pairs to add to the graph body.
  • directory – Where is the generated Flask app root located?
  • sites (set[~schedula.utils.drw.Site], optional) – A set of Site() to maintain alive the backend server.
  • index (bool, optional) – Add the site index as first page?
  • max_lines (int, optional) – Maximum number of lines for rendering node attributes.
  • max_width (int, optional) – Maximum number of characters in a line to render node attributes.
  • view – Open the main page of the site?
Returns:

A SiteMap.

Return type:

schedula.utils.drw.SiteMap

Example:

>>> from schedula import Dispatcher
>>> dsp = Dispatcher(name='Dispatcher')
>>> def fun(a):
...     return a + 1, a - 1
>>> dsp.add_function('fun', fun, ['a'], ['b', 'c'])
'fun'
>>> dsp.plot(view=False, graph_attr={'ratio': '1'})
SiteMap([(Dispatcher, SiteMap())])

digraph dmap { graph [ratio=1] node [style=filled] label = <dmap> splines = ortho style = filled 142 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2">a</TD></TR></TABLE>> fillcolor=cyan shape=box style="rounded,filled" tooltip=a] 143 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2">b</TD></TR></TABLE>> fillcolor=cyan shape=box style="rounded,filled" tooltip=b] 144 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2">c</TD></TR></TABLE>> fillcolor=cyan shape=box style="rounded,filled" tooltip=c] 145 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2" href="./dispatcher-f55282f8d59c8bbcca8a2ef07b63000e69224eaf/fun.html">fun</TD></TR></TABLE>> fillcolor=springgreen shape=box tooltip=fun] 145 -> 143 142 -> 145 145 -> 144 }