locationObjectName gets lost after model update

In our application we need to place nodes at specific locations in the diagram (as defined by an outside XML file). Underneath each node we place a label describing what the node is. In our application we use images for the nodes but for purposes of this question I have switched it to just use a regular shape object. I am seeing the same behaviour in both cases. The labels are wider than the node images themselves, hence the use of the locationObjectName attribute on the template. It is important that the node images are in the location specified and the labels are allowed to be longer. Here is an example of when the diagram is first opened:

As you can see the nodes line up perfectly. Our use case is we want to kick off a long running process that while running needs to disable the nodes (note: in my test case I just change the node’s color). We do this in a transaction. I was expecting the nodes to change but not their locations, but when we do this the nodes now align themselves on the outer boundary of the Node. Its as if the locationObjectName attribute has been removed. Here is the example after changing the model:

You can see now the diagram appears to be left aligned on the text nodes underneath.
I have tried a bunch of different techniques, wrapping the target node inside another node, setting various size attributes, moving the name attribute up in the hierarchy, etc. But nothing seems to work.

I am using gojs 1.4.10 and I have created a jsfiddle site to show the code and behaviour:

http://jsfiddle.net/redwolf/6sdgfmpw/9/

Any help or idea of what I am doing wrong would be greatly appreciated.

No, that property value remains.

Your code was data binding Node.position, which always refers to the top-level corner of the whole Node, not the Node.location, which is affected by the Node.locationObjectName.



That was it, thanks.