Skip to content

Commit 94100b3

Browse files
Integrated latest changes at 09-13-2025 10:30:06 AM
1 parent a9f235b commit 94100b3

File tree

15 files changed

+39
-326
lines changed

15 files changed

+39
-326
lines changed

ej2-javascript/code-snippet/diagram/symbol-palette-contentFnTemplate/index.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
// Template for the HTML and SVG Shapes.
22
function template(obj) {
33
if (obj.id == 'node1') {
4-
return `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
5-
<rect width="24" height="24" fill="#007BFF" />
6-
<path d="M6.5 7.5L17.5 16.5L12 21V3L17.5 7.5L6.5 16.5" fill="none" stroke="white" stroke-width="2" />
7-
</svg>`;
4+
return '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><rect width="24" height="24" fill="#007BFF" /><path d="M6.5 7.5L17.5 16.5L12 21V3L17.5 7.5L6.5 16.5" fill="none" stroke="white" stroke-width="2" /></svg>';
85
}
9-
return `<div style="height:100%; background:#e3daf1;font-family:Arial;padding-left:13px;">
10-
<div style="font-size:12px;font-weight:bold;margin-left:3px;padding-top: 16px;">📅Meeting</div>
11-
<div style="font-size:10px;margin-left:5px;">Team Sync @4PM</div>
12-
<div style="font-size:8px; color:#666;margin-left:5px;">Room 30</div>
13-
</div>`;
6+
return '<div style="height:100%; background:#e3daf1;font-family:Arial;padding-left:13px;"><div style="font-size:12px;font-weight:bold;margin-left:3px;padding-top: 16px;">📅Meeting</div><div style="font-size:10px;margin-left:5px;">Team Sync @4PM</div><div style="font-size:8px; color:#666;margin-left:5px;">Room 30</div></div>';
147
};
158

169
// Initialize Diagram component.
@@ -45,7 +38,7 @@ var palette = new ej.diagrams.SymbolPalette({
4538
content: template.bind(this)
4639
}
4740
}
48-
], title: 'Basic Shapes'
41+
], title: 'HTML and SVG Shapes'
4942
}
5043
]
5144
});

ej2-javascript/code-snippet/diagram/symbol-palette-contentFnTemplate/index.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,9 @@ import { SymbolPalette, NodeModel, Diagram } from '@syncfusion/ej2-diagrams';
33
// Template for the HTML and SVG Shape.
44
function template(obj: any) {
55
if (obj.id == 'node1') {
6-
return `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
7-
<rect width="24" height="24" fill="#007BFF" />
8-
<path d="M6.5 7.5L17.5 16.5L12 21V3L17.5 7.5L6.5 16.5" fill="none" stroke="white" stroke-width="2" />
9-
</svg>`;
6+
return '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><rect width="24" height="24" fill="#007BFF" /><path d="M6.5 7.5L17.5 16.5L12 21V3L17.5 7.5L6.5 16.5" fill="none" stroke="white" stroke-width="2" /></svg>';
107
}
11-
return `<div style="height:100%; background:#e3daf1;font-family:Arial;padding-left:13px;">
12-
<div style="font-size:12px;font-weight:bold;margin-left:3px;padding-top: 16px;">📅Meeting</div>
13-
<div style="font-size:10px;margin-left:5px;">Team Sync @4PM</div>
14-
<div style="font-size:8px; color:#666;margin-left:5px;">Room 30</div>
15-
</div>`;
8+
return '<div style="height:100%; background:#e3daf1;font-family:Arial;padding-left:13px;"><div style="font-size:12px;font-weight:bold;margin-left:3px;padding-top: 16px;">📅Meeting</div><div style="font-size:10px;margin-left:5px;">Team Sync @4PM</div><div style="font-size:8px; color:#666;margin-left:5px;">Room 30</div></div>';
169
};
1710

1811
// Initialize Diagram component.
@@ -47,7 +40,7 @@ let palette: SymbolPalette = new SymbolPalette({
4740
content: template.bind(this)
4841
}
4942
}
50-
], title: 'Basic Shapes'
43+
], title: 'HTML and SVG Shapes'
5144
}
5245
]
5346
});

ej2-javascript/code-snippet/diagram/symbol-palette-cs25/index.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//Initialize the basic shapes for the symbol palette
1+
// Initialize the basic shapes for the symbol palette.
22
function getBasicShapes() {
33
var basicShapes = [
44
{ id: 'Rectangle', shape: { type: 'Basic', shape: 'Rectangle' }},
@@ -12,7 +12,8 @@ function getBasicShapes() {
1212
];
1313
return basicShapes;
1414
}
15-
//Initialize the basic shapes for the symbol palette
15+
16+
// Initialize the flow shapes for the symbol palette.
1617
function getFlowShapes() {
1718
var flowShapes = [
1819
{ id: 'Terminator', shape: { type: 'Flow', shape: 'Terminator' } },
@@ -27,6 +28,9 @@ function getFlowShapes() {
2728
return flowShapes;
2829
}
2930

31+
var checkBox = document.getElementById('showTooltip');
32+
33+
//Initializes the symbol palette
3034
var palette = new ej.diagrams.SymbolPalette({
3135
expandMode: 'Multiple',
3236
palettes: [
@@ -46,24 +50,22 @@ var palette = new ej.diagrams.SymbolPalette({
4650
getNodeDefaults: function (symbol) {
4751
symbol.style.fill = '#6495ED';
4852
symbol.style.strokeColor = '#6495ED';
53+
return symbol;
4954
},
5055
width: '600px',
5156
height: '300px',
5257
symbolHeight: 70,
5358
symbolWidth: 70,
5459
symbolPreview: { height: 80, width: 80 },
5560
symbolMargin: { left: 15, right: 15, top: 15, bottom: 15 },
61+
//Enable/disable tooltip for the symbols
5662
getSymbolInfo: function (symbol) {
57-
return { showTooltip: true };
63+
return { showTooltip: checkBox.checked };
5864
},
5965
});
6066
palette.appendTo('#element');
6167

6268
document.getElementById('showTooltip').onclick = function (args) {
63-
var checkBox = document.getElementById('showTooltip');
64-
palette.getSymbolInfo = function (symbol) {
65-
return { showTooltip: checkBox.checked };
66-
};
67-
palette.dataBind();
69+
palette.refresh();
6870
};
6971

ej2-javascript/code-snippet/diagram/symbol-palette-cs25/index.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ import {
22
SymbolPalette, NodeModel
33
} from '@syncfusion/ej2-diagrams';
44

5+
const checkBox = document.getElementById("showTooltip");
6+
7+
// Initialize the basic shapes for the symbol palette.
58
function getBasicShapes() {
6-
var basicShapes: NodeModel[] = [
9+
const basicShapes: NodeModel[] = [
710
{ id: 'Rectangle', shape: { type: 'Basic', shape: 'Rectangle' } },
811
{ id: 'Ellipse', shape: { type: 'Basic', shape: 'Ellipse' } },
912
{ id: 'Triangle', shape: { type: 'Basic', shape: 'Triangle' } },
@@ -16,8 +19,9 @@ function getBasicShapes() {
1619
return basicShapes;
1720
}
1821

22+
// Initialize the flow shapes for the symbol palette.
1923
function getFlowShapes() {
20-
var flowShapes: NodeModel[] = [
24+
const flowShapes: NodeModel[] = [
2125
{ id: 'Terminator', shape: { type: 'Flow', shape: 'Terminator' } },
2226
{ id: 'Process', shape: { type: 'Flow', shape: 'Process' } },
2327
{ id: 'Decision', shape: { type: 'Flow', shape: 'Decision' } },
@@ -30,7 +34,7 @@ function getFlowShapes() {
3034
return flowShapes;
3135
}
3236

33-
//Initializes the symbol palette
37+
// Initializes the symbol palette.
3438
let palette: SymbolPalette = new SymbolPalette({
3539
expandMode: 'Multiple',
3640
palettes: [
@@ -40,28 +44,25 @@ let palette: SymbolPalette = new SymbolPalette({
4044
getNodeDefaults: function (symbol) {
4145
symbol.style.fill = '#6495ED';
4246
symbol.style.strokeColor = '#6495ED';
47+
return symbol;
4348
},
4449
width: '600px',
4550
height: '300px',
4651
symbolHeight: 70,
4752
symbolWidth: 70,
4853
symbolPreview: { height: 80, width: 80 },
4954
symbolMargin: { left: 15, right: 15, top: 15, bottom: 15 },
55+
56+
// Enable/disable tooltip for the symbols.
5057
getSymbolInfo: function (symbol) {
51-
return { showTooltip: true };
58+
return { showTooltip: (checkBox as any).checked };
5259
},
5360
});
5461
palette.appendTo('#element');
5562

5663
let tooltipCheckBox = document.getElementById('showTooltip');
5764
if (tooltipCheckBox) {
5865
tooltipCheckBox.onclick = function (args) {
59-
var checkBox = document.getElementById("showTooltip");
60-
palette.getSymbolInfo = function (symbol) {
61-
return { showTooltip: (checkBox as any).checked };
62-
}
63-
palette.dataBind();
66+
palette.refresh();
6467
};
65-
}
66-
67-
68+
}

ej2-javascript/code-snippet/diagram/symbol-palette-nodeTemplate/index.css

Lines changed: 0 additions & 18 deletions
This file was deleted.

ej2-javascript/code-snippet/diagram/symbol-palette-nodeTemplate/index.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

ej2-javascript/code-snippet/diagram/symbol-palette-nodeTemplate/index.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

ej2-javascript/code-snippet/diagram/symbol-palette-nodeTemplate/js/index.html

Lines changed: 0 additions & 52 deletions
This file was deleted.

ej2-javascript/code-snippet/diagram/symbol-palette-nodeTemplate/systemjs.config.js

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)