raesl.plot#

RaESL plotting and visualization module.

Submodules#

Package Contents#

Classes#

Style

RaESL plotting style mapping.

Functions#

function_chain_diagram() → graphviz.Digraph)

Draw a function chain diagram using Graphviz.

function_traceability_diagram() → graphviz.Digraph)

Draw a functional traceability diagram using Graphviz.

functional_context_diagram() → graphviz.Digraph)

Draw a functional context diagram using Graphviz.

functional_dependency_diagram() → graphviz.Digraph)

Draw a functional dependency diagram using Graphviz.

hierarchy_diagram() → graphviz.Digraph)

Draw a hierarchical decomposition tree using Graphviz.

mdm() → plotly.graph_objs.Figure)

Create a Multi-Domain Matrix plot using Plotly.

raesl.plot.function_chain_diagram(graph: ragraph.graph.Graph, start_points: List[Tuple[ragraph.node.Node, List[ragraph.node.Node]]], end_points: List[Tuple[ragraph.node.Node, List[ragraph.node.Node]]], levels: int = 1, style: raesl.plot.generic.Style = Style()) graphviz.Digraph#

Draw a function chain diagram using Graphviz.

Parameters:
  • graph – Instantiated ESL graph.

  • start_points – List of tuples that contain the component node and list of function nodes that serve as the starting point of the function chains.

  • end_points – List of tuples that contain the component node and list of function nodes that serve as the end point of the function chains.

  • levels – Number of levels to decompose intermediate components into. This number is relative to the depth of the start nodes and end nodes.

  • style – RaESL style options.

Returns:

Graphviz Digraph object of the function chain diagram.

raesl.plot.function_traceability_diagram(graph: ragraph.graph.Graph, root: ragraph.node.Node, levels: int, style: raesl.plot.generic.Style = Style()) graphviz.Digraph#

Draw a functional traceability diagram using Graphviz.

Parameters:
  • graph – Instantiated ESL graph.

  • root – Node that serves a the root of the traceability tree. Must be a transformation specification.

  • levels – Number of levels to go down into the traceability tree.

  • style – RaESL Style options.

Returns

Graphviz Digraph object of the functional traceability diagram.

raesl.plot.functional_context_diagram(graph: ragraph.graph.Graph, root: ragraph.node.Node, degree: int = 1, style: raesl.plot.generic.Style = Style()) graphviz.Digraph#

Draw a functional context diagram using Graphviz.

Parameters:
  • graph – Instantiated ESL graph.

  • root – Root node for which the functional context is drawn.

  • degree – The degree up to which neighbors must be collected (neighbors of neighbors). Defaults to 1.

  • style – RaESL style options.

Returns:

Graphviz Digraph object of the functional context diagram.

raesl.plot.functional_dependency_diagram(graph: ragraph.graph.Graph, root: ragraph.node.Node, levels: int, style: raesl.plot.generic.Style = Style()) graphviz.Digraph#

Draw a functional dependency diagram using Graphviz.

Parameters:
  • graph – Instantiated ESL graph.

  • root – Root node for which the dependency structure must be drawn.

  • levels – Number of levels to include in the tree.

  • style – RaESL style options.

Returns:

Graphviz Digraph object of the functional dependency diagram.

raesl.plot.hierarchy_diagram(graph: ragraph.graph.Graph, roots: List[ragraph.node.Node], levels: int, style: raesl.plot.generic.Style = Style()) graphviz.Digraph#

Draw a hierarchical decomposition tree using Graphviz.

Parameters:
  • graph – Instantiated ESL graph.

  • roots – List of root nodes for which a tree must be drawn.

  • levels – Number of levels to include in the tree.

  • style – RaESL style options.

Returns:

Graphviz Digraph object of the decomposition tree.

class raesl.plot.Style(diagram: DiagramStyle | Dict[str, Any] | None = None, ragraph: ragraph.plot.generic.Style | Dict[str, Any] | None = None)#

Bases: ragraph.generic.Mapping

RaESL plotting style mapping.

_defaults#
diagram() DiagramStyle#

Graphviz diagram style.

ragraph() ragraph.plot.generic.Style#

RaGraph style options, used for Multi-Domain matrices.

raesl.plot.mdm(graph: ragraph.graph.Graph, node_kinds: List[str] | None = None, edge_kinds: List[str] | None = None, edge_labels: List[str] | None = None, edge_weights: List[str] | None = None, lead_components: List[ragraph.node.Node] | None = None, depth: int | None = 2, style: raesl.plot.generic.Style = Style()) plotly.graph_objs.Figure#

Create a Multi-Domain Matrix plot using Plotly.

Parameters:
  • node_kinds – The node kinds to display.

  • edge_kinds – The edge kinds to display.

  • edge_labels – The edge labels to display.

  • edge_weights – The edge weights to display.

  • lead_components – The lead components to be used in node selection.

  • depth – The depth up to which components and related nodes must be included.

  • style – RaESL style options.

Returns:

Plotly go.Figure object of the Multi-Domain Matrix.