Forums

Full Version: html labels for svn flare
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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:

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.
Good morning Puzuma,

thanks a lot for sharing, highly appreciated.
I am not using the svn trunk at the moment but your post makes me curious checking it out. Is it running stable?

Cheers

martin
Hi Martin,

34all Wrote:I am not using the svn trunk at the moment but your post makes me curious checking it out. Is it running stable?

I have adapted a couple of my experimental scripts and eveything runs smooth, now I'm starting a project which will take some time to complete so I decided to start using the last libraries, till now I haven't found any bug.

Bye

Puzuma (aka Stefano)
Reference URL's