Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::RTreeMapBase Class Referenceabstract

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< NodefNodes
 

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>

Inheritance diagram for ROOT::Experimental::RTreeMapBase:
[legend]

Constructor & Destructor Documentation

◆ RTreeMapBase()

ROOT::Experimental::RTreeMapBase::RTreeMapBase ( )
default

◆ ~RTreeMapBase()

virtual ROOT::Experimental::RTreeMapBase::~RTreeMapBase ( )
virtualdefault

Member Function Documentation

◆ AddBox()

virtual void ROOT::Experimental::RTreeMapBase::AddBox ( const Rect & rect,
const RGBColor & color,
float borderWidth = 0.15f ) const
protectedpure virtual

Logic for drawing a box.

Implemented in ROOT::Experimental::RTreeMapPainter.

◆ AddText()

virtual void ROOT::Experimental::RTreeMapBase::AddText ( const Vec2 & pos,
const std::string & content,
float size,
const RGBColor & color = RGBColor(0, 0, 0),
bool alignCenter = false ) const
protectedpure virtual

Logic for drawing a text.

Implemented in ROOT::Experimental::RTreeMapPainter.

◆ DrawLegend()

void RTreeMapBase::DrawLegend ( ) const
protected

Logic for drawing the legend of leaf types.

Definition at line 156 of file RTreeMapBase.cxx.

◆ DrawTreeMap()

void RTreeMapBase::DrawTreeMap ( const Node & elem,
RTreeMapBase::Rect rect,
int depth ) const
protected

Logic for drawing the entirety of the treemap.

Definition at line 191 of file RTreeMapBase.cxx.

Member Data Documentation

◆ fNodes

std::vector<Node> ROOT::Experimental::RTreeMapBase::fNodes

Definition at line 68 of file RTreeMapBase.hxx.

  • gui/treemap/inc/ROOT/RTreeMapBase.hxx
  • gui/treemap/src/RTreeMapBase.cxx