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 mode
FIXED_SIZE
to arrange the graph with an aspect ratio close to the aspect
ratio of the GraphComponent. Otherwise, the algorithm will use layout mode
AUTO_SIZE
to get a result that is as compact as possible.
If layout mode FIXED_SIZE
is used, the tabular layout algorithm requires a
LayoutGrid that defines the columns and rows for the resulting tabular
arrangement. A LayoutGrid
is not necessary for layout mode
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.