Skip to main content
Version: 4.3

GraphLayer

dia.GraphLayer is a model that represents a collection of cells. It inherits from mvc.Model. Each layer has its own cellCollection property that holds the cells belonging to this layer. Layers are managed by the dia.GraphLayerCollection instance, which is accessible via the layerCollection property of the dia.Graph.

const layer = new dia.GraphLayer({
id: 'layer-1',
});

Methods​

getCells()​

graphLayer.getCells(): dia.Cell[];

Return an array of all cells in this layer's cell collection.

Properties​

cellCollection​

cellCollection: dia.CellCollection;

An ordered collection of cells that belong to this layer. It is an instance of dia.CellCollection class.

graph​

graph: dia.Graph | null;

A reference to the dia.Graph instance this layer belongs to.

Stay in the know

Be where thousands of diagramming enthusiasts meet

Star us on GitHub