GraphStream Users

Archives de la liste Aide


Re: Edge Label derived from Attribute


Chronologique Discussions 
  • From: guilhelm savin <guilhelm.savin AT gmail.com>
  • To: graphstream-users AT litislab.fr, Benjamin Klatt <klatt AT fzi.de>
  • Subject: Re: Edge Label derived from Attribute
  • Date: Thu, 27 Dec 2012 17:55:12 +0100

Hi Benjamin,

And welcome to GraphStream.
There is actually no feature to directly do what you need, but .... we can cheat with the viewer, making a custom pipe.

I've just made this code that do what you need here (it's really quick&dirty but it works) : https://gist.github.com/4389549

Regards.



2012/12/27 Benjamin Klatt <klatt AT fzi.de>

Dear all,

 

I would like to work with a graph with edges storing a custom attribute. Now, I would like to use the value of this attribute as a label in the graph viewer. If the attribute is null, the label of the “ui.label” attribute should be used as it is by default.

 

I checked working with a derived Node class but none of the following is possible:

-        getAttribute(key) to customize the behavior if the key is “ui.label” or “label”

-        getLabel(key) is also a wrapper for getAttribute(key)

 

I understood, that the GraphicNode respectively the GraphicElement class read all attributes at once to pick up the “ui.label”/”label” one.

I don’t want to override the getAttributes() method in my custom node type to manipulate the returned list because I am not sure if this might become a performance issue.

 

So can you give any best practice how to modify the getLabel() method of the GraphicElement class to provide a custom behavior?

When I call graph.display() I do not see any hook to influence the behavior.

 

Thanks in advanced and all the best

Benjamin

 

....................................................................

Dipl.-Inform. Benjamin Klatt

Software Engineering (SE)

 

FZI Forschungszentrum Informatik

Haid-und-Neu-Str. 10–14

76131 Karlsruhe, Germany

Tel. +49 721 9654-690
Fax +49 721 9654-691

 

klatt AT fzi.de

www.fzi.de

....................................................................

Forschungszentrum Informatik (FZI) an der Universität Karlsruhe

Stiftung des bürgerlichen Rechts

Stiftung Az: 14-0563.1 Regierungspräsidium Karlsruhe

Vorstand: Dipl. Wi.-Ing. Michael Flor, Prof. Dr. Ralf Reussner,

Prof. Dr. Rudi Studer, Prof. Dr.-Ing. J. Marius Zöllner         

Vorsitzender des Kuratoriums: Ministerialdirigent Günther Leßnerkraus

 




--
Guilhelm Savin
PhD Student of Computer Science



Archives gérées par MHonArc 2.6.16.

Top of page