Skip to content

Commit c045498

Browse files
committed
Fix logz on lego plots in v7
1 parent 6c81314 commit c045498

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

scripts/JSRoot.v7gpad.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,16 @@ JSROOT.define(['d3', 'painter'], (d3, jsrp) => {
513513
}
514514
}
515515

516+
/** @summary Return scale min */
517+
RAxisPainter.prototype.getScaleMin = function() {
518+
return this.func ? this.func.domain()[0] : 0;
519+
}
520+
521+
/** @summary Return scale max */
522+
RAxisPainter.prototype.getScaleMax = function() {
523+
return this.func ? this.func.domain()[1] : 0;
524+
}
525+
516526
/** @summary Provide label for axis value */
517527
RAxisPainter.prototype.formatLabels = function(d) {
518528
let indx = Math.round(d);

scripts/JSRoot.v7hist3d.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,8 +1001,8 @@ JSROOT.define(['d3', 'base3d', 'painter', 'latex', 'v7hist'], (d3, THREE, jsrp,
10011001
// reduced vertices
10021002
rvertices = [ new THREE.Vector3(0, 0, 0), new THREE.Vector3(0, 1, 0), new THREE.Vector3(1, 1, 0), new THREE.Vector3(1, 0, 0) ],
10031003
main = this.getFramePainter(),
1004-
axis_zmin = main.z_handle.gr.domain()[0],
1005-
axis_zmax = main.z_handle.gr.domain()[1],
1004+
axis_zmin = main.z_handle.getScaleMin(),
1005+
axis_zmax = main.z_handle.getScaleMax(),
10061006
zmin, zmax,
10071007
handle = this.prepareDraw({ rounding: false, use3d: true, extra: 1 }),
10081008
i1 = handle.i1, i2 = handle.i2, j1 = handle.j1, j2 = handle.j2, di = handle.stepi, dj = handle.stepj,
@@ -1524,7 +1524,7 @@ JSROOT.define(['d3', 'base3d', 'painter', 'latex', 'v7hist'], (d3, THREE, jsrp,
15241524
i, j, x1, y1, x2, y2, z11, z12, z21, z22,
15251525
di = handle.stepi, dj = handle.stepj,
15261526
numstepi = handle.i2 - handle.i1, numstepj = handle.j2 - handle.j1,
1527-
axis_zmin = main.z_handle.gr.domain()[0];
1527+
axis_zmin = main.z_handle.getScaleMin();
15281528

15291529
if (di > 1) {
15301530
numstepi = Math.round(numstepi/di);
@@ -1945,8 +1945,8 @@ JSROOT.define(['d3', 'base3d', 'painter', 'latex', 'v7hist'], (d3, THREE, jsrp,
19451945
let main = this.getFramePainter(),
19461946
histo = this.getHisto(),
19471947
handle = this.prepareDraw({ rounding: false, use3d: true, extra: 1 }),
1948-
zmin = main.z_handle.gr.domain()[0],
1949-
zmax = main.z_handle.gr.domain()[1],
1948+
zmin = main.z_handle.getScaleMin(),
1949+
zmax = main.z_handle.getScaleMax(),
19501950
i, j, binz, binerr, x1, y1, x2, y2, z1, z2,
19511951
nsegments = 0, lpos = null, binindx = null, lindx = 0,
19521952
di = handle.stepi, dj = handle.stepj;
@@ -2054,8 +2054,8 @@ JSROOT.define(['d3', 'base3d', 'painter', 'latex', 'v7hist'], (d3, THREE, jsrp,
20542054
let histo = this.getHisto(),
20552055
palette = this.getHistPalette(),
20562056
pmain = this.getFramePainter(),
2057-
axis_zmin = pmain.z_handle.gr.domain()[0],
2058-
axis_zmax = pmain.z_handle.gr.domain()[1],
2057+
axis_zmin = pmain.z_handle.getScaleMin(),
2058+
axis_zmax = pmain.z_handle.getScaleMax(),
20592059
colindx, bin, i, len = histo.fBins.arr.length,
20602060
z0 = pmain.grz(axis_zmin), z1;
20612061

0 commit comments

Comments
 (0)