Event, method, callback when link points change

As a follow up of Node/Port databinding based on incoming links - #3 by reinzor we decided to attach the shape that depends on the node and port state to the link.

No we would like to update this go.Shape when the points of the link gets changed; for now, we have implemented the update in the following places:

  • Link.computePoints
  • In an arbitrary target data binding on source prop '' of the LinkTemplate
  • In the LinkReshapingTool.computeReshape

By updating the shapes in these methods, we get the desired behavior but my question is if this can be achieved in a more easy way. Is there a callback that we can register to (or an override) that gets triggered if any link data gets changed (our link points are also included in the data binding)?


Yes, instead of all those things, implement a Model Changed listener:
Model | GoJS API OR Diagram | GoJS API

GoJS Changed Events -- Northwoods Software

It is more tedious to implement a Model Changed listener, but you have access to everything. You just have to be careful about making changes to the model.

Thanks, that works!