Skip to content

Commit 2513e4e

Browse files
committed
Changes in 7.7.1
1 parent cf95d79 commit 2513e4e

File tree

4 files changed

+105
-201
lines changed

4 files changed

+105
-201
lines changed

build/jsroot.js

Lines changed: 60 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ typeof define === 'function' && define.amd ? define(['exports'], factory) :
77

88
/** @summary version id
99
* @desc For the JSROOT release the string in format 'major.minor.patch' like '7.0.0' */
10-
const version_id = '7.7.0',
10+
const version_id = '7.7.1',
1111

1212
/** @summary version date
1313
* @desc Release date in format day/month/year like '14/04/2022' */
14-
version_date = '22/05/2024',
14+
version_date = '29/05/2024',
1515

1616
/** @summary version id and date
1717
* @desc Produced by concatenation of {@link version_id} and {@link version_date}
@@ -80781,7 +80781,7 @@ let TH1Painter$2 = class TH1Painter extends THistPainter {
8078180781
}
8078280782

8078380783
// final adjustment like in THistPainter.cxx line 7309
80784-
if (!this._exact_y_range && !pad_logy) {
80784+
if (!this._exact_y_range && !this._set_y_range && !pad_logy) {
8078580785
if ((this.options.BaseLine !== false) && (this.ymin >= 0))
8078680786
this.ymin = 0;
8078780787
else {
@@ -80805,17 +80805,22 @@ let TH1Painter$2 = class TH1Painter extends THistPainter {
8080580805
}
8080680806
}
8080780807

80808+
this._set_y_range = false;
80809+
8080880810
if ((hmin !== kNoZoom) && (hmax !== kNoZoom) && !this.draw_content &&
8080980811
((this.ymin === this.ymax) || (this.ymin > hmin) || (this.ymax < hmax))) {
8081080812
this.ymin = hmin;
8081180813
this.ymax = hmax;
80814+
this._set_y_range = true;
8081280815
} else {
8081380816
if (hmin !== kNoZoom) {
80817+
this._set_y_range = true;
8081480818
if (hmin < this.ymin)
8081580819
this.ymin = hmin;
8081680820
set_zoom = true;
8081780821
}
8081880822
if (hmax !== kNoZoom) {
80823+
this._set_y_range = true;
8081980824
if (hmax > this.ymax)
8082080825
this.ymax = hmax;
8082180826
set_zoom = true;
@@ -113179,11 +113184,14 @@ class TF1Painter extends TH1Painter$2 {
113179113184
pad = this.getPadPainter()?.getRootPad(true),
113180113185
logx = pad?.fLogx,
113181113186
gr = fp?.getGrFuncs(this.second_x, this.second_y);
113182-
let xmin = tf1.fXmin, xmax = tf1.fXmax;
113187+
let xmin = tf1.fXmin, xmax = tf1.fXmax, np = Math.max(tf1.fNpx, 100);
113183113188

113184113189
if (gr?.zoom_xmin !== gr?.zoom_xmax) {
113185-
xmin = Math.min(xmin, gr.zoom_xmin);
113186-
xmax = Math.max(xmax, gr.zoom_xmax);
113190+
const dx = (xmax - xmin) / np;
113191+
if ((xmin < gr.zoom_xmin) && (gr.zoom_xmin < xmax))
113192+
xmin = Math.max(xmin, gr.zoom_xmin - dx);
113193+
if ((xmin < gr.zoom_xmax) && (gr.zoom_xmax < xmax))
113194+
xmax = Math.min(xmax, gr.zoom_xmax + dx);
113187113195
}
113188113196

113189113197
this._use_saved_points = (tf1.fSave.length > 3) && (settings.PreferSavedPoints || (this.use_saved > 1));
@@ -113203,7 +113211,6 @@ class TF1Painter extends TH1Painter$2 {
113203113211
// this._use_saved_points = true;
113204113212

113205113213
if (!this._use_saved_points) {
113206-
const np = Math.max(tf1.fNpx, 100);
113207113214
let iserror = false;
113208113215

113209113216
if (!tf1.evalPar) {
@@ -113247,7 +113254,7 @@ class TF1Painter extends TH1Painter$2 {
113247113254
// in the case there were points have saved and we cannot calculate function
113248113255
// if we don't have the user's function
113249113256
if (this._use_saved_points) {
113250-
const np = tf1.fSave.length - 3;
113257+
np = tf1.fSave.length - 3;
113251113258
let custom_xaxis = null;
113252113259
xmin = tf1.fSave[np + 1];
113253113260
xmax = tf1.fSave[np + 2];
@@ -114676,16 +114683,24 @@ class TF2Painter extends TH2Painter {
114676114683
logx = pad?.fLogx, logy = pad?.fLogy,
114677114684
gr = fp?.getGrFuncs(this.second_x, this.second_y);
114678114685
let xmin = func.fXmin, xmax = func.fXmax,
114679-
ymin = func.fYmin, ymax = func.fYmax;
114686+
ymin = func.fYmin, ymax = func.fYmax,
114687+
npx = Math.max(func.fNpx, 20),
114688+
npy = Math.max(func.fNpy, 20);
114680114689

114681-
if (gr?.zoom_xmin !== gr?.zoom_xmax) {
114682-
xmin = Math.min(xmin, gr.zoom_xmin);
114683-
xmax = Math.max(xmax, gr.zoom_xmax);
114690+
if (gr?.zoom_xmin !== gr?.zoom_xmax) {
114691+
const dx = (xmax - xmin) / npx;
114692+
if ((xmin < gr.zoom_xmin) && (gr.zoom_xmin < xmax))
114693+
xmin = Math.max(xmin, gr.zoom_xmin - dx);
114694+
if ((xmin < gr.zoom_xmax) && (gr.zoom_xmax < xmax))
114695+
xmax = Math.min(xmax, gr.zoom_xmax + dx);
114684114696
}
114685114697

114686-
if (gr?.zoom_ymin !== gr?.zoom_ymax) {
114687-
ymin = Math.min(ymin, gr.zoom_ymin);
114688-
ymax = Math.max(ymax, gr.zoom_ymax);
114698+
if (gr?.zoom_ymin !== gr?.zoom_ymax) {
114699+
const dy = (ymax - ymin) / npy;
114700+
if ((ymin < gr.zoom_ymin) && (gr.zoom_ymin < ymax))
114701+
ymin = Math.max(ymin, gr.zoom_ymin - dy);
114702+
if ((ymin < gr.zoom_ymax) && (gr.zoom_ymax < ymax))
114703+
ymax = Math.min(ymax, gr.zoom_ymax + dy);
114689114704
}
114690114705

114691114706
const ensureBins = (nx, ny) => {
@@ -114703,8 +114718,6 @@ class TF2Painter extends TH2Painter {
114703114718
delete this._fail_eval;
114704114719

114705114720
if (!this._use_saved_points) {
114706-
const npx = Math.max(func.fNpx, 20),
114707-
npy = Math.max(func.fNpy, 20);
114708114721
let iserror = false;
114709114722

114710114723
if (!func.evalPar && !proivdeEvalPar(func))
@@ -114746,10 +114759,10 @@ class TF2Painter extends TH2Painter {
114746114759
}
114747114760

114748114761
if (this._use_saved_points) {
114762+
npx = Math.round(func.fSave[nsave+4]);
114763+
npy = Math.round(func.fSave[nsave+5]);
114749114764
const xmin = func.fSave[nsave], xmax = func.fSave[nsave+1],
114750114765
ymin = func.fSave[nsave+2], ymax = func.fSave[nsave+3],
114751-
npx = Math.round(func.fSave[nsave+4]),
114752-
npy = Math.round(func.fSave[nsave+5]),
114753114766
dx = (xmax - xmin) / npx,
114754114767
dy = (ymax - ymin) / npy;
114755114768
function getSave(x, y) {
@@ -115018,21 +115031,33 @@ class TF3Painter extends TH2Painter {
115018115031
gr = fp?.getGrFuncs(this.second_x, this.second_y);
115019115032
let xmin = func.fXmin, xmax = func.fXmax,
115020115033
ymin = func.fYmin, ymax = func.fYmax,
115021-
zmin = func.fZmin, zmax = func.fZmax;
115034+
zmin = func.fZmin, zmax = func.fZmax,
115035+
npx = Math.max(func.fNpx, 20),
115036+
npy = Math.max(func.fNpy, 20),
115037+
npz = Math.max(func.fNpz, 20);
115022115038

115023-
if (gr?.zoom_xmin !== gr?.zoom_xmax) {
115024-
xmin = Math.min(xmin, gr.zoom_xmin);
115025-
xmax = Math.max(xmax, gr.zoom_xmax);
115039+
if (gr?.zoom_xmin !== gr?.zoom_xmax) {
115040+
const dx = (xmax - xmin) / npx;
115041+
if ((xmin < gr.zoom_xmin) && (gr.zoom_xmin < xmax))
115042+
xmin = Math.max(xmin, gr.zoom_xmin - dx);
115043+
if ((xmin < gr.zoom_xmax) && (gr.zoom_xmax < xmax))
115044+
xmax = Math.min(xmax, gr.zoom_xmax + dx);
115026115045
}
115027115046

115028-
if (gr?.zoom_ymin !== gr?.zoom_ymax) {
115029-
ymin = Math.min(ymin, gr.zoom_ymin);
115030-
ymax = Math.max(ymax, gr.zoom_ymax);
115047+
if (gr?.zoom_ymin !== gr?.zoom_ymax) {
115048+
const dy = (ymax - ymin) / npy;
115049+
if ((ymin < gr.zoom_ymin) && (gr.zoom_ymin < ymax))
115050+
ymin = Math.max(ymin, gr.zoom_ymin - dy);
115051+
if ((ymin < gr.zoom_ymax) && (gr.zoom_ymax < ymax))
115052+
ymax = Math.min(ymax, gr.zoom_ymax + dy);
115031115053
}
115032115054

115033-
if (gr?.zoom_zmin !== gr?.zoom_zmax) {
115034-
zmin = Math.min(zmin, gr.zoom_zmin);
115035-
zmax = Math.max(zmax, gr.zoom_zmax);
115055+
if (gr?.zoom_zmin !== gr?.zoom_zmax) {
115056+
// no need for dz here - TH2 is not binned over Z axis
115057+
if ((zmin < gr.zoom_zmin) && (gr.zoom_zmin < zmax))
115058+
zmin = gr.zoom_zmin;
115059+
if ((zmin < gr.zoom_zmax) && (gr.zoom_zmax < zmax))
115060+
zmax = gr.zoom_zmax;
115036115061
}
115037115062

115038115063
const ensureBins = (nx, ny) => {
@@ -115056,9 +115081,6 @@ class TF3Painter extends TH2Painter {
115056115081
delete this._fail_eval;
115057115082

115058115083
if (!this._use_saved_points) {
115059-
const npx = Math.max(func.fNpx, 20),
115060-
npy = Math.max(func.fNpy, 20),
115061-
npz = Math.max(func.fNpz, 20);
115062115084
let iserror = false;
115063115085

115064115086
if (!func.evalPar && !proivdeEvalPar(func))
@@ -115106,12 +115128,12 @@ class TF3Painter extends TH2Painter {
115106115128
xmin = func.fSave[nsave]; xmax = func.fSave[nsave+1];
115107115129
ymin = func.fSave[nsave+2]; ymax = func.fSave[nsave+3];
115108115130
zmin = func.fSave[nsave+4]; zmax = func.fSave[nsave+5];
115109-
const npx = Math.round(func.fSave[nsave+6]),
115110-
npy = Math.round(func.fSave[nsave+7]),
115111-
npz = Math.round(func.fSave[nsave+8]),
115112-
// dx = (xmax - xmin) / npx,
115113-
// dy = (ymax - ymin) / npy,
115114-
dz = (zmax - zmin) / npz;
115131+
npx = Math.round(func.fSave[nsave+6]);
115132+
npy = Math.round(func.fSave[nsave+7]);
115133+
npz = Math.round(func.fSave[nsave+8]);
115134+
// dx = (xmax - xmin) / npx,
115135+
// dy = (ymax - ymin) / npy,
115136+
const dz = (zmax - zmin) / npz;
115115115137

115116115138
ensureBins(npx + 1, npy + 1);
115117115139

changes.md

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

3+
## Changes in 7.7.1
4+
1. Fix - properly select TF1 range after zooming
5+
2. Fix - TH1 y-range selection
6+
3. Fix - add 'gl' and svg2pdf-related packages to dependencies in package.json
7+
8+
39
## Changes in 7.7.0
410
1. Let plot current time, file creation or modification time with `&optdate=[1,2,3]` URL parameters
511
2. Let plot file name, full file name or item name with `&optfile=[1,2,3]` URL parameters

modules/core.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/** @summary version id
22
* @desc For the JSROOT release the string in format 'major.minor.patch' like '7.0.0' */
3-
const version_id = '7.7.0',
3+
const version_id = '7.7.1',
44

55
/** @summary version date
66
* @desc Release date in format day/month/year like '14/04/2022' */
7-
version_date = '22/05/2024',
7+
version_date = '29/05/2024',
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)