hello,
I am trying to set shape or picture as shown in image at node left and right side which indicated direction. it is possible to set shape at these position from linkDataArray. i have linkDataArray like this :
{ “from”: 1, “to”: 2, “color”: go.Brush.randomColor(128, 240), “num”: 10},
{ “from”: 2, “to”: 1, “color”: go.Brush.randomColor(128, 240), “num”: 6}.
Yes – I would add a property on the link data (I assume you are using a GraphLinksModel) of the first link. Let’s name that property “hide”. And the binding would depend on that:
// this goes on your from-end label in your link template
new go.Binding("visible", "hide", function(h) { return !h; })
By default the label would be visible (because GraphObject.visible defaults to true).
Hi, one more query, can i set location in layered digraph?
want to set position on canvas with loc data from my nodedata, data is like below :
{ “key”: 1, “loc”: “-232.34 143.51”, “name”: “Hiren”, “color”: go.Brush.randomColor(128, 240), “checkedin”: null },
The point of any Layout is to position all of the Nodes that it is responsible for laying out. So I don’t understand what it is that you want. Perhaps you want to customize LayeredDigraphLayout to do something? That is possible – for example GenogramLayout does that to position spouses next to each other.
I’m assuming you are still using LayeredDigraphLayout.
If so, you can set LayeredDigraphLayout.setsPortSpots to false, in order for it to stop assuming that all links go into nodes and come out of nodes in the particular LayeredDigraphLayout.direction.
Then you can set or bind the GraphObject.fromSpot and/or GraphObject.toSpot on each port the way that you want.