Skip to main content

Home > @jsplumbtoolkit/core > AbstractLayout > vertexAdded

AbstractLayout.vertexAdded() method#

Called by components to inform a layout that a new Node was added. You should never call this method directly. Also, you should not override this method in a custom layout: if your layout needs to track Node addition, implement _nodeAdded instead.

This method is only ever called after a layout has been run and some change has been made to the data model. When the layout is run again, the layout's list of vertices is completely refreshed.

Signature:

vertexAdded(params?: {        id?: string;        el: any;        pos?: PointXY;        vertex: Node | Group;    }, eventInfo?: {        position?: PointXY;    }): PointXY;

Parameters#

ParameterTypeDescription
params{ id?: string; el: any; pos?: PointXY; vertex: Node | Group; }Method args
eventInfo{ position?: PointXY; }Optional information associated with the Event that the host system needs to pass through without adding to the data model.

Returns:

PointXY