Unit Treemap
Description
Squarified treemap component for the VCL.
This unit implements TTreeMap, a TGraphicControl descendant that renders a set of weighted items as a squarified treemap: nested rectangles whose areas are proportional to each item's TTreeMapItem.Size and whose aspect ratios are kept as close to square as possible for readability.
The public model consists of three cooperating types:
TTreeMapItem – a single node, carrying a size/weight, caption, colors and an optional list of child nodes.
TTreeMapContainer – an owning, size-sorted list of items; the control's TTreeMap.Items property is such a container.
TTreeMap – the visual control that lays the items out, paints them and tracks hovering, selection and clicks.
Custom rendering is possible through TTreeMap.OnDrawItem; when no handler is assigned an internal default painter is used.
Overview
Classes, Interfaces, Objects and Records
| Name | Description |
|---|---|
Class TTreeMap |
A control that displays weighted items as a squarified treemap. |
Class TTreeMapContainer |
An owning, size-sorted list of TTreeMapItem instances. |
Class TTreeMapItem |
A single node in a treemap: a weighted, captioned rectangle. |
Functions and Procedures
procedure Register; |
Types
TTreeMapItemState = (...); |
TTreeMapItemStates = set of TTreeMapItemState; |
TOnDrawTreeMapItemEvent = procedure( Sender: TObject; Canvas: TCanvas; Item: TTreeMapItem; State: TTreeMapItemStates; var Area: TRect) of object; |
TOnTreeMapItemClickEvent = procedure( Sender: TObject; Item: TTreeMapItem; Button: TMouseButton; State: TTreeMapItemStates ) of object; |
Description
Functions and Procedures
procedure Register; |
|
Registers TTreeMap on the "Fasko" component palette page. |
Types
TTreeMapItemState = (...); |
|
State flags describing how a TTreeMapItem is to be painted. They are passed as a set to draw handlers (TOnDrawTreeMapItemEvent) and click handlers (TOnTreeMapItemClickEvent). Values
|
TTreeMapItemStates = set of TTreeMapItemState; |
|
A set of TTreeMapItemState flags describing an item's paint state. |
TOnDrawTreeMapItemEvent = procedure( Sender: TObject; Canvas: TCanvas; Item: TTreeMapItem; State: TTreeMapItemStates; var Area: TRect) of object; |
|
Custom-draw event for a single treemap item. Assign a handler to TTreeMap.OnDrawItem to take over painting of items. Parameters
|
TOnTreeMapItemClickEvent = procedure( Sender: TObject; Item: TTreeMapItem; Button: TMouseButton; State: TTreeMapItemStates ) of object; |
|
Click and double-click event for a treemap item. Used by both TTreeMap.OnClickItem and TTreeMap.OnDblClickItem. Parameters
|
Author
Created
26.07.2026
Last Modified
26.07.2026
Generated by PasDoc 1.0.4.