Skip to content

Commit 12eb5cb

Browse files
committed
Build with unzipJSON
1 parent 3a627fb commit 12eb5cb

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

build/jsroot.js

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const version_id = 'dev',
1212

1313
/** @summary version date
1414
* @desc Release date in format day/month/year like '14/04/2022' */
15-
version_date = '23/09/2025',
15+
version_date = '24/09/2025',
1616

1717
/** @summary version id and date
1818
* @desc Produced by concatenation of {@link version_id} and {@link version_date}
@@ -86879,7 +86879,7 @@ class TPadPainter extends ObjectPainter {
8687986879
this.createAttFill({ attr: this.#pad });
8688086880

8688186881
if ((rect.width <= lmt) || (rect.height <= lmt)) {
86882-
if (this.getSnapId()) {
86882+
if (!this.hasSnapId()) {
8688386883
svg.style('display', 'none');
8688486884
console.warn(`Hide canvas while geometry too small w=${rect.width} h=${rect.height}`);
8688586885
}
@@ -122563,6 +122563,27 @@ function openFile(arg, opts) {
122563122563
return file._open();
122564122564
}
122565122565

122566+
/** @summary Unzip JSON string
122567+
* @desc Should be used for buffer produced with TBufferJSON::zipJSON() method
122568+
* @param tgtsize - original length of json string
122569+
* @param src - string with data returned by TBufferJSON::zipJSON
122570+
* @return {Promise} with unzipped string */
122571+
122572+
async function unzipJSON(tgtsize, src) {
122573+
const bindata = atob_func(src),
122574+
buf = new ArrayBuffer(bindata.length),
122575+
bufView = new DataView(buf);
122576+
for (let i = 0; i < bindata.length; i++)
122577+
bufView.setUint8(i, bindata.charCodeAt(i));
122578+
122579+
return R__unzip(bufView, tgtsize).then(resView => {
122580+
let resstr = '';
122581+
for (let i = 0; i < tgtsize; i++)
122582+
resstr += String.fromCharCode(resView.getUint8(i));
122583+
return resstr;
122584+
});
122585+
}
122586+
122566122587
// special way to assign methods when streaming objects
122567122588
addClassMethods(clTNamed, CustomStreamers[clTNamed]);
122568122589
addClassMethods(clTObjString, CustomStreamers[clTObjString]);
@@ -181271,7 +181292,7 @@ class RPadPainter extends RObjectPainter {
181271181292
this.createAttFill({ pattern: 1001, color: 0 });
181272181293

181273181294
if ((rect.width <= lmt) || (rect.height <= lmt)) {
181274-
if (this.getSnapId()) {
181295+
if (!this.hasSnapId()) {
181275181296
svg.style('display', 'none');
181276181297
console.warn(`Hide canvas while geometry too small w=${rect.width} h=${rect.height}`);
181277181298
}
@@ -184328,6 +184349,7 @@ exports.svgToImage = svgToImage;
184328184349
exports.toJSON = toJSON;
184329184350
exports.treeDraw = treeDraw;
184330184351
exports.treeProcess = treeProcess;
184352+
exports.unzipJSON = unzipJSON;
184331184353
exports.urlClassPrefix = urlClassPrefix;
184332184354
exports.version = version;
184333184355
exports.version_date = version_date;

changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1. Support dark mode when store images
1111
1. With 'Shift' key pressed whole graph is moved by dragging action
1212
1. Support `Xall` and `Yall` as projections width #340
13+
1. Implement `unzipJSON()` function for data embeding in jupyter
1314
1. Support reading TBranch from old ROOT files with custom streamers
1415
1. Upgrade three.js r174 -> r180
1516
1. Upgrade lil-gui.mjs 0.19.2 -> 0.20.0

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 = '23/09/2025',
7+
version_date = '24/09/2025',
88

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

0 commit comments

Comments
 (0)