@@ -278,7 +278,8 @@ class TH1Painter extends THistPainter {
278
278
for ( i = left ; i < right ; ++ i ) {
279
279
xx = xaxis . GetBinCoord ( i + 0.5 ) ;
280
280
281
- if ( cond && ! cond ( xx ) ) continue ;
281
+ if ( cond && ! cond ( xx ) )
282
+ continue ;
282
283
283
284
if ( profile ) {
284
285
w = histo . fBinEntries [ i + 1 ] ;
@@ -350,10 +351,13 @@ class TH1Painter extends THistPainter {
350
351
/** @summary Fill stat box */
351
352
fillStatistic ( stat , dostat , dofit ) {
352
353
// no need to refill statistic if histogram is dummy
353
- if ( this . isIgnoreStatsFill ( ) ) return false ;
354
+ if ( this . isIgnoreStatsFill ( ) )
355
+ return false ;
354
356
355
- if ( dostat === 1 ) dostat = 1111 ;
356
- if ( dofit === 1 ) dofit = 111 ;
357
+ if ( dostat === 1 )
358
+ dostat = 1111 ;
359
+ if ( dofit === 1 )
360
+ dofit = 111 ;
357
361
358
362
const histo = this . getHisto ( ) ,
359
363
print_name = dostat % 10 ,
@@ -417,7 +421,8 @@ class TH1Painter extends THistPainter {
417
421
stat . addText ( `Kurtosis = ${ stat . format ( data . kurtx ) } ` ) ;
418
422
}
419
423
420
- if ( dofit ) stat . fillFunctionStat ( this . findFunction ( clTF1 ) , dofit , 1 ) ;
424
+ if ( dofit )
425
+ stat . fillFunctionStat ( this . findFunction ( clTF1 ) , dofit , 1 ) ;
421
426
422
427
return true ;
423
428
}
@@ -440,9 +445,11 @@ class TH1Painter extends THistPainter {
440
445
xaxis = histo . fXaxis ,
441
446
show_text = o . Text ;
442
447
let text_col , text_angle , text_size ,
443
- side = ( o . BarStyle > 10 ) ? o . BarStyle % 10 : 0 , pr = Promise . resolve ( ) ;
448
+ side = ( o . BarStyle > 10 ) ? o . BarStyle % 10 : 0 ,
449
+ pr = Promise . resolve ( ) ;
444
450
445
- if ( side > 4 ) side = 4 ;
451
+ if ( side > 4 )
452
+ side = 4 ;
446
453
const gry2 = this . getBarBaseline ( funcs , height ) ;
447
454
448
455
if ( show_text ) {
@@ -463,14 +470,16 @@ class TH1Painter extends THistPainter {
463
470
const x1 = xaxis . GetBinLowEdge ( i + 1 ) ,
464
471
x2 = xaxis . GetBinLowEdge ( i + 2 ) ;
465
472
466
- if ( funcs . logx && ( x2 <= 0 ) ) continue ;
473
+ if ( funcs . logx && ( x2 <= 0 ) )
474
+ continue ;
467
475
468
476
let grx1 = Math . round ( funcs . grx ( x1 ) ) ,
469
477
grx2 = Math . round ( funcs . grx ( x2 ) ) ,
470
478
w = grx2 - grx1 ;
471
479
const y = histo . getBinContent ( i + 1 ) ;
472
480
473
- if ( funcs . logy && ( y < funcs . scale_ymin ) ) continue ;
481
+ if ( funcs . logy && ( y < funcs . scale_ymin ) )
482
+ continue ;
474
483
const gry1 = Math . round ( funcs . gry ( y ) ) ;
475
484
476
485
grx1 += Math . round ( histo . fBarOffset / 1000 * w ) ;
@@ -535,7 +544,8 @@ class TH1Painter extends THistPainter {
535
544
536
545
for ( let i = left ; i < right ; ++ i ) {
537
546
const x = histo . fXaxis . GetBinCoord ( i + 0.5 ) ;
538
- if ( funcs . logx && ( x <= 0 ) ) continue ;
547
+ if ( funcs . logx && ( x <= 0 ) )
548
+ continue ;
539
549
const grx = Math . round ( funcs . grx ( x ) ) ,
540
550
y = histo . getBinContent ( i + 1 ) ,
541
551
yerrs = this . getBinErrors ( histo , i + 1 , y ) ;
@@ -982,7 +992,8 @@ class TH1Painter extends THistPainter {
982
992
}
983
993
} else {
984
994
tips . push ( `bin = ${ bin + 1 } ` , `x = ${ xlbl } ` ) ;
985
- if ( histo . $baseh ) cont -= histo . $baseh . getBinContent ( bin + 1 ) ;
995
+ if ( histo . $baseh )
996
+ cont -= histo . $baseh . getBinContent ( bin + 1 ) ;
986
997
if ( cont === Math . round ( cont ) )
987
998
tips . push ( `entries = ${ cont } ` ) ;
988
999
else
@@ -1092,7 +1103,8 @@ class TH1Painter extends THistPainter {
1092
1103
show_rect = ! this . isTF1 ( ) ;
1093
1104
1094
1105
let msize = 3 ;
1095
- if ( this . markeratt ) msize = Math . max ( msize , this . markeratt . getFullSize ( ) ) ;
1106
+ if ( this . markeratt )
1107
+ msize = Math . max ( msize , this . markeratt . getFullSize ( ) ) ;
1096
1108
1097
1109
if ( o . Error ) {
1098
1110
const cont = histo . getBinContent ( findbin + 1 ) ,
@@ -1104,7 +1116,7 @@ class TH1Painter extends THistPainter {
1104
1116
if ( ( cont === 0 ) && this . isTProfile ( ) )
1105
1117
findbin = null ;
1106
1118
1107
- const dx = ( grx2 - grx1 ) * o . errorX ;
1119
+ const dx = ( grx2 - grx1 ) * o . errorX ;
1108
1120
grx1 = Math . round ( midx - dx ) ;
1109
1121
grx2 = Math . round ( midx + dx ) ;
1110
1122
}
@@ -1115,12 +1127,14 @@ class TH1Painter extends THistPainter {
1115
1127
gry1 = Math . min ( gry1 , midy - msize ) ;
1116
1128
gry2 = Math . max ( gry2 , midy + msize ) ;
1117
1129
1118
- if ( ! pnt . touch && ( pnt . nproc === 1 ) )
1119
- if ( ( pnt_y < gry1 ) || ( pnt_y > gry2 ) ) findbin = null ;
1130
+ if ( ! pnt . touch && ( pnt . nproc === 1 ) ) {
1131
+ if ( ( pnt_y < gry1 ) || ( pnt_y > gry2 ) )
1132
+ findbin = null ;
1133
+ }
1120
1134
} else {
1121
1135
// if histogram alone, use old-style with rects
1122
1136
// if there are too many points at pixel, use circle
1123
- show_rect = ( pnt . nproc === 1 ) && ( right - left < width ) ;
1137
+ show_rect = ( pnt . nproc === 1 ) && ( right - left < width ) ;
1124
1138
1125
1139
if ( show_rect ) {
1126
1140
gry2 = height ;
@@ -1188,7 +1202,7 @@ class TH1Painter extends THistPainter {
1188
1202
1189
1203
res . menu = res . exact ; // one could show context menu when histogram is selected
1190
1204
// distance to middle point, use to decide which menu to activate
1191
- res . menu_dist = Math . sqrt ( ( midx - pnt_x ) ** 2 + ( midy - pnt_y ) ** 2 ) ;
1205
+ res . menu_dist = Math . sqrt ( ( midx - pnt_x ) ** 2 + ( midy - pnt_y ) ** 2 ) ;
1192
1206
} else {
1193
1207
const radius = this . lineatt . width + 3 ;
1194
1208
@@ -1251,8 +1265,9 @@ class TH1Painter extends THistPainter {
1251
1265
rebinHist ( sz ) {
1252
1266
const histo = this . getHisto ( ) ,
1253
1267
xaxis = histo . fXaxis ,
1254
- nbins = Math . floor ( xaxis . fNbins / sz ) ;
1255
- if ( nbins < 2 ) return ;
1268
+ nbins = Math . floor ( xaxis . fNbins / sz ) ;
1269
+ if ( nbins < 2 )
1270
+ return ;
1256
1271
1257
1272
const arr = new Array ( nbins + 2 ) ,
1258
1273
xbins = xaxis . fXbins . length ? new Array ( nbins ) : null ;
@@ -1298,13 +1313,15 @@ class TH1Painter extends THistPainter {
1298
1313
const dist = right - left ,
1299
1314
histo = this . getHisto ( ) ;
1300
1315
1301
- if ( ( dist === 0 ) || ! histo ) return ;
1316
+ if ( ( dist === 0 ) || ! histo )
1317
+ return ;
1302
1318
1303
1319
// first find minimum
1304
1320
let min = histo . getBinContent ( left + 1 ) ;
1305
1321
for ( let indx = left ; indx < right ; ++ indx )
1306
1322
min = Math . min ( min , histo . getBinContent ( indx + 1 ) ) ;
1307
- if ( min > 0 ) return ; // if all points positive, no chance for auto-scale
1323
+ if ( min > 0 )
1324
+ return ; // if all points positive, no chance for auto-scale
1308
1325
1309
1326
while ( ( left < right ) && ( histo . getBinContent ( left + 1 ) <= min ) ) ++ left ;
1310
1327
while ( ( left < right ) && ( histo . getBinContent ( right ) <= min ) ) -- right ;
@@ -1322,9 +1339,11 @@ class TH1Painter extends THistPainter {
1322
1339
canZoomInside ( axis , min , max ) {
1323
1340
const histo = this . getHisto ( ) ;
1324
1341
1325
- if ( ( axis === 'x' ) && histo && ( histo . fXaxis . FindBin ( max , 0.5 ) - histo . fXaxis . FindBin ( min , 0 ) > 1 ) ) return true ;
1342
+ if ( ( axis === 'x' ) && histo && ( histo . fXaxis . FindBin ( max , 0.5 ) - histo . fXaxis . FindBin ( min , 0 ) > 1 ) )
1343
+ return true ;
1326
1344
1327
- if ( ( axis === 'y' ) && ( Math . abs ( max - min ) > Math . abs ( this . ymax - this . ymin ) * 1e-6 ) ) return true ;
1345
+ if ( ( axis === 'y' ) && ( Math . abs ( max - min ) > Math . abs ( this . ymax - this . ymin ) * 1e-6 ) )
1346
+ return true ;
1328
1347
1329
1348
return false ;
1330
1349
}
0 commit comments