Skip to content

Commit 7967032

Browse files
committed
Build with support of negative fNdivisions
1 parent b869daf commit 7967032

3 files changed

Lines changed: 17 additions & 8 deletions

File tree

build/jsroot.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const version_id = 'dev',
1414

1515
/** @summary version date
1616
* @desc Release date in format day/month/year like '14/04/2022' */
17-
version_date = '10/03/2026',
17+
version_date = '8/04/2026',
1818

1919
/** @summary version id and date
2020
* @desc Produced by concatenation of {@link version_id} and {@link version_date}
@@ -81644,8 +81644,12 @@ class JSRootMenu {
8164481644
addTAxisMenu(EAxisBits, painter, faxis, kind, axis_painter, frame_painter) {
8164581645
const is_gaxis = faxis._typename === clTGaxis;
8164681646

81647-
this.add('Divisions', () => this.input('Set Ndivisions', faxis.fNdivisions, 'int', 0).then(val => {
81648-
faxis.fNdivisions = val; painter.interactiveRedraw('pad', `exec:SetNdivisions(${val})`, kind);
81647+
this.add('Divisions', () => this.input('Set Ndivisions', is_gaxis ? faxis.fNdiv : faxis.fNdivisions, 'int').then(val => {
81648+
if (is_gaxis)
81649+
faxis.fNdiv = val;
81650+
else
81651+
faxis.fNdivisions = val;
81652+
painter.interactiveRedraw('pad', `exec:SetNdivisions(${val})`, kind);
8164981653
}));
8165081654

8165181655
if (kind !== 'v') {
@@ -82990,7 +82994,7 @@ const AxisPainterMethods = {
8299082994

8299182995
/** @summary Produce axis ticks */
8299282996
produceTicks(ndiv, ndiv2) {
82993-
if (!this.noticksopt) {
82997+
if (!this.noticksopt && !this.exact_ticks) {
8299482998
const total = ndiv * (ndiv2 || 1);
8299582999

8299683000
if (this.log)
@@ -83263,14 +83267,18 @@ class TAxisPainter extends ObjectPainter {
8326383267
else
8326483268
this.gr = this.func;
8326583269

83266-
delete this.format;// remove formatting func
83270+
delete this.format; // remove formatting func
8326783271

8326883272
let ndiv = 508;
8326983273
if (this.is_gaxis)
8327083274
ndiv = axis.fNdiv;
8327183275
else if (axis)
83272-
ndiv = axis.fNdivisions ? Math.max(axis.fNdivisions, 4) : 0;
83276+
ndiv = axis.fNdivisions;
8327383277

83278+
this.exact_ticks = ndiv < 0;
83279+
if (this.exact_ticks)
83280+
ndiv = Math.abs(ndiv);
83281+
ndiv = Math.max(ndiv, 4);
8327483282
this.nticks = ndiv % 100;
8327583283
this.nticks2 = (ndiv % 10000 - this.nticks) / 100;
8327683284
this.nticks3 = Math.floor(ndiv / 10000);

changes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121
1. Let define alternative draw function #378
2222
1. Implement padsN draw option for `THStack` and `TMultiGraph`
2323
1. Support custom click handler for `TGraph` https://root-forum.cern.ch/t/64744
24+
1. Correctly draw axis ticks when `fNdivisions` is negative
2425
1. Use `resvg-js` backend for PNG support in node.js #391, thanks to https://github.com/OmarMesqq
25-
1. Remove support for deprectaed `TH1K` class
2626
1. Introduce `settings.ServerTimeout` global timeout for THttpServer operations
2727
1. Let set custom color palette with `setColorPalette` function
2828
1. Upgrade three.js r180 -> r183
29+
1. Remove support for deprectaed `TH1K` class
2930
1. Fix - paint frame border mode/size from `TCanvas`
3031
1. Fix - interactivity for TH3 palette drawing #398
3132

modules/core.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const version_id = 'dev',
66

77
/** @summary version date
88
* @desc Release date in format day/month/year like '14/04/2022' */
9-
version_date = '10/03/2026',
9+
version_date = '8/04/2026',
1010

1111
/** @summary version id and date
1212
* @desc Produced by concatenation of {@link version_id} and {@link version_date}

0 commit comments

Comments
 (0)