LayerModel
12 Sep 20252 minutes to read
Interface for a class Layer
Properties
addInfo Object
Defines the description of the layer
<div id='diagram'></div>let nodes: NodeModel[] = [{
id: 'node1', width: 100, height: 100, offsetX: 100, offsetY: 100,
annotations: [{ content: 'Default Shape' }]
},
{
id: 'node2', width: 100, height: 100, offsetX: 300, offsetY: 100,
shape: {
type: 'Basic', shape: 'Ellipse'
},
annotations: [{ content: 'Path Element' }]
}
];
let connectors: ConnectorModel[] = [{
id: 'connector1',
type: 'Straight',
sourcePoint: { x: 100, y: 300 },
targetPoint: { x: 200, y: 400 },
}];
let diagram: Diagram = new Diagram({
...
connectors: connectors, nodes: nodes,
layers: [{ id: 'layer1', visible: true, objects: ['node1', 'node2', 'connector1'] }],
...
});
diagram.appendTo('#diagram');id string
Defines the id of a diagram layer
lock boolean
Enables or disables editing objects in a particular layer
objects string[]
Defines the collection of the objects that are added to a particular layer
visible boolean
Enables or disables the visibility of objects in a particular layer
zIndex number
Defines the zOrder of the layer