@SuppressWarnings("unchecked")
	public void setLayout(String layoutName) {
		LayoutAlgorithm.Builder<AttributedVertex, ?, ?> builder = layoutFunction.apply(layoutName);
		LayoutAlgorithm<AttributedVertex> layoutAlgorithm = builder.build();
		// layout algorithm considers the size of vertices
		if (layoutAlgorithm instanceof VertexBoundsFunctionConsumer) {
			((VertexBoundsFunctionConsumer<AttributedVertex>) layoutAlgorithm)
					.setVertexBoundsFunction(vertexBoundsFunction);
		}
		// mincross layouts are 'layered'. put some bounds on the number of
		// iterations of the level cross function based on the size of the graph
		// very large graphs do not improve enough to out-weigh the cost of
		// repeated iterations
		if (layoutAlgorithm instanceof Layered) {
			((Layered<AttributedVertex, AttributedEdge>) layoutAlgorithm).setMaxLevelCrossFunction(
				g -> Math.max(1, Math.min(10, 500 / g.vertexSet().size())));
		}
		// tree layouts need a way to determine which vertices are roots
		// especially when the graph is not a DAG
		if (layoutAlgorithm instanceof TreeLayout) {
			((TreeLayout<AttributedVertex>) layoutAlgorithm).setRootPredicate(rootPredicate);
		}
		// remove any previously added layout paintables
		// and apply paintables to these 2 algorithms
		removePaintable(radialLayoutRings);
		removePaintable(balloonLayoutRings);
		if (layoutAlgorithm instanceof BalloonLayoutAlgorithm) {
			balloonLayoutRings = new LayoutPaintable.BalloonRings<>(visualizationServer,
				(BalloonLayoutAlgorithm<AttributedVertex>) layoutAlgorithm);
			visualizationServer.addPreRenderPaintable(balloonLayoutRings);
		}
		if (layoutAlgorithm instanceof RadialTreeLayout) {
			radialLayoutRings = new LayoutPaintable.RadialRings<>(visualizationServer,
				(RadialTreeLayout<AttributedVertex>) layoutAlgorithm);
			visualizationServer.addPreRenderPaintable(radialLayoutRings);
		}

		// apply the layout algorithm
		LayoutAlgorithmTransition.apply(visualizationServer, layoutAlgorithm);
	}
set the layout in order to configure the requested {@link LayoutAlgorithm}
@param layoutName the name of the layout algorithm to use
Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/LayoutTransitionManager.java