Class Node
Represents a single shape in a SfDiagram.
Inherited Members
Namespace: Syncfusion.Maui.Diagram
Assembly: Syncfusion.Maui.Diagram.dll
Syntax
public class Node : NodeBase
Remarks
Mirrors the EJ2 Diagram NodeModel JSON shape: { id, offsetX, offsetY, width, height,
rotateAngle, shape: { type: 'Basic', shape }, style, annotations, ports }. Add instances to
Nodes to display them.
Constructors
Node()
Initializes a new instance of the Node class.
Declaration
public Node()
Fields
AnnotationsProperty
Identifies the Annotations bindable property.
Declaration
public static readonly BindableProperty AnnotationsProperty
Field Value
| Type |
|---|
| BindableProperty |
CollapseIconProperty
Identifies the CollapseIcon bindable property.
Declaration
public static readonly BindableProperty CollapseIconProperty
Field Value
| Type |
|---|
| BindableProperty |
DataProperty
Identifies the Data bindable property.
Declaration
public static readonly BindableProperty DataProperty
Field Value
| Type |
|---|
| BindableProperty |
ExcludeFromLayoutProperty
Identifies the ExcludeFromLayout bindable property.
Declaration
public static readonly BindableProperty ExcludeFromLayoutProperty
Field Value
| Type |
|---|
| BindableProperty |
ExpandIconProperty
Identifies the ExpandIcon bindable property.
Declaration
public static readonly BindableProperty ExpandIconProperty
Field Value
| Type |
|---|
| BindableProperty |
HeightProperty
Identifies the Height bindable property.
Declaration
public static readonly BindableProperty HeightProperty
Field Value
| Type |
|---|
| BindableProperty |
IsExpandedProperty
Identifies the IsExpanded bindable property.
Declaration
public static readonly BindableProperty IsExpandedProperty
Field Value
| Type |
|---|
| BindableProperty |
LayoutInfoProperty
Identifies the LayoutInfo bindable property.
Declaration
public static readonly BindableProperty LayoutInfoProperty
Field Value
| Type |
|---|
| BindableProperty |
OffsetXProperty
Identifies the OffsetX bindable property.
Declaration
public static readonly BindableProperty OffsetXProperty
Field Value
| Type |
|---|
| BindableProperty |
OffsetYProperty
Identifies the OffsetY bindable property.
Declaration
public static readonly BindableProperty OffsetYProperty
Field Value
| Type |
|---|
| BindableProperty |
PortsProperty
Identifies the Ports bindable property.
Declaration
public static readonly BindableProperty PortsProperty
Field Value
| Type |
|---|
| BindableProperty |
RotateAngleProperty
Identifies the RotateAngle bindable property.
Declaration
public static readonly BindableProperty RotateAngleProperty
Field Value
| Type |
|---|
| BindableProperty |
ShapeProperty
Identifies the Shape bindable property.
Declaration
public static readonly BindableProperty ShapeProperty
Field Value
| Type |
|---|
| BindableProperty |
WidthProperty
Identifies the Width bindable property.
Declaration
public static readonly BindableProperty WidthProperty
Field Value
| Type |
|---|
| BindableProperty |
Properties
Annotations
Gets or sets the collection of text labels attached to this node.
Declaration
public ObservableCollection<ShapeAnnotation> Annotations { get; set; }
Property Value
| Type |
|---|
| ObservableCollection<ShapeAnnotation> |
BackgroundColor
Gets or sets the fill color. Shortcut for Style.Fill.
Declaration
public Color BackgroundColor { get; set; }
Property Value
| Type |
|---|
| Color |
BorderColor
Gets or sets the border color. Shortcut for Style.StrokeColor.
Declaration
public Color BorderColor { get; set; }
Property Value
| Type |
|---|
| Color |
BorderWidth
Gets or sets the border thickness. Shortcut for Style.StrokeWidth.
Declaration
public double BorderWidth { get; set; }
Property Value
| Type |
|---|
| double |
CollapseIcon
Gets or sets the icon shown while this node is collapsed (click it to expand). Defaults to None (no icon); data-bound nodes get a plus icon from NodeDefaults.
Declaration
public ExpandIcon CollapseIcon { get; set; }
Property Value
| Type |
|---|
| ExpandIcon |
Data
Gets or sets the host data object this node represents (the bound item for data-bound charts).
Declaration
public object? Data { get; set; }
Property Value
| Type |
|---|
| object |
ExcludeFromLayout
Gets or sets whether the automatic layout skips this node (it keeps its own offsets).
Declaration
public bool ExcludeFromLayout { get; set; }
Property Value
| Type |
|---|
| bool |
ExpandIcon
Gets or sets the icon shown while this node is expanded (click it to collapse). Only drawn for nodes that have children; set its Shape to None to turn expand/collapse off for this node. Defaults to None (no icon); data-bound nodes get a minus icon from NodeDefaults.
Declaration
public ExpandIcon ExpandIcon { get; set; }
Property Value
| Type |
|---|
| ExpandIcon |
Height
Gets or sets the node's height, in diagram units.
Declaration
public double Height { get; set; }
Property Value
| Type |
|---|
| double |
IsExpanded
Gets or sets a value indicating whether this node's children are visible. Updated automatically from user expand/collapse toggles in the WebView. Defaults to true.
Declaration
public bool IsExpanded { get; set; }
Property Value
| Type |
|---|
| bool |
LayoutInfo
Gets or sets this node's organizational-chart arrangement options (sub-tree orientation/alignment, children offset, and the node's own role). Used for manually added nodes; layout metadata is never written to AddInfo. Optional.
Declaration
public TreeInfo? LayoutInfo { get; set; }
Property Value
| Type |
|---|
| TreeInfo |
OffsetX
Gets or sets the horizontal position of the node's center, in diagram units.
Declaration
public double OffsetX { get; set; }
Property Value
| Type |
|---|
| double |
OffsetY
Gets or sets the vertical position of the node's center, in diagram units.
Declaration
public double OffsetY { get; set; }
Property Value
| Type |
|---|
| double |
Ports
Gets or sets the collection of named connection points on this node that a Connector can attach to via SourcePortID/TargetPortID.
Declaration
public ObservableCollection<PointPort> Ports { get; set; }
Property Value
| Type |
|---|
| ObservableCollection<PointPort> |
RotateAngle
Gets or sets the clockwise rotation angle, in degrees.
Declaration
public double RotateAngle { get; set; }
Property Value
| Type |
|---|
| double |
Shape
Gets or sets the shape descriptor for this node. Assign a BasicShape for geometric shapes, or a FlowShape for flowchart symbols. When set, this property takes precedence over the legacy Shape enum. Defaults to null, which falls back to Shape for backward compatibility.
Declaration
public Shape? Shape { get; set; }
Property Value
| Type |
|---|
| Shape |
Examples
// Basic rounded rectangle
node.Shape = new BasicShape { Shape = NodeBasicShapes.Rectangle, CornerRadius = 8 };
// Flowchart decision diamond
node.Shape = new FlowShape { Shape = NodeFlowShapes.Decision };
Width
Gets or sets the node's width, in diagram units.
Declaration
public double Width { get; set; }
Property Value
| Type |
|---|
| double |