Search results

Linear Arrangement in Blazor Diagram component

14 Apr 2021 / 1 minute to read

Linear arrangement is used to linearly arrange the child nodes in layout, which means the parent node is placed in the center corresponding to its children. When line distribution is enabled, linear arrangement is also activated by default. The Arrangement property of layout is used to enable or disable the linear arrangement in layout. By default Arrangement will be Nonlinear.

Note: Linear arrangement is applicable only for complex hierarchical tree layout.

The following code illustrates how to allow a linear arrangement in diagram layout.

Copied to clipboard
  
    protected override void OnInitialized()
        {
            LayoutValue = new DiagramLayout()
                {
                    Type = LayoutType.ComplexHierarchicalTree,
                    HorizontalSpacing = 40,
                    VerticalSpacing = 40,
                    Orientation = LayoutOrientation.TopToBottom,
                    //To arrange a child nodes in a linear manner
                    Arrangement = ChildArrangement.Linear
                };
            }
        }

See also