_ property in model.addLinkData()

I need to add some data to my link model that isn’t used by the diagram link template. This data is needed later and I thought to use _ to mark it as extra data not used by the template. Here is a simple example:

model.addLinkData({
  a: a,
  b: b,
  _c: c
})

Later in a ChangedEvent I want to access _c after doing this:

    const { model } = event;
    const changes = JSON.parse(model.toIncrementalJson(event));
    const modified = changes.modifiedLinkData || [];

In the debugger model.linkDataArray has the _c property in it but changes.modifiedLinkData doesn’t. Doing a model.toIncrementalJson(event) looks to not include any property with a _. If I change my code to ABC: c then it works just fine.

So does model.toIncrementalJson() purposely ignore any properties with an _? If so is there a recommened way to store data into a link model that isn’t used by the template?

Yes, that is correct: Model | GoJS API

A template doesn’t use a data property if there’s no Binding that uses it.