TreemapLayout Class

Lays a tree out as nested rectangles whose areas are proportional to the values of the nodes, as d3's treemap.

public sealed class TreemapLayout

Constructors

NameDescription
TreemapLayout()

TreemapLayout()

TreemapLayout.cs
public TreemapLayout()

No documentation is available.

Properties

NameDescription
HeightGets or sets the height of the layout. The default is 1.
PaddingInnerGets or sets the space between siblings. The default is 0.
PaddingOuterGets or sets the space between the edges of a node and its children. The default is 0.
PaddingTopGets or sets the space between the top edge of a node and its children, to make room for a label, or null for TreemapLayout.PaddingOuter.
RatioGets or sets the target aspect ratio of TreemapTiling.Squarified. The default is the golden ratio.
TilingGets or sets how the rectangle of a node is divided among its children. The default is TreemapTiling.Squarified.
WidthGets or sets the width of the layout. The default is 1.

Gets or sets the height of the layout. The default is 1.

public double Height { get; set; }

Property value

double

PaddingInner

TreemapLayout.cs

Gets or sets the space between siblings. The default is 0.

public double PaddingInner { get; set; }

Property value

double

PaddingOuter

TreemapLayout.cs

Gets or sets the space between the edges of a node and its children. The default is 0.

public double PaddingOuter { get; set; }

Property value

double

Gets or sets the space between the top edge of a node and its children, to make room for a label, or null for TreemapLayout.PaddingOuter.

public double? PaddingTop { get; set; }

Property value

double?

Gets or sets the target aspect ratio of TreemapTiling.Squarified. The default is the golden ratio.

public double Ratio { get; set; }

Property value

double

Gets or sets how the rectangle of a node is divided among its children. The default is TreemapTiling.Squarified.

public TreemapTiling Tiling { get; set; }

Property value

TreemapTiling

Gets or sets the width of the layout. The default is 1.

public double Width { get; set; }

Property value

double

Methods

NameDescription
Layout<T>(HierarchyNode<T>)Places the nodes of a tree. The values of the nodes must be computed first (HierarchyNode<T>.Sum).

Layout<T>(HierarchyNode<T>)

TreemapLayout.cs

Places the nodes of a tree. The values of the nodes must be computed first (HierarchyNode<T>.Sum).

public IReadOnlyList<HierarchyRectangle<T>> Layout<T>(HierarchyNode<T> root)

Type parameters

T
The type of the data of the nodes.

Parameters

root HierarchyNode<T>
The root of the tree.

Returns

IReadOnlyList<HierarchyRectangle<T>> The rectangle of every node, in pre-order.