Attri-Beauty: Using JGraph Attribute Maps

Graph connectivity represents only the interconnection of vertices, not the placement or arrangement of them in a graphical sense. We saw this in the previous section when we used JGraph's add-ons API to create a circular layout. We needed something besides the graph model to set the location of each vertex. In JGraph, every vertex has an attribute map associated with it. This map contains attributes for location, color, and other properties of the view. The CircleGraphLayout class from the previous section works by setting the location attribute inside each vertex's map.

You can work with the attributes ...

Get Wicked Cool Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.