Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
471 changes: 26 additions & 445 deletions .reviewmark.yaml

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions DemaConsulting.SysML2Tools.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@
<Project Path="src/DemaConsulting.SysML2Tools.Language/DemaConsulting.SysML2Tools.Language.csproj" />
<Project Path="src/DemaConsulting.SysML2Tools.Stdlib/DemaConsulting.SysML2Tools.Stdlib.csproj" />
<Project Path="src/DemaConsulting.SysML2Tools.Core/DemaConsulting.SysML2Tools.Core.csproj" />
<Project Path="src/DemaConsulting.SysML2Tools.Svg/DemaConsulting.SysML2Tools.Svg.csproj" />
<Project Path="src/DemaConsulting.SysML2Tools.Png/DemaConsulting.SysML2Tools.Png.csproj" />
<Project Path="src/DemaConsulting.SysML2Tools.Tool/DemaConsulting.SysML2Tools.Tool.csproj" />
</Folder>
<Folder Name="/tools/">
</Folder>
<Folder Name="/test/">
<Project Path="test/DemaConsulting.SysML2Tools.Tests/DemaConsulting.SysML2Tools.Tests.csproj" />
<Project Path="test/DemaConsulting.SysML2Tools.Svg.Tests/DemaConsulting.SysML2Tools.Svg.Tests.csproj" />
<Project Path="test/DemaConsulting.SysML2Tools.Png.Tests/DemaConsulting.SysML2Tools.Png.Tests.csproj" />
<Project Path="test/DemaConsulting.SysML2Tools.Tool.Tests/DemaConsulting.SysML2Tools.Tool.Tests.csproj" />
</Folder>
</Solution>
32 changes: 1 addition & 31 deletions docs/design/definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@ resource-path:
- docs/design/sysml2-tools-language/semantic/internal
- docs/design/sysml2-tools-core
- docs/design/sysml2-tools-core/layout
- docs/design/sysml2-tools-core/layout/engine
- docs/design/sysml2-tools-core/layout/engine/layered
- docs/design/sysml2-tools-core/layout/internal
- docs/design/sysml2-tools-core/rendering
- docs/design/sysml2-tools-core/rendering/internal
- docs/design/sysml2-tools-stdlib
- docs/design/sysml2-tools-svg
- docs/design/sysml2-tools-png
- docs/design/sysml2-tools-tool
- docs/design/sysml2-tools-tool/cli
- docs/design/sysml2-tools-tool/lint
Expand Down Expand Up @@ -45,26 +41,6 @@ input-files:
- docs/design/sysml2-tools-stdlib/stdlib-provider.md
- docs/design/sysml2-tools-core.md
- docs/design/sysml2-tools-core/layout.md
- docs/design/sysml2-tools-core/layout/box-metrics.md
- docs/design/sysml2-tools-core/layout/layout-tree.md
- docs/design/sysml2-tools-core/layout/connector-label-placer.md
- docs/design/sysml2-tools-core/layout/engine.md
- docs/design/sysml2-tools-core/layout/engine/channel-router.md
- docs/design/sysml2-tools-core/layout/engine/containment-packer.md
- docs/design/sysml2-tools-core/layout/engine/interconnection-layout-engine.md
- docs/design/sysml2-tools-core/layout/engine/layered.md
- docs/design/sysml2-tools-core/layout/engine/layered/layered-graph.md
- docs/design/sysml2-tools-core/layout/engine/layered/layered-layout-pipeline.md
- docs/design/sysml2-tools-core/layout/engine/layered/cycle-breaker.md
- docs/design/sysml2-tools-core/layout/engine/layered/layer-assigner.md
- docs/design/sysml2-tools-core/layout/engine/layered/long-edge-splitter.md
- docs/design/sysml2-tools-core/layout/engine/layered/crossing-minimizer.md
- docs/design/sysml2-tools-core/layout/engine/layered/brandes-kopf-placer.md
- docs/design/sysml2-tools-core/layout/engine/layered/port-distributor.md
- docs/design/sysml2-tools-core/layout/engine/layered/orthogonal-router.md
- docs/design/sysml2-tools-core/layout/engine/layered/long-edge-joiner.md
- docs/design/sysml2-tools-core/layout/engine/layered/axis-transform.md
- docs/design/sysml2-tools-core/layout/engine/layered/component-packer.md
- docs/design/sysml2-tools-core/layout/internal.md
- docs/design/sysml2-tools-core/layout/internal/general-view-layout-strategy.md
- docs/design/sysml2-tools-core/layout/internal/interconnection-view-layout-strategy.md
Expand All @@ -74,17 +50,11 @@ input-files:
- docs/design/sysml2-tools-core/layout/internal/grid-view-layout-strategy.md
- docs/design/sysml2-tools-core/layout/internal/browser-view-layout-strategy.md
- docs/design/sysml2-tools-core/layout/internal/layout-warnings.md
- docs/design/sysml2-tools-core/layout/internal/layered-placement.md
- docs/design/sysml2-tools-core/rendering.md
- docs/design/sysml2-tools-core/rendering/notation-metrics.md
- docs/design/sysml2-tools-core/rendering/theme.md
- docs/design/sysml2-tools-core/rendering/diagram-renderer.md
- docs/design/sysml2-tools-core/rendering/rendering-contracts.md
- docs/design/sysml2-tools-core/rendering/internal.md
- docs/design/sysml2-tools-core/rendering/internal/diagram-type-router.md
- docs/design/sysml2-tools-svg.md
- docs/design/sysml2-tools-svg/svg-renderer.md
- docs/design/sysml2-tools-png.md
- docs/design/sysml2-tools-png/png-renderer.md
- docs/design/sysml2-tools-tool.md
- docs/design/sysml2-tools-tool/program.md
- docs/design/sysml2-tools-tool/cli.md
Expand Down
97 changes: 31 additions & 66 deletions docs/design/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,64 +60,34 @@ system, subsystem, and unit levels:
- **StdlibGen** (Build-time tool) — console tool that parses stdlib source files and writes stdlib.bin
(build-time tooling; excluded from the software-items requirements/design/verification tree — see _Scope_)
- **Program** (Unit) — entry point: parses stdlib, runs resolution, serializes to stdlib.bin
- **DemaConsulting.SysML2Tools** (System) — core library: layout, rendering interfaces, and DiagramRenderer
- **Layout** (Subsystem) — LayoutTree intermediate representation (node types covering all SysML
diagram elements), reusable layout engines, and per-view layout strategies
- **LayoutTree** (Unit) — grouped data-model unit: the ten immutable `LayoutTree` record source
files (`LayoutTree`, `LayoutNode`, `LayoutBox`, `LayoutPort`, `LayoutLine`, `LayoutLabel`,
`LayoutBadge`, `LayoutBand`, `LayoutGrid`, `LayoutLifeline`) that form the intermediate
representation consumed by every renderer
- **Engine** (Subsystem) — reusable, model-independent geometric layout engines
- **ChannelRouter** (Unit) — orthogonal connector routing with obstacle avoidance and clearance
- **ContainmentPacker** (Unit) — packs sized boxes within a bounded container region
- **InterconnectionLayoutEngine** (Unit) — façade that assembles and runs the layered
pipeline for the interconnection view, preserving its public placement API
- **Layered** (Subsystem) — reusable, ELK-style layered layout pipeline of single-responsibility stages
- **LayeredGraph** (Unit) — mutable shared state threaded through the pipeline stages
- **LayeredLayoutPipeline** (Unit) — builds and runs an ordered sequence of layout stages
- **CycleBreaker** (Unit) — reverses back edges to produce an acyclic edge set
- **LayerAssigner** (Unit) — assigns nodes to layers by longest-path ranking
- **LongEdgeSplitter** (Unit) — inserts dummy nodes so every edge spans one layer
- **CrossingMinimizer** (Unit) — orders nodes within layers to reduce edge crossings
- **BrandesKopfPlacer** (Unit) — assigns node coordinates with the Brandes-Köpf algorithm
- **PortDistributor** (Unit) — distributes edge ports along node faces
- **OrthogonalRouter** (Unit) — routes edges as orthogonal segments between layers
- **LongEdgeJoiner** (Unit) — rejoins split sub-edges into original edge polylines
- **AxisTransform** (Unit) — maps pipeline coordinates to the requested layout direction
- **ComponentPacker** (Unit) — lays out each connected component independently and packs them without overlap
- **DemaConsulting.SysML2Tools** (System) — core library: layout strategies, rendering
orchestration, and the SysML-coupled rendering pipeline
- **Layout** (Subsystem) — maps the SysML semantic model onto the off-the-shelf `LayoutTree`
intermediate representation and delegates geometric placement and routing to the off-the-shelf
`DemaConsulting.Rendering.Layout` layered algorithm
- **Internal** (Subsystem) — per-view layout strategies
- **GeneralViewLayoutStrategy** (Unit) — general view: package-grouped definitions placed by the
layered pipeline with orthogonal specialization and membership edges
- **GeneralViewLayoutStrategy** (Unit) — general view: package-grouped definitions placed by
the layered algorithm with orthogonal specialization and membership edges
- **InterconnectionViewLayoutStrategy** (Unit) — internal structure: nested parts, ports, connectors
- **StateTransitionViewLayoutStrategy** (Unit) — state machine: states and guarded transitions
placed top-to-bottom by the layered pipeline (DOWN direction) with orthogonal transitions
placed top-to-bottom by the layered algorithm (DOWN direction) with orthogonal transitions
- **ActionFlowViewLayoutStrategy** (Unit) — action flow with start/done markers, placed
top-to-bottom by the layered pipeline (DOWN direction) with orthogonal successions
top-to-bottom by the layered algorithm (DOWN direction) with orthogonal successions
- **SequenceViewLayoutStrategy** (Unit) — lifelines and ordered messages
- **GridViewLayoutStrategy** (Unit) — specialization/relationship matrix
- **BrowserViewLayoutStrategy** (Unit) — indented membership tree
- **LayoutWarnings** (Unit) — builder for layout diagnostic warning messages
- **ConnectorLabelPlacer** (Unit) — collision-aware placement of connector midpoint labels
- **BoxMetrics** (Unit) — shared box title-area and folder-tab height formulas used by both the
layout strategies and the renderers
- **Rendering** (Subsystem) — rendering pipeline: the `IRenderer`/`ILayoutStrategy` interfaces,
`Theme`, `RenderOptions`, `RenderOutput`, the `DiagramRenderer` orchestrator, and the
`StdlibFilter` helper that excludes standard-library elements from diagrams
- **NotationMetrics** (Unit) — single home for intrinsic, theme-independent notation geometry
(end-marker, port, folder-tab, badge, and label-background metrics) shared by both renderers
- **Theme** (Unit) — immutable visual-configuration record and the built-in `Themes` provider
- **LayeredPlacement** (Unit) — thin helper that adapts the off-the-shelf
`DemaConsulting.Rendering.Layout` layered algorithm, returning placed rectangles and routed
polylines to the strategies
- **Rendering** (Subsystem) — rendering pipeline: consumes the off-the-shelf `IRenderer`, `Theme`,
`RenderOptions`, and `RenderOutput` contracts from `DemaConsulting.Rendering.Abstractions` and
retains the SysML-coupled `ILayoutStrategy`/`ViewContext` contract, the `DiagramRenderer`
orchestrator, and the `StdlibFilter` helper that excludes standard-library elements from diagrams
- **DiagramRenderer** (Unit) — high-level rendering orchestrator: for each view, builds a
`LayoutTree` via an `ILayoutStrategy` and renders it via an `IRenderer`
- **RenderingContracts** (Unit) — grouped contracts unit: the `IRenderer` and `ILayoutStrategy`
interfaces, the `RenderOptions` and `RenderOutput` records, and the `StdlibFilter` helper
- **Internal** (Subsystem) — internal rendering implementation
- **DiagramTypeRouter** (Unit) — selects a layout strategy from a view's resolved kind
- **DemaConsulting.SysML2Tools.Svg** (System) — SVG renderer: renders `LayoutTree` to
SVG output with zero external dependencies
- **SvgRenderer** (Unit) — translates a `LayoutTree` to a self-contained SVG 1.1 document
- **DemaConsulting.SysML2Tools.Png** (System) — PNG renderer: renders `LayoutTree` to
PNG output using SkiaSharp
- **PngRenderer** (Unit) — rasterizes a `LayoutTree` to a PNG image using SkiaSharp
- **DemaConsulting.SysML2Tools.Tool** (System) — dotnet tool: thin CLI wrapper and
orchestration
- **Program** (Unit) — entry point and execution orchestrator
Expand All @@ -136,6 +106,8 @@ system, subsystem, and unit levels:

- ANTLR4 (OTS) — ANTLR4 runtime (Antlr4.Runtime.Standard)
- BuildMark (OTS) — build-notes documentation tool
- DemaConsulting.Rendering (OTS) — SysML-agnostic layout intermediate representation, layered
layout algorithm, and SVG/PNG renderers
- FileAssert (OTS) — document assertion tool
- Pandoc (OTS) — Markdown-to-HTML conversion tool
- ReqStream (OTS) — requirements traceability tool
Expand Down Expand Up @@ -165,11 +137,9 @@ reviewers an explicit navigation aid from design to code:
- **DemaConsulting.SysML2Tools.Stdlib/** — stdlib library
- **Stdlib/** — SysML v2 standard library source files (EPL-2.0; see Stdlib/README.md)
- **DemaConsulting.SysML2Tools.Core/** — core library
- **Layout/** — LayoutTree intermediate representation
- **Internal/** — internal layout implementation (GeneralViewLayoutStrategy)
- **Rendering/** — rendering interfaces and theme
- **DemaConsulting.SysML2Tools.Svg/** — SVG renderer
- **DemaConsulting.SysML2Tools.Png/** — PNG renderer
- **Layout/** — layout strategies mapping the model to the off-the-shelf `LayoutTree`
- **Internal/** — per-view layout strategies and the `LayeredPlacement` helper
- **Rendering/** — SysML-coupled rendering pipeline (`ILayoutStrategy`, `DiagramRenderer`)
- **DemaConsulting.SysML2Tools.Tool/** — dotnet tool CLI wrapper
- **Cli/** — command-line interface subsystem
- **Lint/** — lint command subsystem
Expand All @@ -180,8 +150,6 @@ reviewers an explicit navigation aid from design to code:
- **sysml2-tools-language.md** — language library design
- **sysml2-tools-stdlib.md** — stdlib library design
- **sysml2-tools-core/** — core library unit/subsystem design
- **sysml2-tools-svg.md** — SVG renderer design
- **sysml2-tools-png.md** — PNG renderer design
- **sysml2-tools-tool/** — DemaConsulting.SysML2Tools.Tool unit/subsystem design
- **cli/** — Cli subsystem design
- **lint/** — Lint subsystem design
Expand Down Expand Up @@ -216,8 +184,6 @@ The four top-level systems map to these kebab-case folder names:
| `DemaConsulting.SysML2Tools.Language` | `sysml2-tools-language` |
| `DemaConsulting.SysML2Tools.Stdlib` | `sysml2-tools-stdlib` |
| `DemaConsulting.SysML2Tools` | `sysml2-tools-core` |
| `DemaConsulting.SysML2Tools.Svg` | `sysml2-tools-svg` |
| `DemaConsulting.SysML2Tools.Png` | `sysml2-tools-png` |
| `DemaConsulting.SysML2Tools.Tool` | `sysml2-tools-tool` |

OTS items have integration/usage design documentation parallel to system folders:
Expand All @@ -240,9 +206,9 @@ Review-sets: defined in `.reviewmark.yaml`
| Test results output | `DemaConsulting.TestResults` | — |
| Unit testing | xUnit v3 | Apache 2.0 |

No ImageSharp dependency. SkiaSharp is chosen over ImageSharp to avoid the Six Labors
Split License, which would impose licensing obligations on library consumers embedding
`DemaConsulting.SysML2Tools.Png` in commercial products.
No ImageSharp dependency. The off-the-shelf `DemaConsulting.Rendering.Skia` PNG renderer uses
SkiaSharp, chosen over ImageSharp to avoid the Six Labors Split License, which would impose
licensing obligations on library consumers embedding the renderer in commercial products.

## Architectural Decisions

Expand Down Expand Up @@ -283,12 +249,11 @@ to handle custom viewpoints that specialize stdlib viewpoints.
human-readable message. The `lint` command makes this output useful for AI-assisted
model authoring loops.

**Layout engines are independent and reusable.** Non-trivial layout algorithms
(`ContainmentPacker`, `ChannelRouter`, `InterconnectionLayoutEngine`, and the
reusable `LayeredLayoutPipeline` and its stages) live in `Layout/Engine/` with no
dependency on the SysML semantic model. Each engine accepts plain geometric input
and returns computed geometry, making them independently testable and reusable across
multiple view strategies. See `ROADMAP.md` for the phased introduction of each engine.
**Geometric layout is off-the-shelf.** Non-trivial geometric layout algorithms (containment
packing, orthogonal connector routing, and the layered layout algorithm) are provided by the
off-the-shelf `DemaConsulting.Rendering.Layout` package with no dependency on the SysML semantic
model. The `LayeredPlacement` helper adapts that algorithm for the view strategies, accepting
plain geometric input and returning computed geometry.

**Theme record is a compile-time constant in v1.** Loadable theme files are deferred
to v2. The Theme record data structure is defined in v1 so that v2 loadable themes
Expand All @@ -310,8 +275,8 @@ tests the integrated tool, not just unit-level components.
SARIF output can be added as a formatting option on the existing infrastructure
without any breaking changes.

**SkiaSharp native assets for library consumers.** Consumers referencing
`DemaConsulting.SysML2Tools.Png` must ensure the appropriate
**SkiaSharp native assets for library consumers.** Consumers referencing the off-the-shelf
`DemaConsulting.Rendering.Skia` PNG renderer must ensure the appropriate
`SkiaSharp.NativeAssets.*` package is included in their publish output. This must
be documented clearly in the package README.

Expand Down
20 changes: 12 additions & 8 deletions docs/design/sysml2-tools-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ for SysML v2 diagram generation. It depends on `DemaConsulting.SysML2Tools.Langu
parsing and semantic analysis, and on `DemaConsulting.SysML2Tools.Stdlib` for the pre-compiled
standard library.

Phase 3 introduces two subsystems: **Layout** and **Rendering**. The Layout subsystem defines
the `LayoutTree` intermediate representation consumed by renderers — nine immutable node record
types covering all SysML diagram elements. The Rendering subsystem defines the interfaces and
data types that form the rendering pipeline: `IRenderer`, `ILayoutStrategy`, `Theme`,
`RenderOptions`, `RenderOutput`, and `DiagramRenderer`.
The core library provides two subsystems: **Layout** and **Rendering**. The Layout subsystem
maps the SysML semantic model onto the `LayoutTree` intermediate representation — nine immutable
node record types covering all SysML diagram elements — which is provided off-the-shelf by the
`DemaConsulting.Rendering` package, and delegates geometric placement and routing to the
off-the-shelf `DemaConsulting.Rendering.Layout` layered algorithm. The Rendering subsystem
consumes the off-the-shelf rendering contracts (`IRenderer`, `Theme`, `RenderOptions`,
`RenderOutput`) from the `DemaConsulting.Rendering.Abstractions` package and retains the
SysML-coupled `ILayoutStrategy` and `DiagramRenderer` that drive the pipeline.

```mermaid
flowchart TD
Expand Down Expand Up @@ -88,9 +91,10 @@ N/A — not a safety-classified software item.
`RenderOptions`. For each view declared in the workspace it constructs a `ViewContext`
containing the view name and workspace reference.
2. `ILayoutStrategy.BuildLayout` is called with the `ViewContext` and `RenderOptions`. The
Layout subsystem produces a fully resolved `LayoutTree` via its layered layout pipeline,
placing every node at absolute coordinates and routing every connector as an orthogonal
polyline. The Rendering subsystem then renders that tree.
Layout subsystem produces a fully resolved `LayoutTree` by delegating geometric placement and
routing to the off-the-shelf `DemaConsulting.Rendering.Layout` layered algorithm (through the
`LayeredPlacement` helper), placing every node at absolute coordinates and routing every
connector as an orthogonal polyline. The Rendering subsystem then renders that tree.
3. `IRenderer.Render` is called with the `LayoutTree`, `RenderOptions`, and a fresh output
`Stream`. The renderer reads each `LayoutNode` in the tree, translates it to output-format
primitives, and writes bytes to the stream.
Expand Down
Loading
Loading