GraphStream Users

Archives de la liste Aide


dynamic size of nodes and FileSinkImages


Chronologique Discussions 
  • From: Lao Heike <laoheike AT gmail.com>
  • To: graphstream-users <graphstream-users AT litislab.fr>
  • Subject: dynamic size of nodes and FileSinkImages
  • Date: Wed, 9 May 2012 16:13:20 +0200

Hi (again),


I'm trying to model the dynamic of a graph in order to generate a video. So far, I managed to make a nice video thanks to graphstream (and your previous answer), but I would like to add more features.

One important feature I would like to see is the size of the node growing/shrinking depending on a given attribute of the node.

I played around with the stylesheet of the FileSinkImages. Unfortunately, I cannot access the "size" attribute of a node. It seems by default that the attributes list is empty...

When I set the size in the stylesheet of my FileSinkImages, for instance like this:
fsi.setStyleSheet("graph { padding: 50px; fill-color: black; }" + "node { fill-color: #3d5689; size: 0.1gu;}" + "edge { fill-color: white; }");

Then for a node SingleNode n = g.getNode("A"); I have:

n.getAttributeCount() is 0 and n.getAttributeKeySet() returns [].

However, it seems that all nodes in the generated images are of size 0.1gu...

How can I increase/decrease the size of the node based on some attribute in a dynamic way?

I'm aware of this tutorial: http://graphstream-project.org/doc/FAQ/The-graph-viewer/How-do-I-dynamically-change-color-and-size-in-the-viewer_1.1/

However, I want to do that based on a given attribute and for generating images.


Thanks for your help!



Archives gérées par MHonArc 2.6.16.

Top of page