An object specifying the required callback functions for certain actions

interface ExternalCallbacks {
    onError?: ((error: Error) => void);
    onLayoutComputing?: ((isComputing: boolean) => void);
    onLayoutDone?: (() => void);
    onLayoutStep?: ((p: Node[]) => void);
    onWebGLContextLost?: ((webGLContextEvent: WebGLContextEvent) => void);
    onZoomTransitionDone?: (() => void);
    restart?: (() => void);
}

Properties

onError?: ((error: Error) => void)

Triggered when NVL throws an error after initialization.

onLayoutComputing?: ((isComputing: boolean) => void)

Triggered when a asynchronous layout calculation starts/stops.

onLayoutDone?: (() => void)

Triggered when a layout is done moving.

onLayoutStep?: ((p: Node[]) => void)

Triggered on each step of a layout.

onWebGLContextLost?: ((webGLContextEvent: WebGLContextEvent) => void)
onZoomTransitionDone?: (() => void)

Triggered when a zoom transition (e.g. NVL.fit or NVL.resetZoom) function is done.

restart?: (() => void)