Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arpit/treemaps
An open source ActionScript 3 library for generating Squarified Treemaps.
https://github.com/arpit/treemaps
Last synced: about 2 months ago
JSON representation
An open source ActionScript 3 library for generating Squarified Treemaps.
- Host: GitHub
- URL: https://github.com/arpit/treemaps
- Owner: arpit
- Created: 2010-02-09T05:36:50.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2011-07-30T00:03:11.000Z (over 13 years ago)
- Last Synced: 2024-08-04T05:05:29.297Z (5 months ago)
- Language: ActionScript
- Homepage:
- Size: 102 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.mdown
Awesome Lists containing this project
- awesome-actionscript-sorted - treemaps - An open source ActionScript 3 library for generating Squarified Treemaps. (Unsorted / Other API)
README
***README***
An open source ActionScript 3 library for generating Squarified Treemaps. The library is based on the algorithm by Mark Bruls, Kees Huizing, and Jarke J. van Wijk from the Eindhoven University of Technology, Dept. of Mathematics and Computer Science,The Netherlands. The paper can be found here: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.36.6685&rep=rep1&type=pdf
The library was used to build the DiggGraphr application mentioned here:
http://infosthetics.com/archives/2009/01/digggraphr_digg_stories_in_a_treemap.html**Usage:**
The example below uses a MapItem class that implements the ITreeMapData interface.
The weight property on that interface is used to generate the relative size of the individual rectanglesCustom renderers can be used to draw the rectangles by extending the Treemap class and overriding the draw function.
package
{
import com.arpitonline.treemap.TreeMap;import flash.display.Sprite;
import flash.events.Event;public class SampleTreemapProject extends Sprite
{private var tm:TreeMap = new TreeMap();
public function SampleTreemapProject()
{
stage.scaleMode = "noScale";
stage.align = "TL";tm.setSize(stage.stageWidth, stage.stageHeight);
var dp:Array = [];
for(var i:int = 0; i < 5; i++){
var i1:MapItem = new MapItem("Item_"+i, 4 );
dp.push(i1);}
tm.dataProvider = dp;
addChild(tm);stage.addEventListener(Event.RESIZE, onStageResize);
}
private function onStageResize(event:Event):void{
tm.setSize(stage.stageWidth, stage.stageHeight);
tm.layout();
}
}
}import com.arpitonline.treemap.ITreeMapData;
class MapItem implements ITreeMapData{
private var _label:String;
private var _weight:Number
public function MapItem(label:String, weight:Number){
_label = label;
_weight = weight;
}public function get weight():Number{
return _weight;
}
}