Class DiagramLayout
Configures automatic arrangement of a SfDiagram's nodes and connectors.
Inherited Members
Namespace: Syncfusion.Maui.Diagram
Assembly: Syncfusion.Maui.Diagram.dll
Syntax
public class DiagramLayout : DiagramElement
Remarks
Mirrors (a subset of) the EJ2 Diagram LayoutModel JSON shape: { type, orientation,
horizontalSpacing, verticalSpacing, root }. Assign to Layout, or mutate this
instance's properties in place — either way the change is sent to the JavaScript side and
diagram.dataBind() is called to re-run the layout.
Constructors
DiagramLayout()
Declaration
public DiagramLayout()
Fields
EnableAnimationProperty
Identifies the EnableAnimation bindable property.
Declaration
public static readonly BindableProperty EnableAnimationProperty
Field Value
| Type |
|---|
| BindableProperty |
FixedNodeProperty
Identifies the Syncfusion.Maui.Diagram.DiagramLayout.FixedNode bindable property.
Declaration
public static readonly BindableProperty FixedNodeProperty
Field Value
| Type |
|---|
| BindableProperty |
GetLayoutInfoProperty
Identifies the GetLayoutInfo bindable property.
Declaration
public static readonly BindableProperty GetLayoutInfoProperty
Field Value
| Type |
|---|
| BindableProperty |
HorizontalAlignmentProperty
Identifies the HorizontalAlignment bindable property.
Declaration
public static readonly BindableProperty HorizontalAlignmentProperty
Field Value
| Type |
|---|
| BindableProperty |
HorizontalSpacingProperty
Identifies the HorizontalSpacing bindable property.
Declaration
public static readonly BindableProperty HorizontalSpacingProperty
Field Value
| Type |
|---|
| BindableProperty |
MarginProperty
Identifies the Margin bindable property.
Declaration
public static readonly BindableProperty MarginProperty
Field Value
| Type |
|---|
| BindableProperty |
OrientationProperty
Identifies the Orientation bindable property.
Declaration
public static readonly BindableProperty OrientationProperty
Field Value
| Type |
|---|
| BindableProperty |
RootProperty
Identifies the Root bindable property.
Declaration
public static readonly BindableProperty RootProperty
Field Value
| Type |
|---|
| BindableProperty |
TypeProperty
Identifies the Type bindable property.
Declaration
public static readonly BindableProperty TypeProperty
Field Value
| Type |
|---|
| BindableProperty |
VerticalAlignmentProperty
Identifies the VerticalAlignment bindable property.
Declaration
public static readonly BindableProperty VerticalAlignmentProperty
Field Value
| Type |
|---|
| BindableProperty |
VerticalSpacingProperty
Identifies the VerticalSpacing bindable property.
Declaration
public static readonly BindableProperty VerticalSpacingProperty
Field Value
| Type |
|---|
| BindableProperty |
Properties
EnableAnimation
Gets or sets a value indicating whether layout passes (including expand/collapse re-arrangement) are animated. Defaults to true.
Declaration
public bool EnableAnimation { get; set; }
Property Value
| Type |
|---|
| bool |
GetLayoutInfo
Gets or sets a callback that configures how each node's sub-tree is arranged in an organizational
chart (EJ2 getLayoutInfo). It receives the node — for a data-bound chart a node whose
Id and Data identify the source item — and a TreeInfo
holding its current values; return the TreeInfo to use (or null to keep it).
Declaration
public Func<Node, TreeInfo, TreeInfo?>? GetLayoutInfo { get; set; }
Property Value
| Type |
|---|
| Func<Node, TreeInfo, TreeInfo> |
Remarks
Unlike EJ2, the callback is evaluated on the .NET side each time the layout, data or nodes are sent to the diagram — not synchronously during the JavaScript layout pass — so it should be a pure function of the node. Reassign it to force re-evaluation.
HorizontalAlignment
Gets or sets how the laid-out tree is aligned horizontally on the page. Defaults to Auto.
Declaration
public LayoutHorizontalAlignment HorizontalAlignment { get; set; }
Property Value
| Type |
|---|
| LayoutHorizontalAlignment |
HorizontalSpacing
Gets or sets the spacing between sibling nodes, in diagram units.
Declaration
public double HorizontalSpacing { get; set; }
Property Value
| Type |
|---|
| double |
Margin
Gets or sets the empty space left between the layout bounds and the diagram/page edge. Defaults to (50, 50, 0, 0); negative components are clamped to zero.
Declaration
public Thickness Margin { get; set; }
Property Value
| Type |
|---|
| Thickness |
Orientation
Gets or sets the growth direction for tree-shaped layout types.
Declaration
public LayoutOrientation Orientation { get; set; }
Property Value
| Type |
|---|
| LayoutOrientation |
Root
Gets or sets the Id to treat as the layout's root. Optional — most layout types can infer a root from the connector graph when left null.
Declaration
public string? Root { get; set; }
Property Value
| Type |
|---|
| string |
Type
Gets or sets the layout algorithm. Defaults to None (manual positioning).
Declaration
public DiagramLayoutType Type { get; set; }
Property Value
| Type |
|---|
| DiagramLayoutType |
VerticalAlignment
Gets or sets how the laid-out tree is aligned vertically on the page. Defaults to Auto.
Declaration
public LayoutVerticalAlignment VerticalAlignment { get; set; }
Property Value
| Type |
|---|
| LayoutVerticalAlignment |
VerticalSpacing
Gets or sets the spacing between tree levels/ranks, in diagram units.
Declaration
public double VerticalSpacing { get; set; }
Property Value
| Type |
|---|
| double |