public static <V, E> Rectangle getBoundsForVerticesInLayoutSpace(
			VisualizationServer<V, E> viewer, Collection<V> vertices) {

		Layout<V, E> layout = viewer.getGraphLayout();
		RenderContext<V, E> renderContext = viewer.getRenderContext();
		Function<? super V, Shape> shapeTransformer = renderContext.getVertexShapeTransformer();

		Function<V, Rectangle> transformer = v -> {

			Shape shape = shapeTransformer.apply(v);
			Rectangle bounds = shape.getBounds();
			Point2D point = layout.apply(v);
			bounds.setLocation(new Point((int) point.getX(), (int) point.getY()));
			return bounds;
		};
		return getBoundsForVerticesInLayoutSpace(vertices, transformer);
	}
Returns a rectangle that contains all give vertices

@param viewer the viewer containing the UI
@param vertices the vertices 
@return a rectangle that contains all give vertices
Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/GraphViewerUtils.java