# MermaidStateDocument

Describes a parsed Mermaid state diagram.

 Class  

`ChartForgeX.Mermaid`

**Namespace**

`ChartForgeX.Mermaid`

**Assembly**

`ChartForgeX.Mermaid`

**Source**

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

**Base**

`MermaidDocument`

**Modifiers**

sealed

Describes a parsed Mermaid state diagram.

## Inheritance

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

## 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.ParseState](/api/chartforgex-mermaid-mermaidparser/#method-parsestate-string)

### Accepted by parameters 8

- Extension method [MermaidStateDocument.ToPng](/api/chartforgex-mermaid-mermaidstatedocument/#extension-topng-chartforgex-mermaid-mermaidstatedocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Extension method [MermaidStateDocument.ToSvg](/api/chartforgex-mermaid-mermaidstatedocument/#extension-tosvg-chartforgex-mermaid-mermaidstatedocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Extension method [MermaidStateDocument.ToTopologyChart](/api/chartforgex-mermaid-mermaidstatedocument/#extension-totopologychart-chartforgex-mermaid-mermaidstatedocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Extension method [MermaidStateDocument.ToVisualArtifact](/api/chartforgex-mermaid-mermaidstatedocument/#extension-tovisualartifact-chartforgex-mermaid-mermaidstatedocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Method [MermaidTopologyRendering.ToPng](/api/chartforgex-mermaid-mermaidtopologyrendering/#method-topng-chartforgex-mermaid-mermaidstatedocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Method [MermaidTopologyRendering.ToSvg](/api/chartforgex-mermaid-mermaidtopologyrendering/#method-tosvg-chartforgex-mermaid-mermaidstatedocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Method [MermaidTopologyRendering.ToTopologyChart](/api/chartforgex-mermaid-mermaidtopologyrendering/#method-totopologychart-chartforgex-mermaid-mermaidstatedocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`
- Method [MermaidTopologyRendering.ToVisualArtifact](/api/chartforgex-mermaid-mermaidtopologyrendering/#method-tovisualartifact-chartforgex-mermaid-mermaidstatedocument-chartforgex-mermaid-mermaidtopologyrenderoptions) parameter `document`

 Filter members   

    Show inherited   

 

## Constructors

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

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

## 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? Direction { get; set; }` [#](#property-direction) 

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

Gets or sets the optional diagram direction statement.

 `public List<MermaidStateNode> States { get; }` [#](#property-states) 

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

Gets states in source order.

 `public List<MermaidStateTransition> Transitions { get; }` [#](#property-transitions) 

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

Gets transitions in source order.

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

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

Gets retained non-rendered state statements.

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

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

Gets named paint definitions in source order, including retained unsupported declarations.

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

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

Gets explicit class and style statements at their original source locations.

 `public List<MermaidDiagramNote> Notes { get; }` [#](#property-notes) 

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

Gets visible attached and independently named floating notes in source order.

 `public List<MermaidStateRegion> Regions { get; }` [#](#property-regions) 

[MermaidStateDocument.cs:33](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidStateDocument.cs#L33)

Gets the ordered regions of composite states, including empty regions.

## 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(MermaidStateDocument document, MermaidTopologyRenderOptions? options = null)` [#](#extension-topng-chartforgex-mermaid-mermaidstatedocument-chartforgex-mermaid-mermaidtopologyrenderoptions) 

[MermaidTopologyRendering.cs:157](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidTopologyRendering.cs#L157)

Renders a Mermaid state diagram to PNG.

Parameters

**document ChartForgeX.Mermaid.MermaidStateDocument required**

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

Returns

 `byte[]` 

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

[MermaidTopologyRendering.cs:141](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidTopologyRendering.cs#L141)

Renders a Mermaid state diagram to SVG.

Parameters

**document ChartForgeX.Mermaid.MermaidStateDocument required**

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

Returns

 `string` 

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

[MermaidTopologyRendering.cs:59](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidTopologyRendering.cs#L59)

Converts a Mermaid state diagram to a topology chart.

Parameters

**document ChartForgeX.Mermaid.MermaidStateDocument required**

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

Returns

 `TopologyChart` 

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

[MermaidTopologyRendering.cs:125](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Mermaid/MermaidTopologyRendering.cs#L125)

Wraps a Mermaid state diagram in a visual artifact envelope.

Parameters

**document ChartForgeX.Mermaid.MermaidStateDocument required**

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

Returns

 `VisualArtifact` 

<!-- PowerForge markdown artifact sha256:44923FC01CFB85B2EDE5FCE6878194A757852CE335698C6F7896C5EA688FD490 -->
