---
title: CompactBox
order: 0
redirect_from:
  - /en/examples
---

The nodes with the same depth will be layed on the same level. The node size will be considred while doing layout. <br /> <img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*z-ESRoHTpvIAAAAAAAAAAABkARQnAQ' alt='compactbox' width='300'/>

## Usage

CompactBox is an appropriate layout method for tree data structure. As the demo below, you can deploy it in `layout` while instantiating Graph.

You can set different configurations for different nodes if the parameter is Function type. Please refer to the ducuments for more information.
