# MermaidC4Document

Describes a parsed Mermaid C4 diagram. Review signatures, members, parameters, type relationships, and available reference details in ChartForgeX API reference.

 Class  

`ChartForgeX.Mermaid`

**Namespace**

`ChartForgeX.Mermaid`

**Assembly**

`ChartForgeX.Mermaid`

**Source**

[MermaidC4Document.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Document.cs#L11)

**Base**

`MermaidDocument`

**Modifiers**

sealed

Describes a parsed Mermaid C4 diagram.

## Inheritance

- [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)
- MermaidC4Document

## Usage

 Explore 9 API references to this type 

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Method [MermaidParser.ParseC4](/api/chartforgex-mermaid-mermaidparser/#method-parsec4-string)

### Accepted by parameters 8

- Extension method [MermaidC4Document.ToPng](/api/chartforgex-mermaid-mermaidc4document/#extension-topng-chartforgex-mermaid-mermaidc4document-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Extension method [MermaidC4Document.ToSvg](/api/chartforgex-mermaid-mermaidc4document/#extension-tosvg-chartforgex-mermaid-mermaidc4document-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Extension method [MermaidC4Document.ToTopologyChart](/api/chartforgex-mermaid-mermaidc4document/#extension-totopologychart-chartforgex-mermaid-mermaidc4document-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Extension method [MermaidC4Document.ToVisualArtifact](/api/chartforgex-mermaid-mermaidc4document/#extension-tovisualartifact-chartforgex-mermaid-mermaidc4document-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Method [MermaidC4Rendering.ToPng](/api/chartforgex-mermaid-mermaidc4rendering/#method-topng-chartforgex-mermaid-mermaidc4document-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Method [MermaidC4Rendering.ToSvg](/api/chartforgex-mermaid-mermaidc4rendering/#method-tosvg-chartforgex-mermaid-mermaidc4document-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Method [MermaidC4Rendering.ToTopologyChart](/api/chartforgex-mermaid-mermaidc4rendering/#method-totopologychart-chartforgex-mermaid-mermaidc4document-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Method [MermaidC4Rendering.ToVisualArtifact](/api/chartforgex-mermaid-mermaidc4rendering/#method-tovisualartifact-chartforgex-mermaid-mermaidc4document-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`

 Filter members   

    Show inherited   

 

## Constructors

 `public MermaidC4Document()` [#](#constructor-ctor) 

[MermaidC4Document.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Document.cs#L11)

## Inherited Methods

 `public virtual bool Equals(object? obj)` [#](#method-equals-object) 

Inherited from object

Parameters

**obj object? required**

Returns

 `bool` 

 `public virtual int GetHashCode()` [#](#method-gethashcode) 

Inherited from object

Returns

 `int` 

 `public Type GetType()` [#](#method-gettype) 

Inherited from object

Returns

 `Type` 

 `public virtual string? ToString()` [#](#method-tostring) 

Inherited from object

Returns

 `string?` 

## Properties

 `public string DiagramType { get; set; }` [#](#property-diagramtype) 

[MermaidC4Document.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Document.cs#L11)

Gets or sets the concrete C4 header token such as C4Context.

 `public string? Title { get; set; }` [#](#property-title) 

[MermaidC4Document.cs:14](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Document.cs#L14)

Gets or sets the optional Mermaid title statement.

 `public string? Direction { get; set; }` [#](#property-direction) 

[MermaidC4Document.cs:17](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Document.cs#L17)

Gets or sets an optional Mermaid direction statement.

 `public List<MermaidRawStatement> Statements { get; }` [#](#property-statements) 

[MermaidC4Document.cs:20](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Document.cs#L20)

Gets raw C4 statements retained with source spans.

 `public List<MermaidC4Boundary> Boundaries { get; }` [#](#property-boundaries) 

[MermaidC4Document.cs:23](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Document.cs#L23)

Gets parsed C4 boundaries and deployment nodes in source order.

 `public List<MermaidC4Element> Elements { get; }` [#](#property-elements) 

[MermaidC4Document.cs:26](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Document.cs#L26)

Gets parsed C4 elements in source order.

 `public List<MermaidC4Relationship> Relationships { get; }` [#](#property-relationships) 

[MermaidC4Document.cs:29](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Document.cs#L29)

Gets parsed C4 relationships in source order.

 `public List<MermaidStyleDefinition> ElementStyles { get; }` [#](#property-elementstyles) 

[MermaidC4Document.cs:32](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Document.cs#L32)

Gets supported element style updates in authored order.

 `public List<MermaidC4RelationshipStyle> RelationshipStyles { get; }` [#](#property-relationshipstyles) 

[MermaidC4Document.cs:35](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Document.cs#L35)

Gets supported relationship style updates in authored order.

 `public List<MermaidRawStatement> RetainedStatements { get; }` [#](#property-retainedstatements) 

[MermaidC4Document.cs:38](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Document.cs#L38)

Gets retained C4 statements whose semantics are not rendered exactly yet.

 `public int? MaximumShapesPerRow { get; set; }` [#](#property-maximumshapesperrow) 

[MermaidC4Document.Layout.cs:9](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Document.Layout.cs#L9)

Gets or sets an authored UpdateLayoutConfig shape-row limit; null keeps the native default layout.

 `public int? MaximumBoundariesPerRow { get; set; }` [#](#property-maximumboundariesperrow) 

[MermaidC4Document.Layout.cs:14](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Document.Layout.cs#L14)

Gets or sets an authored UpdateLayoutConfig boundary-row limit; null keeps the native default layout.

## Inherited Properties

 `public MermaidDiagramKind Kind { get; set; }` [#](#property-kind) 

[MermaidDocument.cs:91](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L91)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public bool IsDiagnosticOnly { get; }` [#](#property-isdiagnosticonly) 

[MermaidDocument.cs:94](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L94)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public string SourceText { get; set; }` [#](#property-sourcetext) 

[MermaidDocument.cs:97](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L97)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public MermaidSourceSpan HeaderSpan { get; set; }` [#](#property-headerspan) 

[MermaidDocument.cs:100](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L100)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public string Header { get; set; }` [#](#property-header) 

[MermaidDocument.cs:103](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L103)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public string? FrontMatter { get; set; }` [#](#property-frontmatter) 

[MermaidDocument.cs:106](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L106)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public VisualAccessibility Accessibility { get; }` [#](#property-accessibility) 

[MermaidDocument.cs:109](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L109)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public string? Theme { get; set; }` [#](#property-theme) 

[MermaidDocument.cs:112](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L112)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public MermaidSourceConfiguration Configuration { get; internal set; }` [#](#property-configuration) 

[MermaidDocument.cs:115](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L115)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public List<MermaidDirective> Directives { get; }` [#](#property-directives) 

[MermaidDocument.cs:118](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L118)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

 `public List<MermaidRawStatement> RawStatements { get; }` [#](#property-rawstatements) 

[MermaidDocument.cs:121](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidDocument.cs#L121)

Inherited from [MermaidDocument](/api/chartforgex-mermaid-mermaiddocument/)

## Extension Methods

 `public static byte[] ToPng(MermaidC4Document document, MermaidTopologyRenderOptions? options = null)` [#](#extension-topng-chartforgex-mermaid-mermaidc4document-chartforgex-mermaid-mermaidtopologyrenderoptions) 

[MermaidC4Rendering.cs:115](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Rendering.cs#L115)

Renders a Mermaid C4 document to static PNG.

Parameters

**document ChartForgeX.Mermaid.MermaidC4Document required**

**options ChartForgeX.Mermaid.MermaidTopologyRenderOptions? = null optional**

Returns

 `byte[]` 

 `public static string ToSvg(MermaidC4Document document, MermaidTopologyRenderOptions? options = null)` [#](#extension-tosvg-chartforgex-mermaid-mermaidc4document-chartforgex-mermaid-mermaidtopologyrenderoptions) 

[MermaidC4Rendering.cs:112](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Rendering.cs#L112)

Renders a Mermaid C4 document to static SVG.

Parameters

**document ChartForgeX.Mermaid.MermaidC4Document required**

**options ChartForgeX.Mermaid.MermaidTopologyRenderOptions? = null optional**

Returns

 `string` 

 `public static TopologyChart ToTopologyChart(MermaidC4Document document, MermaidTopologyRenderOptions? options = null)` [#](#extension-totopologychart-chartforgex-mermaid-mermaidc4document-chartforgex-mermaid-mermaidtopologyrenderoptions) 

[MermaidC4Rendering.cs:17](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Rendering.cs#L17)

Converts a Mermaid C4 document into a renderer-independent ChartForgeX topology chart.

Parameters

**document ChartForgeX.Mermaid.MermaidC4Document required**

**options ChartForgeX.Mermaid.MermaidTopologyRenderOptions? = null optional**

Returns

 `TopologyChart` 

 `public static VisualArtifact ToVisualArtifact(MermaidC4Document document, MermaidTopologyRenderOptions? options = null)` [#](#extension-tovisualartifact-chartforgex-mermaid-mermaidc4document-chartforgex-mermaid-mermaidtopologyrenderoptions) 

[MermaidC4Rendering.cs:95](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidC4Rendering.cs#L95)

Wraps a Mermaid C4 document in a visual artifact envelope backed by a ChartForgeX topology chart.

Parameters

**document ChartForgeX.Mermaid.MermaidC4Document required**

**options ChartForgeX.Mermaid.MermaidTopologyRenderOptions? = null optional**

Returns

 `VisualArtifact` 

<!-- PowerForge markdown artifact sha256:2512BF623B862828AF5639A1F625870553DC9248AA742DFC51DFF7374898FDF5 -->
