Nodes are graphical objects used to visually represent the geometrical information, process flow, internal business procedure, entity, or any other kind of data.
A node can be created and added to the diagram, either programmatically or interactively. Nodes are stacked on the diagram area from bottom to top in the order they are added.
To create a node, define the node
object and add that to nodes collection of the diagram model. The following code example illustrates how to add a node to the diagram.
var node = {
// Position of the node
offsetX: 250,
offsetY: 250,
// Size of the node
width: 100,
height: 100,
style: { fill: '#6BA5D7', strokeColor: 'white' },
// Text(label) added to the node
};
// initialize Diagram component
var diagram = new ej.diagrams.Diagram({
width: '100%', height: '600px', nodes: [node]
}, '#element');
<!DOCTYPE html><html lang="en"><head>
<title>EJ2 Diagram</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Typescript UI Controls">
<meta name="author" content="Syncfusion">
<link href="index.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-popups/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-splitbuttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-diagrams/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-navigations/styles/fabric.css" rel="stylesheet">
<script src="https://cdn.syncfusion.com/ej2/21.2.3/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<div id="element"></div>
</div>
<script>
var ele = document.getElementById('container');
if(ele) {
ele.style.visibility = "visible";
}
</script>
<script src="index.js" type="text/javascript"></script>
</body></html>
Note: Node id should not begin with numbers(should begin with a letter).Node Id should be unique for all the shapes and connectors.
collectionChange
event will trigger.The following code illustrates how to add a node.
var node = {
// Position of the node
offsetX: 250,
offsetY: 250,
// Size of the node
width: 100,
height: 100,
style: { fill: '#6BA5D7', strokeColor: 'white' },
// Text(label) added to the node
};
// initialize Diagram component
var diagram = new ej.diagrams.Diagram({
width: '100%', height: '600px'
}, '#element');
diagram.add(node);
<!DOCTYPE html><html lang="en"><head>
<title>EJ2 Diagram</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Typescript UI Controls">
<meta name="author" content="Syncfusion">
<link href="index.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-popups/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-splitbuttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-diagrams/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-navigations/styles/fabric.css" rel="stylesheet">
<script src="https://cdn.syncfusion.com/ej2/21.2.3/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<div id="element"></div>
</div>
<script>
var ele = document.getElementById('container');
if(ele) {
ele.style.visibility = "visible";
}
</script>
<script src="index.js" type="text/javascript"></script>
</body></html>
Nodes can be predefined and added to the palette, and can be dropped into the diagram when needed. For more information
about adding nodes from symbol palette, refer to Symbol Palette
.
dragEnter
event gets triggered.dragOver
event gets triggered.drop
event gets triggered.dragLeave
event gets triggered.Nodes can be generated automatically with the information provided through data source. The default properties for these nodes are fetched from default settings. For more information about data source, refer to Data Binding.
Nodes can be interactively drawn by clicking and dragging the diagram surface by using NodeDrawingTool
. For more
information about drawing nodes, refer to Draw Nodes.
offsetX
and offsetY
properties. By default, these offset properties represent the distance between the origin of the diagram’s page and node’s center point.pivot
point is (0.5, 0.5), that means center of the node.width
and
height
properties.rotateAngle
property.The following table illustrates how pivot relates offset values with node boundaries.
Pivot | Offset |
---|---|
(0.5,0.5) | offsetX and offsetY values are considered as the node’s center point. |
(0,0) | offsetX and offsetY values are considered as the top-left corner of the node. |
(1,1) | offsetX and offsetY values are considered as the bottom-right corner of the node. |
The following code illustrates how to change the pivot
value.
var node = {
// Position of the node
offsetX: 250,
offsetY: 250,
// Size of the node
width: 100,
height: 100,
style: { fill: '#6BA5D7', strokeColor: 'white' },
pivot: {x: 0, y: 0}
};
// initialize Diagram component
var diagram = new ej.diagrams.Diagram({
width: '100%', height: '600px', nodes: [node]
}, '#element');
diagram.select([diagram.nodes[0]]);
<!DOCTYPE html><html lang="en"><head>
<title>EJ2 Diagram</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Typescript UI Controls">
<meta name="author" content="Syncfusion">
<link href="index.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-popups/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-splitbuttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-diagrams/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-navigations/styles/fabric.css" rel="stylesheet">
<script src="https://cdn.syncfusion.com/ej2/21.2.3/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<div id="element"></div>
</div>
<script>
var ele = document.getElementById('container');
if(ele) {
ele.style.visibility = "visible";
}
</script>
<script src="index.js" type="text/javascript"></script>
</body></html>
The diagram Provides support to flip the node. flip
is performed to
give the mirrored image of the original element.
The flip types are as follows:
Horizontal
is used to change the element in horizontal direction.Vertical
is used to change the element in vertical directionBoth
which involves both vertical and horizontal changes of the element.The following code illustrates how to provide the mirror image of the original element.
var node = {
// Position of the node
offsetX: 250,
offsetY: 250,
// Size of the node
width: 100,
height: 100,
style: { fill: '#6BA5D7', strokeColor: 'white' },
pivot: {x: 0, y: 0}
};
// initialize Diagram component
var diagram = new ej.diagrams.Diagram({
width: '100%', height: '600px', nodes: [node]
}, '#element');
diagram.select([diagram.nodes[0]]);
<!DOCTYPE html><html lang="en"><head>
<title>EJ2 Diagram</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Typescript UI Controls">
<meta name="author" content="Syncfusion">
<link href="index.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-popups/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-splitbuttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-diagrams/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-navigations/styles/fabric.css" rel="stylesheet">
<script src="https://cdn.syncfusion.com/ej2/21.2.3/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<div id="element"></div>
</div>
<script>
var ele = document.getElementById('container');
if(ele) {
ele.style.visibility = "visible";
}
</script>
<script src="index.js" type="text/javascript"></script>
</body></html>
fill
color, borderColor
, borderWidth
, strokeDashArray
,
opacity
, and shadow
.visible
property of the node enables or disables the visibility of the node.The following code illustrates how to customize the appearance of the shape.
var node = {
// Position of the node
offsetX: 250,
offsetY: 250,
// Size of the node
width: 100,
height: 100,
style: { fill: '#6BA5D7', strokeDashArray: '5,5'}, borderWidth: 2, borderColor: 'red',
// Text(label) added to the node
};
// initialize Diagram component
var diagram = new ej.diagrams.Diagram({
width: '100%', height: '600px', nodes: [node]
}, '#element');
<!DOCTYPE html><html lang="en"><head>
<title>EJ2 Diagram</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Typescript UI Controls">
<meta name="author" content="Syncfusion">
<link href="index.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-popups/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-splitbuttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-diagrams/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-navigations/styles/fabric.css" rel="stylesheet">
<script src="https://cdn.syncfusion.com/ej2/21.2.3/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<div id="element"></div>
</div>
<script>
var ele = document.getElementById('container');
if(ele) {
ele.style.visibility = "visible";
}
</script>
<script src="index.js" type="text/javascript"></script>
</body></html>
Note: The flip is also applicable for group and BPMN shapes.
The gradient
property of the node allows you to define and apply the gradient effect to that node.
The gradient stop property defines the color and a position, where the previous color transition ends and a new color transition starts.
The gradient stop’s opacity property defines the transparency level of the region.
There are two types of gradients as follows:
LinearGradient
defines a smooth transition between a set of colors (so-called stops) on a line.var linearGradient;
linearGradient = {
//Start point of linear gradient
x1: 0, y1: 0,
//End point of linear gradient
x2: 50, y2: 50,
//Sets an array of stop objects
stops: [{ color: 'white', offset: 0 },
{ color: '#6BA5D7', offset: 100 }],
type: 'Linear'
};
var radialGradient;
radialGradient = {
//Center point of outer circle
cx: 50, cy: 50,
//Center point of inner circle
fx: 25, fy: 25,
//Radius of a radial gradient
r: 50,
//Sets an array of stop objects
stops: [{ color: 'white', offset: 0 },
{ color: '#6BA5D7', offset: 100 }],
type: 'Radial'
};
var node = {
// Position of the node
offsetX: 250,
offsetY: 250,
// Size of the node
width: 100,
height: 100,
style: {gradient: linearGradient, strokeColor: 'white' }
// Text(label) added to the node
};
var node2 = {
// Position of the node
offsetX: 400,
offsetY: 250,
// Size of the node
width: 100,
height: 100,
style: {gradient: radialGradient, strokeColor: 'white' }
};
// initialize Diagram component
var diagram = new ej.diagrams.Diagram({
width: '100%', height: '600px', nodes: [node, node2]
}, '#element');
<!DOCTYPE html><html lang="en"><head>
<title>EJ2 Diagram</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Typescript UI Controls">
<meta name="author" content="Syncfusion">
<link href="index.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-popups/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-splitbuttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-diagrams/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-navigations/styles/fabric.css" rel="stylesheet">
<script src="https://cdn.syncfusion.com/ej2/21.2.3/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<div id="element"></div>
</div>
<script>
var ele = document.getElementById('container');
if(ele) {
ele.style.visibility = "visible";
}
</script>
<script src="index.js" type="text/javascript"></script>
</body></html>
RadialGradient
defines a smooth transition between stops on a circle.var linearGradient;
linearGradient = {
//Start point of linear gradient
x1: 0, y1: 0,
//End point of linear gradient
x2: 50, y2: 50,
//Sets an array of stop objects
stops: [{ color: 'white', offset: 0 },
{ color: '#6BA5D7', offset: 100 }],
type: 'Linear'
};
var radialGradient;
radialGradient = {
//Center point of outer circle
cx: 50, cy: 50,
//Center point of inner circle
fx: 25, fy: 25,
//Radius of a radial gradient
r: 50,
//Sets an array of stop objects
stops: [{ color: 'white', offset: 0 },
{ color: '#6BA5D7', offset: 100 }],
type: 'Radial'
};
var node = {
// Position of the node
offsetX: 250,
offsetY: 250,
// Size of the node
width: 100,
height: 100,
style: {gradient: linearGradient, strokeColor: 'white' }
// Text(label) added to the node
};
var node2 = {
// Position of the node
offsetX: 400,
offsetY: 250,
// Size of the node
width: 100,
height: 100,
style: {gradient: radialGradient, strokeColor: 'white' }
};
// initialize Diagram component
var diagram = new ej.diagrams.Diagram({
width: '100%', height: '600px', nodes: [node, node2]
}, '#element');
<!DOCTYPE html><html lang="en"><head>
<title>EJ2 Diagram</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Typescript UI Controls">
<meta name="author" content="Syncfusion">
<link href="index.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-popups/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-splitbuttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-diagrams/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-navigations/styles/fabric.css" rel="stylesheet">
<script src="https://cdn.syncfusion.com/ej2/21.2.3/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<div id="element"></div>
</div>
<script>
var ele = document.getElementById('container');
if(ele) {
ele.style.visibility = "visible";
}
</script>
<script src="index.js" type="text/javascript"></script>
</body></html>
Diagram provides support to add shadow
effect to a node that is disabled, by default. It can be enabled with the
constraints property of the node. The following code illustrates how to drop shadow.
var node = {
// Position of the node
offsetX: 250,
offsetY: 250,
// Size of the node
width: 100,
height: 100,
style: { fill: '#6BA5D7', strokeColor: 'white' },
constraints: ej.diagrams.NodeConstraints.Default | ej.diagrams.NodeConstraints.Shadow,
// Text(label) added to the node
};
// initialize Diagram component
var diagram = new ej.diagrams.Diagram({
width: '100%', height: '600px', nodes: [node]
}, '#element');
<!DOCTYPE html><html lang="en"><head>
<title>EJ2 Diagram</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Typescript UI Controls">
<meta name="author" content="Syncfusion">
<link href="index.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-popups/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-splitbuttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-diagrams/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-navigations/styles/fabric.css" rel="stylesheet">
<script src="https://cdn.syncfusion.com/ej2/21.2.3/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<div id="element"></div>
</div>
<script>
var ele = document.getElementById('container');
if(ele) {
ele.style.visibility = "visible";
}
</script>
<script src="index.js" type="text/javascript"></script>
</body></html>
The angle, distance, and opacity of the shadow can be customized with the shadow property of the node. The following code example illustrates how to customize shadow.
var node = {
// Position of the node
offsetX: 250,
offsetY: 250,
// Size of the node
width: 100,
height: 100,
style: { fill: '#6BA5D7', strokeColor: 'white' },
constraints: ej.diagrams.NodeConstraints.Default | ej.diagrams.NodeConstraints.Shadow,
shadow: {angle: 50, opacity: 0.8, distance: 9}
};
// initialize Diagram component
var diagram = new ej.diagrams.Diagram({
width: '100%', height: '600px', nodes: [node]
}, '#element');
<!DOCTYPE html><html lang="en"><head>
<title>EJ2 Diagram</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Typescript UI Controls">
<meta name="author" content="Syncfusion">
<link href="index.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-popups/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-splitbuttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-diagrams/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-navigations/styles/fabric.css" rel="stylesheet">
<script src="https://cdn.syncfusion.com/ej2/21.2.3/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<div id="element"></div>
</div>
<script>
var ele = document.getElementById('container');
if(ele) {
ele.style.visibility = "visible";
}
</script>
<script src="index.js" type="text/javascript"></script>
</body></html>
Diagram provides support to describe the state of the node. i.e., the node is expanded or collapsed state.
Note: Icon can be created only when the node has outEdges.
expandIcon
and collapseIcon
.The following code example illustrates how to create an icon of various shapes.
var nodes = [
{
id: 'Start', width: 140, height: 50, offsetX: 300, offsetY: 50,
annotations: [{
content: 'Node1'
}],
style: { fill: '#6BA5D7', strokeColor: 'white' },
expandIcon: {shape: 'ArrowDown', width: 10, height: 10},
collapseIcon: {shape: 'ArrowUp', width: 10, height: 10}
},
{
id: 'Init', width: 140, height: 50, offsetX: 300, offsetY: 140,
style: { fill: '#6BA5D7', strokeColor: 'white' },
annotations: [{
content: 'Node2'
}],
}
];
var connectors = [{
// Unique name for the connector
id: "connector1",
// Source and Target node's name to which connector needs to be connected.
sourceID: "Start",
targetID: "Init",
type: 'Orthogonal'
}];
// initialize Diagram component
var diagram = new ej.diagrams.Diagram({
width: '100%', height: '600px', nodes: nodes, connectors: connectors
}, '#element');
<!DOCTYPE html><html lang="en"><head>
<title>EJ2 Diagram</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Typescript UI Controls">
<meta name="author" content="Syncfusion">
<link href="index.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-base/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-buttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-popups/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-splitbuttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-diagrams/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.2.3/ej2-navigations/styles/fabric.css" rel="stylesheet">
<script src="https://cdn.syncfusion.com/ej2/21.2.3/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<div id="element"></div>
</div>
<script>
var ele = document.getElementById('container');
if(ele) {
ele.style.visibility = "visible";
}
</script>
<script src="index.js" type="text/javascript"></script>
</body></html>
borderColor
,
borderWidth
, background color for an collapseIcon using borderColor, borderWidth, and fill
properties.width
and
height
properties.Diagram provides support to drag, resize, or rotate the node interactively. For more information about editing a node at runtime, refer to Edit Nodes.
The constraints property of the node allows you to enable/disable certain features. For more information about node constraints, refer to Node Constraints
.
The addInfo
property of the node allows to maintain additional information to the node.
The nodes z-order property specifies the stack order of the node. A node with greater stack order is always in front of a node with a lower stack order.
Node has the InEdges and OutEdges read-only property. In this property, you can find what are all the connectors that are connected to the node, and then you can find these connectors by using the getObject
method in the diagram.
var node = {
id: 'node1',
// Position of the node
offsetX: 450,
offsetY: 100,
// Size of the node
width: 80,
height: 50,
style: { fill: '#6BA5D7', strokeColor: 'white' },
};
var node2 = {
id: 'node2',
// Position of the node
offsetX: 350,
offsetY: 200,
// Size of the node
width: 80,
height: 50,
style: { fill: '#6BA5D7', strokeColor: 'white' },
};
var node3 = {
id: 'node3',
// Position of the node
offsetX: 450,
offsetY: 200,
// Size of the node
width: 80,
height: 50,
style: { fill: '#6BA5D7', strokeColor: 'white' },
};
var node4 = {
id: 'node4',
// Position of the node
offsetX: 550,
offsetY: 200,
// Size of the node
width: 80,
height: 50,
style: { fill: '#6BA5D7', strokeColor: 'white' },
};
var connector = {
id: 'connector1', sourceID: 'node1', targetID: 'node2', type: 'Orthogonal'
};
var connector2 = {
id: 'connector2', sourceID: 'node1', targetID: 'node3', type: 'Orthogonal'
};
var connector3 = {
id: 'connector3', sourceID: 'node1', targetID: 'node4', type: 'Orthogonal'
};
var diagram = new ej.diagrams.Diagram({
width: '100%', height: 600, nodes: [node, node2, node3, node4],
connectors: [connector, connector2, connector3]
}, '#element');
diagram.getObject('connector1');