Base logic for drawing a treemap visualization.
A treemap can be used for analyzing a hierarchical data structure whose elements have a certain size. It visualizes this hierarchical data as nested rectangles which allows for easy comparison of proportions within categories, but also the whole structure. The squarification algorithm is used to make these rectangles as close to squares as possible for visual clarity.
Furthermore, we assume that each node has a type and that the size of a non-leaf node equals to the total size of its children. This allows for drawing a legend of types of leaf nodes, and see which types occupy how much of the total space.
Note: this visualization class/technique is independent/unrelated to TTree
.
Definition at line 42 of file RTreeMapBase.hxx.
Classes | |
struct | Node |
struct | Rect |
struct | RGBColor |
struct | Vec2 |
Public Member Functions | |
RTreeMapBase ()=default | |
virtual | ~RTreeMapBase ()=default |
Public Attributes | |
std::vector< Node > | fNodes |
Protected Member Functions | |
virtual void | AddBox (const Rect &rect, const RGBColor &color, float borderWidth=0.15f) const =0 |
Logic for drawing a box. | |
virtual void | AddText (const Vec2 &pos, const std::string &content, float size, const RGBColor &color=RGBColor(0, 0, 0), bool alignCenter=false) const =0 |
Logic for drawing a text. | |
void | DrawLegend () const |
Logic for drawing the legend of leaf types. | |
void | DrawTreeMap (const Node &elem, Rect rect, int depth) const |
Logic for drawing the entirety of the treemap. | |
#include <ROOT/RTreeMapBase.hxx>
|
default |
|
virtualdefault |
|
protectedpure virtual |
Logic for drawing a box.
Implemented in ROOT::Experimental::RTreeMapPainter.
|
protectedpure virtual |
Logic for drawing a text.
Implemented in ROOT::Experimental::RTreeMapPainter.
|
protected |
Logic for drawing the legend of leaf types.
Definition at line 156 of file RTreeMapBase.cxx.
|
protected |
Logic for drawing the entirety of the treemap.
Definition at line 191 of file RTreeMapBase.cxx.
std::vector<Node> ROOT::Experimental::RTreeMapBase::fNodes |
Definition at line 68 of file RTreeMapBase.hxx.