Skip to content

visualization and sample code from Java Universal Network Graph ported to use JGraphT models and algorithms

License

Notifications You must be signed in to change notification settings

tomnelson/jungrapht-visualization

Repository files navigation

JUNGRAPHT-VISUALIZATION: The JUNG visualization and sample code modernized and ported to use JGraphT graphs and algorithms

build workflow Maven Central Snapshot License Language

JUNGRAPHT-VISUALIZATION Website

JUNGRAPHT-VISUALIZATION can be used to render any of the following:

  • org.jgrapht.Graph
  • com.google.common.graph.Network
  • com.google.common.graph.Graph

JUNGRAPHT-VISUALIZATION includes performance enhancements for visualization of large networks, including R*Tree for visualization, Barnes-Hut Quad Tree for force-directed layouts, and a lightweight rendering layer that can swap in while graphs are being animated or when they are zoomed out to a point where details are very small. In the ShowLayoutsWithJGraptIO demonstration program, the lightweight rendering layer allows fast enough rendering that the performance impact of the Barnes Hut Quad Tree for the force directed layout becomes obvious.

Many rendering features may be set via java properties (see sample.jungrapht.properties for keys and default values).

JUNGRAPHT-VISUALIZATION includes the jungrapht-layout module, which is independent of any java.awt imports (so that it may be more easily used by JavaFX or other rendering systems). Jungrapht-layout includes improved layout algorithms for directed graphs and Trees, including the TidierTreeLayoutAlgorithm and the SugiyamaLayoutAlgorithm. All TreeLayoutAlgorithms will make a best attempt to draw any directed graph (by ignoring cycles and reversing feedback edges) for which one or more Root vertices can be determined. Any TreeLayoutAlgorithm, when given an undirected graph, will create a SpanningTree in order to use the TreeLayoutAlgorithm. There are Vertex/Edge Predicates and Vertex/Edge Comparators that are used to coerce out the desired tree structure based on a user-defined procedure to find roots and follow the desired path. All TreeLayoutAlgorithms, including the TidierTreeLayoutAlgorithm, will draw either single or multiple rooted 'forest' graphs. CircleLayout has been improved with an option to reduce edge crossing.

JUNGRAPHT-VISUALIZATION Design and Features:

LayoutAlgorithm and LayoutModel

MouseGestures

Graph using TidierTreeLayoutAlgorithm

Image TidierTree

Graph using SugiyamaLayoutAlgorithm

Image SugiyamaLayout

Graph using Eiglsperger Optimization of SugiyamaLayoutAlgorithm

Image SugiyamaLayout

Graph using CircleLayoutAlgorithm

Image CircleLayout

Same graph using CircleLayoutAlgorithm with reduced edge crossing

Image ReducedEdgeCrossing

Latest Release

The most recent version of JUNGRAPHT-VISUALIZATION is version 1.4, released 20 March 2023.

To add a dependency on this release of JUNGRAPHT-VISUALIZATION using Maven, use the following:

<dependency>
  <groupId>com.github.tomnelson</groupId>
  <artifactId>jungrapht-visualization</artifactId>
  <version>1.4</version>
</dependency>

Snapshots

Snapshots of JUNGRAPHT-VISUALIZATION built from the master branch are available through Maven using version 1.5-SNAPSHOT.

Links