Function drag

  • Creates a new drag behavior. The returned behavior, drag, is both an object and a function, and is typically applied to selected elements via selection.call.

    Use this signature when using the default subject accessor.

    The first generic refers to the type of element to be dragged. The second generic refers to the type of the datum of the dragged element.

    Type Parameters

    Returns DragBehavior<GElement, Datum, Datum | SubjectPosition>

  • Creates a new drag behavior. The returned behavior, drag, is both an object and a function, and is typically applied to selected elements via selection.call.

    Use this signature when using a custom subject accessor.

    The first generic refers to the type of element to be dragged. The second generic refers to the type of the datum of the dragged element. The third generic refers to the type of the drag behavior subject.

    Type Parameters

    • GElement extends Element

    • Datum

    • Subject

    Returns DragBehavior<GElement, Datum, Subject>