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
37 changes: 37 additions & 0 deletions .cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,42 @@ words:
- weasyprint
- netstandard
- yamlfix
# Rendering library technical terms and referenced code identifiers
- Skia
- SkiaSharp
- Noto
- webp
- rasterizer
- rasterizes
- Sugiyama
- Brandes
- Kopf
- Hanan
- Precomputes
- subfolders
- Rects
- Premul
- dasharray
- RRGGBB
- RRGGBBAA
- vdir
- hdir
- posis
- longedge
- selfloop
- edgerouting
- hierarchyhandling
- facade
- browsable
# Non-ASCII terms retained verbatim in extracted source comments
- façade
- Köpf
# DEMA documentation spelling conventions (shared with sibling repositories)
- behaviour
- colour
- colours
- initialised
- optimised

# Exclude common build artifacts, dependencies, and vendored third-party code
ignorePaths:
Expand All @@ -44,6 +80,7 @@ ignorePaths:
- "**/third-party/**"
- "**/3rd-party/**"
- "**/generated/**"
- "src/*/api/**"
- "**/AGENT_REPORT_*.md"
- "**/.agent-logs/**"
- "**/bin/**"
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ __pycache__/
# Generated documentation
**/generated/

# ApiMark-generated API reference (one api/ folder per library project)
src/*/api/

# Test results
TestResults/
*.trx
Expand Down
1 change: 1 addition & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ ignores:
- "**/third-party/**"
- "**/3rd-party/**"
- "**/generated/**"
- "src/*/api/**"
- "**/AGENT_REPORT_*.md"
- "**/.agent-logs/**"
410 changes: 391 additions & 19 deletions .reviewmark.yaml

Large diffs are not rendered by default.

91 changes: 61 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,81 @@
[![Security][badge-security]][link-security]
[![NuGet][badge-nuget]][link-nuget]

DEMA Consulting rendering library.
General-purpose diagram layout and rendering for .NET. Describe a diagram as a graph, lay it out
with a pluggable algorithm, and render it to SVG, PNG, JPEG, or WEBP. The design is inspired by the
[Eclipse Layout Kernel (ELK)][link-elk]: layout and rendering are configured through an open,
extensible property system, and new algorithms, renderers, and options are added additively.

## Features
## Packages

This template demonstrates:
The library is split into focused packages so consumers take only what they need:

- **Simple Library Structure**: Demo class with example methods
- **Multi-Platform Support**: Builds and runs on Windows, Linux, and macOS
- **Multi-Runtime Support**: Targets .NET Standard 2.0, .NET 8, 9, and 10
- **xUnit v3**: Modern unit testing with xUnit framework version 3
- **Comprehensive CI/CD**: GitHub Actions workflows with quality checks and builds
- **Linting Enforcement**: markdownlint, cspell, and yamllint enforced on every CI run
- **Continuous Compliance**: Compliance evidence generated automatically on every CI run, following
the [Continuous Compliance][link-continuous-compliance] methodology
- **SonarCloud Integration**: Quality gate and security analysis on every build
- **Documentation Generation**: Automated build notes, user guide, code quality reports,
requirements, justifications, and trace matrix
- **Requirements Traceability**: Requirements linked to passing tests with auto-generated trace matrix
| Package | Purpose |
| --- | --- |
| `DemaConsulting.Rendering` | Layout model: the `LayoutTree` IR, the property system, and the input `LayoutGraph` |
| `DemaConsulting.Rendering.Abstractions` | SPI: `ILayoutAlgorithm`/`IRenderer`, registries, `Theme`, notation metrics |
| `DemaConsulting.Rendering.Layout` | Layout algorithms: the layered pipeline and `LayeredLayoutAlgorithm` |
| `DemaConsulting.Rendering.Svg` | SVG renderer with zero external dependencies |
| `DemaConsulting.Rendering.Skia` | SkiaSharp raster renderers (PNG, JPEG, WEBP) with an embedded Noto Sans font |

## Installation
Package dependencies form an acyclic graph: `Abstractions` and `Layout` depend on the model;
`Svg` and `Skia` depend on the model and `Abstractions`; the model depends on nothing.

Install the library using the .NET CLI:
## Installation

```bash
dotnet add package DemaConsulting.Rendering
dotnet add package DemaConsulting.Rendering.Layout
dotnet add package DemaConsulting.Rendering.Svg
```

## Usage

```csharp
using System.IO;
using DemaConsulting.Rendering;

var demo = new Demo();
var result = demo.DemoMethod("World"); // result = "Hello, World!"
using DemaConsulting.Rendering.Abstractions;
using DemaConsulting.Rendering.Layout;
using DemaConsulting.Rendering.Svg;

// Describe the diagram as a graph of sized boxes and directed edges.
var graph = new LayoutGraph();
var a = graph.AddNode("a", width: 80, height: 40);
var b = graph.AddNode("b", width: 80, height: 40);
graph.AddEdge("a-b", a, b);

// Lay it out, then render the placed tree to SVG.
var tree = new LayeredLayoutAlgorithm().Apply(graph, new LayoutOptions());
using var output = File.Create("diagram.svg");
new SvgRenderer().Render(tree, new RenderOptions(Themes.Light), output);
```

## Documentation
See the [user guide][link-user-guide] for configuration options and extension points.

## API Reference

Every package ships its full API reference as compact, AI-friendly Markdown in an `api/` folder
inside the NuGet package, generated from the XML documentation comments by ApiMark. Start at
`api/api.md` (the index) and drill into the per-namespace and per-type pages for signatures,
remarks, and usage examples.

Generated documentation includes:
## Gallery

A [rendering gallery][link-gallery] showcases what the library can produce — every bundled layout
algorithm, orthogonal edge routing, all three themes, and both the SVG and PNG output paths. Each
image is generated by the gallery test project directly from the public API, so the gallery doubles
as an end-to-end rendering smoke test. Regenerate it with `./gallery.ps1`.

## Extensibility

- **New layout algorithms** implement `ILayoutAlgorithm` and register under a new id.
- **New output formats** implement `IRenderer` with a distinct media type.
- **New configuration options** are declared as typed `LayoutProperty<T>` keys carried in an open
property bag, so adding an option never changes an existing method signature.

## Documentation

- **Build Notes**: Release information and changes
- **User Guide**: Comprehensive usage documentation
- **Code Quality Report**: CodeQL and SonarCloud analysis results
- **Requirements**: Functional and non-functional requirements
- **Requirements Justifications**: Detailed requirement rationale
- **Trace Matrix**: Requirements to test traceability
Generated documentation includes build notes, a user guide, a code quality report, requirements,
requirement justifications, and a requirements-to-test trace matrix.

## Contributing

Expand Down Expand Up @@ -86,5 +115,7 @@ By contributing to this project, you agree that your contributions will be licen
[link-quality]: https://sonarcloud.io/dashboard?id=demaconsulting_Rendering
[link-security]: https://sonarcloud.io/dashboard?id=demaconsulting_Rendering
[link-nuget]: https://www.nuget.org/packages/DemaConsulting.Rendering
[link-continuous-compliance]: https://github.com/demaconsulting/ContinuousCompliance
[link-elk]: https://eclipse.dev/elk/
[link-gallery]: https://github.com/demaconsulting/Rendering/blob/main/docs/gallery/gallery.md
[link-user-guide]: https://github.com/demaconsulting/Rendering/blob/main/docs/user_guide/introduction.md
[link-contributing]: https://github.com/demaconsulting/Rendering/blob/main/CONTRIBUTING.md
9 changes: 9 additions & 0 deletions Rendering.slnx
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
<Solution>
<Folder Name="/src/">
<Project Path="src/DemaConsulting.Rendering/DemaConsulting.Rendering.csproj" />
<Project Path="src/DemaConsulting.Rendering.Abstractions/DemaConsulting.Rendering.Abstractions.csproj" />
<Project Path="src/DemaConsulting.Rendering.Layout/DemaConsulting.Rendering.Layout.csproj" />
<Project Path="src/DemaConsulting.Rendering.Svg/DemaConsulting.Rendering.Svg.csproj" />
<Project Path="src/DemaConsulting.Rendering.Skia/DemaConsulting.Rendering.Skia.csproj" />
</Folder>
<Folder Name="/test/">
<Project Path="test/DemaConsulting.Rendering.Tests/DemaConsulting.Rendering.Tests.csproj" />
<Project Path="test/DemaConsulting.Rendering.Abstractions.Tests/DemaConsulting.Rendering.Abstractions.Tests.csproj" />
<Project Path="test/DemaConsulting.Rendering.Layout.Tests/DemaConsulting.Rendering.Layout.Tests.csproj" />
<Project Path="test/DemaConsulting.Rendering.Svg.Tests/DemaConsulting.Rendering.Svg.Tests.csproj" />
<Project Path="test/DemaConsulting.Rendering.Skia.Tests/DemaConsulting.Rendering.Skia.Tests.csproj" />
<Project Path="test/DemaConsulting.Rendering.Gallery/DemaConsulting.Rendering.Gallery.csproj" />
</Folder>
</Solution>
5 changes: 4 additions & 1 deletion docs/design/definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ input-files:
- docs/design/title.txt
- docs/design/introduction.md
- docs/design/rendering/rendering.md
- docs/design/rendering/demo.md
- docs/design/rendering-abstractions/rendering-abstractions.md
- docs/design/rendering-layout/rendering-layout.md
- docs/design/rendering-svg/rendering-svg.md
- docs/design/rendering-skia/rendering-skia.md
template: template.html
table-of-contents: true
number-sections: true
Loading
Loading