TreemapNode Class

A node of a treemap: a section, which groups other nodes, or a leaf, whose value gives its area. As in Mermaid, a node with a TreemapNode.Value is a leaf, and a node without one is a section.

public sealed class TreemapNode

Constructors

NameDescription
TreemapNode(string, double?)Initializes a new instance of the TreemapNode class.

TreemapNode(string, double?)

TreemapNode.cs

Initializes a new instance of the TreemapNode class.

public TreemapNode(string name, double? value = null)

Parameters

name string
The name, drawn in the node.
value double?
The value of a leaf, or null for a section.

Exceptions

ArgumentOutOfRangeException
value is negative, not finite or larger than 1E+300.

Properties

NameDescription
ChildrenGets the children of a section. In Mermaid, a leaf has no children.
CssClassGets or sets the name of the class of the node (Mermaid :::class), whose style is in TreemapChart.ClassDefinitions, or null for none.
NameGets or sets the name, drawn in the node.
ValueGets or sets the value of a leaf, or null for a section, whose value is the sum of the values of its children.

Gets the children of a section. In Mermaid, a leaf has no children.

public IList<TreemapNode> Children { get; }

Property value

IList<TreemapNode>

Gets or sets the name of the class of the node (Mermaid :::class), whose style is in TreemapChart.ClassDefinitions, or null for none.

public string? CssClass { get; set; }

Property value

string?

Gets or sets the name, drawn in the node.

public string Name { get; set; }

Property value

string

Gets or sets the value of a leaf, or null for a section, whose value is the sum of the values of its children.

public double? Value { get; set; }

Property value

double?

Exceptions

ArgumentOutOfRangeException
The value is negative, not finite or larger than 1E+300.

Methods

NameDescription
AddChild(string, double?)Adds a child.

AddChild(string, double?)

TreemapNode.cs

Adds a child.

public TreemapNode AddChild(string name, double? value = null)

Parameters

name string
The name, drawn in the node.
value double?
The value of a leaf, or null for a section.

Returns

TreemapNode The child.

Exceptions

ArgumentOutOfRangeException
value is negative, not finite or larger than 1E+300.