Function forceRadial

  • Create a new radial positioning force towards a circle of the specified radius centered at ⟨x,y⟩. If x and y are not specified, they default to ⟨0,0⟩.

    The strength of the force is proportional to the one-dimensional distance between the node’s position and the target position. While this force can be used to position individual nodes, it is intended primarily for global forces that apply to all (or most) nodes.

    The generic refers to the type of data for a node.

    Type Parameters

    Parameters

    • radius: number | ((d, i, data) => number)
    • Optional x: number | ((d, i, data) => number)
    • Optional y: number | ((d, i, data) => number)

    Returns ForceRadial<NodeDatum>