Interface LinkRadial<This, LinkDatum, NodeDatum>

Shorthand for d3.link with d3.curveBumpY; suitable for visualizing links in a tree diagram rooted on the top edge of the display.

The first generic corresponds to the type of the "this" context within which the radial link generator and its accessor functions will be invoked.

The second generic corresponds to the datum type of the link object for which the link is to be generated.

The third generic corresponds to the datum type of the source/target node contained in the link object.

interface LinkRadial {
    angle(): ((this, node, ...args) => number);
    angle(angle): LinkRadial<This, LinkDatum, NodeDatum>;
    context(): CanvasRenderingContext2D;
    context(context): LinkRadial<This, LinkDatum, NodeDatum>;
    radius(): ((this, node, ...args) => number);
    radius(radius): LinkRadial<This, LinkDatum, NodeDatum>;
    source(): ((this, d, ...args) => NodeDatum);
    source(source): LinkRadial<This, LinkDatum, NodeDatum>;
    target(): ((this, d, ...args) => NodeDatum);
    target(target): LinkRadial<This, LinkDatum, NodeDatum>;
    (this, d, ...args): string;
    (this, d, ...args): void;
}

Type Parameters

  • This

  • LinkDatum

  • NodeDatum

  • Generates a radial link for the given arguments.

    IMPORTANT: If the rendering context of the radial link generator is null, then the link is returned as a path data string.

    The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. All arguments passed into this function, will be passed to the accessor functions of the generator.

    Parameters

    • this: This
    • d: LinkDatum

      The datum for which the link is to be generated.

    • Rest ...args: any[]

    Returns string

  • Generates an link for the given arguments.

    IMPORTANT: If the radial link generator has been configured with a rendering context, then the link is rendered to this context as a sequence of path method calls and this function returns void.

    The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked. All arguments passed into this function, will be passed to the accessor functions of the generator.

    Parameters

    • this: This
    • d: LinkDatum

      The datum for which the link is to be generated.

    • Rest ...args: any[]

    Returns void

Methods

  • Returns the current angle accessor, which defaults to a function accepting an number array as its argument an returning the first element of the array.

    Returns ((this, node, ...args) => number)

      • (this, node, ...args): number
      • Returns the current angle accessor, which defaults to a function accepting an number array as its argument an returning the first element of the array.

        Parameters

        • this: This
        • node: NodeDatum
        • Rest ...args: any[]

        Returns number

  • Sets the angle accessor to the specified function and returns this radial link generator. The angle is stated in radians, with 0 at -y (12 o’clock).

    Parameters

    • angle: ((this, node, ...args) => number)

      Angle accessor function. The accessor function is invoked in the same "this" context as the generator was invoked in and receives as its first argument a node object followed by all additional arguments that were passed into the radial link generator.

        • (this, node, ...args): number
        • Parameters

          • this: This
          • node: NodeDatum
          • Rest ...args: any[]

          Returns number

    Returns LinkRadial<This, LinkDatum, NodeDatum>

  • Returns the current radius accessor, which defaults to a function accepting an number array as its argument an returning the second element of the array.

    Returns ((this, node, ...args) => number)

      • (this, node, ...args): number
      • Returns the current radius accessor, which defaults to a function accepting an number array as its argument an returning the second element of the array.

        Parameters

        • this: This
        • node: NodeDatum
        • Rest ...args: any[]

        Returns number

  • Sets the radius accessor to the specified function and returns this radial link generator. The radius is measured as the distance from the origin ⟨0,0⟩.

    Parameters

    • radius: ((this, node, ...args) => number)

      Radius accessor function. The accessor function is invoked in the same "this" context as the generator was invoked in and receives as its first argument a node object followed by all additional arguments that were passed into the radial link generator.

        • (this, node, ...args): number
        • Parameters

          • this: This
          • node: NodeDatum
          • Rest ...args: any[]

          Returns number

    Returns LinkRadial<This, LinkDatum, NodeDatum>

  • Returns the current source node accessor function. The default source accessor function returns a two element array [x, y].

    Returns ((this, d, ...args) => NodeDatum)

      • (this, d, ...args): NodeDatum
      • Returns the current source node accessor function. The default source accessor function returns a two element array [x, y].

        Parameters

        • this: This
        • d: LinkDatum
        • Rest ...args: any[]

        Returns NodeDatum

  • Sets the source accessor to the specified function and returns this radial link generator.

    Parameters

    • source: ((this, d, ...args) => NodeDatum)

      Source node accessor function. The accessor function is invoked in the same "this" context as the generator was invoked in and receives the same arguments that were passed into the radial link generator. The default target accessor function returns a two element array [x, y].

        • (this, d, ...args): NodeDatum
        • Parameters

          • this: This
          • d: LinkDatum
          • Rest ...args: any[]

          Returns NodeDatum

    Returns LinkRadial<This, LinkDatum, NodeDatum>

  • Returns the current target node accessor function. The default target accessor function returns a two element array [x, y].

    Returns ((this, d, ...args) => NodeDatum)

      • (this, d, ...args): NodeDatum
      • Returns the current target node accessor function. The default target accessor function returns a two element array [x, y].

        Parameters

        • this: This
        • d: LinkDatum
        • Rest ...args: any[]

        Returns NodeDatum

  • Sets the target accessor to the specified function and returns this radial link generator.

    Parameters

    • target: ((this, d, ...args) => NodeDatum)

      Target node accessor function. The accessor function is invoked in the same "this" context as the generator was invoked in and receives the same arguments that were passed into the radial link generator. The default target accessor function returns a two element array [x, y].

        • (this, d, ...args): NodeDatum
        • Parameters

          • this: This
          • d: LinkDatum
          • Rest ...args: any[]

          Returns NodeDatum

    Returns LinkRadial<This, LinkDatum, NodeDatum>