Hi,
When i used GOJS 2.3, i used to have the link from/to as strings, for example : “from” : “44545”
Now i see that i have to treat them as integers, namely change all my JSON files to from/to : int
Any work around
Hi,
When i used GOJS 2.3, i used to have the link from/to as strings, for example : “from” : “44545”
Now i see that i have to treat them as integers, namely change all my JSON files to from/to : int
Any work around
Strings should work just fine, as long as your data is consistent, and you are using strings everywhere, for example this will work:
myDiagram.model = new go.GraphLinksModel(
[
{ key: '1', text: 'Alpha', color: 'lightblue' },
{ key: '2', text: 'Beta', color: 'orange' },
{ key: '3', text: 'Gamma', color: 'lightgreen' },
{ key: '4', text: 'Delta', color: 'pink' }
],
[
{ from: '1', to: '2' },
{ from: '1', to: '3' },
{ from: '2', to: '2' },
{ from: '3', to: '4' },
{ from: '4', to: '1' }
]
);
But if the Node keys are numbers, and the from/to are strings, you will have trouble.
Strange,
cause in GOJS 2.3 i was able to mix string and int, as keys
In 3.0, I had to replace all the from/to to int cause the node key is int
We changed our backing data structures to use the built-in JS Map and Set (originally released in 2015, now widely available), the built-in JS map treats "1" and 1 as different keys, while our Map (created in 2010) did not. We mention this issue in the Changelog as a potentially incompatible 3.0 change: