Graphstream MultiGraph to SingleGraph at runtime (and vice-versa)

211 Views Asked by At

I've only started using Graphstream a couple of weeks ago, and so far it is working pretty well, but I have one issue that I have not been able to solve:

I am displaying data which for smaller datasets is nice to view as a MultiGraph, and for larger datasets becomes to hectic and would be nicer to view as a SingleGraph. What I'm trying to accomplish is at runtime to either dump the data from a SingleGraph into a MultiGraph (and vice versa) on some user action. Either that or use MultiGraph all the time if there is some way to suggest to it to display only a single edge between nodes?

So far my only semi-reasonable-looking-to-implement-solution that I have thought up was maintaining both a SingleGraph and MultiGraph and swapping them out with the viewer when the user performs the swap action, but that seemed kludgy (and would have to do every operation on both graphs). I searched around the docs and web for quite awhile but have not come up with a reasonable solution so far...so if anyone knows of an easier way, please let me know :)

EDIT: Solution found (good enough for us anyway)

So what I ended up doing is adding another ui.class to the edges that are known to be duplicates at graph construction time, which for now I made a much less obvious color, so they fade into the background when you're trying to look at the singlegraph links. I could also use this to iterate over the graph and hide them (or just redefine the css to be the same as the background color...or something)...It's not quite what I wanted, but looks like it will serve us well enough for the near and medium term on this project.

Thanks,

-Dave

0

There are 0 best solutions below