Skip to content

Commit fcd44fe

Browse files
author
Anto Gibson
authored
Update App.tsx
1 parent 8152da2 commit fcd44fe

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

src/App.tsx

+17-15
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
HierarchicalTree,
77
Inject,
88
NodeModel,
9-
ConnectorModel
9+
ConnectorModel,
10+
SnapConstraints
1011
} from "@syncfusion/ej2-react-diagrams";
1112
import {DataManager} from "@syncfusion/ej2-data";
1213
function App() {
@@ -142,40 +143,40 @@ function App() {
142143
margin:{top:20},
143144
horizontalSpacing:25,
144145
verticalSpacing:30,
145-
horizontalAlignment:"Left",
146+
horizontalAlignment:"Center",
146147
verticalAlignment:"Center"
147148
}
148149
const defaultNodeSetting = (defaultNode:NodeModel) =>{
149150
defaultNode.shape = {
150151
type : "Text",
151-
content:(defaultNode.data as {Role:"string"}).Role,
152+
content : (defaultNode.data as {Role : "String"}).Role
152153
}
153154
defaultNode.style = {
154-
fill:"None",
155-
strokeColor:"None",
155+
fill: "None",
156+
strokeColor: "None",
156157
bold:true,
157158
color:"white"
158159
}
159160
defaultNode.backgroundColor = "#6BA5D7";
160161
defaultNode.width = 90;
161162
defaultNode.height = 60;
162-
defaultNode.margin= {
163+
defaultNode.margin = {
163164
left : 5,
164-
right:5,
165-
top:5,
166-
bottom:5
165+
right : 5,
166+
top : 5,
167+
bottom : 5
167168
}
168169
return defaultNode;
169170
}
170171
const defaultConnectorSetting = (defaultConnector:ConnectorModel) =>{
171172
defaultConnector.style = {
172-
strokeWidth:2,
173-
strokeColor:"#6BA5D7"
173+
strokeWidth : 2,
174+
strokeColor : "#6BA5D7"
174175
}
175176
if(defaultConnector.targetDecorator?.style){
176-
defaultConnector.targetDecorator.style={
177-
fill:"#6BA5D7",
178-
strokeColor:"#6BA5D7"
177+
defaultConnector.targetDecorator.style = {
178+
fill : "#6BA5D7",
179+
strokeColor : "#6BA5D7"
179180
}
180181
}
181182
defaultConnector.type = "Orthogonal";
@@ -189,8 +190,9 @@ function App() {
189190
height={"750px"}
190191
dataSourceSettings={dataSource}
191192
layout={diagramLayout}
192-
getConnectorDefaults={defaultConnectorSetting}
193193
getNodeDefaults={defaultNodeSetting}
194+
getConnectorDefaults={defaultConnectorSetting}
195+
snapSettings={{constraints:SnapConstraints.None}}
194196
>
195197
<Inject services = {[DataBinding, HierarchicalTree]}/>
196198
</DiagramComponent>

0 commit comments

Comments
 (0)