private static <V extends VisualVertex, E extends VisualEdge<V>> Function<V, Rectangle> 
		createVertexToBoundsTransformer(VisualizationServer<V, E> viewer) {
	//@formatter:on

		RenderContext<V, E> context = viewer.getRenderContext();
		Function<? super V, Shape> shapeTransformer = context.getVertexShapeTransformer();
		Layout<V, E> layout = viewer.getGraphLayout();
		Function<V, Rectangle> transformer = v -> {

			Shape s = shapeTransformer.apply(v);
			Rectangle bounds = s.getBounds();
			Point2D p = layout.apply(v);

			// Note: we use the raw x/y of the layout; the view code will center the vertices
			bounds.setLocation(new Point((int) p.getX(), (int) p.getY()));
			return bounds;
		};
		return transformer;
	}
Transforms the given edge loop shape to graph space, which includes updating
the size and location of the loop to be relative to the vertex.

@param edgeLoopShape The shape to transform
@param vertexShape The shape of the vertex for which the edge is being created
@param x The x coordinate of the vertex
@param y The y coordinate of the vertex
@return the transformed edge loop shape
Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/GraphViewerUtils.java