Skip to content

Commit d939f10

Browse files
committed
Let use expression directly with RNTuple
1 parent 88e5e55 commit d939f10

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

modules/draw.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ drawFuncs = { lst: [
135135
{ name: clTBranchFunc, icon: 'img_leaf_method', draw: () => import_tree().then(h => h.drawTree), opt: ';dump', noinspect: true },
136136
{ name: /^TBranch/, icon: 'img_branch', draw: () => import_tree().then(h => h.drawTree), dflt: 'expand', opt: ';dump', ctrl: 'dump', shift: kInspect, ignore_online: true, always_draw: true },
137137
{ name: /^TLeaf/, icon: 'img_leaf', noexpand: true, draw: () => import_tree().then(h => h.drawTree), opt: ';dump', ctrl: 'dump', ignore_online: true, always_draw: true },
138-
{ name: 'ROOT::RNTuple', icon: 'img_tree', get_expand: () => import('./rntuple.mjs').then(h => h.tupleHierarchy) },
138+
{ name: 'ROOT::RNTuple', icon: 'img_tree', get_expand: () => import('./rntuple.mjs').then(h => h.tupleHierarchy), draw: () => import('./draw/RNTuple.mjs').then(h => h.drawRNTuple) },
139139
{ name: 'ROOT::RNTupleField', icon: 'img_leaf', draw: () => import('./draw/RNTuple.mjs').then(h => h.drawRNTuple), opt: ';dump', ctrl: 'dump', shift: kInspect, ignore_online: true, always_draw: true },
140140
{ name: clTList, icon: 'img_list', draw: () => import_h().then(h => h.drawList), get_expand: () => import_h().then(h => h.listHierarchy), dflt: 'expand' },
141141
{ name: clTHashList, sameas: clTList },

modules/draw/RNTuple.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ async function drawRNTuple(dom, obj, opt) {
1717
args.expr += '>>' + opt;
1818
else if (opt)
1919
args.expr += opt;
20+
} else {
21+
tuple = obj;
22+
args.expr = opt;
2023
}
2124

2225
if (!tuple)

modules/tree.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,9 @@ class TDrawSelector extends TSelector {
982982
let expr = this.parseParameters(tree, args, args.expr), cut = '';
983983

984984
// parse option for histogram creation
985-
this.draw_title = `drawing '${expr}' from ${tree.fName}`;
985+
this.draw_title = `drawing '${expr}'`;
986+
if (tree?.fName)
987+
this.draw_title += `from ${tree.fName}`;
986988

987989
let pos;
988990
if (args.cut)
@@ -1062,7 +1064,7 @@ class TDrawSelector extends TSelector {
10621064
this.vars[0] = new TDrawVariable(this.globals);
10631065
if (!this.vars[0].parse(tree, this, expr, branch, args.direct_branch))
10641066
return false;
1065-
this.draw_title = `drawing branch ${branch.fName} ${expr?' expr:'+expr:''} from ${tree.fName}`;
1067+
this.draw_title = `drawing branch ${branch.fName} ${expr?' expr:'+expr:''} from ${tree.fName ?? ''}`;
10661068

10671069
this.cut = new TDrawVariable(this.globals);
10681070

0 commit comments

Comments
 (0)