Programmatically setting `isSelected` property of a Node

So I have a Node that I add to my diagram through a startTransaction. After I add the node., I try to programmitcally set the isSelected property. I believe I am going about it the wrong way. I find the node with findNodeDataForKey. This returns the simple JSON of the Node independent of the Diagram.

I have done things like `DiagramRef.model.setDataProperty(myNode, “someAttr”, "someValue);

But this doesn’t seem to be the apposite approach when you are using isSelected since it is not a Model property but is rather an Attribute of the Node class. Any help appreciated.

Even though this is wrong, I am basically trying to do this:

 ticketMasterDiagram.model.setDataProperty(newNode, "isSelected", true)

where newNode is from ticketMasterDiagram.model.findNodeDataForKey(myKey)

Nodes belong to Diagrams, data belong to Models.

var node = myDiagram.findNodeForKey (...);
if (node !== null) node.isSelected = true;

Or find your Node some other way – see methods on the Diagram class: