11-07-2008, 11:19 AM
hi everybody,
I'm following this fantastic forum for a while and I finally found the time to contribute something back.
The svn version of flare contains a Labeler class which simplifies the use of labels on nodes. Unfortunately it does not permit to set htmlText, so I hacked up a quick solution: HtmlLabeler that extended the Labeler adding some support for flash HTML.
Here is a almost complete example of using it:
the class containing this code should implement a nodeLabel method that returns the HTML string to be displayed on each node:
Any comment and suggestion will be welcome.
I'm following this fantastic forum for a while and I finally found the time to contribute something back.
The svn version of flare contains a Labeler class which simplifies the use of labels on nodes. Unfortunately it does not permit to set htmlText, so I hacked up a quick solution: HtmlLabeler that extended the Labeler adding some support for flash HTML.
Here is a almost complete example of using it:
Code:
/* Initialize labeler */
var ll:HtmlLabeler = new HtmlLabeler(nodeLabel, Data.NODES, textFormat);
/* set bounding box */
ll.width = boxWidth;
ll.height = boxHeight;
/* set some css */
var css:StyleSheet = ll.css;
var body:Object = new Object();
body.fontFamily = "Arial";
body.fontSize = 9;
css.setStyle("body", body);
/* set textmode to smooth rendering */
ll.textMode = 0;
/* add it to visualization */
vis.operators.add( ll );the class containing this code should implement a nodeLabel method that returns the HTML string to be displayed on each node:
Code:
public function nodeLabel( d:DataSprite ):String {
return "<body><p><b>LABEL</b></p><p>IN HTML !!!</p></body>";
}Any comment and suggestion will be welcome.