General Properties
PackShape:
Elliptical
Rectangular
Spiral
PackMode:
Aspect Ratio
Expand to Fit
Fit

Aspect ratio: |
Layout width: |
Layout height: |

Node Sorting Properties
SortOrder:
Descending
Ascending
SortMode:
None (do not sort nodes)
Max Side Length
Area
Padding between nodes
Spacing:
Circle Packing
hasCircularNodes Node Generation

Number of nodes: |
Node shape: Rectangles Ellipses
Minimum side length: |
Maximum side length: |

Same width/height

This sample demonstrates a custom Layout, PackedLayout, which attempts to pack nodes as close together as possible without overlap. Each node is assumed to be either rectangular or circular (dictated by the 'hasCircularNodes' property). This layout supports packing nodes into either a rectangle or an ellipse, with the shape determined by the PackShape and the aspect ratio determined by either the aspectRatio property, or the specified width and height (depending on the PackMode).

The layout is defined in its own file, as PackedLayout.js, with an additional dependency on Quadtree.js.