Class SnapSettingsBuilder
Implementation of snapsettings properties using view formatting
Inheritance
System.Object
SnapSettingsBuilder
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.Builders
Assembly: Syncfusion.EJ.dll
Syntax
public class SnapSettingsBuilder
Constructors
SnapSettingsBuilder(DiagramProperties)
Declaration
public SnapSettingsBuilder(DiagramProperties model)
Parameters
Type | Name | Description |
---|---|---|
DiagramProperties | model |
Fields
diagramModel
Declaration
public DiagramProperties diagramModel
Field Value
Type | Description |
---|---|
DiagramProperties |
Methods
EnableSnapToObject(Boolean)
Gets or sets snapping nodes/connectors to objects
Declaration
public SnapSettingsBuilder EnableSnapToObject(bool enableSnapToObject)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enableSnapToObject |
Returns
Type | Description |
---|---|
SnapSettingsBuilder | true |
Examples
DiagramProperties Model = new DiagramProperties();
Model.SnapSettings.EnableSnapToObject = false;
HorizontalGridLines(Action<HorizontalGridLinesBuilder>)
Gets or sets the appearance of horizontal gridlines
Declaration
public SnapSettingsBuilder HorizontalGridLines(Action<HorizontalGridLinesBuilder> horizontalGridLines)
Parameters
Type | Name | Description |
---|---|---|
System.Action<HorizontalGridLinesBuilder> | horizontalGridLines |
Returns
Type | Description |
---|---|
SnapSettingsBuilder | null |
Examples
DiagramProperties Model = new DiagramProperties();
Model.SnapSettings.HorizontalGridlines.LineColor = "blue";
SnapAngle(Int32)
Gets or sets angle by which the object needs to be snapped
Declaration
public SnapSettingsBuilder SnapAngle(int snapAngle)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | snapAngle |
Returns
Type | Description |
---|---|
SnapSettingsBuilder | 5 |
Examples
DiagramProperties Model = new DiagramProperties();
Model.SnapSettings.SnapAngle = 90;
SnapConstraints(SnapConstraints)
DiagramProperties Model = new DiagramProperties();
Model.SnapSettings.VerticalGridlines.LineDashArray =
"blue";
Model.SnapSettings.SnapConstraints =
SnapConstraints.ShowHorizontalLines;
Declaration
public SnapSettingsBuilder SnapConstraints(SnapConstraints snapConstraints)
Parameters
Type | Name | Description |
---|---|---|
SnapConstraints | snapConstraints |
Returns
Type | Description |
---|---|
SnapSettingsBuilder | SnapConstraints.All |
Examples
DiagramProperties Model = new DiagramProperties();
Model.SnapSettings.VerticalGridlines.LineDashArray = "blue";
Model.SnapSettings.SnapConstraints = SnapConstraints.ShowHorizontalLines;
SnapObjectDistance(Int32)
Gets or sets the minimum distance between the selected object and the nearest object
Declaration
public SnapSettingsBuilder SnapObjectDistance(int snapObjectDistance)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | snapObjectDistance |
Returns
Type | Description |
---|---|
SnapSettingsBuilder | 5 |
Examples
@{
Html.EJ().Diagram("Diagram").Height("490px").SnapSettings(sn => sn.SnapObjectDistance(100));
}
VerticalGridLines(Action<VerticalGridLinesBuilder>)
Gets or sets the appearance of horizontal gridlines
Declaration
public SnapSettingsBuilder VerticalGridLines(Action<VerticalGridLinesBuilder> verticalGridLines)
Parameters
Type | Name | Description |
---|---|---|
System.Action<VerticalGridLinesBuilder> | verticalGridLines |
Returns
Type | Description |
---|---|
SnapSettingsBuilder | null |
Examples
DiagramProperties Model = new DiagramProperties();
Model.SnapSettings.VerticalGridlines.LineDashArray = "blue";
Model.SnapSettings.VerticalGridlines.LineColor = "5,5";