Package-level declarations

Layout result types, transformation utilities, and bounding box helpers. TreeLayoutResult is a concrete class providing chainable coordinate transforms (mapped, centered, scaledTo, normalized, translated). LayoutTransition enables animated interpolation between two layout states. Extension functions toJson and fromJson provide zero-dependency JSON serialization.

Types

Link copied to clipboard
data class Bounds(val minX: Float, val minY: Float, val maxX: Float, val maxY: Float)

Axis-aligned bounding box of a tree layout.

Link copied to clipboard

Represents a transition between two layout states, enabling animation by interpolating node positions at a given progress fraction.

Link copied to clipboard
class TreeLayoutResult<T>(positions: Map<T, Point>, maxDepth: Int)

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

Functions

Link copied to clipboard

Deserializes a TreeLayoutResult from a JSON string previously produced by toJson.

Link copied to clipboard
fun <T> TreeLayoutResult<T>.toJson(nodeToKey: (T) -> String): String

Serializes a TreeLayoutResult to a JSON string.