Getting GoJS ports location information

We have a scenario where we need to find / get the location information for a Port. The port is a Go.Panel object and have associated port properties bound. Implemented the dynamic ports on the node using itemArray example referred here - Dynamic Ports

However, as I understand, the panel doesn’t have a GoJS property “location” which you normally see on the node object.

So, my question, how am I suppose to access the location for the ports in such case. I need to bind the location information of the GoJS port to our port model object and capture it. This will be a 2 way binding.

Any ideas / thoughts ?

The position of any GraphObject within its Panel is given by its GraphObject.actualBounds. However you can’t have a Binding on that property because it isn’t settable. And I don’t think it makes sense to have a TwoWay Binding on some property denoting its location unless the type of Panel would make sense for its elements to have independent positions.

So what kind of Panel are those ports in? It probably makes sense to have a TwoWay Binding on GraphObject.position if it’s a “Position” Panel. It makes sense to have a TwoWay Binding on GraphObject.alignment if it’s a “Spot” Panel. Maybe it would work for some other panel types too.

FYI, an example of the second kind is used by the node template in the Pipes sample, Pipes