A couple of model questions

I’m working on the next version of our product and trying to use ChangedEvents for everything possible instead of a bunch of DiagramEvents. I have a couple of questions.

  1. Is there anyway to have the auto ID generator for new nodes return a string instead of a number? The auto negative number works perfect but we use strings for id and want to make eslint happy using === instead of ==. If not I’m assuming I need to supply a makeUniqueKeyFunction().

  2. After a node is added I need to add/change some of the node model data. The API says if I change nodeDataArray it doesn’t notify the model or diagram and I don’t see an updateNodeData() method. In the past I’ve used model.setDataProperty() but I have to call it for each item I want to change. What is the best way to bulk change data for a node/link?

  1. Yes, set Model | GoJS API

  2. You need to call Model.set if you want to support undo/redo. If you don’t need to, you can just make the changes and call Model | GoJS API

makeUniqueKeyFunction appears to only be called for nodes and not links. Is there an equivalent for links?

Did you find it in GraphLinksModel | GoJS API ?