GraphStream Users

Archives de la liste Aide


Re: Make Layout Algorithm Run Continuously


Chronologique Discussions 
  • From: guilhelm savin <guilhelm.savin AT gmail.com>
  • To: "Jacob M. H. Smith" <jacob.m.h.smith AT gmail.com>
  • Cc: "graphstream-users AT litislab.fr" <graphstream-users AT litislab.fr>
  • Subject: Re: Make Layout Algorithm Run Continuously
  • Date: Tue, 24 Sep 2013 09:17:19 +0200

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