When I load a graph from a GraphML file, prefuse reorganises IDs given to nodes and edges.
I am fine with prefuse using numerical IDs only (while the GraphML format would allow alphanumerical ones), but I require them to be persistent. I want to use a graph editor based on prefuse, and have its outcome be referenced in other files, i.e. I want to be sure an external reference on node 217 always points to the same node, even if I deleted node 98 in this editor before.
Can prefuse and its GraphML reader be used in such a way? Do you have any other ideas for my problem?
Thanks a lot in advance.
Hmm, just create your own id field in your GraphML file and use this for your reference.
Is it that easy?
best regards, Björn
Yeah, that sure would do the trick.
However, this would mean every node has two IDs for two different purposes. This won't be a catastrophe, but it will look redundant, possibly even confusing (even though I then would rename the second ID to something like "internal name").
Well, thanks for your input - likely I'm going this way anyway.
My viewpoint is the same as thinkpositive has delivered, you can add your node id as an attribute to every node. Prefuse use its own id in the visual layer, it's different from your node id defined in your data layer.
thank you very much for your input. I now implemented it as suggested. I'm still not very happy about it, especially as the edges of course still use the "old" IDs, and so I have to handle both those and the new ones in my external program, but it works for now. -Maybe- I'll write an own XML handler some time that doesn't store prefuse's internal IDs in the file - I could use a simpler (more compact) format than GraphML then, too.
Log in to post a comment.