Skip to content

Diagram Visualizer

The Spec42 visualizer renders your SysML v2 model as an interactive diagram. It lives in the secondary sidebar (right side of VS Code).

Opening the visualizer

  • Go to View → Secondary Side Bar, or
  • Click Open diagram visualizer in the Help section of the Spec42 sidebar.

The visualizer updates automatically as you edit your .sysml files.

Moving to the editor

For more screen space, or to put the diagram on a second monitor, move the visualizer into the editor area:

  • Click the Move Visualizer to Editor button in the visualizer title bar, or
  • Run SysML: Move Visualizer to Editor from the Command Palette.

While it is in the editor:

  • The secondary sidebar shows a short placeholder.
  • Closing the visualizer editor tab returns it to the secondary sidebar.
  • You can also run SysML: Move Visualizer to Secondary Side Bar.

From the editor tab, you can use VS Code's normal editor actions such as Move into New Window.

Working with the Feature Inspector

The visualizer is paired with the Feature Inspector in the secondary sidebar.

  • Clicking a diagram node pins the inspector to that element.
  • The inspector then shows resolved types, specialization/subsetting/redefinition, inherited features, relationships, values, and source location.
  • Use Resume following cursor in the inspector to switch back to live editor selection.

Selecting a view

Use the Select SysML View dropdown in the visualizer toolbar to pick which defined view to render. Views are defined in your model using view def and expose.

If no views are defined, the visualizer shows an empty state with a hint.

Available diagram types

ViewWhat it shows
General ViewPart hierarchy, typing, specialization, containment, binding, and allocation relationships.
Interconnection ViewPort connections between parts — useful for interface and signal flow diagrams.
State Transition ViewState machines with transitions, guards, and actions.

Toolbar controls

ControlAction
HomeFit the diagram to the window.
LR / TBToggle layout direction (left-to-right or top-to-bottom).
LegendShow a legend of diagram line styles and symbols.
ExportExport the diagram as PNG (1×-4×), SVG, or JSON.

Diagram legend

SymbolMeaning
Dashed line + open arrowTyping — a usage is typed by a definition (: Type)
Solid line + hollow triangleSpecialization — a type inherits from another (:>)
Solid line + filled diamond at sourceContainment — a part is owned by a container
Fine dotted lineBinding — two features are equal (bind … = …)
Long dashed line + filled arrowAllocation — a logical element is allocated to physical

Spec42 v0.50.0 · Released under the MIT License.