Preserve Aspect Ratio
Start here

# Compact Tabular Layout

This demo shows how to configure the TabularLayout to create compact drawings.

The algorithm tries to calculate an arrangement that minimizes edge lengths. Since tabular layout only supports straight-line edges, EdgeRouter is used to calculate the final edge paths.

If the Preserve Aspect Ratio button in the toolbar is selected, the tabular layout algorithm will use layout policy `FIXED_SIZE` to arrange the graph with an aspect ratio close to the aspect ratio of the GraphComponent. Otherwise, the algorithm will use layout policy `AUTO_SIZE` to get a result that is as compact as possible.

If layout policy `FIXED_SIZE` is used, the tabular layout algorithm requires a PartitionGrid that defines the columns and rows for the resulting tabular arrangement. A `PartitionGrid` is not necessary for layout policy `AUTO_SIZE`. However, an empty grid may be given to the algorithm to specify the distances between the automatically calculated columns and rows.

### Code Snippet

You can copy the code snippet to configure the layout from GitHub.

### Documentation

The Developer's Guide provides more information about the tabular layout algorithm.