TreeLayoutResult

abstract class TreeLayoutResult<T>

The result of a tree layout computation, providing access to node positions, layout metadata, and transformation utilities.

Type Parameters

T

The node type of the external tree.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

Returns the axis-aligned bounding box of all node positions.

Link copied to clipboard
abstract fun getMaxDepth(): Int

Returns the maximum depth of the tree.

Link copied to clipboard
abstract fun getPosition(node: T): Point

Returns the position assigned to node.

Link copied to clipboard
abstract fun getPositions(): Map<T, Point>

Returns all node-to-position mappings.

Link copied to clipboard

Returns a new result with all positions shifted so the minimum corner is at the origin.

Link copied to clipboard
fun scaledTo(width: Float, height: Float): TreeLayoutResult<T>

Returns a new result uniformly scaled to fit within width×height, preserving aspect ratio. Positions are normalized to origin before scaling.

Link copied to clipboard

Returns a new result with all positions shifted by dx and dy.