---
title: CompactBox
order: 3
---
The nodes with the same depth will be layed on the same level. The node size will be considred while doing layout.
## 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.