Class FrontChainPacker

java.lang.Object
micycle.pgs.commons.FrontChainPacker

public class FrontChainPacker extends Object
Circle packing of rectangle boundaries using the front-chain packing algorithm from 'Visualization of Large Hierarchical Data by Circle Packing'.

The algorithm initialises circles in the boundary center and builds up the packing in a spiral pattern from this center until it reaches the rectangle boundary.

Author:
Mike Bostock, Java port and modifications by Michael Carleton
  • Constructor Summary

    Constructors
    Constructor
    Description
    FrontChainPacker(float width, float height, float radiusMin, float radiusMax)
    Creates a FrontChainPacker instance.
    FrontChainPacker(float width, float height, float radiusMin, float radiusMax, float offsetX, float offsetY, long seed)
    Creates a FrontChainPacker instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<processing.core.PVector>
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FrontChainPacker

      public FrontChainPacker(float width, float height, float radiusMin, float radiusMax)
      Creates a FrontChainPacker instance. Circles are packed upon initialisation.

      Each circle in the output packing is prescribed a random radius between the range given.

      Parameters:
      width - width of rectangle boundary to pack
      height - height of rectangle boundary to pack
      radiusMin - minimum radius of circles in the packing
      radiusMax - maximum radius of circles in the packing#
      See Also:
      • #FrontChainPacker(float, float, float, float, float, float)
    • FrontChainPacker

      public FrontChainPacker(float width, float height, float radiusMin, float radiusMax, float offsetX, float offsetY, long seed)
      Creates a FrontChainPacker instance. Circles are packed upon initialisation. Each circle in the output packing is prescribed a random radius between a radius range given by its minimum and maximum values.
      Parameters:
      width - width of rectangle boundary to pack
      height - height of rectangle boundary to pack
      radiusMin - minimum radius of circles in the packing
      radiusMax - maximum radius of circles in the packing
      See Also:
  • Method Details

    • getCircles

      public List<processing.core.PVector> getCircles()