Skip to content

Commit 0f9e7e9

Browse files
Integrated latest changes at 09-26-2024 10:31:10 PM
1 parent 7359063 commit 0f9e7e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+765
-127
lines changed

ej2-angular/code-snippet/diagram/connectors/connectorsbezierthumbsize-cs1/src/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ standalone: true,
2626
<e-connectors>
2727
<e-connector id='connector1' type='Bezier' sourceID='node1' targetID='node2' [segments]='segments1' [constraints]='Constraints1'>
2828
</e-connector>
29-
<e-connector id='connector2' type='Bezier' sourceID='node3' targetID='node4' [segments]='segments2' [constraints]='Constraints2' [ segmentThumbSize] = 20 >
29+
<e-connector id='connector2' type='Bezier' sourceID='node3' targetID='node4' [segments]='segments2' [constraints]='Constraints2' [segmentThumbSize] = 20 >
3030
</e-connector>
3131
</e-connectors>
3232
</ejs-diagram>`,

ej2-angular/code-snippet/diagram/connectors/connectorsorthothumbsize-cs1/src/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ standalone: true,
2626
<e-connectors>
2727
<e-connector id='connector1' type='Orthogonal' sourceID='node1' targetID='node2' [segments]='segments1' [constraints]='Constraints1'>
2828
</e-connector>
29-
<e-connector id='connector2' type='Orthogonal' sourceID='node3' targetID='node4' [segments]='segments2' [constraints]='Constraints2' [ segmentThumbSize] = 20 >
29+
<e-connector id='connector2' type='Orthogonal' sourceID='node3' targetID='node4' [segments]='segments2' [constraints]='Constraints2' [segmentThumbSize] = 20 >
3030
</e-connector>
3131
</e-connectors>
3232
</ejs-diagram>`,

ej2-angular/code-snippet/diagram/interaction/fixeduserhandletemplate-cs1/src/app.component.ts

Lines changed: 81 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
1-
import { NgModule } from '@angular/core'
2-
import { BrowserModule } from '@angular/platform-browser'
3-
import { DiagramModule } from '@syncfusion/ej2-angular-diagrams'
4-
5-
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
import { CommonModule } from '@angular/common';
4+
import {
5+
DiagramModule,
6+
ShapeStyleModel,
7+
} from '@syncfusion/ej2-angular-diagrams';
68

79
import { Component, ViewEncapsulation, OnInit, ViewChild } from '@angular/core';
8-
import { DiagramComponent, Diagram,MarginModel, NodeModel, ConnectorModel,ConnectorConstraints, OrthogonalSegmentModel, PointModel } from '@syncfusion/ej2-angular-diagrams';
10+
import {
11+
DiagramComponent,
12+
Diagram,
13+
MarginModel,
14+
NodeModel,
15+
ConnectorModel,
16+
ConnectorConstraints,
17+
OrthogonalSegmentModel,
18+
PointModel,
19+
} from '@syncfusion/ej2-angular-diagrams';
20+
21+
import { NgIf, CurrencyPipe } from '@angular/common';
922

1023
@Component({
11-
imports: [
12-
DiagramModule
13-
],
14-
15-
providers: [ ],
16-
standalone: true,
17-
selector: "app-container",
18-
template: `<ejs-diagram #diagram id="diagram" width="100%" height="580px" [getNodeDefaults] ='getNodeDefaults' [fixedUserHandleTemplate]='fixeduserhandleTemplate'>
24+
imports: [DiagramModule,NgIf],
25+
26+
providers: [],
27+
standalone: true,
28+
selector: 'app-container',
29+
template: `<ejs-diagram #diagram id="diagram" width="100%" height="580px" [getNodeDefaults] ='getNodeDefaults' [fixedUserHandleTemplate]='fixeduserhandleTemplate' >
30+
1931
<e-nodes>
2032
<e-node id='node1' [offsetX]=250 [offsetY]=250>
2133
<e-node-fixeduserhandles>
22-
<e-node-fixeduserhandle id='usercon1' [margin]='margin1' [width]=50 [height]=20 [offset]="fixedUserHandleOffset1">
34+
<e-node-fixeduserhandle id='usercon1' [margin]='margin1' [width]=50 [height]=20 [offset]="fixedUserHandleOffset1" >
2335
</e-node-fixeduserhandle>
2436
</e-node-fixeduserhandles>
2537
</e-node>
@@ -28,65 +40,67 @@ import { DiagramComponent, Diagram,MarginModel, NodeModel, ConnectorModel,Connec
2840
<e-connector id='connector1' type= 'Orthogonal' [sourcePoint]='sourcePoint' [targetPoint]='targetPoint'>
2941
<e-connector-fixeduserhandles>
3042
<e-connector-fixeduserhandle
31-
id = 'usercon2' [width]=120 [height]=20 [offset]="fixedUserHandleOffset2" >
43+
id='usercon2' [width]=120 [height]=20 [offset]="fixedUserHandleOffset2" >
3244
</e-connector-fixeduserhandle>
3345
</e-connector-fixeduserhandles>
3446
</e-connector>
3547
</e-connectors>
36-
<ng-template #fixedUserHandleTemplate let-id="id" let-width="width">
37-
<div *ngIf="id === 'usercon1'" style="width:100%;height:100%">
38-
<input id="colorPicker" (change)="onchange()" type="color" value="#008000" style="width:{{width}}"/>
39-
</div>
40-
<div *ngIf="id === 'usercon2'" style="width:100%;height:100%">
41-
<input type="button" value="FixedUserHandleTemplate" style="width:{{width}};color:red;"/>
42-
</div>
43-
</ng-template>
48+
<ng-template #fixeduserhandleTemplate let-data>
49+
<ng-container *ngIf="data.id == 'usercon1'" style="width: 100%; height: 100%">
50+
<input id="colorPicker" type="color" (change)="onchange($event)" value="#008000"/>
51+
</ng-container>
52+
<ng-container *ngIf="data.id == 'usercon2'" style="width:100%;height:100%">
53+
<input type="button" value="FixedUserHandleTemplate"
54+
style="color:red; "/>
55+
</ng-container>
56+
57+
</ng-template>
4458
4559
</ejs-diagram>`,
46-
encapsulation: ViewEncapsulation.None
47-
})
60+
encapsulation: ViewEncapsulation.None,
61+
})
4862
export class AppComponent {
49-
@ViewChild("diagram")
50-
public margin1?: MarginModel;
51-
ngOnInit(): void {
52-
this.margin1 = { right: 20 };
53-
}
54-
public diagram!: DiagramComponent;
55-
public currentColor: any;
56-
public getNodeDefaults(node: NodeModel): NodeModel {
57-
node.height = 100;
58-
node.width = 100;
59-
((node as NodeModel).style as ShapeStyleModel).fill = "#6BA5D7";
60-
((node as NodeModel).style as ShapeStyleModel).strokeColor = "White";
61-
return node;
62-
}
63-
public fixedUserHandleOffset1 = {x : 0, y : 0 };
64-
public sourcePoint = { x: 400, y: 200 };
65-
public targetPoint = { x: 500, y: 300 };
66-
public margin2 = { right : 20};
67-
public fixedUserHandleOffset2 = 0.5;
68-
public getConnectorDefaults(obj: ConnectorModel): void {
69-
obj.style = {
70-
strokeColor: '#6BA5D7',
71-
fill: '#6BA5D7',
72-
strokeWidth: 2
73-
}
74-
obj.targetDecorator = {
75-
style: {
76-
fill: '#6BA5D7',
77-
strokeColor: '#6BA5D7'
78-
}
79-
}
80-
}
63+
@ViewChild('diagram')
64+
public diagram?: DiagramComponent;
65+
public margin1?: MarginModel;
66+
ngOnInit(): void {
67+
this.margin1 = { right: 20 };
68+
}
69+
8170

82-
public onchange():void {
83-
this.currentColor = (document.getElementById('colorPicker') as HTMLSelectElement).value;
84-
if (this.diagram.nodes && this.diagram.nodes.length > 0) {
85-
((this.diagram.nodes[0]) as any).style.fill = this.currentColor;
86-
this.diagram.dataBind(); // Ensure the diagram is updated
87-
}
88-
}
71+
public getNodeDefaults(node: NodeModel): NodeModel {
72+
node.height = 100;
73+
node.width = 100;
74+
((node as NodeModel).style as ShapeStyleModel).fill = '#6BA5D7';
75+
((node as NodeModel).style as ShapeStyleModel).strokeColor = 'White';
76+
return node;
77+
}
78+
public fixedUserHandleOffset1 = { x: 0, y: 0 };
79+
public sourcePoint = { x: 400, y: 200 };
80+
public targetPoint = { x: 500, y: 300 };
81+
public margin2 = { right: 20 };
82+
public fixedUserHandleOffset2 = 0.5;
83+
public getConnectorDefaults(obj: ConnectorModel): void {
84+
obj.style = {
85+
strokeColor: '#6BA5D7',
86+
fill: '#6BA5D7',
87+
strokeWidth: 2,
88+
};
89+
obj.targetDecorator = {
90+
style: {
91+
fill: '#6BA5D7',
92+
strokeColor: '#6BA5D7',
93+
},
94+
};
95+
}
8996

97+
public onchange(args:any) {
98+
let currentColor = (
99+
document.getElementById('colorPicker') as HTMLSelectElement
100+
).value;
101+
102+
(((this.diagram as Diagram).nodes[0] as any).style.fill) = currentColor;
103+
(this.diagram as Diagram).dataBind(); // Ensure the diagram is updated
104+
105+
}
90106
}
91-
92-

ej2-angular/code-snippet/diagram/tooltip/annotationtooltip-cs1/src/app.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NgModule } from '@angular/core'
22
import { BrowserModule } from '@angular/platform-browser'
3-
import { DiagramModule } from '@syncfusion/ej2-angular-diagrams'
3+
import { AnnotationConstraints, DiagramModule, OrthogonalSegmentModel, PointModel } from '@syncfusion/ej2-angular-diagrams'
44

55

66

@@ -17,12 +17,12 @@ standalone: true,
1717
selector: "app-container",
1818
template: `<ejs-diagram #diagram id="diagram" width="900px" height="500px" [getNodeDefaults] ='getNodeDefaults' >
1919
<e-nodes>
20-
<e-node id='node1' [offsetX]=250 [offsetY]=250 >
20+
<e-node id='node1' [offsetX]=250 [offsetY]=150 >
2121
<e-node-annotations>
2222
<e-node-annotation
23-
id= 'label1' content="Annotation"
24-
tooltip = "tooltip1"
25-
constraints = "constraints1"
23+
id= 'label1' content="Rectangle"
24+
[tooltip] = "tooltip1"
25+
[constraints] = "constraints1"
2626
>
2727
</e-node-annotation>
2828
</e-node-annotations>

ej2-angular/code-snippet/image-editor/default-cs3/src/app.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,24 @@ export class AppComponent {
4545
}
4646
rectangleClick(): void {
4747
let dimension: any = this.imageEditorObj?.getImageDimension();
48-
this.imageEditorObj?.drawRectangle(dimension.x, dimension.y, 200, 100);
49-
this.imageEditorObj?.drawRectangle(dimension.x + 300, dimension.y, 200, 100, null, '', '', null, null, 8);
48+
this.imageEditorObj?.drawRectangle(dimension.x + 10, dimension.y + 60, 150, 70);
49+
this.imageEditorObj?.drawRectangle(dimension.x + 250, dimension.y + 60, 150, 700, null, '', '', null, null, 8);
5050
}
5151
ellipseClick(): void {
5252
let dimension: any = this.imageEditorObj?.getImageDimension();
53-
this.imageEditorObj?.drawEllipse(dimension.x, dimension.y);
53+
this.imageEditorObj?.drawEllipse(dimension.x, dimension.y + 200);
5454
}
5555
lineClick(): void {
5656
let dimension: any = this.imageEditorObj?.getImageDimension();
57-
this.imageEditorObj?.drawLine(dimension.x, dimension.y);
57+
this.imageEditorObj?.drawLine(dimension.x+300, dimension.y+300);
5858
}
5959
pathClick(): void {
6060
let dimension: any = this.imageEditorObj?.getImageDimension();
6161
this.imageEditorObj?.drawPath([{x: dimension.x, y: dimension.y}, {x: dimension.x+50, y: dimension.y+50}, {x: dimension.x+20, y: dimension.y+50}], 8);
6262
}
6363
arrowClick(): void {
6464
let dimension: any = this.imageEditorObj?.getImageDimension();
65-
this.imageEditorObj?.drawArrow(dimension.x, dimension.y+10, dimension.x+50, dimension.y+10, 10);
65+
this.imageEditorObj?.drawArrow(dimension.x + 100, dimension.y + 30, dimension.x + 100, dimension.y+10, 10);
6666
}
6767
}
6868

ej2-angular/code-snippet/image-editor/default-cs41/src/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class AppComponent {
2828
const reader = new FileReader();
2929
reader.onload = () => {
3030
// Load the image into the Image Editor
31-
this.imageEditorObj?.open(reader.result);
31+
this.imageEditorObj?.open(reader.result as any);
3232
};
3333
reader.readAsDataURL(args.filesData[0].rawFile);
3434
}

ej2-angular/code-snippet/image-editor/default-cs44/src/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import { ImageEditorComponent } from '@syncfusion/ej2-angular-image-editor';
4545
canvas.height = imageData.height;
4646
ctx.putImageData(imageData, 0, 0);
4747
canvas.toBlob((blob) =>{
48-
this.blobUrl = URL.createObjectURL(blob);// For getting blob.
48+
this.blobUrl = URL.createObjectURL(blob as any);// For getting blob.
4949
});
5050
}
5151
setImage(): void {

ej2-angular/code-snippet/image-editor/default-cs55/src/styles.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
@import 'node_modules/@syncfusion/ej2-image-editor/styles/material.css';
1111
@import 'node_modules/@syncfusion/ej2-angular-base/styles/material.css';
1212
@import 'node_modules/@syncfusion/ej2-angular-image-editor/styles/material.css';
13+
@import "../node_modules/@syncfusion/ej2-angular-navigations/styles/material.css";
1314

1415
.e-section-control {
1516
margin-top: 150px;

ej2-angular/code-snippet/image-editor/default-cs56/src/app.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,20 @@ export class AppComponent {
4343
this.imageEditorObj?.drawRedact(RedactType.Blur, dimension?.x, dimension.y, 200, 300);
4444
}
4545
updateRedact(): void {
46-
let redacts: RedactSettings[] = this.imageEditorObj?.getRedacts();
46+
let redacts: RedactSettings[] | any = this.imageEditorObj?.getRedacts();
4747
if (redacts.length > 0) {
4848
redacts[redacts.length - 1].blurIntensity = 100;
4949
this.imageEditorObj?.updateRedact(redacts[redacts.length - 1]);
5050
}
5151
}
5252
selectRedact(): void {
53-
let redacts: RedactSettings[] = this.imageEditorObj?.getRedacts();
53+
let redacts: RedactSettings[] | any = this.imageEditorObj?.getRedacts();
5454
if (redacts.length > 0) {
5555
this.imageEditorObj?.selectRedact(redacts[redacts.length - 1].id);
5656
}
5757
}
5858
deleteRedact(): void {
59-
let redacts: RedactSettings[] = this.imageEditorObj?.getRedacts();
59+
let redacts: RedactSettings[] | any = this.imageEditorObj?.getRedacts();
6060
if (redacts.length > 0) {
6161
this.imageEditorObj?.deleteRedact(redacts[redacts.length - 1].id);
6262
}

ej2-angular/diagram/undo-redo.md

Lines changed: 0 additions & 31 deletions

ej2-angular/gantt/global-local.md

Lines changed: 2 additions & 1 deletion

ej2-angular/image-editor/open-save.md

Lines changed: 3 additions & 3 deletions
1008 Bytes
960 Bytes
1008 Bytes
960 Bytes

ej2-angular/list-box/getting-started.md

Lines changed: 5 additions & 2 deletions

0 commit comments

Comments
 (0)