From 7e482c3709037c9bca8d723f1e5eb53719173f60 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Mon, 10 Jun 2024 10:14:19 +0200 Subject: [PATCH] Build with TProfile2D fixes --- build/jsroot.js | 20 +++++++++++--------- changes.md | 1 + modules/core.mjs | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/build/jsroot.js b/build/jsroot.js index ca729791f..f36453888 100644 --- a/build/jsroot.js +++ b/build/jsroot.js @@ -11,7 +11,7 @@ const version_id = 'dev', /** @summary version date * @desc Release date in format day/month/year like '14/04/2022' */ -version_date = '7/06/2024', +version_date = '10/06/2024', /** @summary version id and date * @desc Produced by concatenation of {@link version_id} and {@link version_date} @@ -76887,7 +76887,6 @@ let TH2Painter$2 = class TH2Painter extends THistPainter { color = this.getColor(histo.fMarkerColor), rotate = -1*this.options.TextAngle, draw_g = this.draw_g.append('svg:g').attr('class', 'th2_text'), - profile2d = this.matchObjectType(clTProfile2D) && isFunc(histo.getBinEntries), show_err = (this.options.TextKind === 'E'), latex = (show_err && !this.options.TextLine) ? 1 : 0; let x, y, width, height, @@ -76905,7 +76904,7 @@ let TH2Painter$2 = class TH2Painter extends THistPainter { for (let i = handle.i1; i < handle.i2; ++i) { const binw = handle.grx[i+1] - handle.grx[i]; for (let j = handle.j1; j < handle.j2; ++j) { - let binz = histo.getBinContent(i+1, j+1); + const binz = histo.getBinContent(i+1, j+1); if ((binz === 0) && !this._show_empty_bins) continue; if (test_cutg && !test_cutg.IsInside(histo.fXaxis.GetBinCoord(i + 0.5), @@ -76913,9 +76912,6 @@ let TH2Painter$2 = class TH2Painter extends THistPainter { const binh = handle.gry[j] - handle.gry[j+1]; - if (profile2d) - binz = histo.getBinEntries(i+1, j+1); - let text = (binz === Math.round(binz)) ? binz.toString() : floatToString(binz, gStyle.fPaintTextFormat); if (show_err) { @@ -78019,7 +78015,8 @@ let TH2Painter$2 = class TH2Painter extends THistPainter { /** @summary Provide text information (tooltips) for histogram bin */ getBinTooltips(i, j) { - const histo = this.getHisto(); + const histo = this.getHisto(), + profile2d = this.matchObjectType(clTProfile2D) && isFunc(histo.getBinEntries); let binz = histo.getBinContent(i+1, j+1); if (histo.$baseh) @@ -78029,13 +78026,18 @@ let TH2Painter$2 = class TH2Painter extends THistPainter { 'x = ' + this.getAxisBinTip('x', histo.fXaxis, i), 'y = ' + this.getAxisBinTip('y', histo.fYaxis, j), `bin = ${histo.getBin(i+1, j+1)} x: ${i+1} y: ${j+1}`, - 'entries = ' + ((binz === Math.round(binz)) ? binz : floatToString(binz, gStyle.fStatFormat))]; + 'content = ' + ((binz === Math.round(binz)) ? binz : floatToString(binz, gStyle.fStatFormat))]; - if ((this.options.TextKind === 'E') || this.matchObjectType(clTProfile2D)) { + if ((this.options.TextKind === 'E') || profile2d) { const errz = histo.getBinError(histo.getBin(i+1, j+1)); lines.push('error = ' + ((errz === Math.round(errz)) ? errz.toString() : floatToString(errz, gStyle.fPaintTextFormat))); } + if (profile2d) { + const entries = histo.getBinEntries(i+1, j+1); + lines.push('entries = ' + ((entries === Math.round(entries)) ? entries : floatToString(entries, gStyle.fStatFormat))); + } + return lines; } diff --git a/changes.md b/changes.md index 1a21c1f27..d4129e10b 100644 --- a/changes.md +++ b/changes.md @@ -7,6 +7,7 @@ 4. Fix - properly handle zooming in THStack histogram 5. Fix - properly save zoomed ranges in drawingJSON() 6. Fix - always show all ticks for labeled axis +7. Fix - draw TProfile2D bins content as text, not entrie ## Changes in 7.7.1 diff --git a/modules/core.mjs b/modules/core.mjs index 38017a9ca..92136ebb2 100644 --- a/modules/core.mjs +++ b/modules/core.mjs @@ -4,7 +4,7 @@ const version_id = 'dev', /** @summary version date * @desc Release date in format day/month/year like '14/04/2022' */ -version_date = '7/06/2024', +version_date = '10/06/2024', /** @summary version id and date * @desc Produced by concatenation of {@link version_id} and {@link version_date}