A treemap paints a list of data as rectangles in the graphics window, where each rectangle has area proportional to its value. Rectangles at top left are the largest, and at bottom right, the smallest. Such a display makes it obvious which are the largest items and their relative sizes.
The squarified algorithm is used, see Wikipedia.
Colors can indicate other attributes, e.g. if the data has both negative and positive values, then red/green could indicate sign. When data is all positive or all negative, then color could indicate parent. A hotkey might toggle through different color schemes.
Moving the mouse over a rectangle can display information for that cell.
Treemap Verb - the treemap verb can be used to display simple treemaps from the J ijx window, see:
- Verb - the treemap verb
Documentation - for using treemap in an application
- Options - treemap options
- Events - event handling for treemap
- Class - main treemap class
- Algorithms - calculating the layout
Download the treemap addon, then enter:
Press New Run to generate a new set of random data. Resize the display to see that the arrangement of rectangles changes to match the window size. Note that information is displayed as the mouse is moved over the rectangles.
Contributed by Chris Burke.