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
DiagramBlockDiagram
Constructors
| Name | Description |
|---|---|
| BlockDiagram() |
BlockDiagram()
BlockDiagram.cspublic BlockDiagram()No documentation is available.
Properties
| Name | Description |
|---|---|
| ClassDefinitions | Gets the styles of the CSS classes of the blocks, by name (Mermaid classDef). The class default applies to every block. |
| Columns | Gets or sets the number of columns of the top level, or null to place every item on one row (Mermaid columns auto). |
| Edges | Gets the edges, drawn in order. |
| Items | Gets the items of the top level, placed in order, left to right and top to bottom. |
ClassDefinitions
BlockDiagram.csGets 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; }Property value
Columns
BlockDiagram.csEdges
BlockDiagram.csItems
BlockDiagram.csGets the items of the top level, placed in order, left to right and top to bottom.
public IList<BlockDiagramItem> Items { get; }Property value
Methods
| Name | Description |
|---|---|
| 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.csAdds a block to the top level.
public BlockDiagramBlock AddBlock(string id, DiagramText? label = null, FlowchartNodeShape shape = FlowchartNodeShape.Rectangle)Parameters
idstring- The identifier, which is shown when there is no label.
labelDiagramText?- The text, or
nullto show the identifier. shapeFlowchartNodeShape- The shape.
Returns
BlockDiagramBlock The block.
AddEdge(BlockDiagramBlock, BlockDiagramBlock, DiagramText?)
BlockDiagram.csAdds an edge.
public BlockDiagramEdge AddEdge(BlockDiagramBlock from, BlockDiagramBlock to, DiagramText? label = null)Parameters
fromBlockDiagramBlock- The source.
toBlockDiagramBlock- The target.
labelDiagramText?- The text, or
nullfor none.
Returns
BlockDiagramEdge The edge.
EnumerateBlocks()
BlockDiagram.csEnumerates the blocks, the arrows and the composite blocks with their content, depth first.
public IEnumerable<BlockDiagramBlock> EnumerateBlocks()Returns
IEnumerable<BlockDiagramBlock> The blocks.
Find(string)
BlockDiagram.csFinds a block by identifier, in the top level and the composite blocks.
public BlockDiagramBlock? Find(string id)