The jsPlumbService provides the core of the Angular integration, offering methods to create and retrieve instances of the Toolkit.

Properties

data: Map<string, any> = ...

datastore for user set values.

Methods

  • Export an image from some Surface, using either the ShapeLibrary registered on the surface, or one registered on the jsPlumb Angular service.

    Type Parameters

    • T extends ObjectData

    Parameters

    Returns void

  • Export an SVG from some Surface, using either the ShapeLibrary registered on the surface, or one registered on the jsPlumb Angular service.

    Type Parameters

    • T extends ObjectData

    Parameters

    Returns SvgExportOutput | {
        dataUrl: string;
        height: number;
        svg: string;
        viewBoxOnlySvg: string;
        width: number;
    }

  • Gets the surface with the given id, passing it to the supplied callback function. If a surface with the given ID does not exist, the request is queued, and then if a surface with the given ID is subsequently registered, each callback for that surface registered via this method is executed in turn.

    Parameters

    • id: string

      ID of the surface to retrieve

    • callback: ((surface) => void)

      Function to call when the surface has been retrieved.

        • (surface): void
        • Parameters

          • surface: Surface

          Returns void

    • Optional _params: SurfaceOptions

      Optional parameters to pass back into the callback upon successful retrieval of the surface.

    Returns void

  • Create (or get if existing) a Toolkit instance.

    Parameters

    • id: string

      ID of the instance to either create or retrieve.

    • Optional params: JsPlumbToolkitOptions

      Optional constructor options for the Toolkit instance.

    Returns BrowserUIAngular

  • Register a shape library. A convenience method that creates a shape library and stores it

    Type Parameters

    • T extends ObjectData

    Parameters

    • shapeSets: ShapeSet[]

      the Shapes sets to register

    • Optional key: string

      Key to register the shape library with. If you omit this, the default id will be used. If you call this method multiple times without providing a key, the service will just overwrite what you previously stored.

    Returns void

  • Retrieve an arbitrary value from the service.

    Type Parameters

    • T

    Parameters

    • key: string

    Returns T

  • Retrieve a shape library. A convenience method that prefixes the given key and then calls retrieve.

    Type Parameters

    • T extends ObjectData

    Parameters

    • Optional key: string

      Key used to register the shape library. If omitted, the default shape library key will be used.

    Returns ShapeLibraryImpl<T>

  • Show the image export UI for some Surface, using either the ShapeLibrary registered on the surface, or one registered on the jsPlumb Angular service.

    Type Parameters

    • T extends ObjectData

    Parameters

    Returns void

  • Show the export SVG UI for some Surface, using either the ShapeLibrary registered on the surface, or one registered on the jsPlumb Angular service.

    Type Parameters

    • T extends ObjectData

    Parameters

    Returns void | {
        dataUrl: string;
        height: number;
        svg: string;
        viewBoxOnlySvg: string;
        width: number;
    }

  • Store an arbitrary value on the service.

    Type Parameters

    • T

    Parameters

    • key: string
    • value: T

    Returns void

Version :