How to detect a specific graph object in a diagram?

I am wondering if GoJS has a similar function like “getElementbyID” to get a specific graph object in a diagram? Or are there any other ways to detect if a specific graph object has been dropped in the diagram?

Thx~

The methods that you want are on the Diagram class and have names that start with “find…”.

You probably want Diagram.findNodeForKey. But consider also Diagram.findNodesByExample.