Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RTreeMapPainter.hxx
Go to the documentation of this file.
1/// \file ROOT/RTreeMapPainter.hxx
2/// \ingroup TreeMap ROOT7
3/// \author Patryk Tymoteusz Pilichowski <patryk.tymoteusz.pilichowski@cern.ch>
4/// \date 2025-08-21
5/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6/// is welcome!
7
8/*************************************************************************
9 * Copyright (C) 1995-2025, Rene Brun and Fons Rademakers. *
10 * All rights reserved. *
11 * *
12 * For the licensing terms see $ROOTSYS/LICENSE. *
13 * For the list of contributors see $ROOTSYS/README/CREDITS. *
14 *************************************************************************/
15
16#ifndef TTREEMAP_HXX
17#define TTREEMAP_HXX
18
19#include "RTreeMapBase.hxx"
20
21#include "TROOT.h"
22#include "TObject.h"
23#include "TCanvas.h"
24#include "TPad.h"
25
26#include <vector>
27
28namespace ROOT::Experimental {
29class RNTupleInspector;
30
31// clang-format off
32/**
33\class ROOT::Experimental::RTreeMapPainter
34\ingroup TreeMap
35\brief Logic for drawing a treemap on a TVirtualPad
36
37One can visualize an RNTuple in a TCanvas as a treemap like this:
38~~~ {.cpp}
39auto tm = RTreeMapPainter::ImportRNTuple("file.root", "ntuple_name");
40auto c = new TCanvas("c_tm","TreeMap");
41c->Add(tm.release());
42~~~
43*/
44// clang-format on
46public:
47 /////////////////////////////////////////////////////////////////////////////
48 /// \brief Logic for converting an RNTuple to RTreeMapPainter given RNTupleInspector
49 static std::unique_ptr<RTreeMapPainter> ImportRNTuple(const ROOT::Experimental::RNTupleInspector &insp);
50
51 /////////////////////////////////////////////////////////////////////////////
52 /// \brief Logic for converting an RNTuple to RTreeMapPainter given file and tuple names
53 static std::unique_ptr<RTreeMapPainter> ImportRNTuple(std::string_view sourceFileName, std::string_view tupleName);
54
56 public:
58 };
59 RTreeMapPainter() = default;
60 void Paint(Option_t *opt) override;
61
63
64 ~RTreeMapPainter() override = default;
65
66private:
67 /////////////////////////////////////////////////////////////////////////////
68 /// \brief Logic for drawing a box on TVirtualPad
69 void AddBox(const Rect &rect, const RGBColor &color, float borderWidth) const final;
70
71 /////////////////////////////////////////////////////////////////////////////
72 /// \brief Logic for drawing a text on TVirtualPad
73 void AddText(const Vec2 &pos, const std::string &content, float size, const RGBColor &color = RGBColor(0, 0, 0),
74 bool alignCenter = false) const final;
75};
76} // namespace ROOT::Experimental
77#endif
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
#define ClassDef(name, id)
Definition Rtypes.h:344
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t rect
Inspect on-disk and storage-related information of an RNTuple.
Base logic for drawing a treemap visualization.
Logic for drawing a treemap on a TVirtualPad.
void Paint(Option_t *opt) override
This method must be overridden if a class wants to paint itself.
void AddText(const Vec2 &pos, const std::string &content, float size, const RGBColor &color=RGBColor(0, 0, 0), bool alignCenter=false) const final
Logic for drawing a text on TVirtualPad.
void AddBox(const Rect &rect, const RGBColor &color, float borderWidth) const final
Logic for drawing a box on TVirtualPad.
static std::unique_ptr< RTreeMapPainter > ImportRNTuple(const ROOT::Experimental::RNTupleInspector &insp)
Logic for converting an RNTuple to RTreeMapPainter given RNTupleInspector.
Mother of all ROOT objects.
Definition TObject.h:41