TreemapChart Class
A treemap: a hierarchy drawn as nested rectangles, each leaf with an area proportional to its value, each section around its children with its name and its total (Mermaid treemap). It is drawn with the TreemapMark<T> of Meziantou.Framework.Charts, whose squarified layout is the one of d3-hierarchy that Mermaid uses, and the nodes of each section are sorted by decreasing value.
public sealed class TreemapChart : MermaidChart- Inheritance
MermaidChartTreemapChart
Constructors
| Name | Description |
|---|---|
| TreemapChart() |
TreemapChart()
TreemapChart.cspublic TreemapChart()No documentation is available.
Properties
| Name | Description |
|---|---|
| ClassDefinitions | Gets the styles of the classes of the nodes, by name (Mermaid classDef). The fill and the opacity of a style color the nodes of its class; the border, the text and the font of a style are written back but not drawn. |
| DiagramPadding | Gets or sets the space around the top-level nodes, in pixels (Mermaid diagramPadding). The default is 8. |
| InnerPadding | Gets or sets the space between the nodes of a section, in pixels (Mermaid padding). The default is 10. |
| NodeHeight | Gets or sets a tenth of the height of the treemap, in pixels, as the nodeHeight of Mermaid. The default is 40: the treemap is laid out in 400 pixels. |
| NodeWidth | Gets or sets a tenth of the width of the treemap, in pixels, as the nodeWidth of Mermaid. The default is 100: the treemap is laid out in 1,000 pixels. |
| Nodes | Gets the top-level nodes. |
| ShowValues | Gets or sets a value that indicates whether the values of the nodes are drawn: under the names of the leaves, and after the names of the sections. The default is true. |
| ValueFormat | Gets or sets the format of the values: a format specifier of d3-format, such as , (the default, with thousands separators), .1f or .0%, optionally after a $, as in Mermaid. An invalid format falls back to ,. A leaf shows its value under its name, and a section after its name. |
ClassDefinitions
TreemapChart.csGets the styles of the classes of the nodes, by name (Mermaid classDef). The fill and the opacity of a style color the nodes of its class; the border, the text and the font of a style are written back but not drawn.
public IDictionary<string, DiagramStyle> ClassDefinitions { get; }Property value
DiagramPadding
TreemapChart.csGets or sets the space around the top-level nodes, in pixels (Mermaid diagramPadding). The default is 8.
public double DiagramPadding { get; set; }InnerPadding
TreemapChart.csGets or sets the space between the nodes of a section, in pixels (Mermaid padding). The default is 10.
public double InnerPadding { get; set; }NodeHeight
TreemapChart.csGets or sets a tenth of the height of the treemap, in pixels, as the nodeHeight of Mermaid. The default is 40: the treemap is laid out in 400 pixels.
public double NodeHeight { get; set; }NodeWidth
TreemapChart.csGets or sets a tenth of the width of the treemap, in pixels, as the nodeWidth of Mermaid. The default is 100: the treemap is laid out in 1,000 pixels.
public double NodeWidth { get; set; }Nodes
TreemapChart.csShowValues
TreemapChart.csValueFormat
TreemapChart.csGets or sets the format of the values: a format specifier of d3-format, such as , (the default, with thousands separators), .1f or .0%, optionally after a $, as in Mermaid. An invalid format falls back to ,. A leaf shows its value under its name, and a section after its name.
public string ValueFormat { get; set; }Property value
Methods
| Name | Description |
|---|---|
| AddNode(string, double?) | Adds a top-level node. |
| EnumerateNodes() | Enumerates the nodes and their descendants, depth first. |
AddNode(string, double?)
TreemapChart.csAdds a top-level node.
public TreemapNode AddNode(string name, double? value = null)Parameters
Returns
TreemapNode The node.
Exceptions
ArgumentOutOfRangeExceptionvalueis negative, not finite or larger than 1E+300.
EnumerateNodes()
TreemapChart.csEnumerates the nodes and their descendants, depth first.
public IEnumerable<TreemapNode> EnumerateNodes()Returns
IEnumerable<TreemapNode> The nodes.