tryAlternativeLayouts

fun <N> tryAlternativeLayouts(children: Array<N>, bounds: Rectangle2D, rectangles: Array<Rectangle2D?>, accessor: TreeMapAccessor<N>): Array<Rectangle2D?>

If number of items is <= 5, lay them either in a pivot, quad, or snake layout. Pick the best layout whose average aspect ratio is closest to 1.

Return

the new layout

Parameters

children

the child nodes

bounds

the bounding box

rectangles

the current layout