cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
612
Views
0
Helpful
0
Replies

Next-UI Adding New Nodes, Links and ID issues

Darko
Level 1
Level 1

Hi everyone,

 

I've wrote an App using Next-UI framework, but I've ran into some issues with IDs when I add new nodes and links to the topology. Let me calrify first how I handle IDs with the initial topology. All my node ID's start at 0 and all my nodeSet IDs start at 1000 - in case my requirements change in the future, starting IDs for nodeSets can be changed.

 

When I add a new node to the existing topology, the problem I ran into is that although the ID is set to next available ID, for example 250, the node.model.id is actually set to 250 + number of node sets due to the way Next UI handles drawing of graphs (vertex and vertexSet IDs). When I then try to add link between two nodes, the ID's obviously don't match. I did get around this as is now working in real time, but if I want to save the topology and then reload it it doesn't work because Next UI loads nodes first and then node sets and then ID's don't match again. For example, if I save topology where nodes are nodes.length + nodeSet.length, once topology is reloaded the new vertex ID and ID of the node don't match again and I cannot use the node as source or target when defining a new link. It's a shame that Next doesn't use real IDs instead of vertex IDs in the first place.

 

I hope the above makes sense. Has anyone resolved this "issue"?

0 Replies 0