I am not sure if my changes to the accessors in the child classes are the problem if there is something entirely broken in how I create the Node/Link arrays. Do you have any idea what could cause to break?
In general we have been trying to remove uses of GraphObject.make from our samples, even though you can freely mix code styles. You might want to use new go.GraphLinksModel({ . . . }), just in case the “$” in your code isn’t right.
But your code looks fine. So I cannot explain the problem. Can you show us better (i.e. more complete) error messages?
The error occurs when I try to find a node that should be there (and I debug it, and it says it is there), but findNodeForKey(5) is not there, even though when I debug it, I can get the node list, index 5, and there’s the node.
const containedNode = diagramController.diagram.findNodeForKey(5) as Node;
containedNode.isSelected = true;
The failure is when the test sets isSelected to true, but isSelected is on a null object. But in v2, this object is not null.
Could you please show us the node data object in the model? Maybe it was created with a key that was “5” (a string), but your test is trying to look it up with 5 (a number).