# decisym/sysmlv2-gui architecture

> Architecture diagram of the GitHub repository decisym/sysmlv2-gui, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/decisym/sysmlv2-gui
- Repository: https://github.com/decisym/sysmlv2-gui

## Overview

sysmlv2-gui is a Rust/egui viewer and navigator for SysML v2 models, with incremental editing ambitions. Users load a model, browse its hierarchy or search and filter elements, then explore overview and detailed canvas views with properties and source context. Rendering computes layouts and draws SysML notation, connectors, ports, and frames. Native file watching supports external edits; the README also describes web-mode backend access and validation, but sampled code does not show that API integration. Arrows use excerpted code, SOURCE INDEX references, or README claims; unsampled integrations are omitted where wiring is unclear.

Main entry points: [`src/panels/canvas.rs`](https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/canvas.rs) (Diagram Canvas), [`src/model/mod.rs`](https://github.com/decisym/sysmlv2-gui/blob/main/src/model/mod.rs) (Model Representation), [`src/app.rs`](https://github.com/decisym/sysmlv2-gui/blob/main/src/app.rs) (GUI App), [`src/render/layout.rs`](https://github.com/decisym/sysmlv2-gui/blob/main/src/render/layout.rs) (Interconnection Layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application"]
  node_app["GUI App<br/>[app.rs]"]
end

subgraph group_model["Model Processing"]
  node_parser["SysML Parser<br/>[parse.rs]"]
  node_modeldata["Model Representation<br/>[mod.rs]"]
  node_query["Faceted Query<br/>[query.rs]"]
end

subgraph group_explore["Exploration Panels"]
  node_browser["Model Browser<br/>[browser.rs]"]
  node_library["Element Library<br/>[library.rs]"]
  node_search["Search Panel<br/>[search.rs]"]
  node_filter["Kind Filters<br/>[filter.rs]"]
  node_properties["Properties Panel<br/>[properties.rs]"]
  node_source["Source Panel<br/>[source.rs]"]
  node_canvas["Diagram Canvas<br/>[canvas.rs]"]
end

subgraph group_draw["Diagram Rendering"]
  node_layout["Interconnection Layout<br/>[layout.rs]"]
  node_overview["Overview Layout<br/>[overview.rs]"]
  node_elements["Element Drawing<br/>[elements.rs]"]
  node_connectors["Connector Drawing<br/>[connectors.rs]"]
  node_ports["Port Drawing<br/>[ports.rs]"]
  node_frame["Diagram Frame<br/>[frame.rs]"]
  node_theme["Visual Theme<br/>[theme.rs]"]
end

subgraph group_platform["Platform I/O"]
  node_platform["Platform Loader<br/>[mod.rs]"]
  node_native["Native Files<br/>[native.rs]"]
  node_web["Web Demo Loader<br/>[web.rs]"]
  node_watcher["File Watcher<br/>[watcher.rs]"]
end

node_user(("Engineer"))
node_validator["SysML Validator"]
node_backend["Web Backend API"]

node_user -->|"uses"| node_app
node_app -->|"loads model"| node_platform
node_app -->|"renders view"| node_canvas
node_app -->|"updates filters"| node_filter
node_app -->|"updates query"| node_library
node_app -->|"holds model"| node_modeldata
node_platform -->|"selects native"| node_native
node_platform -->|"selects web"| node_web
node_native -->|"parses files"| node_parser
node_web -->|"parses demo"| node_parser
node_native -->|"polls changes"| node_watcher
node_native -.->|"validates model"| node_validator
node_web -.->|"requests files"| node_backend
node_web -.->|"gets validation"| node_backend
node_parser -->|"builds model"| node_modeldata
node_library -->|"executes query"| node_query
node_library -->|"shows tree"| node_browser
node_library -->|"navigates result"| node_canvas
node_browser -->|"browses elements"| node_modeldata
node_search -->|"searches elements"| node_modeldata
node_properties -->|"shows details"| node_modeldata
node_source -->|"shows source"| node_modeldata
node_filter -->|"filters neighborhood"| node_modeldata
node_canvas -->|"applies visibility"| node_filter
node_canvas -->|"computes layout"| node_layout
node_canvas -->|"computes overview"| node_overview
node_canvas -->|"draws elements"| node_elements
node_canvas -->|"draws connectors"| node_connectors
node_canvas -->|"draws ports"| node_ports
node_canvas -->|"draws frame"| node_frame
node_canvas -->|"styles view"| node_theme
node_layout -->|"reads structure"| node_modeldata
node_overview -->|"reads structure"| node_modeldata
node_elements -->|"reads elements"| node_modeldata
node_elements -->|"uses positions"| node_layout
node_connectors -->|"uses routes"| node_layout
node_ports -->|"uses positions"| node_layout
node_frame -->|"uses bounds"| node_layout
node_elements -->|"uses styling"| node_theme
node_connectors -->|"uses styling"| node_theme
node_frame -->|"uses styling"| node_theme

click node_app "https://github.com/decisym/sysmlv2-gui/blob/main/src/app.rs"
click node_parser "https://github.com/decisym/sysmlv2-gui/blob/main/src/model/parse.rs"
click node_modeldata "https://github.com/decisym/sysmlv2-gui/blob/main/src/model/mod.rs"
click node_query "https://github.com/decisym/sysmlv2-gui/blob/main/src/model/query.rs"
click node_browser "https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/browser.rs"
click node_library "https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/library.rs"
click node_search "https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/search.rs"
click node_filter "https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/filter.rs"
click node_properties "https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/properties.rs"
click node_source "https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/source.rs"
click node_canvas "https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/canvas.rs"
click node_layout "https://github.com/decisym/sysmlv2-gui/blob/main/src/render/layout.rs"
click node_overview "https://github.com/decisym/sysmlv2-gui/blob/main/src/render/overview.rs"
click node_elements "https://github.com/decisym/sysmlv2-gui/blob/main/src/render/elements.rs"
click node_connectors "https://github.com/decisym/sysmlv2-gui/blob/main/src/render/connectors.rs"
click node_ports "https://github.com/decisym/sysmlv2-gui/blob/main/src/render/ports.rs"
click node_frame "https://github.com/decisym/sysmlv2-gui/blob/main/src/render/frame.rs"
click node_theme "https://github.com/decisym/sysmlv2-gui/blob/main/src/render/theme.rs"
click node_platform "https://github.com/decisym/sysmlv2-gui/blob/main/src/platform/mod.rs"
click node_native "https://github.com/decisym/sysmlv2-gui/blob/main/src/platform/native.rs"
click node_web "https://github.com/decisym/sysmlv2-gui/blob/main/src/platform/web.rs"
click node_watcher "https://github.com/decisym/sysmlv2-gui/blob/main/src/watcher.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app toneBlue
class node_parser,node_modeldata,node_query toneAmber
class node_browser,node_library,node_search,node_filter,node_properties,node_source,node_canvas,node_backend toneMint
class node_layout,node_overview,node_elements,node_connectors,node_ports,node_frame,node_theme toneRose
class node_platform,node_native,node_web,node_watcher,node_user,node_validator toneIndigo
```

## Components

### Application

- [GUI App](https://github.com/decisym/sysmlv2-gui/blob/main/src/app.rs): `src/app.rs`

### Model Processing

- [SysML Parser](https://github.com/decisym/sysmlv2-gui/blob/main/src/model/parse.rs): `src/model/parse.rs`
- [Model Representation](https://github.com/decisym/sysmlv2-gui/blob/main/src/model/mod.rs): `src/model/mod.rs`
- [Faceted Query](https://github.com/decisym/sysmlv2-gui/blob/main/src/model/query.rs): `src/model/query.rs`

### Exploration Panels

- [Model Browser](https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/browser.rs): `src/panels/browser.rs`
- [Element Library](https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/library.rs): `src/panels/library.rs`
- [Search Panel](https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/search.rs): `src/panels/search.rs`
- [Kind Filters](https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/filter.rs): `src/panels/filter.rs`
- [Properties Panel](https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/properties.rs): `src/panels/properties.rs`
- [Source Panel](https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/source.rs): `src/panels/source.rs`
- [Diagram Canvas](https://github.com/decisym/sysmlv2-gui/blob/main/src/panels/canvas.rs): `src/panels/canvas.rs`

### Diagram Rendering

- [Interconnection Layout](https://github.com/decisym/sysmlv2-gui/blob/main/src/render/layout.rs): `src/render/layout.rs`
- [Overview Layout](https://github.com/decisym/sysmlv2-gui/blob/main/src/render/overview.rs): `src/render/overview.rs`
- [Element Drawing](https://github.com/decisym/sysmlv2-gui/blob/main/src/render/elements.rs): `src/render/elements.rs`
- [Connector Drawing](https://github.com/decisym/sysmlv2-gui/blob/main/src/render/connectors.rs): `src/render/connectors.rs`
- [Port Drawing](https://github.com/decisym/sysmlv2-gui/blob/main/src/render/ports.rs): `src/render/ports.rs`
- [Diagram Frame](https://github.com/decisym/sysmlv2-gui/blob/main/src/render/frame.rs): `src/render/frame.rs`
- [Visual Theme](https://github.com/decisym/sysmlv2-gui/blob/main/src/render/theme.rs): `src/render/theme.rs`

### Platform I/O

- [Platform Loader](https://github.com/decisym/sysmlv2-gui/blob/main/src/platform/mod.rs): `src/platform/mod.rs`
- [Native Files](https://github.com/decisym/sysmlv2-gui/blob/main/src/platform/native.rs): `src/platform/native.rs`
- [Web Demo Loader](https://github.com/decisym/sysmlv2-gui/blob/main/src/platform/web.rs): `src/platform/web.rs`
- [File Watcher](https://github.com/decisym/sysmlv2-gui/blob/main/src/watcher.rs): `src/watcher.rs`

### Other components

- **Engineer**
- **SysML Validator**
- **Web Backend API**

## Connections

- Engineer → GUI App: uses (evidence: `README.md`)
- GUI App → Platform Loader: loads model (evidence: `src/app.rs`)
- GUI App → Diagram Canvas: renders view (evidence: `src/app.rs`)
- GUI App → Kind Filters: updates filters (evidence: `src/app.rs`)
- GUI App → Element Library: updates query (evidence: `src/app.rs`)
- GUI App → Model Representation: holds model (evidence: `src/app.rs`)
- Platform Loader → Native Files: selects native (evidence: `src/platform/mod.rs`)
- Platform Loader → Web Demo Loader: selects web (evidence: `src/platform/mod.rs`)
- Native Files → SysML Parser: parses files (evidence: `src/platform/native.rs`)
- Web Demo Loader → SysML Parser: parses demo (evidence: `src/platform/web.rs`)
- Native Files → File Watcher: polls changes (evidence: `src/platform/native.rs`)
- Native Files → SysML Validator: validates model (evidence: `README.md`)
- Web Demo Loader → Web Backend API: requests files (evidence: `README.md`)
- Web Demo Loader → Web Backend API: gets validation (evidence: `README.md`)
- SysML Parser → Model Representation: builds model (evidence: `README.md`)
- Element Library → Faceted Query: executes query (evidence: `src/panels/library.rs`)
- Element Library → Model Browser: shows tree (evidence: `src/panels/library.rs`)
- Element Library → Diagram Canvas: navigates result (evidence: `src/panels/library.rs`)
- Model Browser → Model Representation: browses elements (evidence: `src/panels/browser.rs`)
- Search Panel → Model Representation: searches elements (evidence: `src/panels/search.rs`)
- Properties Panel → Model Representation: shows details (evidence: `src/panels/properties.rs`)
- Source Panel → Model Representation: shows source (evidence: `src/panels/source.rs`)
- Kind Filters → Model Representation: filters neighborhood (evidence: `src/panels/filter.rs`)
- Diagram Canvas → Kind Filters: applies visibility (evidence: `src/panels/canvas.rs`)
- Diagram Canvas → Interconnection Layout: computes layout (evidence: `src/panels/canvas.rs`)
- Diagram Canvas → Overview Layout: computes overview (evidence: `src/panels/canvas.rs`)
- Diagram Canvas → Element Drawing: draws elements (evidence: `src/panels/canvas.rs`)
- Diagram Canvas → Connector Drawing: draws connectors (evidence: `src/panels/canvas.rs`)
- Diagram Canvas → Port Drawing: draws ports (evidence: `src/panels/canvas.rs`)
- Diagram Canvas → Diagram Frame: draws frame (evidence: `src/panels/canvas.rs`)
- Diagram Canvas → Visual Theme: styles view (evidence: `src/panels/canvas.rs`)
- Interconnection Layout → Model Representation: reads structure (evidence: `src/render/layout.rs`)
- Overview Layout → Model Representation: reads structure (evidence: `src/render/overview.rs`)
- Element Drawing → Model Representation: reads elements (evidence: `src/render/elements.rs`)
- Element Drawing → Interconnection Layout: uses positions (evidence: `src/render/elements.rs`)
- Connector Drawing → Interconnection Layout: uses routes (evidence: `src/render/connectors.rs`)
- Port Drawing → Interconnection Layout: uses positions (evidence: `src/render/ports.rs`)
- Diagram Frame → Interconnection Layout: uses bounds (evidence: `src/render/frame.rs`)
- Element Drawing → Visual Theme: uses styling (evidence: `src/render/elements.rs`)
- Connector Drawing → Visual Theme: uses styling (evidence: `src/render/connectors.rs`)
- Diagram Frame → Visual Theme: uses styling (evidence: `src/render/frame.rs`)
