Hierarchy

  • ForceSimulation

Constructors

Properties

simulationTimeout: null | number = null

Methods

  • A side-effect method which, given a list of nodes, computes the position of dangling nodes in the list if they are to be positioned in a circle pattern.

    Parameters

    • nodes: NodeModel[]

      A list of nodes which contains all the dangling nodes, whose (x, y) coordinates are to be computed

    • center: {
          x: number;
          y: number;
      }

      The coordinates of the center of the circle

      • x: number
      • y: number
    • radius: number

      The radius of the circle

    Returns void

  • Given a list of relationships, this method filters out all "duplicate" relationships connecting the same pair of nodes.

    For example, if the relationships are

    [ { "source": "node1", "target": "node2" }, { "source": "node1", "target": "node2" }, { "source": "node5", "target": "node6" }, ]

    then this method returns

    [ { "source": "node1", "target": "node2" }, { "source": "node5", "target": "node6" }, ]

    Returns

    a sub-list of relationships, each of which connects a unique pair of nodes

    Parameters

    • relationships: RelationshipModel[]

      the specified list of relationshiops to be filtered

    Returns RelationshipModel[]

  • Given a node distance and a number of nodes which are to be positioned on a circle equi-distance, this method returns a approximated radius of the circle.

    The radius calculation is based on the assumption that the perimeter of the circle is approximately equal to (the number of links) x (the number of nodes residing on the circle). The perimeter is, therefore, 2 * PI * R, where R is to be returned by this method.

    Returns

    PERIMETER / (2 * PI)

    Parameters

    • numNodes: number

      the number of nodes residing on the calculated circle.

    Returns number

Generated using TypeDoc