GraphStream Users

Archives de la liste Aide


Re: Make Layout Algorithm Run Continuously


Chronologique Discussions 
  • From: Stefan Balev <stefan.balev AT gmail.com>
  • To: "graphstream-users AT litislab.fr" <graphstream-users AT litislab.fr>, guilhelm savin <guilhelm.savin AT gmail.com>
  • Subject: Re: Make Layout Algorithm Run Continuously
  • Date: Tue, 24 Sep 2013 13:45:08 +0200

Hello,

Just a complement to Guilhelm's answer:
An alternative way to do do the same thing is to use attributes:

graph.addAttribute("layout.stabilization-limit", 0.0);
graph.display();

There are several graph, node and edge attributes that can be used to tweak the default layout algorithm. More information here: http://graphstream-project.org/api/gs-core/org/graphstream/ui/layout/springbox/BarnesHutLayout.html

Best,

--
Stefan



2013/9/24 guilhelm savin <guilhelm.savin AT gmail.com>
Hi,

Just disable the autolayout and then enable it with your layout algorithm:
/* ================================== */
Graph graph = new MultiGraph("graph");

Viewer viewer = graph.display(false);

SpringBox layout = new SpringBox();
layout.setStabilizationLimit(
0.0);
viewer.enableAutoLayout(
layout);

Generator gen = new RandomGenerator(6);
gen.addSink(graph);
gen.begin();
for (int i = 0; i < 100; i++) {
    gen.nextEvents();
}
gen.end();
/* ==============================
==== */

Best regards.



2013/9/24 Jacob M. H. Smith <jacob.m.h.smith AT gmail.com>

Hi.

I have tried that, but it does not seem to work. Maybe I am still doing something wrong.

Are there some layout algorithms that don't support this setting?

Here's my code (the graph always freezes after a few seconds):

/* ================================== */
Graph graph = new MultiGraph("graph");

Viewer viewer = graph.display();
SpringBox layout = new SpringBox();
layout.setStabilizationLimit(0.0);
viewer.enableAutoLayout(layout);

Generator gen = new RandomGenerator(6);
gen.addSink(graph);
gen.begin();
for (int i = 0; i < 100; i++) {
    gen.nextEvents();
}
gen.end();
/* ================================== */

Best regards,
Jacob


On Sep 22, 2013, at 5:42 PM, Guilhelm Savin <guilhelm.savin AT gmail.com> wrote:

> Hi,
>
> You just have to set the stabilization limit to 0.0
> layout.setStabilizationLimit(0.0);
>
> Regards.
> Guilhelm
>
> "Jacob M. H. Smith" <jacob.m.h.smith AT gmail.com> a écrit :
>
>> Hi.
>>
>> When I enable automatic layout in a viewer, the layout algorithm always stops when the nodes have sufficiently stabilized. Can I configure the viewer or layout so that it never stops and the layout algorithm runs continuously?
>>
>> Best regard,
>> Jacob
>>




--
Guilhelm Savin
PhD Student of Computer Science




Archives gérées par MHonArc 2.6.16.

Top of page