Skip to content

Commit

Permalink
Build with TProfile2D fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
linev committed Jun 10, 2024
1 parent 0c663f1 commit 7e482c3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
20 changes: 11 additions & 9 deletions build/jsroot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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,
Expand All @@ -76905,17 +76904,14 @@ 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),
histo.fYaxis.GetBinCoord(j + 0.5))) continue;

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) {
Expand Down Expand Up @@ -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)
Expand All @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/core.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 7e482c3

Please sign in to comment.