raesl.plot.view_funcs#

GraphView view functions for ESL.

Module Contents#

Functions#

multi_domain(→ Tuple[List[ragraph.node.Node], ...)

Create multi-domain-matrix visualization based on an ESL derived graph.

hierarchy(→ Tuple[List[ragraph.node.Node], ...)

Filter nodes and create edges for drawing a hierarchical decomposition diagram.

functional_dependency(→ Tuple[List[ragraph.node.Node], ...)

Filter method for drawing a nested functional dependency structure.

traceability() → Tuple[List[ragraph.node.Node], ...)

Filter nodes and edges for drawing a traceability diagram.

function_chain() → Tuple[List[ragraph.node.Node], ...)

Filter nodes and edges for a function chain diagram.

functional_context() → Tuple[List[ragraph.node.Node], ...)

Filter nodes and edges for drawing a functional context diagram.

_add_component_goal_edges(→ List[ragraph.edge.Edge])

Create edges between component or cluster nodes if a goal cannot be related

raesl.plot.view_funcs.multi_domain(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 = 2) Tuple[List[ragraph.node.Node], List[ragraph.edge.Edge]]#

Create multi-domain-matrix visualization based on an ESL derived graph.

Parameters:
  • graph – Input graph object derived from an ESL specification.

  • node_kinds – The node kinds that are included in the plot. Defaults to all node_kinds present within the graph.

  • edge_kinds – The edge kinds that are included in the plot. Defaults to all edge_kinds present within the graph.

  • edge_labels – The edge labels that are shown in the plot. Defaults to all edge_labels present within the graph.

  • edge_weights – The edge weight types that are shown in the plot. Defaults to a single random edge weight present within the graph.

  • lead_components – The lead components to be used to select other nodes.

  • depth – Depth up to which lead components must be selected if no lead components are provided.

Returns:

Node list and Edge list.

raesl.plot.view_funcs.hierarchy(graph: ragraph.graph.Graph, roots: List[ragraph.node.Node], levels: int) Tuple[List[ragraph.node.Node], List[ragraph.edge.Edge]]#

Filter nodes and create edges for drawing a hierarchical decomposition diagram.

Parameters:
  • graph – Source data graph.

  • roots – Roots of the hierarchical diagram.

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

Returns:

List of selected nodes and list of created edges.

raesl.plot.view_funcs.functional_dependency(graph: ragraph.graph.Graph, root: ragraph.node.Node, levels: int) Tuple[List[ragraph.node.Node], List[ragraph.node.Node]]#

Filter method for drawing a nested functional dependency structure.

Arguments

graph: Instantiated ESL graph. root: Root node for which the dependency structure must be drawn. levels: Number of levels to include in the tree.

Returns:

List of nodes and edges to be displayed.

Note

This method assumes that the data source graph is generated from an ESL specification.

raesl.plot.view_funcs.traceability(graph: ragraph.graph.Graph, root: ragraph.node.Node, levels: int, style: raesl.plot.generic.Style = Style()) Tuple[List[ragraph.node.Node], List[ragraph.edge.Edge]]#

Filter nodes and edges for drawing a traceability diagram.

Parameters:
  • graph – Instantiated ESL graph.

  • root – The root transformation specification.

  • levels – Number of levels to include in the traceability diagram.

  • style – RaESL style options.

Returns:

List of selected nodes and list of selected edges.

raesl.plot.view_funcs.function_chain(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()) Tuple[List[ragraph.node.Node], List[ragraph.edge.Edge]]#

Filter nodes and edges for a function chain diagram.

Parameters:
  • graph – Instantiated ESL graph.

  • start_points – List of start-points for the function chains.

  • end_points – List of end-points for the function chains.

  • levels – Number of levels to decompose intermediate components into (if present).

  • style – style options class.

Returns:

List of selected nodes and list of selected edges.

raesl.plot.view_funcs.functional_context(graph: ragraph.graph.Graph, root: ragraph.node.Node, degree: int, style: raesl.plot.generic.Style = Style()) Tuple[List[ragraph.node.Node], List[ragraph.edge.Edge]]#

Filter nodes and edges for drawing a functional context diagram.

Parameters:
  • graph – Instantiated ESL graph.

  • root – The root node for which the functional context diagram must be drawn.

  • degree – Degree up to which neighbors of neighbors must be sought.

  • style – RaESL style options.

Returns:

List of selected nodes and list of selected edges.

raesl.plot.view_funcs._add_component_goal_edges(graph: ragraph.graph.Graph, tree: List[ragraph.node.Node], functions: List[ragraph.node.Node]) List[ragraph.edge.Edge]#

Create edges between component or cluster nodes if a goal cannot be related to a transformation:

Parameters:
  • graph – Instantiated ESL graph.

  • tree – List of components that are within the (sub)tree that is plotted.

  • functions – List of function specs that is plotted.

Returns:

List of edges.