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,Flowsrendering common
Typedeclarations, 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
Classes
Code snippet annotation (textual representation). |
||
Proxy to an edge in the graph. |
||
Style attributes for an edge. |
||
View of all edges in the graph. |
||
Data structure for SysML graphs. |
||
Label for the heading and declaration parts of this node or edge. |
||
Metadata annotation containing attributes. |
||
A metadata annotation attribute |
||
Proxy to a node in the graph. |
||
Style attributes for a node. |
||
View of all nodes in the graph. |
||
Comment or documentation annotation. |
||
Reusable context for transforming SysML models into graphs. |
Functions
Insert model rooted at |
||
Depth-first traversal of the graph’s node hierarchy. |
||
Visit all nodes, then all edges in an unspecified order. |
Enumerations
Arrow head/tail style for edges. |
||
Typed edge identifier within a graph. |
||
Line style for edges and node borders. |
||
Typed node identifier within a graph. |
||
Abstract node placement relative to the enclosing node. |
||
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
roottograph.Note that edges between different root subtrees may not be created.
If calling this repeatedly, prefer passing in a
contextto 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_enterandon_exitfor each node, then emits all edges viaon_edge.on_enter(node)returns a bool:Trueto descend into the node’s children,Falseto prune the subtree. OnFalse, the pruned node does not invokeon_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.
noneNo arrow.
NormalFilled triangular arrow.
ONormalOpen triangular arrow.
ONormalDotsOpen triangular arrow followed by dots.
ONormalDDotsOpen triangular arrow followed by two rows of dots.
ONormalTeeOpen triangular arrow followed by tee.
DiamondFilled diamond.
ODiamondOpen diamond.
VeeUnclosed triangular arrow.
OVeeOpen unclosed triangular arrow.
ODotOpen dot.
PlusODotOpen dot with overlaid plus.
PacmanFilled arc.
InvNormalInverted filled triangular arrow.
InvOVeeInverted open unclosed triangular arrow.
- class EdgeID
Typed edge identifier within a graph.
Max= 4294967295
Maximum representable ID value. Not intended for direct use.
- class LineStyle
Line style for edges and node borders.
Styles are partly based on graphviz style attributes.
- class NodeID
Typed node identifier within a graph.
Max= 4294967295
Maximum representable ID value. Not intended for direct use.
- class NodePlacement
Abstract node placement relative to the enclosing node.
DefaultDefault placement.
The actual placement will depend on visualization implementation, and whether children are nested or interconnected.
AdjacentOutsideNode should be placed outside and adjacent to the parent.
This is the placement for parameters.
OnEdgeNode 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.
PackagePackage tab shape.
NoteNote shape.
BoxRectangular box.
RoundedBoxRounded rectangle.
CircleFilled circle (start node).
DCircleDouble circle (end node).
XOCircleCircle with X (terminate node).
ODiamondOpen diamond (decision/merge node).
BarFilled bar (fork/join node).