[Go back to Index]
treemap-html is Haskell library and few small tools for construction foldable HTML tree maps. For the details please look on Wikipedia Treemapping
I work on rewrite it from the scratch since the first version could be considered like a fast&dirty implementation without usable interface.
The best is to use HackageDB, the GHC 6.10.x and newer is required.
If you don't want install complete Haskell platform, see dirmap.exe and xml2treemap.exe.
$ cabal install treemap-html
$ cabal install treemap-html-tools
Please be aware that it is still ALPHA quality software.
The function treeMap takes the Data.Tree with the String nodes and render it to the String with HTML elements.
Simple example which explain it:
import Text.HTML.TreeMap
import Data.Tree
exampleTree :: Tree String
exampleTree = Node "Slovakia" [
Node "Bratislava" [
Node "Petrzalka" []
],
Node "Zilina" [
Node "Hajik" [
Node "Mr. Cirman" []
]
]
]
main = putStrLn (treeMap exampleTree)
In Firefox and unfolded (by clicking on the labels):

TreeMap Example
There are two command included:
dirmapxml2treemapTreeMap from the directory listing.
Usage:
Usage: dirmap [OPTION...] directory
-v --verbose verbose output on stderr
-l Integer --level=Integer maxlevel for recursive directory listing
-n Integer --name=Integer maximum size of filename. than truncation.
-o FILE --output=FILE output FILE
-f --files include files in listing
-e do not included subtrees without files
Example usage:
$ dirmap -f -n 1000 -l 2 -o libs_l2.html /usr/lib
The TreeMAP from the the XML element tree.
Usage:
Usage: xml2treemap [OPTION...] <input file.xml>
-v --verbose verbose output on stderr
-o FILE --output=FILE output FILE
Example usage:
$ xml2treemap -o map.xml /usr/share/dbus-1/interfaces/org.kde.KWin.xml
The box is folded/unfolded with clicking by mouse on the text label.

Linux source code dirmap

Hackage DB modules dirmap

Ant Build XML with xml2treemap