Props for the JsPlumbToolkitDragDropComponent. Most users will probably want to use the SurfaceDropComponent instead.

interface DragDropProps {
    container: Element;
    dataGenerator?: DataGeneratorFunction<any>;
    onCanvasDrop?: ((surface, data, position) => any);
    onDrop?: ((surface, data, target, position, draggedElement, e) => any);
    onEdgeDrop?: ((surface, data, edge, positionOnSurface, e, evt, pageLocation) => any);
    selector: string;
    surface: Surface;
}

Properties

container: Element

The DOM element inside which to look for draggable elements.

dataGenerator?: DataGeneratorFunction<any>

Function to use to get a dataset for an item that is being dragged.

onCanvasDrop?: ((surface, data, position) => any)

Function to call when an item is dropped on whitespace in the canvas

Type declaration

    • (surface, data, position): any
    • Parameters

      • surface: Surface
      • data: any
      • position: PointXY

      Returns any

onDrop?: ((surface, data, target, position, draggedElement, e) => any)

Function to call when an item is dropped on ane existing vertex.

Type declaration

    • (surface, data, target, position, draggedElement, e): any
    • Parameters

      • surface: Surface
      • data: any
      • target: Node | Group
      • position: PointXY
      • draggedElement: BrowserElement
      • e: Event

      Returns any

onEdgeDrop?: ((surface, data, edge, positionOnSurface, e, evt, pageLocation) => any)

Function to call when an item is dropped on an edge.

Type declaration

    • (surface, data, edge, positionOnSurface, e, evt, pageLocation): any
    • Parameters

      • surface: Surface
      • data: any
      • edge: Edge
      • positionOnSurface: PointXY
      • e: BrowserElement
      • evt: Event
      • pageLocation: PointXY

      Returns any

selector: string

CSS 3 selector identifying what child elements of container are draggable.

surface: Surface

The surface to attach to.

Version :