Class LayoutBuilder
implementation of layout properties using view formatting
Inheritance
System.Object
LayoutBuilder
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()
Assembly: Syncfusion.EJ.dll
Syntax
public class LayoutBuilder
Constructors
LayoutBuilder(DiagramProperties)
Declaration
public LayoutBuilder(DiagramProperties model)
Parameters
Fields
diagramModel
Declaration
public DiagramProperties diagramModel
Field Value
Methods
Bounds(Rectangle)
Gets or sets the bounds of the layout
Declaration
public LayoutBuilder Bounds(Rectangle Bounds)
Parameters
Returns
Examples
@{
Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.Bounds(){X = 10, Y = 10, Width = 100, Height = 100});
}
FixedNode(String)
Gets or sets the fixed node with reference to which, the layout will be arranged
and fixed node will not be repositioned
Declaration
public LayoutBuilder FixedNode(string nodeId)
Parameters
Type |
Name |
Description |
System.String |
nodeId |
|
Returns
Examples
@{
Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.FixedNode("nodeName"));
}
GetConnectorSegments(String)
Connectors in the layout can be customized
Declaration
public LayoutBuilder GetConnectorSegments(string getConnectorSegments)
Parameters
Type |
Name |
Description |
System.String |
getConnectorSegments |
|
Returns
Examples
<script>
function getConnectorSegments(diagram, connector) {};
</script>
@{
Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.GetConnectorSegments("getConnectorSegments"));
}
GetLayoutInfo(String)
Gets or sets the orientation of trees/sub trees
Declaration
public LayoutBuilder GetLayoutInfo(string getLayoutInfo)
Parameters
Type |
Name |
Description |
System.String |
getLayoutInfo |
|
Returns
Examples
<script>
function getLayoutInfo(diagram, node, options) { options.orientation = "vertical"; options.type = "left"; offset = 10;};
</script>
@{
Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.GetLayoutInfo("getLayoutInfo"));
}
Gets or sets the horizontal alignment of the layout
Declaration
public LayoutBuilder HorizontalAlignment(HorizontalAlignment HorizontalAlignment)
Parameters
Returns
@{
Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.HorizontalAlignment.Center));
}
HorizontalSpacing(Int32)
Gets or sets the space to be horizontally left between nodes
Declaration
public LayoutBuilder HorizontalSpacing(int horizontalSpacing)
Parameters
Type |
Name |
Description |
System.Int32 |
horizontalSpacing |
|
Returns
Examples
@{
Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.HorizontalSpacing(50));
}
Level(Nullable<Int32>)
Gets or sets the nullable value of the layout level
Declaration
public LayoutBuilder Level(int? level)
Parameters
Type |
Name |
Description |
System.Nullable<System.Int32> |
level |
|
Returns
Examples
@{
Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.Level(2));
}
Margin(Margin)
Gets or sets the Margin of the layout
Declaration
public LayoutBuilder Margin(Margin Margin)
Parameters
Type |
Name |
Description |
Margin |
Margin |
|
Returns
Examples
@{
Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.Margin() { Top = 10, Bottom = 10, Left = 10, Right = 10 });
}
MarginX(Int32)
Gets or sets the margin value to be horizontally left between the layout and
diagram
Declaration
public LayoutBuilder MarginX(int marginX)
Parameters
Type |
Name |
Description |
System.Int32 |
marginX |
|
Returns
Examples
@{
Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.MarginX(50));
}
MarginY(Int32)
Gets or sets the margin value to be horizontally left between the layout and
diagram
Declaration
public LayoutBuilder MarginY(int marginY)
Parameters
Type |
Name |
Description |
System.Int32 |
marginY |
|
Returns
Examples
@{
Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.MarginY(50));
}
Gets or sets the orientation/direction to arrange the diagram elements.
Declaration
public LayoutBuilder Orientation(LayoutOrientations orientation)
Parameters
Returns
@{
Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.Orientation(LayoutOrientations.BottomToTop));
}
Gets or sets the type of the layout based on which the elements will be arranged
Declaration
public LayoutBuilder Type(LayoutTypes type)
Parameters
Returns
@{
Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.Type(LayoutTypes.HierarchicalTree));
}
Gets or sets the vertical alignment of the layout
Declaration
public LayoutBuilder VerticalAlignment(VerticalAlignment VerticalAlignment)
Parameters
Returns
@{
Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.VerticalAlignment.Center));
}
VerticalSpacing(Int32)
Gets or sets the space to be vertically top between nodes
Declaration
public LayoutBuilder VerticalSpacing(int verticalSpacing)
Parameters
Type |
Name |
Description |
System.Int32 |
verticalSpacing |
|
Returns
Examples
@{
Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.VerticalSpacing(50));
}