08-28-2015 08:39 PM
Are non integer ids (UUID) supported?
In below sample topologyData1 and topologyData2 works but topologyData3 is failing.
var topologyData1 = {
nodes: [
{"id": 0, "x": 410, "y": 100, "name": "12K-1"},
{"id": 1, "x": 410, "y": 280, "name": "12K-2"}
],
links: [
{"source": 0, "target": 1},
]
};
var topologyData2 = {
nodes: [
{"id": "0", "x": 410, "y": 100, "name": "12K-1"},
{"id": "1", "x": 410, "y": 280, "name": "12K-2"}
],
links: [
{"source": "0", "target": "1"},
]
};
var topologyData3 = {
nodes: [
{"id": "0", "x": 410, "y": 100, "name": "12K-1"},
{"id": "1a", "x": 410, "y": 280, "name": "12K-2"}
],
links: [
{"source": "0", "target": "1a"},
]
};
Solved! Go to Solution.
08-31-2015 12:58 AM
nx.graphic.Topology defaults to using the index instead of the id for identifying link source and destinations, you have to set:
identityKey: 'id',
to make it use the ids which then also works with strings.
08-31-2015 12:58 AM
nx.graphic.Topology defaults to using the index instead of the id for identifying link source and destinations, you have to set:
identityKey: 'id',
to make it use the ids which then also works with strings.
08-31-2015 09:21 AM
Thanks Alexendar.
For future refernce. This works
var topo = new nx.graphic.Topology({
...
identityKey: 'id',
.........
});
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide