Calendar

February 2010
M T W T F S S
« Jan    
1234567
891011121314
15161718192021
22232425262728

BlogMalaysia.com

Labeling node (Labeler)

This simple code will add labeler on the nodes, I’m doing this under “private function visualize(data:Data):void”

vis.data.nodes.setProperties({
“size”: 2,
“fillColor” : 0xffff0000,
“buttonMode” : true,
“filters” : [new DropShadowFilter(7)]
});

//var k:int = 0;
//vis.data.nodes.visit(function(ns:NodeSprite):void {
//    ns.data.label = “Nodes ” + k++;      – - – If you want to put different than in the dataset.
//});

var lan:Labeler = new Labeler(”data.ip_src”,Data.NODES,fmt);
vis.operators.add(lan);
vis.operators.add(new NodeLinkTreeLayout(”topToBottom”,5,5,10));

var fmt:TextFormat = new TextFormat();
fmt.font = “Arial”;
fmt.color = 0×000022;
fmt.size = 17;
fmt.bold = true;

as seen in the code, this will resulted labeler for “data.ip_src”, for source of IP..

labeler

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>