Defines the gridlines and defines how and when the objects have to be snapped
Constraints for gridlines and snapping
Defaults to ‘All’
Defines the horizontal gridlines
<div id='diagram'></div>
let horizontalGridlines: GridlinesModel = {lineColor: 'black', lineDashArray: '1,1' };
let verticalGridlines: GridlinesModel = {lineColor: 'black', lineDashArray: '1,1'};
let diagram: Diagram = new Diagram({
...
snapSettings: { horizontalGridlines, verticalGridlines, constraints: SnapConstraints.ShowLines,
snapObjectDistance: 5, snapAngle: 5 },
...
});
diagram.appendTo('#diagram');
Defaults to {}
number
Defines the angle by which the object needs to be snapped
Defaults to 5
number
Sets the minimum distance between the selected object and the nearest object
Defaults to 5
Defines the vertical gridlines
Defaults to {}