menu

ASP.NET MVC

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class LayoutBuilder

    Show / Hide Table of Contents

    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()
    Namespace: Syncfusion.JavaScript.DataVisualization.Builders
    Assembly: Syncfusion.EJ.dll
    Syntax
    public class LayoutBuilder

    Constructors

    LayoutBuilder(DiagramProperties)

    Declaration
    public LayoutBuilder(DiagramProperties model)
    Parameters
    Type Name Description
    DiagramProperties model

    Fields

    diagramModel

    Declaration
    public DiagramProperties diagramModel
    Field Value
    Type Description
    DiagramProperties

    Methods

    Bounds(Rectangle)

    Gets or sets the bounds of the layout

    Declaration
    public LayoutBuilder Bounds(Rectangle Bounds)
    Parameters
    Type Name Description
    Rectangle Bounds
    Returns
    Type Description
    LayoutBuilder

    Layout.Bounds

    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
    Type Description
    LayoutBuilder

    String.Empty

    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
    Type Description
    LayoutBuilder

    null

    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
    Type Description
    LayoutBuilder

    null

    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"));
      }

    HorizontalAlignment(HorizontalAlignment)

    Gets or sets the horizontal alignment of the layout

    Declaration
    public LayoutBuilder HorizontalAlignment(HorizontalAlignment HorizontalAlignment)
    Parameters
    Type Name Description
    HorizontalAlignment HorizontalAlignment
    Returns
    Type Description
    LayoutBuilder

    HorizontalAlignment.Center

    Examples
    @{
       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
    Type Description
    LayoutBuilder

    30

    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
    Type Description
    LayoutBuilder

    null

    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
    Type Description
    LayoutBuilder

    Layout.Margin

    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
    Type Description
    LayoutBuilder

    0

    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
    Type Description
    LayoutBuilder

    0

    Examples
    @{
       Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.MarginY(50));
    }

    Orientation(LayoutOrientations)

    Gets or sets the orientation/direction to arrange the diagram elements.

    Declaration
    public LayoutBuilder Orientation(LayoutOrientations orientation)
    Parameters
    Type Name Description
    LayoutOrientations orientation
    Returns
    Type Description
    LayoutBuilder

    LayoutOrientations.TopToBottom

    Examples
    @{
       Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.Orientation(LayoutOrientations.BottomToTop));
    }

    Type(LayoutTypes)

    Gets or sets the type of the layout based on which the elements will be arranged

    Declaration
    public LayoutBuilder Type(LayoutTypes type)
    Parameters
    Type Name Description
    LayoutTypes type
    Returns
    Type Description
    LayoutBuilder

    LayoutTypes.None

    Examples
    @{
       Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.Type(LayoutTypes.HierarchicalTree));
    }

    VerticalAlignment(VerticalAlignment)

    Gets or sets the vertical alignment of the layout

    Declaration
    public LayoutBuilder VerticalAlignment(VerticalAlignment VerticalAlignment)
    Parameters
    Type Name Description
    VerticalAlignment VerticalAlignment
    Returns
    Type Description
    LayoutBuilder

    VerticalAlignment.Center

    Examples
    @{
       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
    Type Description
    LayoutBuilder

    30

    Examples
    @{
       Html.EJ().Diagram("Diagram").Height("600px").Layout(lay => lay.VerticalSpacing(50));
    }
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved