GraphStream Users

Archives de la liste Aide


Re: changement de couleurs


Chronologique Discussions 
  • From: guilhelm savin <guilhelm.savin AT gmail.com>
  • To: graphstream-users AT litislab.fr
  • Subject: Re: changement de couleurs
  • Date: Tue, 5 Jul 2011 15:22:07 +0200

It is also possible to use more than two colors
in fill-color :

-- CSS --
node {
fill-color: white, blue, red;
fill-mode : dyn-plain;
}
---------

-- CODE --
n1.setAttribute("ui.color", 0); // white
n2.setAttribute("ui.color", 0.25); // between white and blue
n3.setAttribute("ui.color", 0.5); // blue
n4.setAttribute("ui.color", 1); // red
----------



2011/7/5 Yoann Pign <yoann.pigne AT gmail.com>
Hi,

I guess it's possible, using classes.

String styleSheet = "" +
"node.dynamic_color {" +
" fill-mode: dyn-plain;" +
" fill-color: white, blue;" +
"}"+
"node.static_color {" +
" fill-mode: plain;" +
" fill-color: red;" +
"}";

Graph g = new MultiGraph("ok");
g.addAttribute("stylesheet", styleSheet);

Node n1 = g.addNode("1");
n1.addAttribute("ui.class", "dynamic_color");
n1.addAttribute("ui.color", 0/6f);

Node n2 = g.addNode("2");
n2.addAttribute("ui.class", "static_color");



Cheers,
Yoann


On Jul 5, 2011, at 3:09 PM, <yaroslaw.dafflon AT edu.hefr.ch> <yaroslaw.dafflon AT edu.hefr.ch> wrote:

> bonjour,
>
> pour la cration de mon graphe jutilise fill-color: white, blue; dans le
> stylesheet puis je spcifie (e.setAttribute("ui.color", 0.2); // Couleur
> noeud) pour colorier les noeud
> je voulais savoir si il tait possible de colorier certains noeuds dans une
> autre couleur comme par exemple le rouge?
>
> merci
>
> salutations




--
Guilhelm Savin
PhD Student of Computer Science




Archives gérées par MHonArc 2.6.16.

Top of page