### Start On Load Configuration Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Configuration.Model.MermaidConfig.html Determines whether the diagram should start rendering automatically on load. Set to true to enable auto-rendering. ```csharp [YamlMember(Alias = "startOnLoad")] public bool? StartOnLoad { get; set; }__ ``` -------------------------------- ### Configure a Gantt Diagram Source: https://foggybalrog.github.io/MermaidDotNet/configuration.html Example of creating and configuring a Gantt diagram with specific settings like theme, axis format, and display mode. The configuration is passed as a MermaidConfig object. ```csharp var config = new MermaidConfig { Theme = Theme.Forest, Gantt = new GanttDiagramConfig { AxisFormat = "%d-%m", DisplayMode = DisplayMode.Compact, TickInterval = "1week", Weekday = Weekday.Monday } }; string diagram = Mermaid .GanttDiagram(title: "My Gantt", config: config) .AddTask("Foo", Date("2024-05-01"), Date("2024-05-05"), out GanttTask _) .Build(); __ ``` -------------------------------- ### Initialize UserJourneyDiagramBuilder Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.UserJourneyDiagram.UserJourneyDiagramBuilder.html Instantiate the builder to start creating a user journey diagram. This class is the entry point for diagram construction. ```csharp public class UserJourneyDiagramBuilder ``` -------------------------------- ### Gantt Diagram with Various Task Bounds Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/gantt-diagram.html Demonstrates creating Gantt diagram tasks with different bounding methods: start/end dates, start date/duration, end date of previous task/end date, end date of previous task/duration, and end date of previous task/start date of next task. ```csharp string diagram = Mermaid .GanttDiagram() .AddTask("Foo", DateTimeOffset.Parse("2024-05-01"), DateTimeOffset.Parse("2024-05-05"), out var t1) .AddTask("Bar", DateTimeOffset.Parse("2024-05-08"), TimeSpan.FromDays(3), out var t2) .AddTask("Baz", t1, DateTimeOffset.Parse("2024-05-09"), out var t3) .AddTask("Qux", t1, TimeSpan.FromDays(2), out var t4) .AddTask("Quux", DateTimeOffset.Parse("2024-05-04"), t2, out var t5) .AddTask("Corge", t1, t2, out var t6) .Build(); ``` ```mermaid gantt dateFormat YYYY-MM-DD Foo: task1, 2024-05-01, 2024-05-05 Bar: task2, 2024-05-08, 3d Baz: task3, after task1, 2024-05-09 Qux: task4, after task1, 2d Quux: task5, 2024-05-04, until task2 Corge: task6, after task1, until task2 ``` -------------------------------- ### Add Task by Name, Start Date, and Duration Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.GanttDiagram.GanttDiagramBuilder.html Adds a task to the Gantt diagram by specifying its name, start date, and duration. Throws MermaidException if the task name is whitespace. ```csharp public GanttDiagramBuilder AddTask(string name, DateTimeOffset start, TimeSpan duration, out GanttTask task, TaskTags tags = TaskTags.None)__ ``` -------------------------------- ### Generate a Gantt Diagram Source: https://foggybalrog.github.io/MermaidDotNet/index.html Build a Gantt chart to display project tasks and their timelines. Specify task names, start dates, and end dates. ```csharp string diagram = Mermaid .GanttDiagram() .AddTask("Foo", Date("2024-05-01"), Date("2024-05-05"), out _) .AddTask("Bar", Date("2024-05-08"), Date("2024-05-12"), out _) .Build(); ``` ```mermaid gantt dateFormat YYYY-MM-DD Foo: task1, 2024-05-01, 2024-05-05 Bar: task2, 2024-05-03, 2024-05-08 ``` -------------------------------- ### Create XY Chart Builder Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Use this method to start building an XY Chart. It allows for an optional title, Mermaid configuration, the chart orientation, and Mermaid.Net options. ```csharp public static XYChartBuilder XYChart(string? title = null, MermaidConfig? config = null, XYChartOrientation? orientation = null, MermaidDotNetOptions? options = null) ``` -------------------------------- ### AddTransitionFromStart Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.StateDiagram.StateDiagramBuilder.html Adds a transition originating from the implicit start state of the diagram to a specified state. An optional description can be provided for the transition. ```APIDOC ## AddTransitionFromStart(State to, string? description = null) ### Description Adds a transition from the start state to another state. ### Parameters #### Path Parameters * **to** (State) - Required - The state to transition to. * **description** (string) - Optional - An optional description of the transition. ### Returns StateDiagramBuilder - The current instance of the StateDiagramBuilder. ### Exceptions * MermaidException - Thrown when `to` is not part of the diagram, with the reason ForeignItem. * MermaidException - Thrown when `description` is whitespace, with the reason WhiteSpace. ``` -------------------------------- ### Add Transition From Start - StateDiagramBuilder Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.StateDiagram.StateDiagramBuilder.html Use to create a transition originating from the diagram's start point to a specified state. The target state must be previously defined. ```csharp public StateDiagramBuilder AddTransitionFromStart(State to, string? description = null)__ ``` -------------------------------- ### Add Task by Name, Start Date, and End Date Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.GanttDiagram.GanttDiagramBuilder.html Adds a task to the Gantt diagram using its name, start date, and end date. Throws MermaidException if the task name is whitespace. ```csharp public GanttDiagramBuilder AddTask(string name, DateTimeOffset start, DateTimeOffset end, out GanttTask task, TaskTags tags = TaskTags.None)__ ``` -------------------------------- ### Add Task by Name, Start Date, and Until Task Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.GanttDiagram.GanttDiagramBuilder.html Adds a task to the Gantt diagram, specifying its name, start date, and another task it should end until. Throws MermaidException if the name is whitespace or the untilTask is not part of the diagram. ```csharp public GanttDiagramBuilder AddTask(string name, DateTimeOffset start, GanttTask untilTask, out GanttTask task, TaskTags tags = TaskTags.None)__ ``` -------------------------------- ### Method Parameters Property Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.ClassDiagram.Model.Method.html Gets the list of parameters for the method. This property is read-only. ```csharp public List Parameters { get; } ``` -------------------------------- ### Create Pie Chart Builder Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Use this method to start building a Pie Chart. It accepts an optional title, Mermaid configuration, a boolean to display values on the legend, and Mermaid.Net options. ```csharp public static PieChartBuilder PieChart(string? title = null, MermaidConfig? config = null, bool displayValuesOnLegend = false, MermaidDotNetOptions? options = null) ``` -------------------------------- ### Create Timeline Diagram Builder Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Starts the construction of a Timeline Diagram. This method accepts an optional title, Mermaid configuration, and Mermaid.Net options. ```csharp public static TimelineDiagramBuilder TimelineDiagram(string? title = null, MermaidConfig? config = null, MermaidDotNetOptions? options = null) ``` -------------------------------- ### Create Sankey Diagram Builder Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Starts the process of building a Sankey Diagram. This method accepts an optional title, Mermaid configuration, and Mermaid.Net options. ```csharp public static SankeyDiagramBuilder SankeyDiagram(string? title = null, MermaidConfig? config = null, MermaidDotNetOptions? options = null) ``` -------------------------------- ### Create a Simple User Journey Diagram Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/user-journey-diagram.html Use the UserJourneyDiagram method to start creating a diagram. Add tasks using AddTask and sections using AddSection. The Build method generates the Mermaid code. ```csharp var diagram = Mermaid .UserJourneyDiagram() .AddTask("Task 1", 1, "Actor 1", "Actor 2") .AddTask("Task 2", 2) .AddSection("Section 1") .AddTask("Task 3", 3) .AddTask("Task 4", 4, "Actor 3") .AddSection("Section 2") .AddTask("Task 5", 5, "Actor 1", "Actor 3") .AddTask("Task 6", 6, "Actor 2") .Build(); ``` ```mermaid journey Task 1: 1: Actor 1, Actor 2 Task 2: 2 section Section 1 Task 3: 3 Task 4: 4: Actor 3 section Section 2 Task 5: 5: Actor 1, Actor 3 Task 6: 6: Actor 2 ``` -------------------------------- ### AddTask with After and Until Tasks Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.GanttDiagram.GanttDiagramBuilder.html Adds a task that starts after a specified task and ends before another specified task. Both dependency tasks must exist within the diagram. ```csharp public GanttDiagramBuilder AddTask(string name, GanttTask afterTask, GanttTask untilTask, out GanttTask task, TaskTags tags = TaskTags.None) ``` -------------------------------- ### Create a Timeline Diagram with Sections Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/timeline-diagram.html Organize events into sections using the AddSection method. Events added before the first section are ignored. This example shows two sections with events. ```csharp string diagram = Mermaid .TimelineDiagram("Some title") .AddSection("Section 1") .AddEvents("2021", "Event 1", "Event 2") .AddEvents("2022", "Event 3") .AddSection("Section 2") .AddEvents("2023", "Event 4", "Event 5", "Event 6") .Build(); ``` ```mermaid timeline title Some title section Section 1 2021 : Event 1 : Event 2 2022 : Event 3 section Section 2 2023 : Event 4 : Event 5 : Event 6 ``` -------------------------------- ### Create Simple Class Diagram Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/class-diagram.html Use the ClassDiagram method to start creating a diagram. Add classes, properties, methods, and relationships using the respective methods. The Build method generates the Mermaid code. ```csharp var diagram = Mermaid .ClassDiagram() .AddClass("Animal", out var animal) .AddClass("Dog", out var dog) .AddProperty(animal, "int", "Age") .AddMethod(animal, null, "Breathe") .AddMethod(animal, "Energy", "Eat", parameters: [ ("Food", "food") ]) .AddMethod(dog, "Sound", "Bark", parameters: [ ("int", "times"), ("int", "volume") ]) .AddRelationship(animal, dog, RelationshipType.Inheritance, label: "A dog is an animal") .Build(); ``` ```mermaid classDiagram class Animal { +int Age +Breathe() +Eat(Food food) Energy } class Dog { +Bark(int times, int volume) Sound } Animal <|-- Dog : A dog is an animal ``` -------------------------------- ### Get Exact Cardinality by Integer Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.ClassDiagram.Model.Cardinality.html Gets a cardinality representing an exact count specified by an integer. Ensure the count is non-negative. ```csharp public static Cardinality Exactly(int count) ``` -------------------------------- ### Alternatives Method Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.SequenceDiagram.SequenceDiagramBuilder.html Creates alternative paths within the sequence diagram. Each alternative can have its own description and content. ```csharp public SequenceDiagramBuilder Alternatives(params (string description, Action action)[] alternatives) ``` -------------------------------- ### Get Ranged Cardinality by Strings Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.ClassDiagram.Model.Cardinality.html Gets a cardinality representing a range between two string values. This allows for symbolic or non-numeric range bounds. ```csharp public static Cardinality Range(string from, string to) ``` -------------------------------- ### Create Sequence Diagram with Alternatives Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/sequence-diagram.html Demonstrates how to build a sequence diagram with multiple nested alternative paths using the Mermaid .NET library. Use the `Alternatives` method to define conditional message sequences. ```csharp string diagram = Mermaid .SequenceDiagram() .AddMember(Alice, out var a) .AddMember(Bob, out var b) .SendMessage(a, b, "Hello Bob!") .Alternatives( ("Bob is happy", builder => builder .SendMessage(b, a, "Hello Alice!") .SendMessage(b, a, "Can you hear me?") .Alternatives( ("Alice is happy", builder => builder .SendMessage(a, b, "Yes, I can hear you!")), ("Alice is sad", builder => builder .SendMessage(a, b, "No, I can't hear you!")))), ("Bob is sad", builder => builder .SendMessage(b, a, "Hello Alice.") .Alternatives( ("Alice is happy", builder => builder .SendMessage(a, b, "Sorry to hear that.")), ("Alice is sad", builder => builder .SendMessage(a, b, "Me too."))))) .SendMessage(a, b, "Bye") .Build(); ``` -------------------------------- ### Get Exact Cardinality by String Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.ClassDiagram.Model.Cardinality.html Gets a cardinality representing an exact count specified by a string. This is useful for non-numeric or symbolic exact values. ```csharp public static Cardinality Exactly(string value) ``` -------------------------------- ### Create a Simple Git Graph Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/git-graph.html Demonstrates the basic usage of the GitGraph method to create a simple git graph with commits, branches, merges, and checkouts. ```csharp string graph = Mermaid .GitGraph() .Commit() .Branch("dev", out Branch dev) .Commit() .Checkout(dev) .Commit() .Commit() .CheckoutMain() .Commit() .Merge(dev) .Commit() .Build(); ``` ```mermaid gitGraph commit branch dev commit checkout dev commit commit checkout main commit merge dev commit ``` -------------------------------- ### Get Ranged Cardinality by Integers Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.ClassDiagram.Model.Cardinality.html Gets a cardinality representing a range between two integer values. The 'from' value must be less than or equal to the 'to' value. ```csharp public static Cardinality Range(int from, int to) ``` -------------------------------- ### Create Kanban Diagram Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Initializes a builder for creating a Kanban Diagram. Accepts a title, configuration, and options. ```csharp public static KanbanDiagramBuilder KanbanDiagram(string? title = null, MermaidConfig? config = null, MermaidDotNetOptions? options = null)__ ``` -------------------------------- ### Build Method Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.BlockDiagram.BlockDiagramBuilder.html Generates the Mermaid code string representing the constructed block diagram. ```csharp public string Build() ``` -------------------------------- ### Build Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.StateDiagram.StateDiagramBuilder.html Generates the final Mermaid syntax string for the state diagram based on the configured states and transitions. ```APIDOC ## Build() ### Description Builds the Mermaid code for the state diagram. ### Returns string - The Mermaid code for the state diagram. ``` -------------------------------- ### Method Visibility Property Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.ClassDiagram.Model.Method.html Gets the visibility modifier of the method. This property is read-only. ```csharp public Visibilities Visibility { get; } ``` -------------------------------- ### Build Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.GanttDiagram.GanttDiagramBuilder.html Builds and returns the Mermaid code string for the configured Gantt diagram. ```APIDOC ## Build() ### Description Builds the Mermaid code for the Gantt diagram. ### Returns string - The Mermaid code for the Gantt diagram. ### Exceptions - NotSupportedException: Thrown when an item type is not supported. Should never happen. ``` -------------------------------- ### Build Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.UserJourneyDiagram.UserJourneyDiagramBuilder.html Builds the Mermaid code for the user journey diagram. ```APIDOC ## Build() ### Description Builds the Mermaid code for the user journey diagram. ### Method Signature string Build() ### Returns string - The Mermaid code for the user journey diagram. ``` -------------------------------- ### Method Return Type Property Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.ClassDiagram.Model.Method.html Gets the return type of the method. This property is nullable and read-only. ```csharp public string? ReturnType { get; } ``` -------------------------------- ### Build Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.ClassDiagram.ClassDiagramBuilder.html Generates the final Mermaid syntax string for the class diagram. ```APIDOC ## Build ### Description Compiles all the added elements (classes, properties, relationships, notes) into a single string representing the Mermaid class diagram syntax. ### Method Signature `public string Build()` ### Returns `string` - The generated Mermaid code for the class diagram. ``` -------------------------------- ### Create Simple Kanban Diagram - C# Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/kanban-diagram.html Use the KanbanDiagram method to create a diagram. Add columns with AddColumn and tasks with AddTask. The Build method generates the Mermaid code. ```csharp string diagram = Mermaid .KanbanDiagram("some title") .AddColumn("foo", x => x .AddTask("t1") .AddTask("t2", assigned: "Alice", ticket: "JIRA-123", priority: Priority.VeryHigh)) .AddColumn("bar", x => x .AddTask("t3", assigned: "Alice", priority: Priority.VeryHigh) .AddTask("t4", ticket: "JIRA-123")) .AddColumn("baz") .Build(); ``` -------------------------------- ### AddTask (by afterTask and duration) Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.GanttDiagram.GanttDiagramBuilder.html Adds a task to the Gantt diagram, defining its start relative to `afterTask` and its duration. ```APIDOC ## AddTask(string, GanttTask, TimeSpan, out GanttTask, TaskTags) ### Description Adds a task to the Gantt diagram, by specifying a task that it should start after, and the duration. ### Method `public GanttDiagramBuilder AddTask(string name, GanttTask afterTask, TimeSpan duration, out GanttTask task, TaskTags tags = TaskTags.None)` ### Parameters #### Path Parameters * **name** (string) - Required - The name of the task. * **afterTask** (GanttTask) - Required - The task that this task should start after. * **duration** (TimeSpan) - Required - The duration of the task. * **task** (out GanttTask) - Required - The created task. * **tags** (TaskTags) - Optional - The tags of the task. ### Returns GanttDiagramBuilder - The current GanttDiagramBuilder instance. ### Exceptions * MermaidException - Thrown when `name` is whitespace, with the reason WhiteSpace. * MermaidException - Thrown when `afterTask` is not part of the diagram, with the reason ForeignItem. ``` -------------------------------- ### Create a Simple Mind Map Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/mind-map.html Use the MindMap method to create a mind map with a root node. Add subsequent nodes using AddNode, optionally specifying a parent. Build the diagram code with the Build method. ```csharp var mindMap = Mermaid .MindMap("Root") .AddNode("Node 1", out var node1) .AddNode("Node 2", out var node2, node1) .AddNode("Node 3", out var node3, node1) .AddNode("Node 4", out var node4, node2) .AddNode("Node 5", out var node5, node2) .AddNode("Node 6", out var node6, node3) .AddNode("Node 7", out var node7, node3) .Build(); ``` ```mermaid mindmap Root Node 1 Node 2 Node 4 Node 5 Node 3 Node 6 Node 7 ``` -------------------------------- ### Get Zero Or More Cardinality Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.ClassDiagram.Model.Cardinality.html Provides a static property to represent a cardinality of zero or more. Use this for optional or multiple instances. ```csharp public static Cardinality ZeroOrMore { get; } ``` -------------------------------- ### Build Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.PacketDiagram.PacketDiagramBuilder.html Builds the Mermaid code for the packet diagram. ```APIDOC ## Build() ### Description Builds the Mermaid code for the packet diagram. ### Returns string - The Mermaid code for the packet diagram. ``` -------------------------------- ### Create Packet Diagram Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Initializes a builder for creating a Packet Diagram. Supports title, configuration, and options. ```csharp public static PacketDiagramBuilder PacketDiagram(string? title = null, MermaidConfig? config = null, MermaidDotNetOptions? options = null)__ ``` -------------------------------- ### Create Gantt Diagram Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Initializes a builder for creating a Gantt Diagram. Supports title, configuration, hiding today marker, custom marker CSS, date format, and options. ```csharp public static GanttDiagramBuilder GanttDiagram(string? title = null, MermaidConfig? config = null, bool hideTodayMarker = false, string? todayMarkerCss = null, string dateFormat = "YYYY-MM-DD", MermaidDotNetOptions? options = null)__ ``` -------------------------------- ### AddTask (by afterTask and untilTask) Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.GanttDiagram.GanttDiagramBuilder.html Adds a task to the Gantt diagram, defining its start relative to `afterTask` and its end relative to `untilTask`. ```APIDOC ## AddTask(string, GanttTask, GanttTask, out GanttTask, TaskTags) ### Description Adds a task to the Gantt diagram, by specifying a task that it should start after, and a task that it should end until. ### Method `public GanttDiagramBuilder AddTask(string name, GanttTask afterTask, GanttTask untilTask, out GanttTask task, TaskTags tags = TaskTags.None)` ### Parameters #### Path Parameters * **name** (string) - Required - The name of the task. * **afterTask** (GanttTask) - Required - The task that this task should start after. * **untilTask** (GanttTask) - Required - The task that this task should end until. * **task** (out GanttTask) - Required - The created task. * **tags** (TaskTags) - Optional - The tags of the task. ### Returns GanttDiagramBuilder - The current GanttDiagramBuilder instance. ### Exceptions * MermaidException - Thrown when `name` is whitespace, with the reason WhiteSpace. * MermaidException - Thrown when `afterTask` is not part of the diagram, with the reason ForeignItem. * MermaidException - Thrown when `untilTask` is not part of the diagram, with the reason ForeignItem. ``` -------------------------------- ### Add Relationships with Cardinalities Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/class-diagram.html Shows how to add relationships with specific cardinalities on one or both sides. Use `Cardinality.One` for a single instance and `Cardinality.Range` for a range. ```csharp var diagram = Mermaid .ClassDiagram() .AddClass("c1", out var c1) .AddClass("c2", out var c2) .AddClass("c3", out var c3) .AddClass("c4", out var c4) .AddRelationship(c1, c2, RelationshipType.Inheritance, fromCardinality: Cardinality.One) .AddRelationship(c3, c4, RelationshipType.Inheritance, toCardinality: Cardinality.Range("a", "b")) .Build(); ``` ```mermaid classDiagram c1 "1" <|-- c2 c3 <|--"a..b" c4 ``` -------------------------------- ### AddTask with After Task and Duration Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.GanttDiagram.GanttDiagramBuilder.html Adds a task that starts after a specified task and has a defined duration. The 'afterTask' must be part of the diagram. ```csharp public GanttDiagramBuilder AddTask(string name, GanttTask afterTask, TimeSpan duration, out GanttTask task, TaskTags tags = TaskTags.None) ``` -------------------------------- ### Generate a Flowchart Diagram Source: https://foggybalrog.github.io/MermaidDotNet/index.html Use this to create a basic flowchart with nodes and links. Ensure the Mermaid library is initialized. ```csharp string diagram = Mermaid .Flowchart() .AddNode("N1", out var n1) .AddNode("N2", out var n2) .AddNode("N3", out var n3) .AddLink(n1, n2, "some text") .AddLink(n2, n3) .Build(); ``` -------------------------------- ### Top Margin Property Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Configuration.Model.SubGraphTitleMargin.html Sets or gets the top margin for the subgraph title. This property is nullable and mapped to 'top' in YAML. ```csharp [YamlMember(Alias = "top")] public int? Top { get; set; } ``` -------------------------------- ### Bottom Margin Property Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Configuration.Model.SubGraphTitleMargin.html Sets or gets the bottom margin for the subgraph title. This property is nullable and mapped to 'bottom' in YAML. ```csharp [YamlMember(Alias = "bottom")] public int? Bottom { get; set; } ``` -------------------------------- ### Generate a Class Diagram Source: https://foggybalrog.github.io/MermaidDotNet/index.html Build a class diagram to show classes, properties, methods, and relationships. Specify relationship types and labels. ```csharp var diagram = Mermaid .ClassDiagram() .AddClass("Animal", out var animal) .AddClass("Dog", out var dog) .AddProperty(animal, "int", "Age") .AddMethod(animal, null, "Breathe") .AddMethod(animal, "void", "Eat", parameters: [ ("Food", "food") ]) .AddMethod(dog, "Sound", "Bark", parameters: [ ("int", "times"), ("int", "volume") ]) .AddRelationship(animal, dog, RelationshipType.Inheritance, label: "A dog is an animal") .Build(); ``` -------------------------------- ### Get One Cardinality Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.ClassDiagram.Model.Cardinality.html Provides a static property to represent a cardinality of exactly one. Use this for mandatory single instances. ```csharp public static Cardinality One { get; } ``` -------------------------------- ### Get Any Cardinality Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.ClassDiagram.Model.Cardinality.html Provides a static property to represent a cardinality of any number. Use this when the exact number of instances is not specified or relevant. ```csharp public static Cardinality Any { get; } ``` -------------------------------- ### Initialize RequirementDiagramBuilder Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.RequirementDiagram.RequirementDiagramBuilder.html Instantiate the RequirementDiagramBuilder to begin constructing a requirement diagram. ```csharp public class RequirementDiagramBuilder ``` -------------------------------- ### AddVerticalMarker Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.GanttDiagram.GanttDiagramBuilder.html Adds a vertical marker to the Gantt diagram at a specified position. An optional offset for the following task start can also be provided. ```APIDOC ## AddVerticalMarker(string name, DateTimeOffset position, TimeSpan? nextTaskOffset = null) ### Description Adds a vertical marker to the gantt diagram, at a given position. ### Parameters #### Path Parameters - `name` (string) - The marker name. - `position` (DateTimeOffset) - The position. - `nextTaskOffset` (TimeSpan?) - Optional. An optional offset for the following task start. #### Returns GanttDiagramBuilder - The current GanttDiagramBuilder instance. #### Remarks This feature was introduced in Mermaid 11.7.0. #### Exceptions - MermaidException: Thrown when `name` is whitespace, with the reason WhiteSpace. ``` -------------------------------- ### Create Mind Map Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Initializes a builder for creating a Mind Map. Requires root text and allows customization of title, configuration, root shape, markdown usage, icon, options, and classes. ```csharp public static MindMapBuilder MindMap(string rootText, string? title = null, MermaidConfig? config = null, NodeShape rootShape = NodeShape.Default, bool rootIsMarkdown = false, string? rootIcon = null, MermaidDotNetOptions? options = null, params string[] rootClasses)__ ``` -------------------------------- ### AddTask (by afterTask and end date) Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.GanttDiagram.GanttDiagramBuilder.html Adds a task to the Gantt diagram, defining its start relative to `afterTask` and its fixed end date. ```APIDOC ## AddTask(string, GanttTask, DateTimeOffset, out GanttTask, TaskTags) ### Description Adds a task to the Gantt diagram, by specifying a task that it should start after, and the end date. ### Method `public GanttDiagramBuilder AddTask(string name, GanttTask afterTask, DateTimeOffset end, out GanttTask task, TaskTags tags = TaskTags.None)` ### Parameters #### Path Parameters * **name** (string) - Required - The name of the task. * **afterTask** (GanttTask) - Required - The task that this task should start after. * **end** (DateTimeOffset) - Required - The end date of the task. * **task** (out GanttTask) - Required - The created task. * **tags** (TaskTags) - Optional - The tags of the task. ### Returns GanttDiagramBuilder - The current GanttDiagramBuilder instance. ### Exceptions * MermaidException - Thrown when `name` is whitespace, with the reason WhiteSpace. * MermaidException - Thrown when `afterTask` is not part of the diagram, with the reason ForeignItem. ``` -------------------------------- ### Get Zero Or One Cardinality Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.ClassDiagram.Model.Cardinality.html Provides a static property to represent a cardinality of zero or one. Use this for optional single instances. ```csharp public static Cardinality ZeroOrOne { get; } ``` -------------------------------- ### Create Block Diagram Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Initializes a builder for creating a Block Diagram. Allows setting a title, configuration, columns, and options. ```csharp public static BlockDiagramBuilder BlockDiagram(string? title = null, MermaidConfig? config = null, int? columns = null, MermaidDotNetOptions? options = null)__ ``` -------------------------------- ### Create Sequence Diagram Builder Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Initializes a Sequence Diagram builder. You can provide an optional title, Mermaid configuration, a boolean to enable autonumbering, and Mermaid.Net options. ```csharp public static SequenceDiagramBuilder SequenceDiagram(string? title = null, MermaidConfig? config = null, bool autonumber = false, MermaidDotNetOptions? options = null) ``` -------------------------------- ### Get One Or More Cardinality Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.ClassDiagram.Model.Cardinality.html Provides a static property to represent a cardinality of one or more. Use this for relationships where at least one instance is required. ```csharp public static Cardinality OneOrMore { get; } ``` -------------------------------- ### Build Method Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.GitGraph.GitGraphBuilder.html Builds the Mermaid code string for the Git graph that has been constructed. ```APIDOC ## Build Method ### Description Builds the Mermaod code for the Git graph. ### Method Signature `public string Build()` ### Returns string - The Mermaid code for the Git graph. ### Exceptions - InvalidOperationException: Thrown when an unknown command is encountered. Should never happen. ``` -------------------------------- ### Create a Timeline Diagram with a Title Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/timeline-diagram.html Set the timeline title by passing a string to the TimelineDiagram method. This example demonstrates adding a title to the diagram. ```csharp string diagram = Mermaid .TimelineDiagram("Some title") .AddEvents("2021", "Event 1", "Event 2") .AddEvents("2022", "Event 3") .AddEvents("2023", "Event 4", "Event 5", "Event 6") .Build(); ``` ```mermaid timeline title Some title 2021 : Event 1 : Event 2 2022 : Event 3 2023 : Event 4 : Event 5 : Event 6 ``` -------------------------------- ### Create Git Graph Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Initializes a builder for creating a Git Graph. Allows setting a title, configuration, vertical orientation, and options. ```csharp public static GitGraphBuilder GitGraph(string? title = null, MermaidConfig? config = null, bool vertical = false, MermaidDotNetOptions? options = null)__ ``` -------------------------------- ### Create Flowchart Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Initializes a builder for creating a Flowchart. Allows specifying a title, configuration, orientation, and options. ```csharp public static FlowchartBuilder Flowchart(string? title = null, MermaidConfig? config = null, FlowchartOrientation orientation = FlowchartOrientation.TopToBottom, MermaidDotNetOptions? options = null)__ ``` -------------------------------- ### ActivationType Enum Definition Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.SequenceDiagram.Model.ActivationType.html Defines the activation types for sequence diagram elements. Use None for no activation, Activate to start an activation, and Deactivate to end one. ```csharp public enum ActivationType ``` -------------------------------- ### Create State Diagram Builder Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Use this to create a State Diagram builder. Options include an optional title, Mermaid configuration, and the direction of the diagram, along with Mermaid.Net options. ```csharp public static StateDiagramBuilder StateDiagram(string? title = null, MermaidConfig? config = null, StateDiagramDirection? direction = null, MermaidDotNetOptions? options = null) ``` -------------------------------- ### Alternatives Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.SequenceDiagram.SequenceDiagramBuilder.html Creates alternative sequences within the diagram, allowing for different paths based on conditions. ```APIDOC ## Alternatives ### Description Creates alternative sequences in the diagram. Each alternative can have a description and a set of actions to perform within that alternative. ### Method `Alternatives(params (string description, Action action)[] alternatives)` ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * None ### Request Example ```csharp // Example usage: builder.Alternatives( ("Option A", b => b.Comment("Executing Option A")), ("Option B", b => b.Comment("Executing Option B")) ); ``` ### Response #### Success Response * `SequenceDiagramBuilder`: The current SequenceDiagramBuilder instance for chaining. #### Response Example ```csharp // Returns the builder instance ``` #### Exceptions * `MermaidException`: Thrown when any of the descriptions in `alternatives` is whitespace. ``` -------------------------------- ### Configure Input Sanitization and Validation Source: https://foggybalrog.github.io/MermaidDotNet/index.html Use MermaidDotNetOptions to disable input validation and enable input sanitization. This example demonstrates setting these options before building a flowchart. ```csharp var options = new MermaidDotNetOptions { ValidateInputs = false, SanitizeInputs = true }; string diagram = Mermaid .Flowchart(options: options) .AddNode("N1", out var n1) .AddNode("N2", out var n2) .AddNode("N3", out var n3) .AddLink(n1, n2, "some text") .AddLink(n2, n3) .Build(); ``` -------------------------------- ### Build Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.EntityRelationshipDiagram.EntityRelationshipDiagramBuilder.html Generates and returns the complete Mermaid syntax string for the entity relationship diagram that has been constructed. ```APIDOC ## Build ### Description Builds the Mermaid code for the entity relationship diagram. ### Method Signature public string Build() ### Returns string - The Mermaid code for the entity relationship diagram. ``` -------------------------------- ### Create a Horizontal XY Chart Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/xy-chart.md.html Configure an XY chart to render horizontally by passing XYChartOrientation.Horizontal to the XYChart method. This example demonstrates adding a bar series. ```csharp string diagram = Mermaid .XYChart(orientation: XYChartOrientation.Horizontal) .AddBarSeries([1, 2, 3, 4]) .Build(); ``` ```mermaid xychart horizontal bar [1, 2, 3, 4] ``` -------------------------------- ### Create Class Diagram Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Initializes a builder for creating a Class Diagram. Supports setting a title, configuration, direction, and options. ```csharp public static ClassDiagramBuilder ClassDiagram(string? title = null, MermaidConfig? config = null, ClassDiagramDirection? direction = null, MermaidDotNetOptions? options = null)__ ``` -------------------------------- ### Create State Diagram with Title Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/state-diagram.html Set the state diagram's title by passing a string to the StateDiagram method. This example demonstrates adding a title and then defining states and transitions. ```csharp var diagram = Mermaid .StateDiagram("My title") .AddState("State 1", out var s1) .AddState("State 2", out var s2) .AddTransitionFromStart(s1) .AddStateTransition(s1, s2) .AddTransitionToEnd(s2) .Build(); ``` ```mermaid --- title: My title --- stateDiagram-v2 s1 : State 1 s2 : State 2 [*] --> s1 s1 --> s2 s2 --> [*] ``` -------------------------------- ### Cardinality Methods Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.ClassDiagram.Model.Cardinality.html Methods for creating specific cardinality instances. ```APIDOC ## Methods ### Exactly(int) Gets a cardinality of exactly the specified count. ```csharp public static Cardinality Exactly(int count) ``` #### Parameters `count` int A count. #### Returns Cardinality The cardinality. ### Exactly(string) Gets a cardinality of exactly the specified value. ```csharp public static Cardinality Exactly(string value) ``` #### Parameters `value` string A value. #### Returns Cardinality The cardinality. ### Range(int, int) Gets a ranged cardinality. ```csharp public static Cardinality Range(int from, int to) ``` #### Parameters `from` int The lower bound of the range. `to` int The upper bound of the range. #### Returns Cardinality The cardinality. ### Range(string, string) Gets a ranged cardinality. ```csharp public static Cardinality Range(string from, string to) ``` #### Parameters `from` string The lower bound of the range. `to` string The upper bound of the range. #### Returns Cardinality The cardinality. ``` -------------------------------- ### Create a Simple Quadrant Chart Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/quadrant-chart.html Use the QuadrantChart method to create a basic quadrant chart and AddPoint to add data points. Coordinates must be between 0 and 1. Build the diagram with the Build method. ```csharp var quadrantChart = Mermaid .QuadrantChart() .AddPoint("A", 0.1, 0.2) .AddPoint("B", 0.3, 0.4) .Build(); ``` ```mermaid quadrantChart A: [0.1, 0.2] B: [0.3, 0.4] ``` -------------------------------- ### Add Links Between Blocks in Mermaid .NET Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/block-diagram.html Use the AddLink method to connect blocks. Links can optionally display text. This example shows basic block creation and linking. ```csharp var diagram = Mermaid .BlockDiagram() .AddBlock("A", out var a) .AddSpace() .AddBlock("B", out var b) .AddLink(a, b) .Build(); ``` ```mermaid block b0["A"] space b1["B"] b0 --> b1 ``` -------------------------------- ### Create Simple State Diagram Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/state-diagram.html Use the StateDiagram method to create a diagram. Add states with AddState and transitions with AddTransitionFromStart, AddStateTransition, and AddTransitionToEnd. Build the diagram code with Build. ```csharp var diagram = Mermaid .StateDiagram() .AddState("State 1", out var s1) .AddState("State 2", out var s2) .AddTransitionFromStart(s1) .AddStateTransition(s1, s2) .AddTransitionToEnd(s2) .Build(); ``` ```mermaid stateDiagram-v2 s1 : State 1 s2 : State 2 [*] --> s1 s1 --> s2 s2 --> [*] ``` -------------------------------- ### Configure XY Chart Axes Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/xy-chart.md.html Specify categorical or numeric X-axes and numeric Y-axes with titles. This example uses categorical X-axis with month labels and a numeric Y-axis with a title. ```csharp string diagram = Mermaid .XYChart("Some title") .WithCategoricalXAxis(["Jan", "Feb", "Mar", "Apr", "May"], "Months") .WithNumericYAxis(0, 100, "Percentage") .AddBarSeries([20, 40, 60, 80, 100]) .AddLineSeries([15, 95, 25, 75, 35]) .Build(); ``` ```mermaid --- title: Some title --- xychart x-axis "Months" ["Jan", "Feb", "Mar", "Apr", "May"] y-axis "Percentage" 0 --> 100 bar [20, 40, 60, 80, 100] line [15, 95, 25, 75, 35] ``` -------------------------------- ### Build Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.SequenceDiagram.SequenceDiagramBuilder.html Generates the final Mermaid code string for the sequence diagram. ```APIDOC ## Build ### Description Builds and returns the Mermaid code string for the sequence diagram that has been constructed. ### Method `Build()` ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * None ### Request Example ```csharp string mermaidCode = builder.Build(); Console.WriteLine(mermaidCode); ``` ### Response #### Success Response (string) * `string`: The generated Mermaid code for the sequence diagram. #### Response Example ```mermaid sequenceDiagram participant Alice participant Bob Alice->>Bob: Hello Bob, how are you? Bob-->>Alice: Fine, thank you! ``` #### Exceptions * `InvalidOperationException`: Thrown when an unknown sequence item is encountered during the build process. This should ideally not happen. ``` -------------------------------- ### UseWidth Property Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Configuration.Model.BaseDiagramConfig.html Sets a specific width for the diagram. This property is nullable. ```csharp [YamlMember(Alias = "useWidth")] public int? UseWidth { get; set; } ``` -------------------------------- ### Set Axis Labels for Quadrant Chart Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/quadrant-chart.html Customize the X and Y axis labels using SetXAxisLabel and SetYAxisLabel methods. These methods can accept one or two parameters for start and end labels. ```csharp var quadrantChart = Mermaid .QuadrantChart() .SetXAxisLabel("Left", "Right") .SetYAxisLabel("Bottom", "Top") .AddPoint("A", 0.1, 0.2) .AddPoint("B", 0.3, 0.4) .Build(); ``` ```mermaid quadrantChart x-axis Left --> Right y-axis Bottom --> Top A: [0.1, 0.2] B: [0.3, 0.4] ``` -------------------------------- ### AddTask (by duration) Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.GanttDiagram.GanttDiagramBuilder.html Adds a task to the Gantt diagram, specifying its name, start date, and duration. It also provides an output parameter for the created task and an optional parameter for task tags. ```APIDOC ## AddTask(string name, DateTimeOffset start, TimeSpan duration, out GanttTask task, TaskTags tags = TaskTags.None) ### Description Adds a task to the Gantt diagram, by specifying the start date and duration. ### Parameters #### Path Parameters - `name` (string) - The name of the task. - `start` (DateTimeOffset) - The start date of the task. - `duration` (TimeSpan) - The duration of the task. - `task` (out GanttTask) - The created task. - `tags` (TaskTags) - Optional. The tags of the task. Defaults to TaskTags.None. #### Returns GanttDiagramBuilder - The current GanttDiagramBuilder instance. #### Exceptions - MermaidException: Thrown when `name` is whitespace, with the reason WhiteSpace. ``` -------------------------------- ### Build Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.XYChart.XYChartBuilder.html Builds the mermaid code string for the configured XY chart. ```APIDOC ## Build() ### Description Builds the mermaid code for the XY chart. ### Returns string - The generated mermaid code. ``` -------------------------------- ### Build Gantt Diagram Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.GanttDiagram.GanttDiagramBuilder.html Builds and returns the Mermaid code string for the configured Gantt diagram. Throws NotSupportedException if an unsupported item type is encountered, though this should not typically happen. ```csharp public string Build()__ ``` -------------------------------- ### AddTask (by untilTask) Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.GanttDiagram.GanttDiagramBuilder.html Adds a task to the Gantt diagram, specifying its name, start date, and the task it should end until. It also provides an output parameter for the created task and an optional parameter for task tags. ```APIDOC ## AddTask(string name, DateTimeOffset start, GanttTask untilTask, out GanttTask task, TaskTags tags = TaskTags.None) ### Description Adds a task to the Gantt diagram, by specifying the start date and a task that it should end until. ### Parameters #### Path Parameters - `name` (string) - The name of the task. - `start` (DateTimeOffset) - The start date of the task. - `untilTask` (GanttTask) - The task that this task should end until. - `task` (out GanttTask) - The created task. - `tags` (TaskTags) - Optional. The tags of the task. Defaults to TaskTags.None. #### Returns GanttDiagramBuilder - The current GanttDiagramBuilder instance. #### Exceptions - MermaidException: Thrown when `name` is whitespace, with the reason WhiteSpace. - MermaidException: Thrown when `untilTask` is not part of the diagram, with the reason ForeignItem. ``` -------------------------------- ### Create a Simple Gantt Diagram Source: https://foggybalrog.github.io/MermaidDotNet/diagrams/gantt-diagram.html Use the GanttDiagram method to create a Gantt diagram and AddTask to add tasks. The Build method generates the Mermaid code. ```csharp string diagram = Mermaid .GanttDiagram() .AddTask("Foo", DateTimeOffset.Parse("2024-05-01"), DateTimeOffset.Parse("2024-05-05"), out _) .AddTask("Bar", DateTimeOffset.Parse("2024-05-03"), DateTimeOffset.Parse("2024-05-08"), out _) .Build(); ``` ```mermaid gantt dateFormat YYYY-MM-DD Foo: task1, 2024-05-01, 2024-05-05 Bar: task2, 2024-05-03, 2024-05-08 ``` -------------------------------- ### Create User Journey Diagram Builder Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.Mermaid.html Initiates the building process for a User Journey Diagram. This builder can be configured with an optional title, Mermaid configuration, and Mermaid.Net options. ```csharp public static UserJourneyDiagramBuilder UserJourneyDiagram(string? title = null, MermaidConfig? config = null, MermaidDotNetOptions? options = null) ``` -------------------------------- ### Build Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.PieChart.PieChartBuilder.html Builds the Mermaid code string for the pie chart based on the added data sets. ```APIDOC ## Build() ### Description Builds the Mermaid code for the pie chart. ### Method Signature ```csharp public string Build() ``` ### Returns - string - The Mermaid code for the pie chart. ``` -------------------------------- ### AddState Method Source: https://foggybalrog.github.io/MermaidDotNet/api/FoggyBalrog.MermaidDotNet.StateDiagram.StateDiagramBuilder.html Adds a simple state to the state diagram. Throws a MermaidException if the description is whitespace. ```csharp public StateDiagramBuilder AddState(string description, out State state) ```