TreeMap Haskell library

[Go back to Index]

TreeMap Haskell library

Overview

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.

Installation

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.

Usage of library

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

TreeMap Example

Usage of tools

There are two command included:

  1. dirmap
  2. xml2treemap

dirmap

TreeMap 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

xml2treemap

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

Examples

The box is folded/unfolded with clicking by mouse on the text label.

Linux source code dirmap

Linux source code dirmap

Hackage DB modules dirmap

Hackage DB modules dirmap

Ant Build XML with xml2treemap

Ant Build XML with xml2treemap

Download

Sources

Changes treemap-html

Changes treemap-html-tools