Options
All
  • Public
  • Public/Protected
  • All
Menu

Layout of the nodes in a network.

Hierarchy

  • Layout

Index

Properties

coordinates: number[][]

Coordinates of each node.

nNodes: number

Number of nodes.

Constructors

Methods

  • initializeBasedOnNNodes(nNodes: number): void
  • Initializes a random layout for a specified number of nodes.

    Parameters

    • nNodes: number

      Number of nodes

    Returns void

  • initializeBasedOnNNodesAndRandom(nNodes: number, random: Random): void
  • Initializes a random layout for a specified number of nodes.

    Parameters

    • nNodes: number

      Number of nodes

    • random: Random

      Random number generator

    Returns void

  • initializeBasedOnCoordinates(coordinates: number[][]): void
  • Initializes a layout using specified coordinates for each node.

    Parameters

    • coordinates: number[][]

      Coordinates of each node

    Returns void

  • getNNodes(): number
  • Returns the number of nodes.

    Returns number

    Number of nodes

  • getCoordinates(): number[][]
  • Returns the coordinates of each node.

    Returns number[][]

    Coordinates of each node

  • getCoordinatesNode(node: number): number[]
  • Returns the coordinates of a node.

    Parameters

    • node: number

      Node

    Returns number[]

    Coordinates

  • getMinCoordinates(): number[]
  • Returns the minimum of the coordinates of all node.

    Returns number[]

    Minimum coordinates

  • getMaxCoordinates(): number[]
  • Returns the maximum of the coordinates of all node.

    Returns number[]

    Maximum coordinates

  • getAverageDistance(): number
  • Returns the average distance between all pairs of nodes.

    Returns number

    Average distance

  • setCoordinates(node: number, coordinates: number[]): void
  • Positions a node at coordinates.

    Parameters

    • node: number

      Node

    • coordinates: number[]

      Coordinates

    Returns void

  • initRandomCoordinates(random?: Random): void
  • Initializes a random layout.

    Each node is positioned at random coordinates.

    Parameters

    • random: Random = ...

      Random number generator

    Returns void

  • standardize(standardizeDistances: boolean): void
  • Standardizes a layout.

    Standardization involves translation, rotation, reflection, and optionally dilation. The layout is translated so that it is centered at the origin. The layout is rotated so that the variance in the horizontal dimension is maximized. The layout is reflected so that in both the horizontal and the vertical dimension the median of the coordinates is non-positive. If standardizeDistances = true, the layout is dilated so that the average distance between nodes equals one.

    Parameters

    • standardizeDistances: boolean

      Standardize distances

    Returns void

  • rotate(angle: number): void
  • Rotates a layout.

    Parameters

    • angle: number

      Angle

    Returns void

  • flip(dimension: number): void
  • Flips a layout.

    Parameters

    • dimension: number

      Dimension

    Returns void

  • initRandomCoordinatesHelper(random: Random): void

Generated using TypeDoc