I need to find and modify link with 'from' or 'to'. For example i have 4 node key and i need to get all link connected to their node.
{ "class": "GraphLinksModel",
"copiesArrays": true,
"nodeCategoryProperty": "shape",
"linkLabelKeysProperty": "labelKeys",
"nodeDataArray": [
{"key":"e9bc2374-67ec-46d5-b973-fc9d58f05ca5", "shape":"FEMALE"},
{"key":"6597a4dd-f3b2-4ba3-9fb9-782c29f84071", "shape":"FEMALE"},
{"key":"b94c6c98-e556-4417-8ef3-b21f5cc144f9", "shape":"MALE"},
{"key":"93928089-7d09-456e-a386-b0ab0eec87a7", "shape":"MALE"},
{"shape":"LinkLabel", "key":-5}
],
"linkDataArray": [
{"from":"b94c6c98-e556-4417-8ef3-b21f5cc144f9", "to":"6597a4dd-f3b2-4ba3-9fb9-782c29f84071", "labelKeys":[ -5 ], "category":"Marriage"},
{"from":-5, "to":"e9bc2374-67ec-46d5-b973-fc9d58f05ca5"},
{"from":-5, "to":"93928089-7d09-456e-a386-b0ab0eec87a7"}
]}
How i can find this links ?
Nodes have several methods for this: findLinksConnected, findLinksOutOf, findLinksInto
To get a reference to a node you can call
myDiagram.findNodeForKey(someKey)
.