Hi,
I have add the arrow on both the sides based on the condition. How can I add the function or logic in
(go.Shape, { fromArrow: "Standard" }),
(go.Shape, { toArrow: “Standard” }),
Please share me any example or let me know how to add.
Hi,
I have add the arrow on both the sides based on the condition. How can I add the function or logic in
(go.Shape, { fromArrow: "Standard" }),
(go.Shape, { toArrow: “Standard” }),
Please share me any example or let me know how to add.
$(go.Link,
$(go.Shape, { strokeWidth: 2 }),
$(go.Shape, { fromArrow: "Standard" }),
$(go.Shape, { toArrow: "Standard" })
)
produces links like:
Is that what you want? More common is:
$(go.Shape, { fromArrow: "Backward" }),
$(go.Shape, { toArrow: "Standard" })
which looks like:
You can use a Binding to control whether an arrowhead (or any other GraphObject) is visible:
new go.Binding("visible", "show")
so that when data.show
is false, the object won’t be GraphObject.visible.
$(go.Shape, { fromArrow: “Standard” },
new go.Binding(“visible”, “show”), function (v) {
return false
})
After adding the above code getting below error, Please let me know
ERROR Error: Unknown initializer “function (v) {
return false;
}” for object being constructed by GraphObject.make: Shape(Standard)#3308
One cannot pass a function to GraphObject.make as an argument.
I have made changes like below and now arrows are coming on both the sides based on the condition logic. But, the fromArrow and toArrow pointing to the same direction as below screenshot.
$(go.Shape, { fromArrow: "Standard" },
new go.Binding("visible", "", function (v) {
if (v.srcSyncOption === 'BOTH' || v.srcSyncOption === 'UPDATE' || v.srcSyncOption === 'CREATE') {
return true
} else {
return false
}
})),
$(go.Shape, { toArrow: "Standard" },
new go.Binding("visible", "", function (v) {
if (v.destSyncOption === 'BOTH' || v.destSyncOption === 'UPDATE' || v.destSyncOption === 'CREATE') {
return true
} else {
return false
}
})),
Please read my first response.