Research Article

Graph Drawing and Analysis Library and Its Domain-Specific Language for Graphs’ Layout Specifications

Listing 6

JAVA code corresponding to the layout specification from Listing 5.
//select algorithm
LayoutAlgorithms algorithm = LayoutAlgorithms.RADIAL_TREE;
//set properties
GraphLayoutProperties  layoutProperties = new  GraphLayoutProperties();
layoutProperties.setProperty(RadialTreeProperties.X_DISTANCE,5);
layoutProperties.setProperty(RadialTreeProperties.Y_DISTANCE,20);
//initialize the layouter, assuming that vertices and edges
//are lists containing elements of the graph
Layouter<GraphVertex, GraphEdge> layouter = new  Layouter<>(
              vertices, edges, algorithm, layoutProperties);
Drawing<GraphVertex, GraphEdge> drawing = layouter.layout();