BlockDiagram Class

A block diagram: blocks placed on a grid of columns in the order they are declared, spanning one or more columns, grouped in composite blocks, with block arrows, empty spaces and edges (Mermaid block). Unlike a flowchart, the author decides where each block goes.

public sealed class BlockDiagram : Diagram
Inheritance
Diagram BlockDiagram

Constructors

NameDescription
BlockDiagram()

BlockDiagram()

BlockDiagram.cs
public BlockDiagram()

No documentation is available.

Properties

NameDescription
ClassDefinitionsGets the styles of the CSS classes of the blocks, by name (Mermaid classDef). The class default applies to every block.
ColumnsGets or sets the number of columns of the top level, or null to place every item on one row (Mermaid columns auto).
EdgesGets the edges, drawn in order.
ItemsGets the items of the top level, placed in order, left to right and top to bottom.

ClassDefinitions

BlockDiagram.cs

Gets the styles of the CSS classes of the blocks, by name (Mermaid classDef). The class default applies to every block.

public IDictionary<string, DiagramStyle> ClassDefinitions { get; }

Gets or sets the number of columns of the top level, or null to place every item on one row (Mermaid columns auto).

public int? Columns { get; set; }

Property value

int?

Gets the edges, drawn in order.

public IList<BlockDiagramEdge> Edges { get; }

Gets the items of the top level, placed in order, left to right and top to bottom.

public IList<BlockDiagramItem> Items { get; }

Methods

NameDescription
AddBlock(string, DiagramText?, FlowchartNodeShape)Adds a block to the top level.
AddEdge(BlockDiagramBlock, BlockDiagramBlock, DiagramText?)Adds an edge.
EnumerateBlocks()Enumerates the blocks, the arrows and the composite blocks with their content, depth first.
Find(string)Finds a block by identifier, in the top level and the composite blocks.

AddBlock(string, DiagramText?, FlowchartNodeShape)

BlockDiagram.cs

Adds a block to the top level.

public BlockDiagramBlock AddBlock(string id, DiagramText? label = null, FlowchartNodeShape shape = FlowchartNodeShape.Rectangle)

Parameters

id string
The identifier, which is shown when there is no label.
label DiagramText?
The text, or null to show the identifier.
shape FlowchartNodeShape
The shape.

Returns

BlockDiagramBlock The block.

AddEdge(BlockDiagramBlock, BlockDiagramBlock, DiagramText?)

BlockDiagram.cs

Adds an edge.

public BlockDiagramEdge AddEdge(BlockDiagramBlock from, BlockDiagramBlock to, DiagramText? label = null)

Parameters

from BlockDiagramBlock
The source.
to BlockDiagramBlock
The target.
label DiagramText?
The text, or null for none.

Returns

BlockDiagramEdge The edge.

EnumerateBlocks()

BlockDiagram.cs

Enumerates the blocks, the arrows and the composite blocks with their content, depth first.

public IEnumerable<BlockDiagramBlock> EnumerateBlocks()

Find(string)

BlockDiagram.cs

Finds a block by identifier, in the top level and the composite blocks.

public BlockDiagramBlock? Find(string id)

Parameters

id string
The identifier.

Returns

BlockDiagramBlock? The block, or null when there is none.