viz Labs

Submodule for generating SysML visualizations.

Note that this any features in this module are still in very early stages and subject to change. Features will be extended and more implemented in future versions.

Currently implemented:

  • hierarchical nodes and edges

  • binary edges

  • n-ary edges

  • metadata prefixes

  • annotating elements

  • DOT nested and interconnection diagrams

  • edges from Types, e.g. Connections, Flows

  • rendering common Type declarations, including heritage, and feature values

To be implemented:

  • rendering type-specific declarations, e.g. connectors

  • inserting cross-referenced elements

  • inserting and modifying nodes and edges manually

  • more rendered graph types

  • more render targets

  • embedded hyperlinks

  • semantically highlighted SysML text

  • styling

  • layouting

Index

Submodules

dot

Labs

Submodule for rendering DOT graphs.

Classes

Code

Code snippet annotation (textual representation).

Edge

Proxy to an edge in the graph.

EdgeStyle

Style attributes for an edge.

Edges

View of all edges in the graph.

Graph

Data structure for SysML graphs.

Label

Label for the heading and declaration parts of this node or edge.

Metadata

Metadata annotation containing attributes.

MetadataAttribute

A metadata annotation attribute

Node

Proxy to a node in the graph.

NodeStyle

Style attributes for a node.

Nodes

View of all nodes in the graph.

TextAnnotation

Comment or documentation annotation.

TransformationContext

Reusable context for transforming SysML models into graphs.

Functions

transform_to

Insert model rooted at root to graph.

traverse_hierarchical

Depth-first traversal of the graph’s node hierarchy.

traverse_unordered

Visit all nodes, then all edges in an unspecified order.

Enumerations

ArrowStyle

Arrow head/tail style for edges.

EdgeID

Typed edge identifier within a graph.

LineStyle

Line style for edges and node borders.

NodeID

Typed node identifier within a graph.

NodePlacement

Abstract node placement relative to the enclosing node.

NodeShape

Shape used when rendering a node.


󰊕 Functions

transform_to(graph: syside.experimental.viz.Graph, root: syside.Namespace, *, context: syside.experimental.viz.TransformationContext | None = None) None

Insert model rooted at root to graph.

Note that edges between different root subtrees may not be created.

If calling this repeatedly, prefer passing in a context to improve performance.

traverse_hierarchical(graph: syside.experimental.viz.Graph, on_enter: Callable[[syside.experimental.viz.Node], bool], on_exit: Callable[[syside.experimental.viz.Node], None], on_edge: Callable[[syside.experimental.viz.Edge], None]) None

Depth-first traversal of the graph’s node hierarchy.

Visits all root nodes via DFS, calling on_enter and on_exit for each node, then emits all edges via on_edge.

on_enter(node) returns a bool: True to descend into the node’s children, False to prune the subtree. On False, the pruned node does not invoke on_exit.

traverse_hierarchical(graph: syside.experimental.viz.Graph, on_enter: Callable[[syside.experimental.viz.Node], bool], on_exit: Callable[[syside.experimental.viz.Node], None], root: syside.experimental.viz.NodeID) None

Depth-first traversal of the graph’s node hierarchy from a given root.

Node traversal follows the same rules as full graph hierarchical traversal, except edges are not visited.

traverse_unordered(graph: syside.experimental.viz.Graph, on_node: Callable[[syside.experimental.viz.Node], None], on_edge: Callable[[syside.experimental.viz.Edge], None]) None

Visit all nodes, then all edges in an unspecified order.

Enumerations

class ArrowStyle

Arrow head/tail style for edges.

Styles are partly based on graphviz arrow shapes.

No arrow.

Filled triangular arrow.

Open triangular arrow.

Open triangular arrow followed by dots.

Open triangular arrow followed by two rows of dots.

Open triangular arrow followed by tee.

Filled diamond.

Open diamond.

Unclosed triangular arrow.

Open unclosed triangular arrow.

Open dot.

Open dot with overlaid plus.

Filled arc.

Inverted filled triangular arrow.

Inverted open unclosed triangular arrow.

class EdgeID

Typed edge identifier within a graph.

= 4294967295

Maximum representable ID value. Not intended for direct use.

Used in
class LineStyle

Line style for edges and node borders.

Styles are partly based on graphviz style attributes.

Solid line.

Long dashes.

Short dashes.

Dotted line.

class NodeID

Typed node identifier within a graph.

= 4294967295

Maximum representable ID value. Not intended for direct use.

Used in
class NodePlacement

Abstract node placement relative to the enclosing node.

Default placement.

The actual placement will depend on visualization implementation, and whether children are nested or interconnected.

Node should be placed outside and adjacent to the parent.

This is the placement for parameters.

Node should be placed on the perimeter of parent node.

This is the placement for ports.

class NodeShape

Shape used when rendering a node.

Shapes correspond to graphviz node shapes where applicable.

Package tab shape.

Note shape.

Rectangular box.

Rounded rectangle.

Filled circle (start node).

Double circle (end node).

Circle with X (terminate node).

Open diamond (decision/merge node).

Filled bar (fork/join node).