Class LayoutUtil

java.lang.Object
edu.cmu.tetrad.graph.LayoutUtil

public class LayoutUtil extends Object

LayoutUtil class.

Version:
$Id: $Id
Author:
josephramsey
  • Constructor Details

    • LayoutUtil

      public LayoutUtil()
      Constructor.
  • Method Details

    • kamadaKawaiLayout

      public static void kamadaKawaiLayout(Graph graph, boolean randomlyInitialized, double naturalEdgeLength, double springConstant, double stopEnergy)

      kamadaKawaiLayout.

      Parameters:
      graph - a Graph object
      randomlyInitialized - a boolean
      naturalEdgeLength - a double
      springConstant - a double
      stopEnergy - a double
    • fruchtermanReingoldLayout

      public static void fruchtermanReingoldLayout(Graph graph)

      fruchtermanReingoldLayout.

      Parameters:
      graph - a Graph object
    • arrangeByLayout

      public static void arrangeByLayout(Graph graph, HashMap<String,PointXy> layout)

      arrangeByLayout.

      Parameters:
      graph - a Graph object
      layout - a HashMap object
    • defaultLayout

      public static void defaultLayout(Graph graph)
      Arranges the nodes in the graph in a circle if there are 20 or fewer nodes, otherwise arranges them in a square.
      Parameters:
      graph - the graph to be arranged.
    • circleLayout

      public static void circleLayout(Graph graph)
      Arranges the nodes in the graph in a circle.
      Parameters:
      graph - the graph to be arranged.
    • squareLayout

      public static void squareLayout(Graph graph)

      squareLayout.

      Parameters:
      graph - a Graph object
    • layoutByCausalOrder

      public static void layoutByCausalOrder(Graph graph)

      layoutByCausalOrder.

      Parameters:
      graph - a Graph object
    • arrangeBySourceGraph

      public static boolean arrangeBySourceGraph(Graph resultGraph, Graph sourceGraph)
      Arranges the nodes in the result graph according to their positions in the source graph.
      Parameters:
      resultGraph - a Graph object
      sourceGraph - a Graph object
      Returns:
      true if all the nodes were arranged, false if not.