Posted in: javascript infovis toolkit , visualization

TM . Squarified . implement ({ leafBox : function ( json , coord ) { var config = this . config ; var backgroundColor = config . Color . allow && this . setColor ( json ), offst = config . offset , width = coord . width - offst , height = coord . height - offst ; var c = { 'top' : ( offst / 2 ) + "px" , 'height' : height + "px" , 'width' : width + "px" , 'left' : ( offst / 2 ) + "px" }; if ( backgroundColor ) c [ 'background-color' ] = backgroundColor ; //Add an image to our leaf node to create a cushion treemap. var img = "<img src='gradient.png' style='position:absolute; z-index:2; top:0; left:0; width:" + c . width + "; height:" + c . height + "'; />" ; return "<div class='leaf' style=" + this . toStyle ( c ) + ">" + img + json . name + "</div>" ; } });