25using namespace std::string_literals;
30 std::unique_ptr<Browsable::RHolder>
fObject;
38 fViewer.SetShowHierarchy(
false);
39 fViewer.SetCallback([
this](
const std::string &canvas_name) {
46 std::string
GetKind()
const override {
return "tree"s; }
50 bool DrawElement(std::shared_ptr<Browsable::RElement> &elem,
const std::string & =
"")
override
55 auto obj = elem->GetObject();
59 auto tree = obj->Get<
TTree>();
69 TTree *new_tree =
nullptr;
70 std::string expr = elem->GetContent(
"tree");
72 auto branch = obj->Get<
TBranch>();
73 auto leaf = obj->Get<
TLeaf>();
79 expr = branch->GetFullName().Data();
81 new_tree = leaf->GetBranch()->
GetTree();
84 }
else if (browsable) {
90 if (!new_tree || expr.empty())
93 if (new_tree != tree) {
94 fObject = std::make_unique<Browsable::TObjectHolder>(new_tree);
99 return fViewer.SuggestExpression(expr);
110 std::shared_ptr<RBrowserWidget>
Create(
const std::string &
name)
final
112 return std::make_shared<RBrowserTreeWidget>(
name);
std::shared_ptr< RBrowserWidget > Create(const std::string &name) final
~RBrowserTreeProvider() override=default
@ kActTree
can be shown in tree viewer
bool ActivateWidget(const std::string &title, const std::string &kind="")
Activate widget in RBrowser One should specify title and (optionally) kind of widget like "tcanvas" o...
Web-based ROOT TTree viewer.
A TTree is a list of TBranches.
virtual TString GetFullName() const
Return the 'full' name of the branch.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
TBranch * GetBranch() const
const char * GetName() const override
Returns name of object.
const char * Data() const
A TTree represents a columnar dataset.
virtual TTree * GetTree() const
TVirtualBranchBrowsable is a base class (not really abstract, but useless by itself) for helper objec...