0

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

DaveA
  • 1
  • 2
  • From what I unserstand from your problem, there is no clean way to do it in GraphStream. Have you tried to hide unwanted edges using `ui.hide` attributes? – Yoann May 24 '17 at 07:49
  • I had considered that, but I am already hiding some edges, so on the face of it, it would be a bit confusing. I suppose I could just add extra attributes when I hide for different reasons, so I can then later see why they are hidden to make it easier to hide/unhide for the single/multi transition without influencing the other hidden edges. I guess I just sort of assumed that since there was a SingleGraph and a MultiGraph that I must be missing something relatively easy to do. – DaveA May 24 '17 at 08:14
  • So what I ended up doing (for now--we'll see how people like it) 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). – DaveA Jun 02 '17 at 10:34

0 Answers0