GraphStream Users

Archives de la liste Aide

Re: Flickering while adding nodes

Chronologique Discussions 
  • From: Eduardo Lidanski <eduardo.lidanski AT>
  • To: guilhelm savin <guilhelm.savin AT>, "graphstream-users AT" <graphstream-users AT>
  • Subject: Re: Flickering while adding nodes
  • Date: Mon, 25 Nov 2013 03:24:22 +0100

Thanks a lot! I will test it and tell you if I have any more problems.


Am 24.11.2013 12:01, schrieb guilhelm savin:
Hi Eduardo,

Yes, it's a big issue in fact. GraphicGraph transforms the edgeAttributeChanged event into a edgeAttributeRemoved so after the second call to addAttribute(), the "ui.color" attribute is removed.
It's now fixed on the github repository.

Thanks for reporting this bug and sorry for the late reply.


2013/11/24 Eduardo Lidanski <eduardo.lidanski AT>

is this an issue with the library or did I understand something wrong? I still cannot correctly set the style of the edges in version 1.3 although I tried different approaches.

Thank you,

Am 15.11.2013 15:56, schrieb Eduardo Lidanski:
Hi Antoine,

thank you for the fix. I tested with the 1.3 release from today and it seems to work better. But with the upgrade from 1.2 -> 1.3 I got a new problem related with the css file, so I cannot tell for 100% sure that the problem is gone.
Attached a testcase.
The node AB should change the color to black and stay black, since g.getEdge("AB").setAttribute("ui.color", 1); is called repeatedly. But it becomes white again and stays white?!
With release 1.2 the behaviour is different (and correct), so something changed with release 1.3.

Thank you

public class Test {

    public static void main(String args[]) {

        DefaultGraph g = new DefaultGraph("Graph");
        try {

                    StyleConverter.convert(new File("test.css")));
        } catch (IOException e) {
            System.err.println("CSS File not found");




        g.addEdge("AB", "A", "B");

        g.addEdge("AC", "A", "C");

        g.addEdge("BC", "B", "C");

        while (true) {
            try {
            } catch (InterruptedException e) {
            g.getEdge("AB").setAttribute("ui.color", 1);



edge {
    fill-mode: dyn-plain;
    fill-color: white, black;
    size: 1px;
    arrow-shape: arrow;


Am 14.11.2013 12:14, schrieb Antoine Dutot:
I Eduardo,

The last commit should improve things. It will be available as downloadable packages tomorrow in the nightly builds :

Please could you test it and tell us if it works ?


2013/11/13 Eduardo Lidanski <eduardo.lidanski AT>

attached are three screenshots. When the node 18 is added, the graph becomes smaller, then bigger again (after the edge is added). I hope with the images it is easy to understand what is the problem.

Thank you

Am 13.11.2013 17:18, schrieb Eduardo Lidanski:


I have a graph where I add nodes constantly and after some few time after each graph.addNode() operation I add an edge of the node.
So I have:
Node n = graph.addNode()
//some time passes
Edge n_a = graph.addEdge()

Normally, the time between adding the node and adding its edge is less than 1 second, but in my application I cannot know that for advance, since it is possible that no edge is being added.
it works well, but each time a node is added, the whole graph flickers ... so it is very annoying.
I think that is because the node adds itself at the upper right corner of the graph, a second after that it adds its edge, and this causes the flickering.
But do you know what can I do to prevent the flickering ?
I tried to create a thread that adds the node and the edge together after 1 second if an edge has been found in that second. If not, it adds the node alone. This prevents the flickering, but is not good for my application.
What else could I do?

I noticed the node appears at the very far end up, so the graph becomes for a small second very small, and then the graph appears with its normal size again. I think the node is appearing veeery far away, that is why the graph changes its actual size for a second. How can I limit this?


Guilhelm Savin
PhD Student of Computer Science

Archives gérées par MHonArc 2.6.16.

Top of page