SysML v2 Views
The viz view command renders diagrams from SysML v2 view definitions in your model.
Rendering options such as layout style, depth, and file name are controlled through
attributes on each view. By default, views are rendered as nested diagrams.
package MyViews {
private import Views::asTreeDiagram;
part def SystemViews {
view customDroneView {
expose DroneModel::DroneSystem::myDrone;
filter @ SysML::PartUsage;
// depth defaults to 1
attribute depth = 2;
// fileName defaults to "diagram-{viewName}.{fileType}"
attribute fileName = "tree-zoom.png";
// fileType defaults to "SVG"
attribute fileType = "PNG";
// zoomLevel defaults to "3.0"
attribute zoomLevel = 2.0;
// omitting render defaults to nested diagram
render asTreeDiagram;
}
}
}
Configurable Attributes
The following attributes can be set on each view:
Attribute |
Default |
Description |
|---|---|---|
|
|
How many levels of descendants to show. |
|
Nested Diagram |
Layout style. Use |
|
|
Output format: |
|
|
Output file name |
|
|
Zoom level for rendering. Applicable only to PNG output |
CI/CD Integration
Generate diagrams in a CI pipeline:
# Render all views
xvfb-run -a syside viz view models/ --output-dir artifacts/diagrams
# Render a specific element
xvfb-run -a syside viz element "MySystem::TopLevel" models/ \
--output-file artifacts/diagrams/top-level.svg