Connector customization
22 Mar 202524 minutes to read
Diagram allows you to customize the connector appearances. The following topics shows how to customize several properties of the connectors.
Decorator
-
Starting and ending points of a connector can be decorated with some customizable shapes like arrows, circles, diamond, or path. The connection end points can be decorated with the
sourceDecorator
andtargetDecorator
properties of the connector. -
The
shape
property ofsourceDecorator
allows to define the shape of the decorators. Similarly, the shape property oftargetDecorator
allows to define the shape of the decorators. -
To create custom shape for source decorator, use
pathData
property. Similarly, to create custom shape for target decorator, usepathData
property. -
The following code example illustrates how to create decorators of various shapes.
import { Diagram, ConnectorModel } from '@syncfusion/ej2-diagrams';
let connectors: ConnectorModel = {
id: 'connector1',
type: 'Straight',
// Decorator shape- circle
sourceDecorator: {
shape: 'Circle',
},
// Decorator shape - Diamond
targetDecorator: {
// Defines the custom shape for the connector's target decorator
shape: 'Custom',
//Defines the path for the connector's target decorator
pathData:
'M80.5,12.5 C80.5,19.127417 62.59139,24.5 40.5,24.5 C18.40861,24.5 0.5,19.127417 0.5,12.5' +
'C0.5,5.872583 18.40861,0.5 40.5,0.5 C62.59139,0.5 80.5,5.872583 80.5,12.5 z',
},
sourcePoint: {
x: 100,
y: 100,
},
targetPoint: {
x: 200,
y: 200,
},
};
let connectors2: ConnectorModel = {
id: 'connectors2',
type: 'Straight',
// Decorator shape - IndentedArrow
sourceDecorator: {
shape: 'IndentedArrow',
},
// Decorator shape - OutdentedArrow
targetDecorator: {
shape: 'OutdentedArrow',
},
sourcePoint: {
x: 400,
y: 100,
},
targetPoint: {
x: 300,
y: 200,
},
};
let diagram: Diagram = new Diagram({
width: '100%',
height: '600px',
connectors: [connectors, connectors2],
});
diagram.appendTo('#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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>
Customize the decorator appearance
-
The source decorator’s
strokeColor
,strokeWidth
, andstrokeDashArray
properties are used to customize the color, width, and appearance of the decorator. -
To set the border stroke color, stroke width, and stroke dash array for the target decorator, use
strokeColor
,strokeWidth
, andstrokeDashArray
. -
To set the size for source and target decorator, use width and height property.
The following code example illustrates how to customize the appearance of the decorator.
import { Diagram, ConnectorModel } from '@syncfusion/ej2-diagrams';
let connectors: ConnectorModel = {
id: 'connector1',
type: 'Straight',
// Decorator shape- circle
sourceDecorator: {
shape: 'Circle',
// Defines the style for the sourceDecorator
style: {
// Defines the strokeWidth for the sourceDecorator
strokeWidth: 3,
// Defines the strokeColor for the sourceDecorator
strokeColor: 'red',
},
},
// Decorator shape - Diamond
targetDecorator: {
// Defines the custom shape for the connector's target decorator
shape: 'Custom',
//Defines the path for the connector's target decorator
pathData:
'M80.5,12.5 C80.5,19.127417 62.59139,24.5 40.5,24.5 C18.40861,24.5 0.5,19.127417 0.5,12.5' +
'C0.5,5.872583 18.40861,0.5 40.5,0.5 C62.59139,0.5 80.5,5.872583 80.5,12.5 z',
//defines the style for the target decorator
style: {
// Defines the strokeWidth for the targetDecorator
strokeWidth: 3,
// Defines the strokeColor for the sourceDecorator
strokeColor: 'green',
// Defines the opacity for the sourceDecorator
opacity: 0.8,
},
},
sourcePoint: {
x: 100,
y: 100,
},
targetPoint: {
x: 200,
y: 200,
},
};
let connectors2: ConnectorModel = {
id: 'connectors2',
type: 'Straight',
// Decorator shape - IndentedArrow
sourceDecorator: {
shape: 'IndentedArrow',
style: {
strokeWidth: 3,
strokeColor: 'blue',
},
},
// Decorator shape - OutdentedArrow
targetDecorator: {
shape: 'OutdentedArrow',
style: {
strokeWidth: 3,
strokeColor: 'yellow',
},
},
sourcePoint: {
x: 400,
y: 100,
},
targetPoint: {
x: 300,
y: 200,
},
};
let diagram: Diagram = new Diagram({
width: '100%',
height: '600px',
connectors: [connectors, connectors2],
});
diagram.appendTo('#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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>
Gradient style for decorator.
The gradient property is used to set the gradient color for the decorator. There are two types of gradient.
- Linear
- Radial
The following code example illustrates how to apply gradient for the decorator.
import {
ConnectorModel,
NodeModel,
BasicShapeModel,
Diagram,
GradientModel,
} from '@syncfusion/ej2-diagrams';
let connectors: ConnectorModel[] = [
{
id: 'connector1',
type: 'Straight',
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
strokeWidth: 2,
},
bridgeSpace: 20,
// Cutomize the target decorator
targetDecorator: {
style: {
strokeWidth: 1,
opacity: 0.5,
gradient: {
x1: 20,
y1: 20,
x2: 70,
y2: 70,
stops: [
{
color: 'green',
offset: 50,
opacity: 1,
},
{
color: 'yellow',
offset: 100,
opacity: 1,
},
],
type: 'Linear',
} as GradientModel,
},
},
sourcePoint: {
x: 100,
y: 100,
},
targetPoint: {
x: 200,
y: 200,
},
},
{
id: 'connector2',
type: 'Straight',
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
strokeWidth: 2,
},
bridgeSpace: 20,
// Cutomize the target decorator
targetDecorator: {
style: {
gradient: {
cx: 50,
cy: 50,
fx: 50,
fy: 50,
stops: [
{ color: '#00555b', offset: 0 },
{ color: 'yellow', offset: 90 },
],
type: 'Radial',
},
},
},
sourcePoint: {
x: 300,
y: 100,
},
targetPoint: {
x: 400,
y: 200,
},
},
];
let diagram: Diagram = new Diagram({
width: '100%',
height: 900,
connectors: connectors,
created: function () {
diagram.zoomTo({
type: 'ZoomIn',
zoomFactor: 2,
focusPoint: { x: 0, y: 0.5 },
});
diagram.fitToPage();
},
});
diagram.appendTo('#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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>
Padding
Padding is used to leave the space between the Connector’s end point and the object to where it is connected.
-
The
sourcePadding
property of connector defines space between the source point and the source node of the connector. -
The
targetPadding
property of connector defines space between the end point and the target node of the connector. -
The following code example illustrates how to leave space between the connection end points and source and target nodes.
import {ConnectorModel,NodeModel,BasicShapeModel,Diagram} from '@syncfusion/ej2-diagrams';
let nodes: NodeModel[] = [{
id: 'node',
width: 100,
height: 100,
offsetX: 100,
offsetY: 100,
},
{
id: 'node1',
width: 100,
height: 100,
offsetX: 300,
offsetY: 100,
},
];
let connectors: ConnectorModel = {
id: "connector1",
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
strokeWidth: 2
},
targetDecorator: {
style: {
fill: '#6BA5D7',
strokeColor: '#6BA5D7'
}
},
sourceID: 'node',
targetID: 'node1',
// Set Source Padding value
sourcePadding:20,
// Set Target Padding value
targetPadding:20
}
let diagram: Diagram = new Diagram({
width: '100%',
height: 900,
nodes: nodes,
connectors: [connectors],
getNodeDefaults: (node: NodeModel) => {
node.height = 100;
node.width = 100;
node.style.fill = '#6BA5D7';
node.style.strokeColor = 'white';
return node;
},
});
diagram.appendTo('#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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>
Bridging
Line bridging creates a bridge for lines to smartly cross over the other lines, at points of intersection. By default, bridgeDirection
is set to top. Depending upon the direction given bridging direction appears.
Bridging can be enabled/disabled either with the connector.constraints
or diagram.constraints
. The following code example illustrates how to enable line bridging.
import {Diagram,ConnectorBridging,DiagramConstraints,ConnectorModel,NodeModel}from'@syncfusion/ej2-diagrams';
Diagram.Inject(ConnectorBridging);
let node1: NodeModel = {
id: 'Transaction',
width: 150,
height: 60,
offsetX: 300,
offsetY: 60,
shape: {
type: 'Flow',
shape: 'Terminator'
},
annotations: [{
id: 'label1',
content: 'Start Transaction',
offset: {
x: 0.5,
y: 0.5
}
}],
};
let node2: NodeModel = {
id: 'Verification',
width: 150,
height: 60,
offsetX: 300,
offsetY: 250,
shape: {
type: 'Flow',
shape: 'Process'
},
annotations: [{
id: 'label2',
content: 'Verification',
offset: {
x: 0.5,
y: 0.5
}
}]
};
let connectors: ConnectorModel = {
id: 'connector1',
type: 'Straight',
sourceID: 'Transaction',
targetID: 'Verification'
};
let connectors2: ConnectorModel = {
id: 'connector2',
type: 'Straight',
sourcePoint: {
x: 200,
y: 130
},
targetPoint: {
x: 400,
y: 130
}
};
let connector3: ConnectorModel = {
id: 'connector3',
type: 'Straight',
sourcePoint: {
x: 200,
y: 170
},
targetPoint: {
x: 400,
y: 170
}
};
// Enables bridging for every connector added in the model
let diagram: Diagram = new Diagram({
width: '100%',
getConnectorDefaults: (obj: ConnectorModel): ConnectorModel => {
obj.style.strokeColor = '#6BA5D7';
obj.style.fill = '#6BA5D7';
obj.style.strokeWidth = 2;
obj.targetDecorator.style.fill = '#6BA5D7';
obj.targetDecorator.style.strokeColor = '#6BA5D7';
return obj;
},
getNodeDefaults: (node: NodeModel) => {
node.height = 100;
node.width = 100;
node.style.fill = '#6BA5D7';
node.style.strokeColor = 'white';
return node;
},
nodes: [node1, node2],
height: '600px',
// Enables the bridging constraints for the connector
constraints: DiagramConstraints.Default | DiagramConstraints.Bridging,
connectors: [connectors, connectors2, connector3]
});
diagram.appendTo('#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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>
NOTE
You need to inject connector bridging module into the diagram.
The bridgeSpace
property of connectors can be used to define the width for line bridging.
Limitation: Bezier segments do not support bridging.
Hit padding
-
The
hitPadding
property enables you to define the clickable area around the connector path.The default value for hitPadding is 10. -
The following code example illustrates how to specify hit padding for connector.
import {
Diagram,
ConnectorModel,
OrthogonalSegmentModel,ConnectorConstraints,ConnectorEditing
} from '@syncfusion/ej2-diagrams';
Diagram.Inject(ConnectorEditing);
let connectors: ConnectorModel[] = [{
id: "connector1",
type:"Orthogonal",
hitPadding:40,
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
strokeWidth: 2
},
targetDecorator: {
style: {
fill: '#6BA5D7',
strokeColor: '#6BA5D7'
}
},
sourcePoint: { x: 100, y: 100 },
targetPoint: { x: 300, y: 300 },
constraints:ConnectorConstraints.Default | ConnectorConstraints.DragSegmentThumb,
}]
let diagram: Diagram = new Diagram({
width: '100%',
height: '600px',
connectors: connectors,
});
diagram.appendTo('#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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>
Corner radius
Corner radius allows to create connectors with rounded corners. The radius of the rounded corner is set with the cornerRadius
property.
import {Diagram,NodeModel,ConnectorModel} from '@syncfusion/ej2-diagrams';
let nodes: NodeModel[] = [{
id: 'node1',
width: 100,
height: 100,
offsetX: 100,
offsetY: 100,
},
{
id: 'node2',
width: 100,
height: 100,
offsetX: 100,
offsetY: 350,
},
]
let connectors: ConnectorModel[] = [{
id: "connector1",
type: 'Orthogonal',
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
strokeWidth: 2
},
targetDecorator: {
style: {
fill: '#6BA5D7',
strokeColor: '#6BA5D7'
}
},
// Sets the radius for the rounded corner
cornerRadius: 10,
sourceID: 'node1',
targetID: 'node2',
segments: [{
type: 'Orthogonal',
direction: 'Right',
length: 50
}],
}]
let diagram: Diagram = new Diagram({
width: '100%',
height: '600px',
connectors: connectors,
nodes: nodes,
getNodeDefaults: (node: NodeModel) => {
node.height = 100;
node.width = 100;
node.style.fill = '#6BA5D7';
node.style.strokeColor = 'white';
return node;
},
});
diagram.appendTo('#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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>
Connector Appearance
-
The connector’s
strokeWidth
,strokeColor
,strokeDashArray
, andopacity
properties are used to customize the appearance of the connector segments. -
The
visible
property of the connector enables or disables the visibility of connector. -
Default values for all the
connectors
can be set using thegetConnectorDefaults
properties. For example, if all connectors have the same type or having the same property then such properties can be moved intogetConnectorDefaults
.
Segment appearance
The following code example illustrates how to customize the segment appearance.
import {
ConnectorModel,
NodeModel,
BasicShapeModel,
Diagram,
} from '@syncfusion/ej2-diagrams';
let connectors: ConnectorModel[] = [
{
id: 'connector1',
targetDecorator: {
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
strokeWidth: 2,
},
},
style: {
// Stroke color
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
// Stroke width of the line
strokeWidth: 5,
// Line style
strokeDashArray: '2,2',
},
sourcePoint: {
x: 100,
y: 100,
},
targetPoint: {
x: 200,
y: 200,
},
},
{
id: 'connector2',
// Set the visibility of the connector to false
visible: true,
type: 'Orthogonal',
targetDecorator: {
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
strokeWidth: 2,
},
},
style: {
// Stroke color
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
// Stroke width of the line
strokeWidth: 5,
// Line style
strokeDashArray: '2,2',
},
sourcePoint: {
x: 300,
y: 300,
},
targetPoint: {
x: 400,
y: 400,
},
segments: [
{
type: 'Orthogonal',
direction: 'Right',
length: 50,
},
],
},
{
id: 'connector3',
// Set the visibility of the connector to false
visible: true,
type: 'Bezier',
targetDecorator: {
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
strokeWidth: 2,
},
},
style: {
// Stroke color
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
// Stroke width of the line
strokeWidth: 5,
// Line style
strokeDashArray: '2,2',
},
sourcePoint: {
x: 500,
y: 100,
},
targetPoint: {
x: 600,
y: 300,
},
segments: [
{
type: 'Bezier',
},
],
},
];
let diagram: Diagram = new Diagram({
width: '100%',
height: 900,
connectors: connectors,
});
diagram.appendTo('#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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>
Connector constraints
-
The
constraints
property of connector allows to enable/disable certain features of connectors. -
To enable or disable the constraints, refer
constraints
.
The following code illustrates how to disable selection.
import {
Diagram,
DiagramConstraints,
ConnectorConstraints,
ConnectorModel,
} from '@syncfusion/ej2-diagrams';
let connectors: ConnectorModel[] = [
{
id: 'connector1',
constraints: ConnectorConstraints.Default & ~ConnectorConstraints.Select,
annotations: [{ content: 'Connector Selection disabled' }],
type: 'Straight',
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
strokeWidth: 2,
},
targetDecorator: {
style: {
fill: '#6BA5D7',
strokeColor: '#6BA5D7',
},
},
sourcePoint: {
x: 100,
y: 100,
},
targetPoint: {
x: 200,
y: 200,
},
},
{
id: 'connector2',
constraints: ConnectorConstraints.Default & ~ConnectorConstraints.Drag,
annotations: [{ content: 'Connector Drag disabled' }],
type: 'Straight',
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
strokeWidth: 2,
},
targetDecorator: {
style: {
fill: '#6BA5D7',
strokeColor: '#6BA5D7',
},
},
sourcePoint: {
x: 300,
y: 100,
},
targetPoint: {
x: 400,
y: 200,
},
},
{
id: 'connector3',
constraints:
ConnectorConstraints.Default & ~ConnectorConstraints.DragSourceEnd,
annotations: [{ content: 'Connector Source end disabled' }],
type: 'Straight',
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
strokeWidth: 2,
},
targetDecorator: {
style: {
fill: '#6BA5D7',
strokeColor: '#6BA5D7',
},
},
sourcePoint: {
x: 500,
y: 100,
},
targetPoint: {
x: 600,
y: 200,
},
},
{
id: 'connector4',
constraints:
ConnectorConstraints.Default & ~ConnectorConstraints.DragTargetEnd,
annotations: [{ content: 'Connector Target end disabled' }],
type: 'Straight',
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
strokeWidth: 2,
},
targetDecorator: {
style: {
fill: '#6BA5D7',
strokeColor: '#6BA5D7',
},
},
sourcePoint: {
x: 700,
y: 100,
},
targetPoint: {
x: 800,
y: 200,
},
},
];
let diagram: Diagram = new Diagram({
width: 1500,
height: 1500,
connectors: connectors,
});
diagram.appendTo('#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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>
Add info for connector
The addInfo
property of connectors allow you to maintain additional information to the connectors.
var connectors = {
id: 'connector1',
//AddInfo for connector
addInfo: {type:'connector',id:'connector1'},
type: 'Straight',
sourcePoint: {x: 300,y: 100},
targetPoint: {x: 300,y: 200}
}
ZIndex for connector
The connectors zIndex
property specifies the stack order of the connector. A connector with greater stack order is always in front of a connector with a lower stack order.
The following code illustrates how to render connector based on the stack order.
import {Diagram,ConnectorModel} from '@syncfusion/ej2-diagrams';
let connectors: ConnectorModel = {
id: 'connector1',
// Defines the z-index value for the connector
zIndex: 2,
type: 'Straight',
sourcePoint: {
x: 300,
y: 100
},
targetPoint: {
x: 300,
y: 200
}
};
let connectors2: ConnectorModel = {
id: 'connector2',
type: 'Straight',
// Defines the z-index value for the connector
zIndex: 1,
sourcePoint: {
x: 100,
y: 100
},
targetPoint: {
x: 200,
y: 200
}
};
let diagram: Diagram = new Diagram({
width: '100%',
getConnectorDefaults: (obj: ConnectorModel): ConnectorModel => {
obj.style.strokeColor = '#6BA5D7';
obj.style.fill = '#6BA5D7';
obj.style.strokeWidth = 2;
obj.targetDecorator.style.fill = '#6BA5D7';
obj.targetDecorator.style.strokeColor = '#6BA5D7';
return obj;
},
height: '600px',
connectors: [connectors, connectors2]
});
diagram.appendTo('#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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>
Connector spacing
- The
connectorSpacing
property allows you to define the distance between the source node and the connector. It is the minimum distance the connector will re-rout or the new segment will create.
import {Diagram,NodeModel,ConnectorModel} from '@syncfusion/ej2-diagrams';
let nodes: NodeModel[] = [{
id: 'Start',
width: 140,
height: 50,
offsetX: 300,
offsetY: 100,
annotations: [{
id: 'label1',
content: 'Start'
}],
shape: {
type: 'Flow',
shape: 'Terminator'
}
},
{
id: 'Init',
width: 140,
height: 50,
offsetX: 300,
offsetY: 300,
shape: {
type: 'Flow',
shape: 'Process'
},
annotations: [{
content: 'var i = 0;'
}]
}
];
let connectors: ConnectorModel = {
// Name of the connector
id: "connector1",
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
strokeWidth: 2
},
targetDecorator: {
style: {
fill: '#6BA5D7',
strokeColor: '#6BA5D7'
}
},
// ID of the source and target nodes
sourceID: "Start",
targetID: "Init",
connectorSpacing: 7,
type: 'Orthogonal'
};
let diagram: Diagram = new Diagram({
width: '100%',
height: '600px',
nodes: nodes,
connectors: [connectors],
// Defines the default properties for the node
getNodeDefaults: (node: NodeModel) => {
node.height = 100;
node.width = 100;
node.style.fill = '#6BA5D7';
return node;
},
});
diagram.appendTo('#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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>
MaxSegment thumb
The property maxSegmentThumb
is used to limit the number of segment thumb in the connector.
import {
Diagram,
ConnectorModel,
OrthogonalSegmentModel,ConnectorConstraints,ConnectorEditing
} from '@syncfusion/ej2-diagrams';
Diagram.Inject(ConnectorEditing);
let connectors: ConnectorModel[] = [{
id: "connector1",
// Define the type of the segment
type: 'Orthogonal',
segments: [{
type: 'Orthogonal'
}],
style: {
strokeColor: '#6BA5D7',
fill: '#6BA5D7',
strokeWidth: 2
},
targetDecorator: {
style: {
fill: '#6BA5D7',
strokeColor: '#6BA5D7'
}
},
sourcePoint: {
x: 100,
y: 100
},
targetPoint: {
x: 200,
y: 200
},
maxSegmentThumb: 3,
constraints:ConnectorConstraints.Default | ConnectorConstraints.DragSegmentThumb,
},]
let diagram: Diagram = new Diagram({
width: '100%',
height: '600px',
connectors: connectors,
});
diagram.appendTo('#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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>
Reset segments
The resetSegments
method resets the segments of connectors to their default state based on their connection points. This operation removes any custom segments and restores the connectors to their original configuration. The following example demonstrates how to reset connector segments at runtime.
import {
Diagram,
NodeModel,
ConnectorModel,
HierarchicalTree,
ConnectorConstraints,
ConnectorEditing,
} from '@syncfusion/ej2-diagrams';
Diagram.Inject(HierarchicalTree, ConnectorEditing);
let nodes: NodeModel[] = [
{
id: 'Start',
width: 140,
height: 50,
offsetX: 300,
offsetY: 50,
annotations: [
{
content: 'Node1',
},
],
style: {
fill: '#6BA5D7',
strokeColor: 'white',
},
expandIcon: {
shape: 'ArrowDown',
width: 20,
height: 15,
},
collapseIcon: {
shape: 'ArrowUp',
width: 20,
height: 15,
},
},
{
id: 'Init',
width: 140,
height: 50,
offsetX: 200,
offsetY: 240,
style: {
fill: '#6BA5D7',
strokeColor: 'white',
},
annotations: [
{
content: 'Node2',
},
],
},
];
let connectors: ConnectorModel[] = [
{
// 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',
constraints:
ConnectorConstraints.Default | ConnectorConstraints.DragSegmentThumb,
},
];
let diagram: Diagram = new Diagram({
width: '100%',
height: '600px',
nodes: nodes,
connectors: connectors,
});
diagram.appendTo('#element');
(document.getElementById('resetSegments') as HTMLInputElement).onclick = () => {
diagram.resetSegments();
};
<!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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<input type="button" value="resetSegments" id="resetSegments" />
<div id='element'></div>
</div>
</body>
</html>
Enable Connector Splitting
The connectors are used to create a link between two points, ports, or nodes to represent the relationship between them. Split the connector between two nodes when dropping a new node onto an existing connector and create a connection between the new node and existing nodes by setting the enableConnectorSplit
as true. The default value of the enableConnectorSplit
is false
The following code illustrates how to split the connector and create a connection with new node.
import {
Diagram,NodeModel,ConnectorModel,ConnectorConstraints
} from '@syncfusion/ej2-diagrams';
let node1: NodeModel = {
id: 'node1',
width: 100, height: 100,
offsetX: 150, offsetY: 150,
annotations: [{ content: 'node1' }]
};
let node2: NodeModel = {
id: 'node2',
width: 100, height: 100,
offsetX: 650, offsetY: 150,
annotations: [{ content: 'node2' }]
};
let node3: NodeModel = {
id: 'node3',
width: 100, height: 100,
offsetX: 490, offsetY: 290,
annotations: [{ content: 'node3' }]
};
let connector1: ConnectorModel = {
id: 'connector1',sourceID:"node1",targetID:"node2",
constraints: ConnectorConstraints.Default | ConnectorConstraints.AllowDrop
};
let diagram:Diagram = new Diagram({
width: 1500, height: 1000,
enableConnectorSplit:true,
nodes: [node1, node2, node3],
connectors: [connector1]
});
diagram.appendTo('#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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>
Preserve connector style while connector splitting
When splitting a connector using enableConnectorSplit
, the new connector created will be a normal connector without any specific styles. To ensure the new connector has the same style as the original connector, you can use the collectionChange event to apply the styles.
The following example demonstrates how to apply the same style of the original connector to the newly added connector:
import {
Diagram,
NodeModel,
NodeConstraints,
Connector,
ConnectorConstraints,
ConnectorModel,
Node
} from '@syncfusion/ej2-diagrams';
let nodes: NodeModel[] = [
{
id: 'node1',
offsetX: 100,
offsetY: 100,
width: 100,
height: 100,
},
{
id: 'node2',
offsetX: 600,
offsetY: 100,
width: 100,
height: 100,
},
{
id: 'node3',
offsetX: 400,
offsetY: 300,
width: 100,
height: 100,
},
];
// Initial connectors for the diagram
let connectors: ConnectorModel[] = [
{
id: 'connector1',
sourceID: 'node1',
targetID: 'node2',
style: { strokeColor: 'red', strokeWidth: 2, strokeDashArray: '3,3' },
},
];
// initialize Diagram component
let diagram: Diagram = new Diagram({
width: '100%',
height: '600px',
// Add node
nodes: nodes,
connectors: connectors,
getNodeDefaults: (obj: NodeModel) => {
obj.width = 100;
obj.height = 100;
obj.constraints = NodeConstraints.Default | NodeConstraints.AllowDrop;
return obj;
},
getConnectorDefaults: (obj: ConnectorModel) => {
obj.constraints =
ConnectorConstraints.Default | ConnectorConstraints.AllowDrop;
return obj;
},
enableConnectorSplit: true,
collectionChange: function (args) {
if (args.state === 'Changed' && args.element instanceof Connector) {
let sourceNode: Node = diagram.getObject(args.element.sourceID);
if (sourceNode) {
sourceNode.inEdges.forEach((edgeId) => {
let initialConnector = diagram.getObject(edgeId);
args.element.style = initialConnector.style;
});
}
}
diagram.dataBind();
},
});
// render initialized Diagram
diagram.appendTo('#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" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-base/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-buttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-popups/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-splitbuttons/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-diagrams/styles/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/29.2.4/ej2-navigations/styles/fabric.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container'>
<div id='element'></div>
</div>
</body>
</html>