ErDiagram Class
An entity relationship diagram: entities with their attributes, linked by relationships whose ends show their cardinality in crow's foot notation, grouped in subgraphs (Mermaid erDiagram).
public sealed class ErDiagram : Diagram- Inheritance
DiagramErDiagram
Constructors
| Name | Description |
|---|---|
| ErDiagram() |
ErDiagram()
ErDiagram.cspublic ErDiagram()No documentation is available.
Properties
| Name | Description |
|---|---|
| ClassDefinitions | Gets the styles of the CSS classes of the elements, by name (Mermaid classDef). The class default applies to every entity. |
| Direction | Gets or sets the direction of the relationships. The default is DiagramDirection.TopToBottom. |
| Entities | Gets the entities, in the subgraphs or not. The entities of the subgraphs that are not in this list are drawn too. |
| NodeSpacing | Gets or sets the space between two entities of the same rank, in pixels. |
| RankSpacing | Gets or sets the space between two ranks, in pixels. |
| Relationships | Gets the relationships, drawn in order. |
| Subgraphs | Gets the top-level subgraphs. |
ClassDefinitions
ErDiagram.csGets the styles of the CSS classes of the elements, by name (Mermaid classDef). The class default applies to every entity.
public IDictionary<string, DiagramStyle> ClassDefinitions { get; }Property value
Direction
ErDiagram.csGets or sets the direction of the relationships. The default is DiagramDirection.TopToBottom.
public DiagramDirection Direction { get; set; }Property value
Entities
ErDiagram.csGets the entities, in the subgraphs or not. The entities of the subgraphs that are not in this list are drawn too.
Property value
NodeSpacing
ErDiagram.csRankSpacing
ErDiagram.csRelationships
ErDiagram.csGets the relationships, drawn in order.
public IList<ErRelationship> Relationships { get; }Property value
Subgraphs
ErDiagram.csMethods
| Name | Description |
|---|---|
| AddEntity(string, DiagramText?) | Adds an entity. |
| AddRelationship(ErElement, ErElement, ErCardinality, ErCardinality, DiagramText?) | Adds a relationship. |
| AddSubgraph(string, DiagramText?) | Adds a top-level subgraph. |
| EnumerateSubgraphs() | Enumerates the subgraphs and their nested subgraphs, depth first. |
| Find(string) | Finds an entity or a subgraph by identifier. A subgraph hides an entity of the same name. |
AddEntity(string, DiagramText?)
ErDiagram.csAdds an entity.
public ErEntity AddEntity(string id, DiagramText? label = null)Parameters
idstring- The name of the entity, which is shown when there is no label.
labelDiagramText?- The name shown instead of the identifier (Mermaid alias), or
null.
Returns
ErEntity The entity.
AddRelationship(ErElement, ErElement, ErCardinality, ErCardinality, DiagramText?)
ErDiagram.csAdds a relationship.
public ErRelationship AddRelationship(ErElement from, ErElement to, ErCardinality fromCardinality, ErCardinality toCardinality, DiagramText? label = null)Parameters
fromErElement- The first element.
toErElement- The second element.
fromCardinalityErCardinality- How many instances of
froman instance oftorelates to. toCardinalityErCardinality- How many instances of
toan instance offromrelates to. labelDiagramText?- The text of the relationship, from the point of view of
from, ornull.
Returns
ErRelationship The relationship.
AddSubgraph(string, DiagramText?)
ErDiagram.csAdds a top-level subgraph.
public ErSubgraph AddSubgraph(string id, DiagramText? title = null)Parameters
idstring- The identifier.
titleDiagramText?- The title, or
nullto show the identifier.
Returns
ErSubgraph The subgraph.
EnumerateSubgraphs()
ErDiagram.csEnumerates the subgraphs and their nested subgraphs, depth first.
public IEnumerable<ErSubgraph> EnumerateSubgraphs()Returns
IEnumerable<ErSubgraph> The subgraphs.
Find(string)
ErDiagram.csFinds an entity or a subgraph by identifier. A subgraph hides an entity of the same name.