menu

ASP.NET MVC

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

    Show / Hide Table of Contents

    Class NodeBase

    Implements a abstract class of node

    Inheritance
    System.Object
    EJTagHelper
    NodeBase
    Group
    Node
    Inherited Members
    EJTagHelper.GetControlDetails()
    EJTagHelper.GetControlDetails(String)
    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.Models.Diagram
    Assembly: Syncfusion.EJ.dll
    Syntax
    public abstract class NodeBase : EJTagHelper

    Constructors

    NodeBase()

    Declaration
    protected NodeBase()

    Properties

    AddInfo

    Gets or sets additional information about nodes

    Declaration
    [JsonProperty("addInfo")]
    public object AddInfo { get; set; }
    Property Value
    Type Description
    System.Object

    null

    Examples
               Dictionary<string, string> AddInfo = new Dictionary<string, string>();
               AddInfo.Add("TooltipData", "Shares the information with the customer");
               Node Node = new Node();
               Node.Name = "node"; 
               Node.AddInfo = AddInfo; 

    AllowDrop

    Gets or sets wether the node can be dropped from the palette

    Declaration
    [JsonProperty("allowDrop")]
    public bool AllowDrop { get; set; }
    Property Value
    Type Description
    System.Boolean

    true

    Examples
                DiagramProperties Model = new DiagramProperties();
               Node Node = new Node()
               {
                   Name = "node",
                   AllowDrop = false
               };
               Model.Nodes.Add(Node);
               ViewData["diagramModel"] = Model;

    BorderColor

    Gets or sets the borderColor of the node.

    Declaration
    [JsonProperty("borderColor")]
    public string BorderColor { get; set; }
    Property Value
    Type Description
    System.String
    Examples
        // Apply the border color for the node 
         Node Node = new Node()
         {
             BorderColor = "red"
         };

    BorderDashArray

    Gets or sets the border dash array of the node.

    Declaration
    [JsonProperty("borderDashArray")]
    public string BorderDashArray { get; set; }
    Property Value
    Type Description
    System.String
    Examples
              // Apply the border dash array  for the node
               Node Node = new Node()
               {
                   BorderDashArray = "3,3"
               };

    BorderWidth

    Gets or sets the border width of the node.

    Declaration
    [JsonProperty("borderWidth")]
    public double BorderWidth { get; set; }
    Property Value
    Type Description
    System.Double
    Examples
        // Apply the border width for the node 
         Node Node = new Node()
         {
             BorderWidth = 2
         };

    Children

    Gets or sets collection of Node objects where each object represents a child node/connector

    Declaration
    [JsonProperty("children")]
    public List<object> Children { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.Object>

    new Collection

    Examples
                DiagramProperties Model = new DiagramProperties();
               Node Node1 = new Node() { Name = "node2", Width = 100, Height = 100 }; Model.Nodes.Add(Node1);
               Node Node2 = new Node() { Name = "node2", Width = 100, Height = 100 }; Model.Nodes.Add(Node2);
               Group Group = new Group();
               Group.Name = "Group";
               Group.Children.Add("Node1");
               Group.Children.Add("Node2");
               Group.CanUngroup = false;
               Model.Nodes.Add(Group);

    CollapseIcon

    Declaration
    [JsonProperty("collapseIcon")]
    public DiagramIcon CollapseIcon { get; set; }
    Property Value
    Type Description
    DiagramIcon

    ConnectorPadding

    Gets or sets distance to be left between a node and its connections(In coming and out going connections)

    Declaration
    [JsonProperty("connectorPadding")]
    public double ConnectorPadding { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
               Node Node = new Node();
               Node.Name = "dataobject";
               Node.Width = 100;
               Node.Height = 100;
               Node.Type = Shapes.BPMN;
               Node.ConnectorPadding = 5;
               Model.Nodes.Add(Node); 

    Constraints

    Gets or sets the default behaviors of the node

    Declaration
    [JsonProperty("constraints")]
    [JsonConverter(typeof(StringEnumConverter))]
    public NodeConstraints Constraints { get; set; }
    Property Value
    Type Description
    NodeConstraints

    NodeConstraints.Default

    Examples
               DiagramProperties Model = new DiagramProperties();
               Node Node = new Node();
               Node.Name = "dataobject";
               Node.Width = 100;
               Node.Height = 100;
               Node.Type = Shapes.BPMN;
               Node.Constraints = NodeConstraints.Default & ~NodeConstraints.Select;
               Model.Nodes.Add(Node);
               ViewData["diagramModel"] = Model;

    Container

    Gets or sets how the child objects need to be arranged(Either in any predefined manner or automatically). Applicable, if the node is a group.

    Declaration
    [JsonProperty("container")]
    public Container Container { get; set; }
    Property Value
    Type Description
    Container

    null

    Examples
               Node Node1 = new Node();
               Node1.Name = "node1";
               Node1.Width = 100;
               Node1.Height = 100;
               Model.Nodes.Add(Node1);
               Node Node2 = new Node();
               Node2.Name = "node2";
               Node2.Width = 100;
               Node2.Height = 100;
               Model.Nodes.Add(Node2);
               Group Group = new Group();
               Group.Name = "Group";
               Group.Children.Add("node1");
               Group.Children.Add("node2");
               Group.Container = new Container() { Type = ContainerType.Stack };
               Model.Nodes.Add(Group);

    CssClass

    Gets or sets style configurations of the node

    Declaration
    [JsonProperty("cssClass")]
    public string CssClass { get; set; }
    Property Value
    Type Description
    System.String

    String.Empty

    Examples
       <style>
           .hoverNode:hover {
               fill:blue
           }
       </style>
    
               BasicShape Node = new BasicShape();
               Node.Name = "node2";
               Node.Width = 100;
               Node.Height = 100;
               Node.CssClass = "hoverNode";
               Model.Nodes.Add(Node); 

    ExcludeFromLayout

    Gets or sets whether the node can be automatically arranged using layout or not

    Declaration
    [JsonProperty("excludeFromLayout")]
    public bool ExcludeFromLayout { get; set; }
    Property Value
    Type Description
    System.Boolean

    false

    Examples
               DiagramProperties Model = new DiagramProperties();
               Node Node1 = new Node();
               Node1.Name = "node1"; 
               Node1.ExcludeFromLayout = true;
               Model.Nodes.Add(Node1);
               Node Node2= new Node();
               Node2.Name = "node2"; 
               Model.Nodes.Add(Node2);
               Node Node3 = new Node();
               Node.Name = "node3"; 
               Model.Nodes.Add(Node3);
               Model.Layout.Type = LayoutTypes.HierarchicalTree;

    ExpandIcon

    Declaration
    [JsonProperty("expandIcon")]
    public DiagramIcon ExpandIcon { get; set; }
    Property Value
    Type Description
    DiagramIcon

    FillColor

    Gets or sets the fill color of the node.

    Declaration
    [JsonProperty("fillColor")]
    public string FillColor { get; set; }
    Property Value
    Type Description
    System.String
    Examples
        // Apply the fill color for the node 
         Node Node = new Node()
         {
             FillColor = "red"
         };

    Height

    Gets or sets Height of the node

    Declaration
    [JsonProperty("height")]
    public double Height { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
               DiagramProperties Model = new DiagramProperties();
               Node Node = new Node();
               Node.Name = "swimlane";
               Node.Height = 100;
               Model.Nodes.Add(Node);
               ViewData["diagramModel"] = Model;

    HorizontalAlign

    Gets or sets the horizontal alignment of the node. Applicable, if the parent of the node is a container

    Declaration
    [JsonProperty("horizontalAlign")]
    [JsonConverter(typeof(StringEnumConverter))]
    public HorizontalAlignment HorizontalAlign { get; set; }
    Property Value
    Type Description
    HorizontalAlignment

    HorizontalAlignment.Left

    Examples
               DiagramProperties Model = new DiagramProperties();
               Node Node1 = new Node() { Name = "node1", Height = 100, HorizontalAlign = HorizontalAlignment.Right };
               Model.Nodes.Add(Node1);
               Node Node2= new Node() { Name = "node2", Height = 100 };
               Model.Nodes.Add(Node2);
               Group Group = new Group() { Name = "group", Height = 400, Width = 400 };
               Group.Children.Add("Node1");
               Group.Children.Add("Node2");
               Model.Nodes.Add(Group); 
               ViewData["diagramModel"] = Model;

    IsGroup

    Declaration
    [Obsolete("Use Type")]
    public bool IsGroup { get; set; }
    Property Value
    Type Description
    System.Boolean

    Labels

    Gets or sets collection of objects where each object represents a label

    Declaration
    [JsonProperty("labels")]
    public Collection Labels { get; set; }
    Property Value
    Type Description
    Collection

    Collection

    Examples
               DiagramProperties Model = new DiagramProperties();
               Node Node = new Node() { Name = "node1", Height = 100, HorizontalAlign = HorizontalAlignment.Right };
               Collection labels = new Collection();
               labels.Add(new Label() { Text = "Node1", FontColor = "Red" });
               Model.Nodes.Add(Node);
               ViewData["diagramModel"] = Model;

    MarginBottom

    Gets or sets the minimum space to be bottom between the bottom of parent bounds and the node. Applicable, if the parent is a container.

    Declaration
    [JsonProperty("marginBottom")]
    public double MarginBottom { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
              SwimLane SwimLane = new SwimLane();
               Dictionary<string, string> AddInfo = new Dictionary<string, string>();
               AddInfo.Add("customvalue", "lane");
               Collection Children = new Collection();
               Children.Add(new Node() { Name = "node1", Height = 100, MarginBottom = 50 });
               SwimLane.Lanes.Add(new Lane() { Name = "lane1", Width = 300, Orientation = "vertical" });
               Model.Nodes.Add(SwimLane);

    MarginLeft

    Gets or sets the minimum space to be left between the left of parent bounds and the node. Applicable, if the parent is a container.

    Declaration
    [JsonProperty("marginLeft")]
    public double MarginLeft { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
              SwimLane SwimLane = new SwimLane();
               Dictionary<string, string> AddInfo = new Dictionary<string, string>();
               AddInfo.Add("customvalue", "lane");
               Collection Children = new Collection();
               Children.Add(new Node() { Name = "node1", Height = 100, MarginLeft = 50 });
               SwimLane.Lanes.Add(new Lane() { Name = "lane1", Width = 300, Orientation = "vertical" });
               Model.Nodes.Add(SwimLane);

    MarginRight

    Gets or sets the minimum space to be right between the right of parent bounds and the node. Applicable, if the parent is a container.

    Declaration
    [JsonProperty("marginRight")]
    public double MarginRight { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
              SwimLane SwimLane = new SwimLane();
               Dictionary<string, string> AddInfo = new Dictionary<string, string>();
               AddInfo.Add("customvalue", "lane");
               Collection Children = new Collection();
               Children.Add(new Node() { Name = "node1", Height = 100, MarginRight = 50 });
               SwimLane.Lanes.Add(new Lane() { Name = "lane1", Width = 300, Orientation = "vertical" });
               Model.Nodes.Add(SwimLane);

    MarginTop

    Gets or sets the minimum space to be top between the top of parent bounds and the node. Applicable, if the parent is a container.

    Declaration
    [JsonProperty("marginTop")]
    public double MarginTop { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
              SwimLane SwimLane = new SwimLane();
               Dictionary<string, string> AddInfo = new Dictionary<string, string>();
               AddInfo.Add("customvalue", "lane");
               Collection Children = new Collection();
               Children.Add(new Node() { Name = "node1", Height = 100, MarginTop = 50 });
               SwimLane.Lanes.Add(new Lane() { Name = "lane1", Width = 300, Orientation = "vertical" });
               Model.Nodes.Add(SwimLane);

    MaxHeight

    Gets or sets the maximum height limit of the node

    Declaration
    [JsonProperty("maxHeight")]
    public double MaxHeight { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
              SwimLane SwimLane = new SwimLane();
               Dictionary<string, string> AddInfo = new Dictionary<string, string>();
               AddInfo.Add("customvalue", "lane");
               Collection Children = new Collection();
               Children.Add(new Node() { Name = "node1", Height = 100, maxHeight = 50 });
               SwimLane.Lanes.Add(new Lane() { Name = "lane1", Width = 300, Orientation = "vertical" });
               Model.Nodes.Add(SwimLane);

    MaxWidth

    Gets or sets the maximum width limit of the node

    Declaration
    [JsonProperty("maxWidth")]
    public double MaxWidth { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
              SwimLane SwimLane = new SwimLane();
               Dictionary<string, string> addInfo = new Dictionary<string, string>();
               addInfo.Add("customvalue", "lane");
               Collection Children = new Collection();
               Children.Add(new Node() { Name = "node1", Height = 100, maxWidth = 50 });
               SwimLane.Lanes.Add(new Lane() { Name = "lane1", Width = 300, Orientation = "vertical" });
               Model.Nodes.Add(SwimLane);

    MinHeight

    Gets or sets the minimum height limit of the node

    Declaration
    [JsonProperty("minHeight")]
    public double MinHeight { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
              SwimLane SwimLane = new SwimLane();
               Dictionary<string, string> AddInfo = new Dictionary<string, string>();
               AddInfo.Add("customvalue", "lane");
               Collection Children = new Collection();
               Children.Add(new Node() { Name = "node1", Height = 100, minHeight = 50 });
               SwimLane.Lanes.Add(new Lane() { Name = "lane1", Width = 300, Orientation = "vertical" });
               Model.Nodes.Add(SwimLane);

    MinWidth

    Gets or sets the minimum width limit of the node

    Declaration
    [JsonProperty("minWidth")]
    public double MinWidth { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
              SwimLane SwimLane = new SwimLane();
               Dictionary<string, string> AddInfo = new Dictionary<string, string>();
               AddInfo.Add("customvalue", "lane");
               Collection Children = new Collection();
               Children.Add(new Node() { Name = "node1", Height = 100, minWidth = 50 });
               SwimLane.Lanes.Add(new Lane() { Name = "lane1", Width = 300, Orientation = "vertical" });
               Model.Nodes.Add(SwimLane);

    Name

    Gets or sets name of the node

    Declaration
    [JsonProperty("name")]
    public string Name { get; set; }
    Property Value
    Type Description
    System.String

    String.Empty

    Examples
               DiagramProperties Model = new DiagramProperties();
               Node Node = new Node() { Name = "node1", Width = 100, Height = 100 }; Model.Nodes.Add(Node); 
               return View();

    OffsetX

    Gets or sets the position of the node on X-Axis

    Declaration
    [JsonProperty("offsetX")]
    public double OffsetX { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
               DiagramProperties Model = new DiagramProperties();
               Node Node = new Node() { Name = "node1", Height = 100, Width = 100, OffsetX = 50, OffsetY = 50 };
               Model.Nodes.Add(Node);
               ViewData["diagramModel"] = Model;

    OffsetY

    Gets or sets the position of the node on Y-Axis

    Declaration
    [JsonProperty("offsetY")]
    public double OffsetY { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
               DiagramProperties Model = new DiagramProperties();
               Node Node = new Node() { Name = "node1", Height = 100, Width = 100, OffsetX = 50, OffsetY = 50 };
               Model.Nodes.Add(Node);
               ViewData["diagramModel"] = Model;

    PaletteItem

    Gets or sets the size and preview size of the node to add that to symbol palette

    Declaration
    [JsonProperty("paletteItem")]
    public PaletteItem PaletteItem { get; set; }
    Property Value
    Type Description
    PaletteItem

    null

    Examples
               SymbolPaletteProperties SymbolPalette = new SymbolPaletteProperties();
               SymbolPalette.Palettes = new Collection();
               Palette Palette = new Palette("Connectors");
               Palette.Expanded = true;
               Node Connector = new Node();
               Connector.Name = "Node"; 
               Connector.PaletteItem.PreviewWidth = 100;
               Connector.PaletteItem.PreviewHeight = 100;
               Palette.Items.Add(Connector);
               ViewData["PaletteModel"] = SymbolPalette;

    Parent

    Gets or sets the name of the parent group

    Declaration
    [JsonProperty("parent")]
    public string Parent { get; set; }
    Property Value
    Type Description
    System.String

    String.Empty

    Examples
               Node Node1 = new Node() { Name = "node1", Height = 100, };
               Model.Nodes.Add(Node1);
               Node Node2 = new Node() { Name = "node2", Height = 100, Parent = "group" };
               Model.Nodes.Add(Node2);
               Group Group = new Group() { Name = "group", Height = 400, Width = 400, PaddingBottom = 20 };
               Group.Children.Add("Node1");
               Group.Children.Add("Node2"); 

    Pivot

    Gets or sets the ratio/ fractional value relative to node, based on which the node will be transformed(positioning, scaling and rotation)

    Declaration
    [JsonProperty("pivot")]
    public DiagramPoint Pivot { get; set; }
    Property Value
    Type Description
    DiagramPoint

    new DiagramPoint(){ X:.5f , Y:.5f }

    Examples
               DiagramProperties Model = new DiagramProperties();
               BasicShape Node = new BasicShape() { Name = "SwimLane", Pivot = new DiagramPoint(0.7f, 0.2f) };
               Model.Nodes.Add(Node);
               ViewData["diagramModel"] = Model;

    Ports

    Gets or sets an collection of objects where each object represents a port

    Declaration
    [JsonProperty("ports")]
    public Collection Ports { get; set; }
    Property Value
    Type Description
    Collection

    Collection

    Examples
               DiagramProperties Model = new DiagramProperties();
               Collection Ports = new Collection();
               Ports.Add(new Port() { Name = "port1", Offset = new DiagramPoint(.5f, 0) });
               Ports.Add(new Port() { Name = "port1", Offset = new DiagramPoint(.5f, 1) });
               BasicShape Node = new BasicShape() { Name = "SwimLane", Ports = Ports };
               Model.Nodes.Add(Node);
               ViewData["diagramModel"] = Model;

    RotateAngle

    Gets or sets the angle to which the node should be rotated

    Declaration
    [JsonProperty("rotateAngle")]
    public double RotateAngle { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
               DiagramProperties Model = new DiagramProperties();
               BasicShape Node = new BasicShape() { Name = "SwimLane", RotateAngle = 23 };
               Model.Nodes.Add(Node);
               ViewData["diagramModel"] = Model;

    Tag

    Declaration
    [JsonProperty("tag")]
    public object Tag { get; set; }
    Property Value
    Type Description
    System.Object

    Tooltip

    Gets or sets the tooltip that should be shown when the mouse hovers over node

    Declaration
    [JsonProperty("tooltip")]
    public Tooltip Tooltip { get; set; }
    Property Value
    Type Description
    Tooltip

    null

    Examples
           <script type="text/x-jsrender" id="mouseovertooltip">
           <div style="background-color: #F08080; color: white; white-space: nowrap; height: 20px">
               <span style="padding: 5px;"> {{:name}} </span>
           </div>
           </script> 
                 Tooltip Tooltip = new Tooltip() { TemplateId = "mouseovertooltip", Alignment = new Alignment() { Horizontal = HorizontalAlignment.Center, Vertical = VerticalAlignment.Bottom } };
                   Node Node = new Node()
                   {
                       Name = "node",
                       Tooltip = Tooltip
                   };
                   Model.Nodes.Add(Node);

    VerticalAlign

    Gets or sets the vertical aligment of a node. Applicable, if the parent of a node is a container.

    Declaration
    [JsonConverter(typeof(StringEnumConverter))]
    [JsonProperty("verticalAlign")]
    public VerticalAlignment VerticalAlign { get; set; }
    Property Value
    Type Description
    VerticalAlignment

    VerticalAlignment.Top

    Examples
               DiagramProperties Model = new DiagramProperties();
               Node Node1 = new Node() { Name = "node1", Height = 100, VerticalAlign = VerticalAlignment.Center };
               Model.Nodes.Add(Node1);
               Node Node2= new Node() { Name = "node2", Height = 100, VerticalAlign = VerticalAlignment.Center };
               Model.Nodes.Add(Node2);
               Group Group = new Group() { Name = "group", Height = 400, Width = 400, };
               Group.Children.Add("Node1");
               Group.Children.Add("Node2");

    Visible

    Gets or sets the visibility of the node

    Declaration
    [JsonProperty("visible")]
    public bool Visible { get; set; }
    Property Value
    Type Description
    System.Boolean

    true

    Examples
               DiagramProperties Model = new DiagramProperties();
               Node Node = new Node()
                  {
                      Name = "node",
                      Visible = false
                  };
               Model.Nodes.Add(Node);
               ViewData["diagramModel"] = Model;

    Width

    Gets or sets the width of the node

    Declaration
    [JsonProperty("width")]
    public double Width { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
               DiagramProperties Model = new DiagramProperties();
               Node Node = new Node()
                  {
                      Name = "node",
                      Width = 100
                  };
               Model.Nodes.Add(Node);
               ViewData["diagramModel"] = Model;

    ZOrder

    Gets or sets the z-index of the node

    Declaration
    [JsonProperty("zOrder")]
    public double ZOrder { get; set; }
    Property Value
    Type Description
    System.Double

    0

    Examples
               DiagramProperties Model = new DiagramProperties();
               Node Node = new Node()
                  {
                      Name = "node",
                      ZOrder = 5
                  };
               Model.Nodes.Add(Node);
               ViewData["diagramModel"] = Model;
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved