Home
Categories
Dictionary
Download
Project Details
Changes Log
FAQ
License

Layouts



The layouts library allows to apply a layout to a graph. Note that the layout library uses code from the JUNG library

Usage

The GraphMLLayoutFactory is a factory class which allows to apply any layout which is provided in the library:

Example

For example:
      GraphmlFactory factory = GraphmlFactory.getInstance();
      GraphmlDiagram diagram = factory.newDiagram();
      // add nodes to the diagram
      // ..
      //
      
      GraphMLLayoutFactory lfactory = GraphMLLayoutFactory.getInstance();
      FRLayout layout = lfactory.newFRLayout();
      lfactory.layout(diagram, layout);

List of supported layouts

The supported layouts are:
  • BalloonLayout: a Layout that assigns positions to vertices using associations with nested circles ("balloons"). A balloon is nested inside another balloon if the first balloon's subtree is a subtree of the second balloon's subtree
  • CircleLayout: A Layout that positions vertices equally spaced on a regular circle
  • DAGLayout: An implementation of Layout suitable for tree-like directed acyclic graphs. Parts of it will probably not terminate if the graph is cyclic. The layout will result in directed edges pointing generally upwards. Any vertices with no successors are considered to be level 0, and tend towards the top of the layout. Any vertex has a level one greater than the maximum level of all its successors
  • FRLayout: Implements the Fruchterman-Reingold force-directed algorithm for node layout[1]
    The purpose of this algorithm is to position the nodes of a graph in two-dimensional or three-dimensional space so that all the edges are of more or less equal length and there are as few crossing edges as possible, by assigning forces among the set of edges and the set of nodes, based on their relative positions, and then using these forces either to simulate the motion of the edges and nodes or to minimize their energy
  • FRLayout2: An optimized version of the FRLayout, but with the same objective
  • ISOMLayout: Implements a self-organizing map layout algorithm, based on Meyer's self-organizing graph methods[2]
    See github.com/w8r/isom-layout for more information
  • KKLayout: Implements the Kamada-Kawai algorithm for node layout, which is another forece-directed graph algorithm.Note that this algorithm is designed for undirected graphs
  • RadialTreeLayout: A radial layout for graphs
  • SpringLayout: The SpringLayout represents a visualization of a set of nodes
  • SpringLayout2: An optimized version of the SpringLayout algorithm
  • SugiyamaLayout: A Sugiyama layout implementation. Layered graph drawing or hierarchical graph drawing is a type of graph drawing in which the vertices of a directed graph are drawn in horizontal rows or layers with the edges generally directed downwards

Distribution

Main Article: distribution

To use the layouts library, you must have the JGraphml-layout.jar jar file in your classpath.

Notes

  1. ^ The purpose of this algorithm is to position the nodes of a graph in two-dimensional or three-dimensional space so that all the edges are of more or less equal length and there are as few crossing edges as possible, by assigning forces among the set of edges and the set of nodes, based on their relative positions, and then using these forces either to simulate the motion of the edges and nodes or to minimize their energy
  2. ^ See github.com/w8r/isom-layout for more information

Categories: layouts

Copyright 2021 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence