UseCaseDiagram Class

A use case diagram, in the style of UML: actors, the use cases of a system they take part in, the system boundaries, and the relationships between them (Mermaid usecase-beta).

public sealed class UseCaseDiagram : Diagram
Inheritance
Diagram UseCaseDiagram

Constructors

NameDescription
UseCaseDiagram()

UseCaseDiagram()

UseCaseDiagram.cs
public UseCaseDiagram()

No documentation is available.

Properties

NameDescription
ActorsGets the actors. The actors of the boundaries that are not in this list are drawn too.
BoundariesGets the system boundaries.
ClassDefinitionsGets the styles of the CSS classes of the elements, by name (Mermaid classDef). The class default applies to every actor, use case and table.
DirectionGets or sets the direction of the relationships. The default is DiagramDirection.LeftToRight.
NodeSpacingGets or sets the space between two elements of the same rank, in pixels.
NotesGets the notes.
RankSpacingGets or sets the space between two ranks, in pixels.
RelationshipsGets the relationships, drawn in order.
TablesGets the tables that show JSON data.
UseCasesGets the use cases. The use cases of the boundaries that are not in this list are drawn too.

Gets the actors. The actors of the boundaries that are not in this list are drawn too.

public IList<UseCaseActor> Actors { get; }

Property value

IList<UseCaseActor>

Gets the system boundaries.

public IList<UseCaseBoundary> Boundaries { get; }

ClassDefinitions

UseCaseDiagram.cs

Gets the styles of the CSS classes of the elements, by name (Mermaid classDef). The class default applies to every actor, use case and table.

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

Gets or sets the direction of the relationships. The default is DiagramDirection.LeftToRight.

public DiagramDirection Direction { get; set; }

Property value

DiagramDirection

Gets or sets the space between two elements of the same rank, in pixels.

public double NodeSpacing { get; set; }

Property value

double

Gets the notes.

public IList<UseCaseNote> Notes { get; }

Property value

IList<UseCaseNote>

Gets or sets the space between two ranks, in pixels.

public double RankSpacing { get; set; }

Property value

double

Relationships

UseCaseDiagram.cs

Gets the relationships, drawn in order.

public IList<UseCaseRelationship> Relationships { get; }

Gets the tables that show JSON data.

public IList<UseCaseJsonTable> Tables { get; }

Gets the use cases. The use cases of the boundaries that are not in this list are drawn too.

public IList<UseCase> UseCases { get; }

Property value

IList<UseCase>

Methods

NameDescription
AddActor(string, DiagramText?)Adds an actor.
AddBoundary(string, DiagramText?)Adds a system boundary.
AddNote(UseCaseDiagramElement, DiagramText)Adds a note.
AddRelationship(UseCaseDiagramElement, UseCaseDiagramElement, UseCaseRelationshipKind, DiagramText?)Adds a relationship.
AddTable(string, string)Adds a table that shows JSON data.
AddUseCase(string, DiagramText?, UseCaseShape)Adds a use case.
Find(string)Finds an actor, a use case or a table by identifier, in the diagram and its boundaries.

AddActor(string, DiagramText?)

UseCaseDiagram.cs

Adds an actor.

public UseCaseActor AddActor(string id, DiagramText? label = null)

Parameters

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

Returns

UseCaseActor The actor.

AddBoundary(string, DiagramText?)

UseCaseDiagram.cs

Adds a system boundary.

public UseCaseBoundary AddBoundary(string id, DiagramText? title = null)

Parameters

id string
The identifier.
title DiagramText?
The title, or null to show the identifier.

Returns

UseCaseBoundary The boundary.

AddNote(UseCaseDiagramElement, DiagramText)

UseCaseDiagram.cs

Adds a note.

public UseCaseNote AddNote(UseCaseDiagramElement target, DiagramText text)

Parameters

target UseCaseDiagramElement
The actor or the use case the note is attached to.
text DiagramText
The text.

Returns

UseCaseNote The note.

AddRelationship(UseCaseDiagramElement, UseCaseDiagramElement, UseCaseRelationshipKind, DiagramText?)

UseCaseDiagram.cs

Adds a relationship.

Parameters

from UseCaseDiagramElement
The source.
to UseCaseDiagramElement
The target.
kind UseCaseRelationshipKind
The kind. An association has an arrowhead at to.
label DiagramText?
The text of an association, or null for none.

Returns

UseCaseRelationship The relationship.

AddTable(string, string)

UseCaseDiagram.cs

Adds a table that shows JSON data.

public UseCaseJsonTable AddTable(string id, string json)

Parameters

id string
The identifier, shown as the title of the table.
json string
The data: a JSON object.

Returns

UseCaseJsonTable The table.

AddUseCase(string, DiagramText?, UseCaseShape)

UseCaseDiagram.cs

Adds a use case.

public UseCase AddUseCase(string id, DiagramText? label = null, UseCaseShape shape = UseCaseShape.Ellipse)

Parameters

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

Returns

UseCase The use case.

Find(string)

UseCaseDiagram.cs

Finds an actor, a use case or a table by identifier, in the diagram and its boundaries.

public UseCaseDiagramElement? Find(string id)

Parameters

id string
The identifier.

Returns

UseCaseDiagramElement? The element, or null when there is none.