diff --git a/ej2-javascript-toc.html b/ej2-javascript-toc.html
index ae9a158a6..1e560afa3 100644
--- a/ej2-javascript-toc.html
+++ b/ej2-javascript-toc.html
@@ -1875,6 +1875,7 @@
SignatureSelect and SignatureUnselect event
Controlling File Downloads
Minimum and Maximum Zoom Properties
+How to Restrict Zoom Percentage on Mobile Devices
Troubleshooting
diff --git a/ej2-javascript/code-snippet/diagram/customRuler-cs1/index.js b/ej2-javascript/code-snippet/diagram/customRuler-cs1/index.js
index 27796afee..8b61d2f4c 100644
--- a/ej2-javascript/code-snippet/diagram/customRuler-cs1/index.js
+++ b/ej2-javascript/code-snippet/diagram/customRuler-cs1/index.js
@@ -1,8 +1,23 @@
var diagram = new ej.diagrams.Diagram({
- width: '100%', height: '600px',
- rulerSettings: {
- showRulers: true, horizontalRuler:{interval:8, segmentWidth:100, thickness:35, tickAlignment:"LeftOrTop"}, verticalRuler:{interval:10, segmentWidth:150, thickness:35, tickAlignment:"RightOrBottom"}
- },
-});
-diagram.appendTo('#element');
-
+ width: '100%',
+ height: '600px',
+ rulerSettings: {
+ showRulers: true,
+ horizontalRuler: {
+ interval: 8,
+ segmentWidth: 100,
+ thickness: 35,
+ //Align horizontal ruler tick to the bottom side.
+ tickAlignment: 'RightOrBottom',
+ },
+ verticalRuler: {
+ interval: 10,
+ segmentWidth: 200,
+ thickness: 35,
+ //Align vertical ruler tick to the left side.
+ tickAlignment: 'LeftOrTop',
+ },
+ },
+ });
+ diagram.appendTo('#element');
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/customRuler-cs1/index.ts b/ej2-javascript/code-snippet/diagram/customRuler-cs1/index.ts
index 8845827db..f581b2571 100644
--- a/ej2-javascript/code-snippet/diagram/customRuler-cs1/index.ts
+++ b/ej2-javascript/code-snippet/diagram/customRuler-cs1/index.ts
@@ -1,12 +1,23 @@
-
-
-
import { Diagram } from '@syncfusion/ej2-diagrams';
let diagram: Diagram = new Diagram({
- width: '100%', height: '600px', rulerSettings: {
- showRulers: true, horizontalRuler:{interval:8, segmentWidth:100, thickness:25, tickAlignment:"LeftOrTop"},verticalRuler:{interval:10, segmentWidth:150, thickness:35, tickAlignment:"RightOrBottom"}
- },
- });
- diagram.appendTo('#element');
-
-
+ width: '100%',
+ height: '600px',
+ rulerSettings: {
+ showRulers: true,
+ horizontalRuler: {
+ interval: 8,
+ segmentWidth: 100,
+ thickness: 25,
+ //Align horizontal ruler tick to the bottom side.
+ tickAlignment: 'RightOrBottom',
+ },
+ verticalRuler: {
+ interval: 10,
+ segmentWidth: 200,
+ thickness: 35,
+ //Align vertical ruler tick to the left side.
+ tickAlignment: 'LeftOrTop',
+ },
+ },
+});
+diagram.appendTo('#element');
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-cs3/index.ts b/ej2-javascript/code-snippet/diagram/gridlines-cs3/index.ts
index de9ebc74b..9bdf952d2 100644
--- a/ej2-javascript/code-snippet/diagram/gridlines-cs3/index.ts
+++ b/ej2-javascript/code-snippet/diagram/gridlines-cs3/index.ts
@@ -1,29 +1,34 @@
-
-
-
-import {Diagram,SnapConstraints,SnapSettingsModel,Snapping} from '@syncfusion/ej2-diagrams';
-Diagram.Inject(Snapping);
-let snapSettings: SnapSettingsModel = {
+import {
+ Diagram,
+ SnapConstraints,
+ SnapSettingsModel,
+ Snapping,
+ } from '@syncfusion/ej2-diagrams';
+ Diagram.Inject(Snapping);
+ let snapSettings: SnapSettingsModel = {
+ // Define the Constraints for gridlines and snapping
constraints: SnapConstraints.ShowLines,
+ gridType: 'Dots',
+ // Defines the horizontalGridlines for SnapSettings
horizontalGridlines: {
- // Sets the lineIntervals of Gridlines
- lineIntervals: [1.25, 14, 0.25, 15, 0.25, 15, 0.25, 15, 0.25, 15],
- lineColor: 'blue',
- lineDashArray: '2 2'
+ // Sets the line color of gridlines
+ lineColor: 'blue',
+ // Defines the dot intervals of gridlines
+ dotIntervals: [3, 20, 1, 20, 1, 20, 1, 20, 1, 20],
},
+ // Defines the verticalGridlines for SnapSettings
verticalGridlines: {
- // Sets the lineIntervals of Gridlines
- lineIntervals: [1.25, 14, 0.25, 15, 0.25, 15, 0.25, 15, 0.25, 15],
- lineColor: 'blue',
- lineDashArray: '2 2'
- }
-};
-let diagram: Diagram = new Diagram({
+ // Defines the dot intervals of gridlines
+ dotIntervals: [3, 20, 1, 20, 1, 20],
+ // Sets the line color of gridlines
+ lineColor: 'blue',
+ },
+ };
+ let diagram: Diagram = new Diagram({
width: '100%',
- height: '500px',
- snapSettings: snapSettings
-});
-diagram.appendTo('#element');
-
-
-
+ height: '700px',
+ // Define the snap setting for the diagram
+ snapSettings: snapSettings,
+ });
+ diagram.appendTo('#element');
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-cs6/index.js b/ej2-javascript/code-snippet/diagram/gridlines-cs6/index.js
index cfd74e49e..61f37955c 100644
--- a/ej2-javascript/code-snippet/diagram/gridlines-cs6/index.js
+++ b/ej2-javascript/code-snippet/diagram/gridlines-cs6/index.js
@@ -1,31 +1,44 @@
-let nodes = [{
- id: 'node1',
- width: 100,
- height: 100,
- offsetX: 100,
- offsetY: 100,
- style: {
- strokeColor: '#6BA5D7',
- fill: '#6BA5D7'
- }
-}];
-
-var snapSettings = {
+let nodes = [
+ {
+ id: 'node1',
+ style: { fill: '#6BA5D7', strokeColor: '#6BA5D7' },
+ width: 100,
+ height: 100,
+ offsetX: 100,
+ offsetY: 100,
+ },
+ {
+ id: 'node2',
+ style: { fill: '#6BA5D7', strokeColor: '#6BA5D7' },
+ width: 100,
+ height: 100,
+ offsetX: 300,
+ offsetY: 100,
+ },
+ ];
+
+ var snapSettings = {
+ // Enable snap to object constraint
+ constraints:
+ ej.diagrams.SnapConstraints.SnapToObject |
+ ej.diagrams.SnapConstraints.ShowLines,
+ // Sets the Snap object distance
snapObjectDistance: 10,
- snapAngle: 10,
- snapLineColor: 'red'
-};
-var diagram = new ej.diagrams.Diagram({
- width: '800px',
- height: '500px',
- nodes: nodes,
- getNodeDefaults: function(node) {
+ };
+ var diagram = new ej.diagrams.Diagram(
+ {
+ width: '800px',
+ height: '500px',
+ nodes: nodes,
+ getNodeDefaults: function (node) {
node.height = 100;
node.width = 100;
node.style.fill = '#6BA5D7';
node.style.strokeColor = 'white';
return node;
+ },
+ snapSettings: snapSettings,
},
- snapSettings: snapSettings
-}, '#element');
-
+ '#element'
+ );
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-cs6/index.ts b/ej2-javascript/code-snippet/diagram/gridlines-cs6/index.ts
index 73fb16596..e08f20552 100644
--- a/ej2-javascript/code-snippet/diagram/gridlines-cs6/index.ts
+++ b/ej2-javascript/code-snippet/diagram/gridlines-cs6/index.ts
@@ -1,41 +1,40 @@
-
-
-
-import {Diagram,SnapConstraints,SnapSettingsModel,Snapping,NodeModel} from '@syncfusion/ej2-diagrams';
-Diagram.Inject(Snapping);
-let nodes: NodeModel[] = [{
- id: 'node1',
- style:{fill:'#6BA5D7',strokeColor:'#6BA5D7'},
- width: 100,
- height: 100,
- offsetX: 100,
- offsetY: 100
-},{
- id: 'node2',
- style:{fill:'#6BA5D7',strokeColor:'#6BA5D7'},
- width: 100,
- height: 100,
- offsetX: 300,
- offsetY: 100
-}];
-let snapSettings: SnapSettingsModel = {
+import {
+ Diagram,
+ SnapConstraints,
+ SnapSettingsModel,
+ Snapping,
+ NodeModel,
+ } from '@syncfusion/ej2-diagrams';
+ Diagram.Inject(Snapping);
+ let nodes: NodeModel[] = [
+ {
+ id: 'node1',
+ style: { fill: '#6BA5D7', strokeColor: '#6BA5D7' },
+ width: 100,
+ height: 100,
+ offsetX: 100,
+ offsetY: 100,
+ },
+ {
+ id: 'node2',
+ style: { fill: '#6BA5D7', strokeColor: '#6BA5D7' },
+ width: 100,
+ height: 100,
+ offsetX: 300,
+ offsetY: 100,
+ },
+ ];
+ let snapSettings: SnapSettingsModel = {
// Enable snap to object constraint
- constraints: SnapConstraints.SnapToObject|SnapConstraints.ShowLines,
+ constraints: SnapConstraints.SnapToObject | SnapConstraints.ShowLines,
// Sets the Snap object distance
snapObjectDistance: 10,
- // Snap Angle for object
- snapAngle: 10,
- // Set the Snapline color
- snapLineColor: 'red'
-
-};
-let diagram: Diagram = new Diagram({
+ };
+ let diagram: Diagram = new Diagram({
width: '100%',
height: '500px',
nodes: nodes,
- snapSettings: snapSettings
-});
-diagram.appendTo('#element');
-
-
-
+ snapSettings: snapSettings,
+ });
+ diagram.appendTo('#element');
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-dots/index.css b/ej2-javascript/code-snippet/diagram/gridlines-dots/index.css
new file mode 100644
index 000000000..25baa48fc
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-dots/index.css
@@ -0,0 +1,18 @@
+#container {
+ visibility: hidden;
+}
+
+#loader {
+ color: #008cff;
+ font-family: 'Helvetica Neue','calibiri';
+ font-size: 14px;
+ height: 40px;
+ left: 45%;
+ position: absolute;
+ top: 45%;
+ width: 30%;
+}
+
+#element {
+ display: block;
+}
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-dots/index.js b/ej2-javascript/code-snippet/diagram/gridlines-dots/index.js
new file mode 100644
index 000000000..61ea229cc
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-dots/index.js
@@ -0,0 +1,28 @@
+var snapSettings = {
+ // Define the Constraints for gridlines and snapping
+ constraints: ej.diagrams.SnapConstraints.ShowLines,
+ gridType: 'Dots',
+ // Defines the horizontalGridlines for SnapSettings
+ horizontalGridlines: {
+ // Sets the line color of gridlines
+ lineColor: 'blue',
+ // Defines the dot intervals of gridlines
+ dotIntervals: [3, 20, 1, 20, 1, 20, 1, 20, 1, 20],
+ },
+ // Defines the verticalGridlines for SnapSettings
+ verticalGridlines: {
+ // Defines the dot intervals of gridlines
+ dotIntervals: [3, 20, 1, 20, 1, 20],
+ // Sets the line color of gridlines
+ lineColor: 'blue',
+ },
+ };
+ var diagram = new ej.diagrams.Diagram(
+ {
+ width: '100%',
+ height: '700px',
+ snapSettings: snapSettings,
+ },
+ '#element'
+ );
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-dots/index.ts b/ej2-javascript/code-snippet/diagram/gridlines-dots/index.ts
new file mode 100644
index 000000000..1026f7fd6
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-dots/index.ts
@@ -0,0 +1,27 @@
+import {
+ Diagram,
+ SnapConstraints,
+ SnapSettingsModel,
+ Snapping,
+ } from '@syncfusion/ej2-diagrams';
+ Diagram.Inject(Snapping);
+ let snapSettings: SnapSettingsModel = {
+ constraints: SnapConstraints.ShowLines,
+ horizontalGridlines: {
+ // Sets the lineIntervals of Gridlines
+ lineIntervals: [1.25, 10, 0.25, 10, 0.25, 10, 0.25, 10, 0.25, 10],
+ lineColor: 'black',
+ },
+ verticalGridlines: {
+ // Sets the lineIntervals of Gridlines
+ lineIntervals: [1.25, 10, 0.25, 10, 0.25, 10, 0.25, 10, 0.25, 10],
+ lineColor: 'black',
+ },
+ };
+ let diagram: Diagram = new Diagram({
+ width: '100%',
+ height: '500px',
+ snapSettings: snapSettings,
+ });
+ diagram.appendTo('#element');
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-dots/js/index.html b/ej2-javascript/code-snippet/diagram/gridlines-dots/js/index.html
new file mode 100644
index 000000000..730d62dc9
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-dots/js/index.html
@@ -0,0 +1,33 @@
+
+ EJ2 Diagram
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-dots/systemjs.config.js b/ej2-javascript/code-snippet/diagram/gridlines-dots/systemjs.config.js
new file mode 100644
index 000000000..52d3cc78f
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-dots/systemjs.config.js
@@ -0,0 +1,38 @@
+System.config({
+ transpiler: "typescript",
+ typescriptOptions: {
+ compilerOptions: {
+ target: "umd",
+ module: "commonjs",
+ moduleResolution: "node",
+ emitDecoratorMetadata: true,
+ experimentalDecorators: true
+ }
+ },
+ paths: {
+ "syncfusion:": "https://cdn.syncfusion.com/ej2/20.3.56/"
+ },
+ map: {
+ main: "index.ts",
+ typescript: "https://unpkg.com/typescript@2.2.2/lib/typescript.js",
+ "@syncfusion/ej2-base": "syncfusion:ej2-base/dist/ej2-base.umd.min.js",
+ "@syncfusion/ej2-data": "syncfusion:ej2-data/dist/ej2-data.umd.min.js",
+ "@syncfusion/ej2-diagrams": "syncfusion:ej2-diagrams/dist/ej2-diagrams.umd.min.js",
+ "@syncfusion/ej2-popups": "syncfusion:ej2-popups/dist/ej2-popups.umd.min.js",
+ "@syncfusion/ej2-buttons": "syncfusion:ej2-buttons/dist/ej2-buttons.umd.min.js",
+ "@syncfusion/ej2-pdf-export": "syncfusion:ej2-pdf-export/dist/ej2-pdf-export.umd.min.js",
+ "@syncfusion/ej2-file-utils": "syncfusion:ej2-file-utils/dist/ej2-file-utils.umd.min.js",
+ "@syncfusion/ej2-compression": "syncfusion:ej2-compression/dist/ej2-compression.umd.min.js",
+ "@syncfusion/ej2-navigations": "syncfusion:ej2-navigations/dist/ej2-navigations.umd.min.js",
+ "@syncfusion/ej2-calendars": "syncfusion:ej2-calendars/dist/ej2-calendars.umd.min.js",
+ "@syncfusion/ej2-lists": "syncfusion:ej2-lists/dist/ej2-lists.umd.min.js",
+ "@syncfusion/ej2-inputs": "syncfusion:ej2-inputs/dist/ej2-inputs.umd.min.js",
+ "@syncfusion/ej2-svg-base": "syncfusion:ej2-svg-base/dist/ej2-svg-base.umd.min.js",
+ "@syncfusion/ej2-splitbuttons": "syncfusion:ej2-splitbuttons/dist/ej2-splitbuttons.umd.min.js"
+ }
+});
+
+System.import('index.ts').catch(console.error.bind(console)).then(function () {
+ document.getElementById('loader').style.display = "none";
+ document.getElementById('container').style.visibility = "visible";
+});
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-dots/ts/index.html b/ej2-javascript/code-snippet/diagram/gridlines-dots/ts/index.html
new file mode 100644
index 000000000..62d246b58
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-dots/ts/index.html
@@ -0,0 +1,28 @@
+
+
+
+
+ EJ2 Diagram
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Loading....
+
+
+
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/index.css b/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/index.css
new file mode 100644
index 000000000..25baa48fc
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/index.css
@@ -0,0 +1,18 @@
+#container {
+ visibility: hidden;
+}
+
+#loader {
+ color: #008cff;
+ font-family: 'Helvetica Neue','calibiri';
+ font-size: 14px;
+ height: 40px;
+ left: 45%;
+ position: absolute;
+ top: 45%;
+ width: 30%;
+}
+
+#element {
+ display: block;
+}
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/index.js b/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/index.js
new file mode 100644
index 000000000..c313e33a7
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/index.js
@@ -0,0 +1,40 @@
+let nodes = [
+ {
+ id: 'node1',
+ width: 100,
+ height: 100,
+ offsetX: 100,
+ offsetY: 100,
+ style: {
+ strokeColor: '#6BA5D7',
+ fill: '#6BA5D7',
+ },
+ },
+ ];
+
+ var snapSettings = {
+ snapAngle: 20,
+ };
+ var diagram = new ej.diagrams.Diagram(
+ {
+ width: '800px',
+ height: '500px',
+ getNodeDefaults: function (node) {
+ node.height = 100;
+ node.width = 100;
+ node.style.fill = '#6BA5D7';
+ node.style.strokeColor = 'white';
+ return node;
+ },
+ nodes: nodes,
+ snapSettings: snapSettings,
+ },
+ '#element'
+ );
+
+ document.getElementById('snapAngle').onchange = (args) => {
+ //Update snapAngle dynamically
+ diagram.snapSettings.snapAngle = Number(args.target.value);
+ diagram.dataBind();
+ };
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/index.ts b/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/index.ts
new file mode 100644
index 000000000..e37accf99
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/index.ts
@@ -0,0 +1,34 @@
+import {
+ Diagram,
+ SnapSettingsModel,
+ Snapping,
+ NodeModel,
+ } from '@syncfusion/ej2-diagrams';
+ Diagram.Inject(Snapping);
+ let snapSettings: SnapSettingsModel = {
+ snapAngle: 20,
+ };
+ let nodes: NodeModel[] = [
+ {
+ id: 'node1',
+ width: 100,
+ style: { fill: '#6BA5D7', strokeColor: '#6BA5D7' },
+ height: 100,
+ offsetX: 100,
+ offsetY: 100,
+ },
+ ];
+ let diagram: Diagram = new Diagram({
+ width: '100%',
+ height: '500px',
+ nodes: nodes,
+ snapSettings: snapSettings,
+ });
+ diagram.appendTo('#element');
+
+ (document.getElementById('snapAngle') as HTMLInputElement).onchange = (args: any) => {
+ //Update snapAngle dynamically
+ diagram.snapSettings.snapAngle = Number(args.target.value);
+ diagram.dataBind();
+ };
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/js/index.html b/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/js/index.html
new file mode 100644
index 000000000..1ae0c7659
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/js/index.html
@@ -0,0 +1,34 @@
+
+ EJ2 Diagram
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/systemjs.config.js b/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/systemjs.config.js
new file mode 100644
index 000000000..52d3cc78f
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/systemjs.config.js
@@ -0,0 +1,38 @@
+System.config({
+ transpiler: "typescript",
+ typescriptOptions: {
+ compilerOptions: {
+ target: "umd",
+ module: "commonjs",
+ moduleResolution: "node",
+ emitDecoratorMetadata: true,
+ experimentalDecorators: true
+ }
+ },
+ paths: {
+ "syncfusion:": "https://cdn.syncfusion.com/ej2/20.3.56/"
+ },
+ map: {
+ main: "index.ts",
+ typescript: "https://unpkg.com/typescript@2.2.2/lib/typescript.js",
+ "@syncfusion/ej2-base": "syncfusion:ej2-base/dist/ej2-base.umd.min.js",
+ "@syncfusion/ej2-data": "syncfusion:ej2-data/dist/ej2-data.umd.min.js",
+ "@syncfusion/ej2-diagrams": "syncfusion:ej2-diagrams/dist/ej2-diagrams.umd.min.js",
+ "@syncfusion/ej2-popups": "syncfusion:ej2-popups/dist/ej2-popups.umd.min.js",
+ "@syncfusion/ej2-buttons": "syncfusion:ej2-buttons/dist/ej2-buttons.umd.min.js",
+ "@syncfusion/ej2-pdf-export": "syncfusion:ej2-pdf-export/dist/ej2-pdf-export.umd.min.js",
+ "@syncfusion/ej2-file-utils": "syncfusion:ej2-file-utils/dist/ej2-file-utils.umd.min.js",
+ "@syncfusion/ej2-compression": "syncfusion:ej2-compression/dist/ej2-compression.umd.min.js",
+ "@syncfusion/ej2-navigations": "syncfusion:ej2-navigations/dist/ej2-navigations.umd.min.js",
+ "@syncfusion/ej2-calendars": "syncfusion:ej2-calendars/dist/ej2-calendars.umd.min.js",
+ "@syncfusion/ej2-lists": "syncfusion:ej2-lists/dist/ej2-lists.umd.min.js",
+ "@syncfusion/ej2-inputs": "syncfusion:ej2-inputs/dist/ej2-inputs.umd.min.js",
+ "@syncfusion/ej2-svg-base": "syncfusion:ej2-svg-base/dist/ej2-svg-base.umd.min.js",
+ "@syncfusion/ej2-splitbuttons": "syncfusion:ej2-splitbuttons/dist/ej2-splitbuttons.umd.min.js"
+ }
+});
+
+System.import('index.ts').catch(console.error.bind(console)).then(function () {
+ document.getElementById('loader').style.display = "none";
+ document.getElementById('container').style.visibility = "visible";
+});
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/ts/index.html b/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/ts/index.html
new file mode 100644
index 000000000..389e87940
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-snapAngle/ts/index.html
@@ -0,0 +1,29 @@
+
+
+
+
+ EJ2 Diagram
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Loading....
+
+
+
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/index.css b/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/index.css
new file mode 100644
index 000000000..25baa48fc
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/index.css
@@ -0,0 +1,18 @@
+#container {
+ visibility: hidden;
+}
+
+#loader {
+ color: #008cff;
+ font-family: 'Helvetica Neue','calibiri';
+ font-size: 14px;
+ height: 40px;
+ left: 45%;
+ position: absolute;
+ top: 45%;
+ width: 30%;
+}
+
+#element {
+ display: block;
+}
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/index.js b/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/index.js
new file mode 100644
index 000000000..54e0e89a6
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/index.js
@@ -0,0 +1,51 @@
+let nodes = [
+ {
+ id: 'node1',
+ width: 100,
+ height: 100,
+ offsetX: 100,
+ offsetY: 100,
+ style: {
+ strokeColor: '#6BA5D7',
+ fill: '#6BA5D7',
+ },
+ },
+ {
+ id: 'node2',
+ width: 100,
+ height: 100,
+ offsetX: 300,
+ offsetY: 100,
+ style: {
+ strokeColor: '#6BA5D7',
+ fill: '#6BA5D7',
+ },
+ },
+ ];
+
+ var snapSettings = {
+ snapLineColor: '#14AF41',
+ };
+ var diagram = new ej.diagrams.Diagram(
+ {
+ width: '800px',
+ height: '500px',
+ getNodeDefaults: function (node) {
+ node.height = 100;
+ node.width = 100;
+ node.style.fill = '#6BA5D7';
+ node.style.strokeColor = 'white';
+ return node;
+ },
+ nodes: nodes,
+ snapSettings: snapSettings,
+ },
+ '#element'
+ );
+
+ document.getElementById('snapLineColor').onchange = (args) => {
+ //Update snapLineColor dynamically
+ diagram.snapSettings.snapLineColor = args.target.value;
+ diagram.dataBind();
+ };
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/index.ts b/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/index.ts
new file mode 100644
index 000000000..235bca6c2
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/index.ts
@@ -0,0 +1,42 @@
+import {
+ Diagram,
+ SnapSettingsModel,
+ Snapping,
+ NodeModel,
+ } from '@syncfusion/ej2-diagrams';
+ Diagram.Inject(Snapping);
+ let snapSettings: SnapSettingsModel = {
+ snapLineColor: '#14AF41',
+ };
+ let nodes: NodeModel[] = [
+ {
+ id: 'node1',
+ width: 100,
+ style: { fill: '#6BA5D7', strokeColor: '#6BA5D7' },
+ height: 100,
+ offsetX: 100,
+ offsetY: 100,
+ },
+ {
+ id: 'node2',
+ width: 100,
+ style: { fill: '#6BA5D7', strokeColor: '#6BA5D7' },
+ height: 100,
+ offsetX: 300,
+ offsetY: 100,
+ },
+ ];
+ let diagram: Diagram = new Diagram({
+ width: '100%',
+ height: '500px',
+ nodes: nodes,
+ snapSettings: snapSettings,
+ });
+ diagram.appendTo('#element');
+
+ (document.getElementById('snapLineColor') as HTMLInputElement).onchange = (args: any) => {
+ //Update snapLineColor dynamically
+ diagram.snapSettings.snapLineColor = args.target.value;
+ diagram.dataBind();
+ };
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/js/index.html b/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/js/index.html
new file mode 100644
index 000000000..276c3c91f
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/js/index.html
@@ -0,0 +1,35 @@
+
+ EJ2 Diagram
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/systemjs.config.js b/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/systemjs.config.js
new file mode 100644
index 000000000..52d3cc78f
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/systemjs.config.js
@@ -0,0 +1,38 @@
+System.config({
+ transpiler: "typescript",
+ typescriptOptions: {
+ compilerOptions: {
+ target: "umd",
+ module: "commonjs",
+ moduleResolution: "node",
+ emitDecoratorMetadata: true,
+ experimentalDecorators: true
+ }
+ },
+ paths: {
+ "syncfusion:": "https://cdn.syncfusion.com/ej2/20.3.56/"
+ },
+ map: {
+ main: "index.ts",
+ typescript: "https://unpkg.com/typescript@2.2.2/lib/typescript.js",
+ "@syncfusion/ej2-base": "syncfusion:ej2-base/dist/ej2-base.umd.min.js",
+ "@syncfusion/ej2-data": "syncfusion:ej2-data/dist/ej2-data.umd.min.js",
+ "@syncfusion/ej2-diagrams": "syncfusion:ej2-diagrams/dist/ej2-diagrams.umd.min.js",
+ "@syncfusion/ej2-popups": "syncfusion:ej2-popups/dist/ej2-popups.umd.min.js",
+ "@syncfusion/ej2-buttons": "syncfusion:ej2-buttons/dist/ej2-buttons.umd.min.js",
+ "@syncfusion/ej2-pdf-export": "syncfusion:ej2-pdf-export/dist/ej2-pdf-export.umd.min.js",
+ "@syncfusion/ej2-file-utils": "syncfusion:ej2-file-utils/dist/ej2-file-utils.umd.min.js",
+ "@syncfusion/ej2-compression": "syncfusion:ej2-compression/dist/ej2-compression.umd.min.js",
+ "@syncfusion/ej2-navigations": "syncfusion:ej2-navigations/dist/ej2-navigations.umd.min.js",
+ "@syncfusion/ej2-calendars": "syncfusion:ej2-calendars/dist/ej2-calendars.umd.min.js",
+ "@syncfusion/ej2-lists": "syncfusion:ej2-lists/dist/ej2-lists.umd.min.js",
+ "@syncfusion/ej2-inputs": "syncfusion:ej2-inputs/dist/ej2-inputs.umd.min.js",
+ "@syncfusion/ej2-svg-base": "syncfusion:ej2-svg-base/dist/ej2-svg-base.umd.min.js",
+ "@syncfusion/ej2-splitbuttons": "syncfusion:ej2-splitbuttons/dist/ej2-splitbuttons.umd.min.js"
+ }
+});
+
+System.import('index.ts').catch(console.error.bind(console)).then(function () {
+ document.getElementById('loader').style.display = "none";
+ document.getElementById('container').style.visibility = "visible";
+});
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/ts/index.html b/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/ts/index.html
new file mode 100644
index 000000000..f5e5ea78b
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/gridlines-snapLineColor/ts/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+ EJ2 Diagram
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Loading....
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/nodes-cs4/index.js b/ej2-javascript/code-snippet/diagram/nodes-cs4/index.js
index b2293c992..a80f24a28 100644
--- a/ej2-javascript/code-snippet/diagram/nodes-cs4/index.js
+++ b/ej2-javascript/code-snippet/diagram/nodes-cs4/index.js
@@ -5,15 +5,26 @@ var node = {
// 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]]);
-
+ // Flip the node in Horizontal Direction
+ flip: 'Horizontal',
+ shape: {
+ type: 'Basic',
+ shape: 'RightTriangle',
+ },
+ style: {
+ fill: '#6BA5D7',
+ strokeDashArray: '5,5',
+ },
+ };
+
+ // initialize Diagram component
+
+ var diagram = new ej.diagrams.Diagram(
+ {
+ width: '100%',
+ height: '600px',
+ nodes: [node],
+ },
+ '#element'
+ );
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/nodes-flipMode/index.css b/ej2-javascript/code-snippet/diagram/nodes-flipMode/index.css
new file mode 100644
index 000000000..25baa48fc
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/nodes-flipMode/index.css
@@ -0,0 +1,18 @@
+#container {
+ visibility: hidden;
+}
+
+#loader {
+ color: #008cff;
+ font-family: 'Helvetica Neue','calibiri';
+ font-size: 14px;
+ height: 40px;
+ left: 45%;
+ position: absolute;
+ top: 45%;
+ width: 30%;
+}
+
+#element {
+ display: block;
+}
diff --git a/ej2-javascript/code-snippet/diagram/nodes-flipMode/index.js b/ej2-javascript/code-snippet/diagram/nodes-flipMode/index.js
new file mode 100644
index 000000000..b4beff782
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/nodes-flipMode/index.js
@@ -0,0 +1,125 @@
+var nodes = [
+ {
+ id: 'node1',
+ // Position of the node
+ offsetX: 100,
+ offsetY: 100,
+ // Size of the node
+ width: 100,
+ height: 100,
+ ports: [
+ {
+ id: 'left',
+ offset: { x: 0, y: 0.5 },
+ visibility: ej.diagrams.PortVisibility.Visible,
+ },
+ ],
+ annotations: [{ content: 'FlipMode as Label' }],
+ // Flip the node in Horizontal Direction
+ flip: 'Horizontal',
+ //FlipMode as Label
+ flipMode: 'Label',
+ shape: {
+ type: 'Basic',
+ shape: 'RightTriangle',
+ },
+ style: {
+ fill: '#6BA5D7',
+ },
+ },
+ {
+ id: 'node2',
+ // Position of the node
+ offsetX: 300,
+ offsetY: 100,
+ // Size of the node
+ width: 100,
+ height: 100,
+ annotations: [{ content: 'FlipMode as Port' }],
+ // Flip the node in Horizontal Direction
+ flip: 'Horizontal',
+ ports: [
+ {
+ id: 'left',
+ offset: { x: 0, y: 0.5 },
+ visibility: ej.diagrams.PortVisibility.Visible,
+ },
+ ],
+ //FlipMode as Port
+ flipMode: 'Port',
+ shape: {
+ type: 'Basic',
+ shape: 'RightTriangle',
+ },
+ style: {
+ fill: '#6BA5D7',
+ },
+ },
+ {
+ id: 'node3',
+ // Position of the node
+ offsetX: 100,
+ offsetY: 300,
+ // Size of the node
+ width: 100,
+ height: 100,
+ annotations: [{ content: 'FlipMode as All' }],
+ // Flip the node in Horizontal Direction
+ flip: 'Horizontal',
+ ports: [
+ {
+ id: 'left',
+ offset: { x: 0, y: 0.5 },
+ visibility: ej.diagrams.PortVisibility.Visible,
+ },
+ ],
+ //FlipMode as All
+ flipMode: 'All',
+ shape: {
+ type: 'Basic',
+ shape: 'RightTriangle',
+ },
+ style: {
+ fill: '#6BA5D7',
+ },
+ },
+ {
+ id: 'node4',
+ // Position of the node
+ offsetX: 300,
+ offsetY: 300,
+ // Size of the node
+ width: 100,
+ height: 100,
+ annotations: [{ content: 'FlipMode as None' }],
+ // Flip the node in Horizontal Direction
+ flip: 'Horizontal',
+ ports: [
+ {
+ id: 'left',
+ offset: { x: 0, y: 0.5 },
+ visibility: ej.diagrams.PortVisibility.Visible,
+ },
+ ],
+ //FlipMode as None
+ flipMode: 'None',
+ shape: {
+ type: 'Basic',
+ shape: 'RightTriangle',
+ },
+ style: {
+ fill: '#6BA5D7',
+ },
+ },
+];
+
+// initialize Diagram component
+
+var diagram = new ej.diagrams.Diagram(
+ {
+ width: '100%',
+ height: '600px',
+ nodes: nodes,
+ },
+ '#element'
+);
diff --git a/ej2-javascript/code-snippet/diagram/nodes-flipMode/index.ts b/ej2-javascript/code-snippet/diagram/nodes-flipMode/index.ts
new file mode 100644
index 000000000..1d3d78f49
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/nodes-flipMode/index.ts
@@ -0,0 +1,125 @@
+import { Diagram, NodeModel, PortVisibility } from '@syncfusion/ej2-diagrams';
+// A node is created and stored in nodes array.
+let nodes: NodeModel[] = [
+ {
+ id: 'node1',
+ // Position of the node
+ offsetX: 100,
+ offsetY: 100,
+ // Size of the node
+ width: 100,
+ height: 100,
+ ports: [
+ {
+ id: 'left',
+ offset: { x: 0, y: 0.5 },
+ visibility: PortVisibility.Visible,
+ },
+ ],
+ annotations: [{ content: 'FlipMode as Label' }],
+ // Flip the node in Horizontal Direction
+ flip: 'Horizontal',
+ //FlipMode as Label
+ flipMode: 'Label',
+ shape: {
+ type: 'Basic',
+ shape: 'RightTriangle',
+ },
+ style: {
+ fill: '#6BA5D7',
+ },
+ },
+ {
+ id: 'node2',
+ // Position of the node
+ offsetX: 300,
+ offsetY: 100,
+ // Size of the node
+ width: 100,
+ height: 100,
+ annotations: [{ content: 'FlipMode as Port' }],
+ // Flip the node in Horizontal Direction
+ flip: 'Horizontal',
+ ports: [
+ {
+ id: 'left',
+ offset: { x: 0, y: 0.5 },
+ visibility: PortVisibility.Visible,
+ },
+ ],
+ //FlipMode as Port
+ flipMode: 'Port',
+ shape: {
+ type: 'Basic',
+ shape: 'RightTriangle',
+ },
+ style: {
+ fill: '#6BA5D7',
+ },
+ },
+ {
+ id: 'node3',
+ // Position of the node
+ offsetX: 100,
+ offsetY: 300,
+ // Size of the node
+ width: 100,
+ height: 100,
+ annotations: [{ content: 'FlipMode as All' }],
+ // Flip the node in Horizontal Direction
+ flip: 'Horizontal',
+ ports: [
+ {
+ id: 'left',
+ offset: { x: 0, y: 0.5 },
+ visibility: PortVisibility.Visible,
+ },
+ ],
+ //FlipMode as All
+ flipMode: 'All',
+ shape: {
+ type: 'Basic',
+ shape: 'RightTriangle',
+ },
+ style: {
+ fill: '#6BA5D7',
+ },
+ },
+ {
+ id: 'node4',
+ // Position of the node
+ offsetX: 300,
+ offsetY: 300,
+ // Size of the node
+ width: 100,
+ height: 100,
+ annotations: [{ content: 'FlipMode as None' }],
+ // Flip the node in Horizontal Direction
+ flip: 'Horizontal',
+ ports: [
+ {
+ id: 'left',
+ offset: { x: 0, y: 0.5 },
+ visibility: PortVisibility.Visible,
+ },
+ ],
+ //FlipMode as None
+ flipMode: 'None',
+ shape: {
+ type: 'Basic',
+ shape: 'RightTriangle',
+ },
+ style: {
+ fill: '#6BA5D7',
+ },
+ },
+];
+// initialize Diagram component
+let diagram: Diagram = new Diagram({
+ width: '100%',
+ height: '600px',
+ // Add node
+ nodes: nodes,
+});
+// render initialized Diagram
+diagram.appendTo('#element');
diff --git a/ej2-javascript/code-snippet/diagram/nodes-flipMode/js/index.html b/ej2-javascript/code-snippet/diagram/nodes-flipMode/js/index.html
new file mode 100644
index 000000000..730d62dc9
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/nodes-flipMode/js/index.html
@@ -0,0 +1,33 @@
+
+ EJ2 Diagram
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/nodes-flipMode/systemjs.config.js b/ej2-javascript/code-snippet/diagram/nodes-flipMode/systemjs.config.js
new file mode 100644
index 000000000..52d3cc78f
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/nodes-flipMode/systemjs.config.js
@@ -0,0 +1,38 @@
+System.config({
+ transpiler: "typescript",
+ typescriptOptions: {
+ compilerOptions: {
+ target: "umd",
+ module: "commonjs",
+ moduleResolution: "node",
+ emitDecoratorMetadata: true,
+ experimentalDecorators: true
+ }
+ },
+ paths: {
+ "syncfusion:": "https://cdn.syncfusion.com/ej2/20.3.56/"
+ },
+ map: {
+ main: "index.ts",
+ typescript: "https://unpkg.com/typescript@2.2.2/lib/typescript.js",
+ "@syncfusion/ej2-base": "syncfusion:ej2-base/dist/ej2-base.umd.min.js",
+ "@syncfusion/ej2-data": "syncfusion:ej2-data/dist/ej2-data.umd.min.js",
+ "@syncfusion/ej2-diagrams": "syncfusion:ej2-diagrams/dist/ej2-diagrams.umd.min.js",
+ "@syncfusion/ej2-popups": "syncfusion:ej2-popups/dist/ej2-popups.umd.min.js",
+ "@syncfusion/ej2-buttons": "syncfusion:ej2-buttons/dist/ej2-buttons.umd.min.js",
+ "@syncfusion/ej2-pdf-export": "syncfusion:ej2-pdf-export/dist/ej2-pdf-export.umd.min.js",
+ "@syncfusion/ej2-file-utils": "syncfusion:ej2-file-utils/dist/ej2-file-utils.umd.min.js",
+ "@syncfusion/ej2-compression": "syncfusion:ej2-compression/dist/ej2-compression.umd.min.js",
+ "@syncfusion/ej2-navigations": "syncfusion:ej2-navigations/dist/ej2-navigations.umd.min.js",
+ "@syncfusion/ej2-calendars": "syncfusion:ej2-calendars/dist/ej2-calendars.umd.min.js",
+ "@syncfusion/ej2-lists": "syncfusion:ej2-lists/dist/ej2-lists.umd.min.js",
+ "@syncfusion/ej2-inputs": "syncfusion:ej2-inputs/dist/ej2-inputs.umd.min.js",
+ "@syncfusion/ej2-svg-base": "syncfusion:ej2-svg-base/dist/ej2-svg-base.umd.min.js",
+ "@syncfusion/ej2-splitbuttons": "syncfusion:ej2-splitbuttons/dist/ej2-splitbuttons.umd.min.js"
+ }
+});
+
+System.import('index.ts').catch(console.error.bind(console)).then(function () {
+ document.getElementById('loader').style.display = "none";
+ document.getElementById('container').style.visibility = "visible";
+});
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/nodes-flipMode/ts/index.html b/ej2-javascript/code-snippet/diagram/nodes-flipMode/ts/index.html
new file mode 100644
index 000000000..62d246b58
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/nodes-flipMode/ts/index.html
@@ -0,0 +1,28 @@
+
+
+
+
+ EJ2 Diagram
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Loading....
+
+
+
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/overview-create/index.css b/ej2-javascript/code-snippet/diagram/overview-create/index.css
new file mode 100644
index 000000000..25baa48fc
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/overview-create/index.css
@@ -0,0 +1,18 @@
+#container {
+ visibility: hidden;
+}
+
+#loader {
+ color: #008cff;
+ font-family: 'Helvetica Neue','calibiri';
+ font-size: 14px;
+ height: 40px;
+ left: 45%;
+ position: absolute;
+ top: 45%;
+ width: 30%;
+}
+
+#element {
+ display: block;
+}
diff --git a/ej2-javascript/code-snippet/diagram/overview-create/index.js b/ej2-javascript/code-snippet/diagram/overview-create/index.js
new file mode 100644
index 000000000..9f73786bf
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/overview-create/index.js
@@ -0,0 +1,23 @@
+/**
+ * OverView
+ */
+
+ // Initializtion of the diagram.
+ let diagram = new ej.diagrams.Diagram({
+ width: '100%',
+ height: '790px',
+ nodes: [{ id: 'node1', offsetX: 400, offsetY: 400, height: 100, width: 200 }],
+ scrollSettings: { scrollLimit: 'Diagram' },
+ // Sets the constraints of the SnapSettings
+ snapSettings: { constraints: ej.diagrams.SnapConstraints.None },
+ });
+ diagram.appendTo('#element');
+
+ // Initializtion of the Overview.
+ let overview = new ej.diagrams.Overview({
+ width: '300px',
+ height: '150ppx',
+ sourceID: 'element',
+ });
+ overview.appendTo('#overview');
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/overview-create/index.ts b/ej2-javascript/code-snippet/diagram/overview-create/index.ts
new file mode 100644
index 000000000..0c1cc3179
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/overview-create/index.ts
@@ -0,0 +1,24 @@
+/**
+ * OverView
+ */
+
+import { Diagram, Overview, SnapConstraints } from '@syncfusion/ej2-diagrams';
+
+// Initializtion of the diagram.
+let diagram: Diagram = new Diagram({
+ width: '100%',
+ height: '790px',
+ nodes: [{ id: 'node1', offsetX: 400, offsetY: 400, height: 100, width: 200 }],
+ scrollSettings: { scrollLimit: 'Diagram' },
+ // Sets the constraints of the SnapSettings
+ snapSettings: { constraints: SnapConstraints.None },
+});
+diagram.appendTo('#element');
+
+// Initializtion of the Overview.
+let overview: Overview = new Overview({
+ width: '300px',
+ height: '150ppx',
+ sourceID: 'element',
+});
+overview.appendTo('#overview');
diff --git a/ej2-javascript/code-snippet/diagram/overview-create/js/index.html b/ej2-javascript/code-snippet/diagram/overview-create/js/index.html
new file mode 100644
index 000000000..5180303a4
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/overview-create/js/index.html
@@ -0,0 +1,44 @@
+
+ EJ2 Diagram
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/overview-create/systemjs.config.js b/ej2-javascript/code-snippet/diagram/overview-create/systemjs.config.js
new file mode 100644
index 000000000..52d3cc78f
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/overview-create/systemjs.config.js
@@ -0,0 +1,38 @@
+System.config({
+ transpiler: "typescript",
+ typescriptOptions: {
+ compilerOptions: {
+ target: "umd",
+ module: "commonjs",
+ moduleResolution: "node",
+ emitDecoratorMetadata: true,
+ experimentalDecorators: true
+ }
+ },
+ paths: {
+ "syncfusion:": "https://cdn.syncfusion.com/ej2/20.3.56/"
+ },
+ map: {
+ main: "index.ts",
+ typescript: "https://unpkg.com/typescript@2.2.2/lib/typescript.js",
+ "@syncfusion/ej2-base": "syncfusion:ej2-base/dist/ej2-base.umd.min.js",
+ "@syncfusion/ej2-data": "syncfusion:ej2-data/dist/ej2-data.umd.min.js",
+ "@syncfusion/ej2-diagrams": "syncfusion:ej2-diagrams/dist/ej2-diagrams.umd.min.js",
+ "@syncfusion/ej2-popups": "syncfusion:ej2-popups/dist/ej2-popups.umd.min.js",
+ "@syncfusion/ej2-buttons": "syncfusion:ej2-buttons/dist/ej2-buttons.umd.min.js",
+ "@syncfusion/ej2-pdf-export": "syncfusion:ej2-pdf-export/dist/ej2-pdf-export.umd.min.js",
+ "@syncfusion/ej2-file-utils": "syncfusion:ej2-file-utils/dist/ej2-file-utils.umd.min.js",
+ "@syncfusion/ej2-compression": "syncfusion:ej2-compression/dist/ej2-compression.umd.min.js",
+ "@syncfusion/ej2-navigations": "syncfusion:ej2-navigations/dist/ej2-navigations.umd.min.js",
+ "@syncfusion/ej2-calendars": "syncfusion:ej2-calendars/dist/ej2-calendars.umd.min.js",
+ "@syncfusion/ej2-lists": "syncfusion:ej2-lists/dist/ej2-lists.umd.min.js",
+ "@syncfusion/ej2-inputs": "syncfusion:ej2-inputs/dist/ej2-inputs.umd.min.js",
+ "@syncfusion/ej2-svg-base": "syncfusion:ej2-svg-base/dist/ej2-svg-base.umd.min.js",
+ "@syncfusion/ej2-splitbuttons": "syncfusion:ej2-splitbuttons/dist/ej2-splitbuttons.umd.min.js"
+ }
+});
+
+System.import('index.ts').catch(console.error.bind(console)).then(function () {
+ document.getElementById('loader').style.display = "none";
+ document.getElementById('container').style.visibility = "visible";
+});
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/overview-create/ts/index.html b/ej2-javascript/code-snippet/diagram/overview-create/ts/index.html
new file mode 100644
index 000000000..4990603db
--- /dev/null
+++ b/ej2-javascript/code-snippet/diagram/overview-create/ts/index.html
@@ -0,0 +1,42 @@
+
+
+
+
+ EJ2 Diagram
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Loading....
+
+
+
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/overview-cs1/index.js b/ej2-javascript/code-snippet/diagram/overview-cs1/index.js
index 54b08ab18..2ceb4983b 100644
--- a/ej2-javascript/code-snippet/diagram/overview-cs1/index.js
+++ b/ej2-javascript/code-snippet/diagram/overview-cs1/index.js
@@ -1,101 +1,93 @@
-ej.diagrams.Diagram.Inject(ej.diagrams.DataBinding, ej.diagrams.HierarchicalTree);
-// A node is created and stored in nodes array.
-var data = [
- {
- 'Id': 'parent', 'Name': 'Maria Anders', 'Designation': 'Managing Director',
- 'ImageUrl': '../content/images/orgchart/Clayton.png', 'IsExpand': 'true', 'RatingColor': '#C34444'
- },
- {
- 'Id': 1, 'Name': 'Ana Trujillo', 'Designation': 'Project Manager',
- 'ImageUrl': '../content/images/orgchart/Thomas.PNG', 'IsExpand': 'false',
- 'RatingColor': '#68C2DE', 'ReportingPerson': 'parent'
- },
- {
- 'Id': 2, 'Name': 'Anto Moreno', 'Designation': 'Project Lead',
- 'ImageUrl': '../content/images/orgchart/image53.png', 'IsExpand': 'false',
- 'RatingColor': '#93B85A', 'ReportingPerson': 'parent'
- },
- {
- 'Id': 3, 'Name': 'Thomas Hardy', 'Designation': 'Senior S/w Engg',
- 'ImageUrl': '../content/images/orgchart/image57.png', 'IsExpand': 'false',
- 'RatingColor': '#68C2DE', 'ReportingPerson': 1
+ej.diagrams.Diagram.Inject(
+ ej.diagrams.DataBinding,
+ ej.diagrams.HierarchicalTree,
+ ej.diagrams.LayoutAnimation
+ );
+ /**
+ * hierarchical-model
+ */
+ //Click event for Appearance of the Property Panel.
+
+ //sets node default value
+ function nodeDefaults(obj, diagram) {
+ obj.style = {
+ fill: '#659be5',
+ strokeColor: 'none',
+ color: 'white',
+ strokeWidth: 2,
+ };
+ obj.borderColor = '#3a6eb5';
+ obj.backgroundColor = '#659be5';
+ obj.width = 150;
+ obj.height = 50;
+ obj.expandIcon = {
+ height: 10,
+ width: 10,
+ shape: 'None',
+ fill: 'lightgray',
+ offset: { x: 0.5, y: 1 },
+ };
+ obj.expandIcon.verticalAlignment = 'Auto';
+ obj.expandIcon.margin = { left: 0, right: 0, top: 0, bottom: 0 };
+ obj.collapseIcon.offset = { x: 0.5, y: 1 };
+ obj.collapseIcon.verticalAlignment = 'Auto';
+ obj.collapseIcon.margin = { left: 0, right: 0, top: 0, bottom: 0 };
+ obj.collapseIcon.height = 10;
+ obj.collapseIcon.width = 10;
+ obj.collapseIcon.padding.top = 5;
+ obj.collapseIcon.shape = 'None';
+ obj.collapseIcon.fill = 'lightgray';
+ return obj;
+ }
+ //sets connector default value
+ function connectorDefaults(connector, diagram) {
+ connector.targetDecorator.shape = 'None';
+ connector.type = 'Orthogonal';
+ connector.style.strokeColor = '#6d6d6d';
+ connector.constraints = 0;
+ connector.cornerRadius = 5;
+ return connector;
+ }
+
+ // tslint:disable-next-line:max-func-body-length
+
+ //Initializes the nodes for the diagram
+ var diagram = new ej.diagrams.Diagram({
+ width: '100%',
+ height: '499px',
+ snapSettings: { constraints: ej.diagrams.SnapConstraints.None },
+ //configures data source settings
+ dataSourceSettings: {
+ id: 'Name',
+ parentId: 'Category',
+ dataSource: new ej.data.DataManager(window.hierarchicalTree),
+ doBinding: function (nodeModel, data, diagram) {
+ nodeModel.shape = { type: 'Text', content: data.Name };
+ },
},
- {
- 'Id': 4, 'Name': 'Christina kaff', 'Designation': 'S/w Engg',
- 'ImageUrl': '../content/images/orgchart/Robin.png', 'IsExpand': 'false',
- 'RatingColor': '#93B85A', 'ReportingPerson': 3
- }]
-var items = new ej.data.DataManager(data , new ej.data.Query().take(7));
-var overview;
-var diagram = new ej.diagrams.Diagram({
- snapSettings: { constraints: 0 },
+ //Disables all interactions except zoom/pan
+ tool: ej.diagrams.DiagramTools.ZoomPan,
+ //Configures automatic layout
layout: {
- type: 'OrganizationalChart', margin: { top: 20 },
- getLayoutInfo: (node, tree) => {
- if (!tree.hasSubTree) {
- tree.orientation = 'Vertical';
- tree.type = 'Alternate';
- }
- }
+ type: 'HierarchicalTree',
+ verticalSpacing: 30,
+ horizontalSpacing: 40,
+ enableAnimation: true,
},
- dataSourceSettings: {
- id: 'Id', parentId: 'ReportingPerson', dataManager: items
+ //Defines the default node and connector properties
+ getNodeDefaults: function (obj, diagram) {
+ return nodeDefaults(obj, diagram);
},
-
- getNodeDefaults: (obj) => {
- obj.height = 50;
- obj.backgroundColor = 'lightgrey';
- obj.style = { fill: 'transparent', strokeWidth: 2 };
- return obj;
- }, getConnectorDefaults: (connector) => {
- connector.targetDecorator.shape = 'None';
- connector.type = 'Orthogonal';
- return connector;
+ getConnectorDefaults: function (connector, diagram) {
+ return connectorDefaults(connector, diagram);
},
-
- setNodeTemplate: (obj) => {
- var content = new ej.diagrams.StackPanel();
- content.id = obj.id + '_outerstack';
- content.style.strokeColor = 'darkgreen';
- content.orientation = 'Horizontal';
- content.padding = { left: 5, right: 10, top: 5, bottom: 5 };
- var image = new ej.diagrams.ImageElement();
- image.width = 50;
- image.height = 50;
- image.style.strokeColor = 'none';
- image.source = './employee.PNG';
- image.id = obj.id + '_pic';
- var innerStack = new ej.diagrams.StackPanel();
- innerStack.style.strokeColor = 'none';
- innerStack.margin = { left: 5, right: 0, top: 0, bottom: 0 };
- innerStack.id = obj.id + '_innerstack';
-
- var text = new ej.diagrams.TextElement();
- text.content = obj.data['Name'];
-
- text.style.color = 'blue';
- text.style.strokeColor = 'none';
- text.style.fill = 'none';
- text.id = obj.id + '_text1';
-
- var desigText = new ej.diagrams.TextElement();
- desigText.margin = { left: 0, right: 0, top: 5, bottom: 0 };
- desigText.content = obj.data['Designation'];
- desigText.style.color = 'blue';
- desigText.style.strokeColor = 'none';
- desigText.style.fill = 'none';
- desigText.style.textWrapping = 'Wrap';
- desigText.id = obj.id + '_desig';
- innerStack.children = [text, desigText];
-
- content.children = [image, innerStack];
-
- return content;
- }
-});
-diagram.appendTo('#element');
-overview = new ej.diagrams.Overview({
- sourceID: 'element'
-});
- overview.appendTo('#overview');
-
+ });
+ diagram.appendTo('#element');
+ // Initializtion of the Overview.
+ let overview = new ej.diagrams.Overview({
+ width: '100%',
+ height: '250px',
+ sourceID: 'element',
+ });
+ overview.appendTo('#overview');
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/overview-cs1/index.ts b/ej2-javascript/code-snippet/diagram/overview-cs1/index.ts
index e54c1e0fb..1c9e4a9cc 100644
--- a/ej2-javascript/code-snippet/diagram/overview-cs1/index.ts
+++ b/ej2-javascript/code-snippet/diagram/overview-cs1/index.ts
@@ -1,173 +1,155 @@
-
-
+/**
+ * hierarchical-model
+ */
import {
Diagram,
+ NodeModel,
ConnectorModel,
- Overview,
- OverviewModel
-} from '@syncfusion/ej2-diagrams';
-import {
- DataManager,
- Query
-} from '@syncfusion/ej2-data';
-import {
- TreeInfo,
- Node,
- StackPanel,
- ImageElement,
- Container,
- TextElement,
+ LayoutAnimation,
DataBinding,
- HierarchicalTree
-} from '@syncfusion/ej2-diagrams';
-/**
- * Overview
- */
-let diagram: Diagram;
-let overview: Overview;
-Diagram.Inject(DataBinding, HierarchicalTree);
-let data: object[] = [{
- 'Id': 'parent',
- 'Name': 'Maria Anders',
- 'Designation': 'Managing Director',
- 'IsExpand': 'true',
- 'RatingColor': '#C34444'
+ HierarchicalTree,
+ SnapConstraints,
+ DiagramTools,
+ Overview,
+ } from '@syncfusion/ej2-diagrams';
+ import { DataManager } from '@syncfusion/ej2-data';
+ Diagram.Inject(DataBinding, HierarchicalTree, LayoutAnimation);
+
+ export interface EmployeeInfo {
+ Name: string;
+ }
+ let hierarchicalTree: object = [
+ {
+ Name: 'Diagram',
+ fillColor: '#916DAF',
},
{
- 'Id': 1,
- 'Name': 'Ana Trujillo',
- 'Designation': 'Project Manager',
- 'IsExpand': 'false',
- 'RatingColor': '#68C2DE',
- 'ReportingPerson': 'parent'
+ Name: 'Layout',
+ Category: 'Diagram',
},
{
- 'Id': 2,
- 'Name': 'Anto Moreno',
- 'Designation': 'Project Lead',
- 'IsExpand': 'false',
- 'RatingColor': '#93B85A',
- 'ReportingPerson': 'parent'
+ Name: 'Tree Layout',
+ Category: 'Layout',
},
{
- 'Id': 3,
- 'Name': 'Thomas Hardy',
- 'Designation': 'Senior S/w Engg',
- 'IsExpand': 'false',
- 'RatingColor': '#68C2DE',
- 'ReportingPerson': 1
+ Name: 'Organizational Chart',
+ Category: 'Layout',
},
{
- 'Id': 4,
- 'Name': 'Christina kaff',
- 'Designation': 'S/w Engg',
- 'IsExpand': 'false',
- 'RatingColor': '#93B85A',
- 'ReportingPerson': 2
+ Name: 'Hierarchical Tree',
+ Category: 'Tree Layout',
},
{
- 'Id': 5,
- 'Name': 'Hanna Moos',
- 'Designation': 'Project Trainee',
- 'IsExpand': 'true',
- 'RatingColor': '#D46E89',
- 'ReportingPerson': 2
+ Name: 'Radial Tree',
+ Category: 'Tree Layout',
},
-];
-let items: DataManager = new DataManager(data as JSON[], new Query().take(7));
-// Initializes the diagram control
-diagram = new Diagram({
- snapSettings: {
- constraints: 0
+ {
+ Name: 'Mind Map',
+ Category: 'Hierarchical Tree',
},
- layout: {
- type: 'OrganizationalChart',
- margin: {
- top: 20
- },
- getLayoutInfo: (node: Node, tree: TreeInfo) => {
- if (!tree.hasSubTree) {
- tree.orientation = 'Vertical';
- tree.type = 'Alternate';
- }
- }
+ {
+ Name: 'Family Tree',
+ Category: 'Hierarchical Tree',
},
- dataSourceSettings: {
- id: 'Id',
- parentId: 'ReportingPerson',
- dataManager: items
+ {
+ Name: 'Management',
+ Category: 'Organizational Chart',
},
- getNodeDefaults: (node: NodeModel) => {
- node.height = 50;
- node.style.fill = '#6BA5D7';
- node.style.borderColor = 'white';
- node.style.strokeColor = 'white';
- return node;
+ {
+ Name: 'Human Resources',
+ Category: 'Management',
},
- 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';
- obj.targetDecorator.shape = 'None';
- obj.type = 'Orthogonal';
- return obj;
+ {
+ Name: 'University',
+ Category: 'Management',
},
- setNodeTemplate: (obj: Node, diagram: Diagram): Container => {
- let content: StackPanel = new StackPanel();
- content.id = obj.id + '_outerstack';
- content.style.strokeColor = 'darkgreen';
- content.style.fill = '#6BA5D7';
- content.orientation = 'Horizontal';
- content.padding = {
- left: 5,
- right: 10,
- top: 5,
- bottom: 5
- };
- let innerStack: StackPanel = new StackPanel();
- innerStack.style.strokeColor = 'none';
- innerStack.style.fill = '#6BA5D7';
- innerStack.margin = {
- left: 5,
- right: 0,
- top: 0,
- bottom: 0
- };
- innerStack.id = obj.id + '_innerstack';
- let text: TextElement = new TextElement();
- text.content = obj.data['Name'];
- text.style.color = 'white';
- text.style.strokeColor = 'none';
- text.style.fill = 'none';
- text.id = obj.id + '_text1';
- let desigText: TextElement = new TextElement();
- desigText.margin = {
- left: 0,
- right: 0,
- top: 5,
- bottom: 0
- };
- desigText.content = obj.data['Designation'];
- desigText.style.color = 'white';
- desigText.style.strokeColor = 'none';
- desigText.style.fill = 'none';
- desigText.style.textWrapping = 'Wrap';
- desigText.id = obj.id + '_desig';
- innerStack.children = [text, desigText];
- content.children = [innerStack];
- return content;
- }
-});
-diagram.appendTo('#element');
-// Initializes the overview control
-let options: OverviewModel = {};
-// Relates diagram with overview
-options.sourceID = 'element';
-overview = new Overview(options);
-overview.appendTo('#overview');
-
-
-
+ {
+ Name: 'Business',
+ Category: 'Management',
+ },
+ ];
+ //sets node default value
+ function nodeDefaults(obj: NodeModel): NodeModel {
+ obj.style = {
+ fill: '#659be5',
+ strokeColor: 'none',
+ color: 'white',
+ strokeWidth: 2,
+ };
+ obj.width = 150;
+ obj.height = 50;
+ obj.borderColor = '#3a6eb5';
+ obj.backgroundColor = '#659be5';
+ obj.expandIcon = {
+ height: 10,
+ width: 10,
+ shape: 'None',
+ fill: 'lightgray',
+ offset: { x: 0.5, y: 1 },
+ };
+ obj.expandIcon.verticalAlignment = 'Auto';
+ obj.expandIcon.margin = { left: 0, right: 0, top: 0, bottom: 0 };
+ obj.collapseIcon.offset = { x: 0.5, y: 1 };
+ obj.collapseIcon.verticalAlignment = 'Auto';
+ obj.collapseIcon.margin = { left: 0, right: 0, top: 0, bottom: 0 };
+ obj.collapseIcon.height = 10;
+ obj.collapseIcon.width = 10;
+ obj.collapseIcon.padding.top = 5;
+ obj.collapseIcon.shape = 'None';
+ obj.collapseIcon.fill = 'lightgray';
+ return obj;
+ }
+
+ function connectorDefaults(
+ connector: ConnectorModel,
+ diagram: Diagram
+ ): ConnectorModel {
+ connector.targetDecorator.shape = 'None';
+ connector.type = 'Orthogonal';
+ connector.style.strokeColor = '#6d6d6d';
+ connector.cornerRadius = 5;
+ return connector;
+ }
+
+ // tslint:disable-next-line:max-func-body-length
+
+ //Initializes the nodes for the diagram
+ let diagram: Diagram = new Diagram({
+ width: '100%',
+ height: '499px',
+ snapSettings: { constraints: SnapConstraints.None },
+ //configures data source settings
+ dataSourceSettings: {
+ //sets the fields to bind
+ id: 'Name',
+ parentId: 'Category',
+ dataSource: new DataManager(hierarchicalTree),
+ //binds the data with the nodes
+ doBinding: (nodeModel: NodeModel, data: object, diagram: Diagram) => {
+ nodeModel.shape = { type: 'Text', content: (data as EmployeeInfo).Name };
+ },
+ },
+ //Disables all interactions except zoom/pan
+ tool: DiagramTools.ZoomPan,
+ //Configures automatic layout
+ layout: {
+ type: 'HierarchicalTree',
+ verticalSpacing: 30,
+ horizontalSpacing: 40,
+ enableAnimation: true,
+ },
+ //Defines the default node and connector properties
+ getNodeDefaults: nodeDefaults,
+ getConnectorDefaults: connectorDefaults,
+ });
+ diagram.appendTo('#element');
+
+ // Initializtion of the Overview.
+ let overview: Overview = new Overview({
+ width: '100%',
+ height: '250px',
+ sourceID: 'element',
+ });
+ overview.appendTo('#overview');
+
\ No newline at end of file
diff --git a/ej2-javascript/code-snippet/diagram/overview-cs1/js/index.html b/ej2-javascript/code-snippet/diagram/overview-cs1/js/index.html
index 046884605..0e05bf66c 100644
--- a/ej2-javascript/code-snippet/diagram/overview-cs1/js/index.html
+++ b/ej2-javascript/code-snippet/diagram/overview-cs1/js/index.html
@@ -18,15 +18,24 @@
-