Skip to content

Commit 49ad827

Browse files
committed
By default expand RNTuple - like TTree
1 parent 7167dad commit 49ad827

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
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), draw: () => import('./draw/RNTuple.mjs').then(h => h.drawRNTuple), pm: true },
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), dflt: 'expand', pm: true },
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/gui/HierarchyPainter.mjs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,8 @@ class HierarchyPainter extends BasePainter {
16001600
let upcnt = d3_select(node).property('upcnt') || 1;
16011601
while (upcnt-- > 0)
16021602
hitem = hitem?._parent;
1603-
if (!hitem) return;
1603+
if (!hitem)
1604+
return;
16041605
itemname = this.itemFullName(hitem);
16051606
d3cont = d3_select(hitem?._d3cont || null);
16061607
place = kPM;
@@ -1617,11 +1618,12 @@ class HierarchyPainter extends BasePainter {
16171618
const prnt = hitem._parent, indx = prnt._childs.indexOf(hitem),
16181619
d3chlds = d3_select(d3cont.node().parentNode);
16191620

1620-
if (indx < 0) return console.error('internal error');
1621+
if (indx < 0)
1622+
return console.error('internal error');
16211623

16221624
prnt._show_limit = (prnt._show_limit || settings.HierarchyLimit) * 2;
16231625

1624-
for (let n = indx+1; n < prnt._childs.length; ++n) {
1626+
for (let n = indx + 1; n < prnt._childs.length; ++n) {
16251627
const chld = prnt._childs[n];
16261628
chld._parent = prnt;
16271629
if (!this.addItemHtml(chld, d3chlds, n)) break; // if too many items, skip rest
@@ -1636,7 +1638,8 @@ class HierarchyPainter extends BasePainter {
16361638
prnt = prnt._parent;
16371639
}
16381640

1639-
if (!place) place = 'item';
1641+
if (!place)
1642+
place = 'item';
16401643
const selector = (hitem._kind === getKindForType(clTKey) && hitem._more) ? 'noinspect' : '',
16411644
sett = getDrawSettings(hitem._kind, selector), handle = sett.handle;
16421645

@@ -1671,7 +1674,8 @@ class HierarchyPainter extends BasePainter {
16711674
if (handle?.execute)
16721675
return this.executeCommand(itemname, node.parentNode);
16731676

1674-
if (handle?.ignore_online && this.isOnlineItem(hitem)) return;
1677+
if (handle?.ignore_online && this.isOnlineItem(hitem))
1678+
return;
16751679

16761680
const dflt_expand = (this.default_by_click === kExpand);
16771681
let can_draw = hitem._can_draw,
@@ -1680,7 +1684,8 @@ class HierarchyPainter extends BasePainter {
16801684

16811685
if (evnt.shiftKey) {
16821686
drawopt = handle?.shift || kInspect;
1683-
if (isStr(drawopt) && (drawopt.indexOf(kInspect) === 0) && handle?.noinspect) drawopt = '';
1687+
if (isStr(drawopt) && (drawopt.indexOf(kInspect) === 0) && handle?.noinspect)
1688+
drawopt = '';
16841689
}
16851690
if (evnt.ctrlKey && handle?.ctrl)
16861691
drawopt = handle.ctrl;
@@ -1723,7 +1728,8 @@ class HierarchyPainter extends BasePainter {
17231728
if (getTypeForKind(hitem._kind) && sett.inspect && (can_draw !== false))
17241729
return this.display(itemname, kInspect, null, true);
17251730

1726-
if (!hitem._childs || (hitem === this.h)) return;
1731+
if (!hitem._childs || (hitem === this.h))
1732+
return;
17271733
}
17281734

17291735
if (hitem._isopen)

0 commit comments

Comments
 (0)