Package com.treemap

# Class AlgorithmFactory

java.lang.Object
com.treemap.AlgorithmFactory

@JsType public class AlgorithmFactory extends Object
Factory class for accessing predefined layout algorithms.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final Algorithm`
  `BAR`
  Bar Chart layout.
  `static final Algorithm`
  `BINARY_TREE`
  Implementation of the Binary Tree algorithm.
  `static final Algorithm`
  `CIRCLEPACKING`
  Circle packing treemap layout.
  `static final Algorithm`
  `CIRCULAR`
  Circular treemap layout.
  `static final Algorithm`
  `ICICLE`
  `static final Algorithm`
  `MATRIX`
  Matrix layout.
  `static final Algorithm`
  `PIE`
  Pie Chart layout.
  `static final Algorithm`
  `PIVOT_BY_SPLIT_SIZE`
  Implementation of the Pivot By algorithm.
  `static final Algorithm`
  `SLICE`
  Implementation of the Slice-and-dice algorithm described in the original treemap paper.
  `static final Algorithm`
  `SPLIT`
  Implementation of the Split algorithm.
  `static final Algorithm`
  `SQUARIFIED`
  Implementation of the Squarified algorithm.
  `static final Algorithm`
  `SQUARIFIEDPLUS`
  Implementation of the Squarified+ algorithm.
  `static final Algorithm`
  `STRIP`
  Implementation of the Strip algorithm.
  `static final Algorithm`
  `SUNBURST`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AlgorithmFactory(Algorithm... entries)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(Algorithm entry)`
  `Algorithm`
  `get(String name)`
  `List<Algorithm>`
  `getAlgorithms()`
  `Algorithm`
  `getDefault()`
  `static AlgorithmFactory`
  `getInstance()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### BINARY_TREE

    public static final Algorithm BINARY_TREE
    Implementation of the Binary Tree algorithm. It is described in:

    Martin Wattenberg and Ben Bederson: Dynamic treemap layout comparison. University of Maryland: http://www.cs.umd.edu/hcil/treemap-history/java_algorithms/LayoutApplet.html.

    Complexity: O(n log n), where n is the number of nodes in the tree.

  - ### SLICE

    public static final Algorithm SLICE
    Implementation of the Slice-and-dice algorithm described in the original treemap paper. It is described in:

    Ben Shneiderman. 'Tree Visualization with Tree-Maps: 2-d Space-filling Approach." ACM Transactions on Graphics, 11(1), pp. 92-99, 1992.

    It uses parallel lines to divide a rectangle representing an item into smaller rectangles representing its children. At each level of hierarchy the orientation of the lines - vertical or horizontal - is switched (alternate), computed according to the aspect ratio (Best), or fixed (Vertical, Horizontal).

    Complexity: O(n), where n is the number of nodes in the tree.

  - ### SQUARIFIED

    public static final Algorithm SQUARIFIED
    Implementation of the Squarified algorithm. It is described in:

    Bruls, D.M., C. Huizing, J.J. van Wijk. "Squarified Treemaps". In: W. de Leeuw, R. van Liere (eds.), Data Visualization 2000, Proceedings of the joint Eurographics and IEEE TCVG Symposium on Visualization, 2000, pp. 33-42.

    Sub-divids a parent rectangular area into child rectangles. It implements the squaring treemap algorithm where all child nodes are allocated areas proportional to their values, but the aspect ratio of each rectangle is kept as close as possible to a square.

    Complexity: O(n), where n is the number of nodes in the tree.

  - ### SQUARIFIEDPLUS

    public static final Algorithm SQUARIFIEDPLUS
    Implementation of the Squarified+ algorithm. It is described in:

    Cesarano A, Ferrucci F, Torre M. A heuristic extending the Squarified treemapping algorithm. arXiv preprint arXiv:1609.00754. 2016 Sep 2.

    A heuristic extending the squarified algorithm with better aspect ratios and higher homogeneity among items.

    Complexity: O(n), where n is the number of nodes in the tree.

  - ### STRIP

    public static final Algorithm STRIP
    Implementation of the Strip algorithm. It is described in:

    Ben Shneiderman and Martin Wattenberg. Ordered and quantum treemaps. Information Visualization, 2001. Infovis 2001. IEEE Symposium on pages 73-78, 2001. ISSN 1522-404X.

    Complexity: O(sqrt(n)) average, O(n) worse case, where n is the number of nodes in the tree.

  - ### PIVOT_BY_SPLIT_SIZE

    public static final Algorithm PIVOT_BY_SPLIT_SIZE
    Implementation of the Pivot By algorithm. It is described described in:

    Ben Shneiderman and Martin Wattenberg. Ordered treemap layouts. IEEE Symposium on Information Visualization, 0:73, 2001.

    Complexity: O(n^2), where n is the number of nodes in the tree (depends on the pivot in use).

  - ### SPLIT

    public static final Algorithm SPLIT
    Implementation of the Split algorithm. It is described in:

    Engdahl, B. "Ordered and Unordered Treemap Algorithms and Their Applications on Handheld Devices". 2005.

    Produces a layout where the natural ordering of the data set is roughly preserved, while in most cases producing better aspect ratios than the Pivot and the Strip treemaps.

    Complexity: O(n log n) (worst case), O(n) average, where n is the number of nodes in the tree.

  - ### CIRCULAR

    public static final Algorithm CIRCULAR
    Circular treemap layout.

  - ### CIRCLEPACKING

    public static final Algorithm CIRCLEPACKING
    Circle packing treemap layout.

  - ### PIE

    public static final Algorithm PIE
    Pie Chart layout.

  - ### BAR

    public static final Algorithm BAR
    Bar Chart layout.

  - ### MATRIX

    public static final Algorithm MATRIX
    Matrix layout.

  - ### SUNBURST

    public static final Algorithm SUNBURST

  - ### ICICLE

    public static final Algorithm ICICLE

- ## Constructor Details

  - ### AlgorithmFactory

    protected AlgorithmFactory(Algorithm... entries)

- ## Method Details

  - ### getInstance

    public static AlgorithmFactory getInstance()

  - ### add

    public void add(Algorithm entry)

  - ### getDefault

    public Algorithm getDefault()

  - ### getAlgorithms

    public List<Algorithm> getAlgorithms()

  - ### get

    public Algorithm get(String name)