Set Shape both side of node in Layered Digraph

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}.

Please Look on this query.

You can use link labels at the ends of your links to accomplish that.

hi, thanks,
I integrate it using your suggested link.
i have doubt in one thing. can i remove start point picture like below picture

Are you asking about how to hide a label? I suggest that you use a Binding on the label controlling its GraphObject.visible property.

can i hide only 1st using this? i used picture here

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).

thank you! it works…

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.

ok, got it.


Perhaps you just want to prevent a layout from being performed. If so, please read GoJS Layouts -- Northwoods Software

Hi,is there any way to set tospot side to any one node
Like fixed left or right.

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.

Thanks! Done with it.
can we update linkdata like we update nodedata with updateRelationshipsFromData() and updateTargetBindings().?

Yes, you can.