Skip to content

Commit 285d798

Browse files
committed
[jsroot] dev 18/09/2025
1. RNtuple support, thanks to Kriti Mahajan (https://github.com/Krmjn09) 1. Implement RTreeMapPainter to display RNTuple structure, thanks to Patryk Pilichowski (https://github.com/magnustymoteus) 1. Support reading TBranch from old ROOT files with custom streamers 1. Fix - TTree::Draw with strings 1. Fix - first color in palette drawing #365 1. Fix - toggle vertical/horizontal palette via context menu
1 parent 1406061 commit 285d798

22 files changed

+4896
-1869
lines changed

js/build/jsroot.js

Lines changed: 2966 additions & 1199 deletions
Large diffs are not rendered by default.

js/changes.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
# JSROOT changelog
22

3+
34
## Changes in dev
4-
1. Use ES6 modules to implement geoworker, enable node.js usage
5+
1. RNtuple support, thanks to Kriti Mahajan (https://github.com/Krmjn09)
6+
1. Implement RTreeMapPainter to display RNTuple structure, thanks to Patryk Pilichowski (https://github.com/magnustymoteus)
57
1. Let use hex colors in histogram draw options like "fill_00ff00" or "line_77aa1166"
68
1. Let configure exact axis ticks position via draw option like "xticks:[-3,-1,1,3]"
79
1. Support gStyle.fBarOffset for `TGraph` bar drawing
810
1. Support "fill_<id>" and "line_<id>" draw options for `TGraph`
911
1. Support dark mode when store images
1012
1. With 'Shift' key pressed whole graph is moved by dragging action
1113
1. Support `Xall` and `Yall` as projections width #340
12-
1. Upgrade three.js r174 -> r177
14+
1. Support reading TBranch from old ROOT files with custom streamers
15+
1. Upgrade three.js r174 -> r180
1316
1. Upgrade lil-gui.mjs 0.19.2 -> 0.20.0
14-
1. Remove experimental RHist classes, deprecated in ROOT
17+
1. Use ES6 modules to implement geoworker, enable node.js usage
18+
1. Remove countGeometryFaces function - use numGeometryFaces instead
19+
1. Remove experimental RHist classes, deprecated in ROOT 6.38
1520
1. Internal - ws members are private, new methods has to be used
1621
1. Fix - ticks size and labels with kMoreLogLabels axis bit
1722
1. Fix - reading TLeafC leafs
1823
1. Fix - support BigInt in object inspector
1924
1. Fix - svg2pdf.js URL bounding box
25+
1. Fix - TTree::Draw with strings
26+
1. Fix - first color in palette drawing #365
27+
1. Fix - toggle vertical/horizontal palette via context menu
2028

2129

2230
## Changes in 7.9.1

js/modules/base/colors.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ function getRGBfromTColor(col) {
105105
function getGrayColors(rgb_array) {
106106
const gray_colors = [];
107107

108-
if (!rgb_array) rgb_array = getRootColors();
108+
if (!rgb_array)
109+
rgb_array = getRootColors();
109110

110111
for (let n = 0; n < rgb_array.length; ++n) {
111112
if (!rgb_array[n]) continue;

js/modules/core.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const version_id = 'dev',
44

55
/** @summary version date
66
* @desc Release date in format day/month/year like '14/04/2022' */
7-
version_date = '4/07/2025',
7+
version_date = '18/09/2025',
88

99
/** @summary version id and date
1010
* @desc Produced by concatenation of {@link version_id} and {@link version_date}

js/modules/draw.mjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,22 @@ drawFuncs = { lst: [
121121
{ name: 'TEveGeoShapeExtract', sameas: clTGeoVolume, opt: ';more;all;count;projx;projz;wire;dflt' },
122122
{ name: nsREX+'REveGeoShapeExtract', sameas: clTGeoVolume, opt: ';more;all;count;projx;projz;wire;dflt' },
123123
{ name: 'TGeoOverlap', sameas: clTGeoVolume, opt: ';more;all;count;projx;projz;wire;dflt', dflt: 'dflt', ctrl: 'expand' },
124-
{ name: 'TGeoManager', sameas: clTGeoVolume, opt: ';more;all;count;projx;projz;wire;tracks;no_screen;dflt', dflt: 'expand', ctrl: 'dflt', noappend: true, exapnd_after_draw: true },
124+
{ name: 'TGeoManager', sameas: clTGeoVolume, opt: ';more;all;count;projx;projz;wire;tracks;no_screen;dflt', dflt: 'expand', pm: true, ctrl: 'dflt', noappend: true, exapnd_after_draw: true },
125125
{ name: 'TGeoVolumeAssembly', sameas: clTGeoVolume, /* icon: 'img_geoassembly', */ opt: ';more;all;count' },
126126
{ name: /^TGeo/, class: () => import_geo().then(h => h.TGeoPainter), get_expand: () => import_geo().then(h => h.expandGeoObject), opt: ';more;all;axis;compa;count;projx;projz;wire;no_screen;dflt', dflt: 'dflt', ctrl: 'expand' },
127127
{ name: 'TAxis3D', icon: 'img_graph', draw: () => import_geo().then(h => h.drawAxis3D), direct: true },
128128
// these are not draw functions, but provide extra info about correspondent classes
129129
{ name: 'kind:Command', icon: 'img_execute', execute: true },
130130
{ name: 'TFolder', icon: 'img_folder', icon2: 'img_folderopen', noinspect: true, get_expand: () => import_h().then(h => h.folderHierarchy) },
131131
{ name: 'TTask', icon: 'img_task', get_expand: () => import_h().then(h => h.taskHierarchy), for_derived: true },
132-
{ name: clTTree, icon: 'img_tree', get_expand: () => import('./tree.mjs').then(h => h.treeHierarchy), draw: () => import_tree().then(h => h.drawTree), dflt: 'expand', opt: 'player;testio', shift: kInspect },
132+
{ name: clTTree, icon: 'img_tree', get_expand: () => import('./tree.mjs').then(h => h.treeHierarchy), draw: () => import_tree().then(h => h.drawTree), dflt: 'expand', opt: 'player;testio', shift: kInspect, pm: true },
133133
{ name: 'TNtuple', sameas: clTTree },
134134
{ name: 'TNtupleD', sameas: clTTree },
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) },
139-
{ name: 'ROOT::RNTupleField', icon: 'img_leaf', opt: 'inspect', ctrl: 'inspect' },
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 },
139+
{ 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 },
142142
{ name: clTObjArray, sameas: clTList },
@@ -162,7 +162,8 @@ drawFuncs = { lst: [
162162
{ name: nsREX+'RPaveText', icon: 'img_pavetext', class: () => import_v7('pave').then(h => h.RPaveTextPainter), opt: '' },
163163
{ name: nsREX+'RFrame', icon: 'img_frame', draw: () => import_v7().then(h => h.drawRFrame), opt: '' },
164164
{ name: nsREX+'RFont', icon: 'img_text', draw: () => import_v7().then(h => h.drawRFont), opt: '', direct: 'v7', csstype: 'font' },
165-
{ name: nsREX+'RAxisDrawable', icon: 'img_frame', draw: () => import_v7().then(h => h.drawRAxis), opt: '' }
165+
{ name: nsREX+'RAxisDrawable', icon: 'img_frame', draw: () => import_v7().then(h => h.drawRAxis), opt: '' },
166+
{ name: nsREX+'RTreeMapPainter', class: () => import('./draw/RTreeMapPainter.mjs').then(h => h.RTreeMapPainter), opt: '' }
166167
], cache: {} };
167168

168169

js/modules/draw/RNTuple.mjs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { isStr } from '../core.mjs';
2+
import { treeDrawProgress } from './TTree.mjs';
3+
import { rntupleDraw } from '../rntuple.mjs';
4+
5+
/** @summary function called from draw()
6+
* @desc just envelope for real TTree::Draw method which do the main job
7+
* Can be also used for the branch and leaf object
8+
* @private */
9+
async function drawRNTuple(dom, obj, opt) {
10+
const args = {};
11+
let tuple;
12+
13+
if (obj?.$tuple) {
14+
// case of fictional ROOT::RNTupleField
15+
tuple = obj.$tuple;
16+
args.expr = obj._name;
17+
if (isStr(opt) && opt.indexOf('dump') === 0)
18+
args.expr += '>>' + opt;
19+
else if (opt)
20+
args.expr += opt;
21+
} else {
22+
tuple = obj;
23+
args.expr = opt;
24+
}
25+
26+
if (!tuple)
27+
throw Error('No RNTuple object available for drawing');
28+
29+
console.log('expression', args.expr);
30+
31+
args.drawid = dom;
32+
33+
args.progress = treeDrawProgress.bind(args);
34+
35+
return rntupleDraw(tuple, args).then(res => args.progress(res, true));
36+
}
37+
38+
export { drawRNTuple };

0 commit comments

Comments
 (0)