Class SnapSettings
The model’s snapSettings property is used to customize the gridlines and control the snapping behavior in the diagram.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.JavaScript.DataVisualization.Models.Diagram
Assembly: Syncfusion.EJ.dll
Syntax
public class SnapSettings : EJTagHelper
Constructors
SnapSettings()
Declaration
public SnapSettings()
Properties
EnableSnapToObject
Gets or sets snapping nodes/connectors to objects
Declaration
[JsonProperty("enableSnapToObject")]
public bool EnableSnapToObject { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true |
Examples
@{
Html.EJ().Diagram("Diagram").Height("600px").SnapSettings(sn => sn.EnableSnapToObject(false));
}
HorizontalGridlines
Gets or sets the appearance of horizontal gridlines
Declaration
[JsonProperty("horizontalGridLines")]
public GridLines HorizontalGridlines { get; set; }
Property Value
Type | Description |
---|---|
GridLines | null |
Examples
@{
Html.EJ().Diagram("Diagram").Height("600px").SnapSettings(sn => sn.HorizontalGridLines(vgl => vgl.LineColor("red")));
}
SnapAngle
Gets or sets angle by which the object needs to be snapped
Declaration
[JsonProperty("snapAngle")]
public double SnapAngle { get; set; }
Property Value
Type | Description |
---|---|
System.Double | 5 |
Examples
@{
Html.EJ().Diagram("Diagram").Height("600px").SnapSettings(sn => sn.SnapAngle(10));
}
SnapConstraints
To enable/disable to snap the nearest intersection of gridlines while being dragged or resized the nodes.
Declaration
[JsonProperty("snapConstraints")]
[JsonConverter(typeof(StringEnumConverter))]
public SnapConstraints SnapConstraints { get; set; }
Property Value
Type | Description |
---|---|
SnapConstraints | SnapConstraints.All |
Examples
@{
Html.EJ().Diagram("Diagram").Height("600px").SnapSettings(sn => sn.SnapConstraints(SnapConstraints.ShowHorizontalLines));
}
SnapObjectDistance
Gets or sets the minimum distance between the selected object and the nearest object
Declaration
[JsonProperty("snapObjectDistance")]
public double SnapObjectDistance { get; set; }
Property Value
Type | Description |
---|---|
System.Double | 5 |
Examples
DiagramProperties Model = new DiagramProperties();
Model.SnapSettings.SnapObjectDistance = 90;
VerticalGridlines
Gets or sets the appearance of horizontal gridlines
Declaration
[JsonProperty("verticalGridLines")]
public GridLines VerticalGridlines { get; set; }
Property Value
Type | Description |
---|---|
GridLines | null |
Examples
@{
Html.EJ().Diagram("Diagram").Height("600px").SnapSettings(sn => sn.VerticalGridLines(vgl => vgl.LineColor("red")));
}