Interface ChordLayout

A D3 chord diagram Layout to visualize relationships or network flow with an aesthetically-pleasing circular layout.

The relationships are represented as a square matrix of size n×n, where the matrix represents the directed flow amongst a network (a complete digraph) of n nodes.

interface ChordLayout {
    padAngle(): number;
    padAngle(angle): ChordLayout;
    sortChords(): ((a, b) => number);
    sortChords(compare): ChordLayout;
    sortGroups(): ((a, b) => number);
    sortGroups(compare): ChordLayout;
    sortSubgroups(): ((a, b) => number);
    sortSubgroups(compare): ChordLayout;
    (matrix): Chords;
}
  • Computes the chord layout for the specified square matrix of size n×n, where the matrix represents the directed flow amongst a network (a complete digraph) of n nodes.

    Parameters

    • matrix: number[][]

      An (n x n) matrix representing the directed flow amongst a network (a complete digraph) of n nodes.The given matrix must be an array of length n, where each element matrix[i] is an array of n numbers, where each matrix[i][j] represents the flow from the ith node in the network to the jth node. Each number matrix[i][j] must be nonnegative, though it can be zero if there is no flow from node i to node j.

    Returns Chords

Methods

  • Returns the current pad angle in radians, which defaults to zero.

    Returns number

  • Sets the pad angle between adjacent groups to the specified number in radians and returns this chord layout.

    The default is zero.

    Parameters

    • angle: number

      Pad angle between adjacent groups in radians.

    Returns ChordLayout

  • Returns the current chord comparator, which defaults to null.

    Returns ((a, b) => number)

      • (a, b): number
      • Parameters

        • a: number
        • b: number

        Returns number

  • Sets the chord comparator to the specified function or null and returns this chord layout. If the chord comparator is non-null, it is used to sort the chords by their combined flow; this only affects the z-order of the chords. See also d3.ascending and d3.descending.

    Parameters

    • compare: ((a, b) => number)
        • (a, b): number
        • Parameters

          • a: number
          • b: number

          Returns number

    Returns ChordLayout

  • Returns the current group comparator, which defaults to null.

    Returns ((a, b) => number)

      • (a, b): number
      • Parameters

        • a: number
        • b: number

        Returns number

  • Sets the group comparator to the specified function or null and returns this chord layout. If the group comparator is non-null, it is used to sort the groups by their total outflow. See also d3.ascending and d3.descending.

    Parameters

    • compare: ((a, b) => number)
        • (a, b): number
        • Parameters

          • a: number
          • b: number

          Returns number

    Returns ChordLayout

  • Returns the current subgroup comparator, which defaults to null.

    Returns ((a, b) => number)

      • (a, b): number
      • Parameters

        • a: number
        • b: number

        Returns number

  • Sets the subgroup comparator to the specified function or null and returns this chord layout. If the subgroup comparator is non-null, it is used to sort the subgroups corresponding to matrix[i][0 … n - 1] for a given group i by their total outflow. See also d3.ascending and d3.descending.

    Parameters

    • compare: ((a, b) => number)
        • (a, b): number
        • Parameters

          • a: number
          • b: number

          Returns number

    Returns ChordLayout