Extract and generalize rendering library with ELK-style API#3
Merged
Conversation
Fork the SysML-agnostic layout and rendering code out of SysML2Tools into five packages: Rendering (LayoutTree IR + open property system + input LayoutGraph), Rendering.Abstractions (ILayoutAlgorithm/IRenderer contracts, registries, theme, metrics), Rendering.Layout (layered pipeline engines + LayeredLayoutAlgorithm), Rendering.Svg and Rendering.Png renderers. Adds an ELK-inspired open, property-based SPI (LayoutProperty/IPropertyHolder/ LayoutOptions, CoreOptions catalog) and pluggable algorithm/renderer registries so new diagram types and output formats are additive. Builds green and all 16 tests pass across net8.0/net9.0/net10.0, proving graph -> layered layout -> SVG/PNG. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port 27 SysML-free test files (engine, layered pipeline, IR records, shared metrics, and SVG/PNG renderers) from SysML2Tools with the same namespace remap. SysML-coupled tests (view strategies, semantic/stdlib integration) are excluded. 189 tests per target framework pass across net8.0/net9.0/net10.0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rename the Png package to DemaConsulting.Rendering.Skia and refactor it into a shared SkiaRasterRenderer base with concrete PngRenderer, JpegRenderer, and WebpRenderer format renderers. Extend IRenderer with the file extensions it produces and add extension-based registration/resolution (ResolveByExtension) to RendererRegistry. Add full Continuous Compliance artifacts for all five systems: reqstream requirements (system + unit, traced to real tests), design documents, and verification documents, plus rewritten design/verification introductions, README, user guide, requirements.yaml, platform requirements, and .reviewmark.yaml review-sets. lint.ps1 passes (reqstream, reviewmark, versionmark, yamllint, cspell, markdownlint, dotnet format) and all tests pass across net8.0/net9.0/net10.0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Expose the reusable engine tier and a recursive, ELK-style layout model so any tool can compose diagrams: - Public geometry (Rect), EdgeRouting enum + CoreOptions.EdgeRouting, ConnectorRouter, ContainmentLayout. - Recursive input model (LayoutGraphNode.Children) + HierarchicalLayoutAlgorithm (per-node algorithm, hierarchy handling, LCA cross-container routing) with byte-identical flat-graph output. - Bundled ContainmentLayoutAlgorithm; LayoutEngine happy-path facade + default registry. - Renamed ChannelRouter->OrthogonalEdgeRouter and the layered OrthogonalRouter->LayeredCorridorRouter. - Fixed cross-container anchor selection (FacingAnchors) so connectors don't cross wide boxes. - Full compliance artifacts (reqstream/design/verification/reviewmark), user guide, ApiMark XmlDoc + NamespaceDoc carriers (ApiMark 0.4.9, ApiMarkPackDocs), and a docs/gallery showcase (build via gallery.ps1). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… API Resolve KeyNotFoundException when the 'hierarchical' algorithm id (the documented default) is selected explicitly: HierarchicalLayoutAlgorithm now degrades its own id to the default leaf algorithm (layered) in ResolveScopeAlgorithm instead of a self-referential registry lookup. Adds regression tests for explicit options, container-node, and graph-root selection. Expose LayoutGraph.Nodes/Edges as read-only IReadOnlyList<T> views so callers cannot bypass AddNode/AddEdge and break per-container id-uniqueness. Adds Point2D/Rect construction tests to close a model geometry verification gap. Both fixes were surfaced by the P10 formal reviews. Layout 159 and model 42 tests pass; byte-for-byte layout oracle intact. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Split each system's monolithic requirements, design, and verification documents into a slim system-level file plus per-unit files (and a per-subsystem file for the Layout Engine subsystem), per the software-items and reviewmark-usage standards, so a system-level review excludes unit detail and each unit review carries only its own slice. Also folds in P10 formal-review doc fixes: adds a Rendering-Model-LayoutTree Geometry requirement covering Point2D/Rect; corrects the design intro's shipped algorithm list and Layout structure tree; expands the Svg compound requirements into single-criterion requirements; aligns the Skia design/verification to the theme-background contract; documents the LayoutGraph read-only invariant; and removes a relative gallery link from the user guide. reqstream --lint passes across all five split systems. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the five monolithic per-system review-sets with the full hierarchy mandated by the reviewmark-usage and software-items standards: a repo Purpose set, per-system Architecture/Design/AllRequirements sets, the Layout Engine subsystem set, and one unit set per functional unit (25 units) that carries the only source in the hierarchy. Data-only records are folded into their owning functional unit (e.g. Point2D/Rect into layout-tree). Fixes the kebab-case 'rendering-skia' id to 'Rendering-Skia'. reviewmark --lint passes and reviewmark --plan --enforce reports full coverage (no uncovered files). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply fix.ps1 line-ending normalization to the recreated system requirement files and reword a cspell-flagged term in the SvgRenderer verification doc so lint.ps1 passes cleanly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Skia: replace PngRenderer_Render_BackgroundIsWhite with a theme-parameterized PngRenderer_Render_BackgroundIsThemeBackground theory over Light and Dark themes, asserting the canvas fill equals RenderOptions.Theme.BackgroundColor (the dark theme, whose background is not white, proves the fill is theme-driven). - Svg: strengthen the diamond/crossbar marker tests to assert the connector path references the marker (marker-start/marker-end url) instead of merely that the id appears in <defs>, preventing a false pass. - Abstractions: add explicit Arrange/Act/Assert comments to the Registry, ConnectorLabelPlacer, and Theme tests. - Platform requirements: trace each platform/runtime requirement to representative tests spanning the model, layout, and SVG-render layers so a matrix run proves the stack builds and runs, not just that one type loads. Updated the corresponding verification/requirements docs. build.ps1 and lint.ps1 pass across net8.0/net9.0/net10.0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Formal reviews (gpt-5.4-mini) over the restructured branch surfaced standards and coverage issues; the built-in code-review found no code defects. Fixes: - Docs: remove all 153 relative/anchor markdown cross-doc links across the split design/verification docs (the technical-documentation standard forbids them as they break PDF compilation) in favor of verbal cross-references. - LayoutGraph: back Nodes/Edges with cached ReadOnlyCollection<T> views so the read-only contract cannot be bypassed by downcasting. - Split the compound HierarchicalLayoutAlgorithm null-validation requirement into three single-criterion requirements (graph/options/registry) across its requirements, design, and verification docs. - Refresh stale Layout overview text (design introduction bullet + companion artifact structure + rendering-layout.yaml header) to reflect the per-unit split and the full bundled algorithm set. - Close coverage gaps: add scoped edge-id-reuse and sibling-container cross-edge tests (LayoutGraph) and a swim-lane band render test (Skia), wired into their requirements and verification coverage. build.ps1 and lint.ps1 green across net8.0/9.0/10.0; reqstream --lint and reviewmark --lint/--plan --enforce all pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The gallery is viewed on GitHub in dark mode, where transparent-canvas SVGs only read well when their elements suit a dark background. Render the layout-algorithm and edge-routing diagrams (and their raster PNG twins) with the dark theme so they display cleanly, and render the three theme-showcase images through the raster PNG path instead of SVG so each carries a solid theme background. Removes the stale theme-*.svg files and regenerates docs/gallery and gallery.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CI failed: Rendering-OTS-xUnit-Execute/Report were unsatisfied because the template-scaffolded xunit.yaml still pointed at a demo project's Demo_* tests that do not exist in this repository. Unlike the DemaConsulting tool OTS items (satisfied by each tool's self-validation TRX), xUnit is the test framework itself, so its requirements must trace to this repo's own tests. Re-point both requirements (and their verification scenarios) at a stable sample of real tests spanning the model, layout, and renderer projects. Also replace the un-customized 'Template-' scaffolding prefix on every OTS requirement id with the repository's 'Rendering-' convention (Template-OTS-* -> Rendering-OTS-*) across the OTS requirements and verification docs. Verified locally: reqstream trace against the repo test TRX now satisfies both xUnit requirements; only the tool OTS items remain (satisfied in CI by their self-validation TRX). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The containment showcase used eight identical 120px boxes; the algorithm's 4:3-area wrap-width heuristic (~253px) is just under two such boxes plus the gap, so it stacked them into a single column that read as a plain list. Replace the input with a dozen varied-width peer boxes so the shelf-packer visibly wraps them into a compact multi-row block, clearly distinguishing containment packing from the layered algorithm's connectivity-driven layers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request restructures the Rendering library into a modular, multi-package architecture, updates documentation to reflect the new structure and usage, and improves developer tooling and spelling/linting rules. The most important changes are:
Library Architecture and Solution Structure
Rendering.slnx) now includes five core packages:DemaConsulting.Rendering,DemaConsulting.Rendering.Abstractions,DemaConsulting.Rendering.Layout,DemaConsulting.Rendering.Svg, andDemaConsulting.Rendering.Skia, along with corresponding test projects and a gallery project.Documentation Updates
README.mdis rewritten to describe the new package structure, installation, usage, extensibility, and documentation approach, with added links to the user guide and gallery. [1] [2]docs/design/introduction.md) is overhauled to document the new multi-system architecture, the separation of concerns, and the mapping between code, requirements, and documentation artifacts. [1] [2]BoxMetricsunit is added underrendering-abstractions, specifying its responsibilities and API.Developer Tooling and Linting
.cspell.yaml) is expanded with technical terms and code identifiers relevant to the new rendering packages, and the spelling/linting ignore paths are updated to exclude generated API documentation folders. [1] [2] [3]These changes modularize the library for better maintainability and extensibility, clarify its architecture, and improve the developer experience.