Skip to content

Commit 0a5ee42

Browse files
committed
Format around ; f/g/h
1 parent 0cbc99f commit 0a5ee42

File tree

11 files changed

+164
-45
lines changed

11 files changed

+164
-45
lines changed

examples.htm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,8 @@ <h1><div><a href="https://root.cern/js/">JSROOT</a></div><a id="version" href="h
797797
jsonname = filepath + jsonname;
798798
} else {
799799
if ('file' in entry) {
800-
url = ''; filename = entry.file;
800+
url = '';
801+
filename = entry.file;
801802
if ((filename.indexOf('http:') < 0) && (filename.indexOf('https:') < 0))
802803
filename = filepath + filename;
803804
}

modules/base/TAttFillHandler.mjs

Lines changed: 114 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -205,43 +205,133 @@ class TAttFillHandler {
205205
id = `pat_${this.pattern}_${indx}`;
206206

207207
switch (this.pattern) {
208-
case 3001: w = h = 2; fills = 'M0,0h1v1h-1zM1,1h1v1h-1z'; break;
209-
case 3002: w = 4; h = 2; fills = 'M1,0h1v1h-1zM3,1h1v1h-1z'; break;
210-
case 3003: w = h = 4; fills = 'M2,1h1v1h-1zM0,3h1v1h-1z'; break;
211-
case 3004: w = h = 8; lines = 'M8,0L0,8'; break;
212-
case 3005: w = h = 8; lines = 'M0,0L8,8'; break;
213-
case 3006: w = h = 4; lines = 'M1,0v4'; break;
214-
case 3007: w = h = 4; lines = 'M0,1h4'; break;
208+
case 3001:
209+
w = h = 2;
210+
fills = 'M0,0h1v1h-1zM1,1h1v1h-1z';
211+
break;
212+
case 3002:
213+
w = 4;
214+
h = 2;
215+
fills = 'M1,0h1v1h-1zM3,1h1v1h-1z';
216+
break;
217+
case 3003:
218+
w = h = 4;
219+
fills = 'M2,1h1v1h-1zM0,3h1v1h-1z';
220+
break;
221+
case 3004:
222+
w = h = 8;
223+
lines = 'M8,0L0,8';
224+
break;
225+
case 3005:
226+
w = h = 8;
227+
lines = 'M0,0L8,8';
228+
break;
229+
case 3006:
230+
w = h = 4;
231+
lines = 'M1,0v4';
232+
break;
233+
case 3007:
234+
w = h = 4;
235+
lines = 'M0,1h4';
236+
break;
215237
case 3008:
216238
w = h = 10;
217239
fills = 'M0,3v-3h3ZM7,0h3v3ZM0,7v3h3ZM7,10h3v-3ZM5,2l3,3l-3,3l-3,-3Z';
218240
lines = 'M0,3l5,5M3,10l5,-5M10,7l-5,-5M7,0l-5,5';
219241
break;
220-
case 3009: w = 12; h = 12; lines = 'M0,0A6,6,0,0,0,12,0M6,6A6,6,0,0,0,12,12M6,6A6,6,0,0,1,0,12'; lfill = 'none'; break;
221-
case 3010: w = h = 10; lines = 'M0,2h10M0,7h10M2,0v2M7,2v5M2,7v3'; break; // bricks
222-
case 3011: w = 9; h = 18; lines = 'M5,0v8M2,1l6,6M8,1l-6,6M9,9v8M6,10l3,3l-3,3M0,9v8M3,10l-3,3l3,3'; lfill = 'none'; break;
223-
case 3012: w = 10; h = 20; lines = 'M5,1A4,4,0,0,0,5,9A4,4,0,0,0,5,1M0,11A4,4,0,0,1,0,19M10,11A4,4,0,0,0,10,19'; lfill = 'none'; break;
224-
case 3013: w = h = 7; lines = 'M0,0L7,7M7,0L0,7'; lfill = 'none'; break;
225-
case 3014: w = h = 16; lines = 'M0,0h16v16h-16v-16M0,12h16M12,0v16M4,0v8M4,4h8M0,8h8M8,4v8'; lfill = 'none'; break;
226-
case 3015: w = 6; h = 12; lines = 'M2,1A2,2,0,0,0,2,5A2,2,0,0,0,2,1M0,7A2,2,0,0,1,0,11M6,7A2,2,0,0,0,6,11'; lfill = 'none'; break;
227-
case 3016: w = 12; h = 7; lines = 'M0,1A3,2,0,0,1,3,3A3,2,0,0,0,9,3A3,2,0,0,1,12,1'; lfill = 'none'; break;
228-
case 3017: w = h = 4; lines = 'M3,1l-2,2'; break;
229-
case 3018: w = h = 4; lines = 'M1,1l2,2'; break;
242+
case 3009:
243+
w = h = 12;
244+
lines = 'M0,0A6,6,0,0,0,12,0M6,6A6,6,0,0,0,12,12M6,6A6,6,0,0,1,0,12';
245+
lfill = 'none';
246+
break;
247+
case 3010: // bricks
248+
w = h = 10;
249+
lines = 'M0,2h10M0,7h10M2,0v2M7,2v5M2,7v3';
250+
break;
251+
case 3011:
252+
w = 9;
253+
h = 18;
254+
lines = 'M5,0v8M2,1l6,6M8,1l-6,6M9,9v8M6,10l3,3l-3,3M0,9v8M3,10l-3,3l3,3';
255+
lfill = 'none';
256+
break;
257+
case 3012:
258+
w = 10;
259+
h = 20;
260+
lines = 'M5,1A4,4,0,0,0,5,9A4,4,0,0,0,5,1M0,11A4,4,0,0,1,0,19M10,11A4,4,0,0,0,10,19';
261+
lfill = 'none';
262+
break;
263+
case 3013:
264+
w = h = 7;
265+
lines = 'M0,0L7,7M7,0L0,7';
266+
lfill = 'none';
267+
break;
268+
case 3014:
269+
w = h = 16;
270+
lines = 'M0,0h16v16h-16v-16M0,12h16M12,0v16M4,0v8M4,4h8M0,8h8M8,4v8';
271+
lfill = 'none';
272+
break;
273+
case 3015:
274+
w = 6;
275+
h = 12;
276+
lines = 'M2,1A2,2,0,0,0,2,5A2,2,0,0,0,2,1M0,7A2,2,0,0,1,0,11M6,7A2,2,0,0,0,6,11';
277+
lfill = 'none';
278+
break;
279+
case 3016:
280+
w = 12;
281+
h = 7;
282+
lines = 'M0,1A3,2,0,0,1,3,3A3,2,0,0,0,9,3A3,2,0,0,1,12,1';
283+
lfill = 'none';
284+
break;
285+
case 3017:
286+
w = h = 4;
287+
lines = 'M3,1l-2,2';
288+
break;
289+
case 3018:
290+
w = h = 4;
291+
lines = 'M1,1l2,2';
292+
break;
230293
case 3019:
231294
w = h = 12;
232295
lines = 'M1,6A5,5,0,0,0,11,6A5,5,0,0,0,1,6h-1h1A5,5,0,0,1,6,11v1v-1A5,5,0,0,1,11,6h1h-1A5,5,0,0,1,6,1v-1v1A5,5,0,0,1,1,6';
233296
lfill = 'none';
234297
break;
235-
case 3020: w = 7; h = 12; lines = 'M1,0A2,3,0,0,0,3,3A2,3,0,0,1,3,9A2,3,0,0,0,1,12'; lfill = 'none'; break;
236-
case 3021: w = h = 8; lines = 'M8,2h-2v4h-4v2M2,0v2h-2'; lfill = 'none'; break; // left stairs
237-
case 3022: w = h = 8; lines = 'M0,2h2v4h4v2M6,0v2h2'; lfill = 'none'; break; // right stairs
238-
case 3023: w = h = 8; fills = 'M4,0h4v4zM8,4v4h-4z'; fills2 = 'M4,0L0,4L4,8L8,4Z'; break;
239-
case 3024: w = h = 16; fills = 'M0,8v8h2v-8zM8,0v8h2v-8M4,14v2h12v-2z'; fills2 = 'M0,2h8v6h4v-6h4v12h-12v-6h-4z'; break;
240-
case 3025: w = h = 18; fills = 'M5,13v-8h8ZM18,0v18h-18l5,-5h8v-8Z'; break;
298+
case 3020:
299+
w = 7;
300+
h = 12;
301+
lines = 'M1,0A2,3,0,0,0,3,3A2,3,0,0,1,3,9A2,3,0,0,0,1,12';
302+
lfill = 'none';
303+
break;
304+
case 3021: // left stairs
305+
w = h = 8;
306+
lines = 'M8,2h-2v4h-4v2M2,0v2h-2';
307+
lfill = 'none';
308+
break;
309+
case 3022: // right stairs
310+
w = h = 8;
311+
lines = 'M0,2h2v4h4v2M6,0v2h2';
312+
lfill = 'none';
313+
break;
314+
case 3023:
315+
w = h = 8;
316+
fills = 'M4,0h4v4zM8,4v4h-4z';
317+
fills2 = 'M4,0L0,4L4,8L8,4Z';
318+
break;
319+
case 3024:
320+
w = h = 16;
321+
fills = 'M0,8v8h2v-8zM8,0v8h2v-8M4,14v2h12v-2z';
322+
fills2 = 'M0,2h8v6h4v-6h4v12h-12v-6h-4z';
323+
break;
324+
case 3025:
325+
w = h = 18;
326+
fills = 'M5,13v-8h8ZM18,0v18h-18l5,-5h8v-8Z';
327+
break;
241328
default: {
242329
if ((this.pattern > 3025) && (this.pattern < 3100)) {
243330
// same as 3002, see TGX11.cxx, line 2234
244-
w = 4; h = 2; fills = 'M1,0h1v1h-1zM3,1h1v1h-1z'; break;
331+
w = 4;
332+
h = 2;
333+
fills = 'M1,0h1v1h-1zM3,1h1v1h-1z';
334+
break;
245335
}
246336

247337
const code = this.pattern % 1000,

modules/core.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,8 @@ function createHistogram(typename, nbinsx, nbinsy, nbinsz) {
15861586
const histo = create(typename);
15871587
if (!histo.fXaxis || !histo.fYaxis || !histo.fZaxis)
15881588
return null;
1589-
histo.fName = 'hist'; histo.fTitle = 'title';
1589+
histo.fName = 'hist';
1590+
histo.fTitle = 'title';
15901591
if (nbinsx)
15911592
extend(histo.fXaxis, { fNbins: nbinsx, fXmin: 0, fXmax: nbinsx });
15921593
if (nbinsy)

modules/gpad/RAxisPainter.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,8 @@ class RAxisPainter extends RObjectPainter {
640640
if (ticks_plusminus > 0)
641641
h2 = -h1;
642642
else if (side < 0) {
643-
h2 = -h1; h1 = 0;
643+
h2 = -h1;
644+
h1 = 0;
644645
} else
645646
h2 = 0;
646647

modules/gpad/TAxisPainter.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,8 @@ class TAxisPainter extends ObjectPainter {
10611061
if (ticksPlusMinus > 0)
10621062
h2 = -h1;
10631063
else if (side < 0) {
1064-
h2 = -h1; h1 = 0;
1064+
h2 = -h1;
1065+
h1 = 0;
10651066
}
10661067

10671068
path1 += this.vertical ? `M${h1},${handle.grpos}H${h2}` : `M${handle.grpos},${-h1}V${-h2}`;

modules/gui/HierarchyPainter.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4167,7 +4167,8 @@ class HierarchyPainter extends BasePainter {
41674167
if (!isStr(s))
41684168
continue;
41694169
if ((s === this.getLayout()) || (s.replace(/ /g, '') === this.getLayout())) {
4170-
selects.selectedIndex = i; found = true;
4170+
selects.selectedIndex = i;
4171+
found = true;
41714172
break;
41724173
}
41734174
}

modules/gui/display.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,10 +1502,13 @@ class BrowserLayout {
15021502

15031503
if (mode === 'toggle')
15041504
mode = !is_visible;
1505-
else if (mode === 'delete') {
1506-
mode = false; height = 0; delete this.status_layout;
1505+
else if (mode === 'delete') {
1506+
mode = false;
1507+
height = 0;
1508+
delete this.status_layout;
15071509
} else if (mode === undefined) {
1508-
mode = true; this.status_layout = 'app';
1510+
mode = true;
1511+
this.status_layout = 'app';
15091512
}
15101513

15111514
if (is_visible) {

modules/hist/TH2Painter.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ function drawTH2PolyLego(painter) {
6666
dist2 = fp.size_x3d * fp.size_z3d;
6767
const dist2limit = (ntry > 0) ? 0 : dist2/1e6;
6868

69-
pnts = []; faces = null;
69+
pnts = [];
70+
faces = null;
7071

7172
for (let vert = 0; vert < npnts; ++vert) {
7273
currx = fp.grx(x[vert]);

modules/hist/hist3d.mjs

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -772,9 +772,12 @@ function drawXYZ(toplevel, AxisPainter, opts) {
772772
y_zoomed = false, z_zoomed = false;
773773

774774
if (!this.size_z3d) {
775-
grminx = this.xmin; grmaxx = this.xmax;
776-
grminy = this.ymin; grmaxy = this.ymax;
777-
grminz = this.zmin; grmaxz = this.zmax;
775+
grminx = this.xmin;
776+
grmaxx = this.xmax;
777+
grminy = this.ymin;
778+
grmaxy = this.ymax;
779+
grminz = this.zmin;
780+
grmaxz = this.zmax;
778781
scalingSize = (grmaxz - grminz);
779782
}
780783

@@ -2099,13 +2102,28 @@ function drawBinsSurf3D(painter, is_v7 = false) {
20992102
if (is_v7) {
21002103
let need_palette = 0;
21012104
switch (painter.options.Surf) {
2102-
case 11: need_palette = 2; break;
2105+
case 11:
2106+
need_palette = 2;
2107+
break;
21032108
case 12:
21042109
case 15: // make surf5 same as surf2
2105-
case 17: need_palette = 2; handle.dolines = false; break;
2106-
case 14: handle.dolines = false; handle.donormals = true; break;
2107-
case 16: need_palette = 1; handle.dogrid = true; handle.dolines = false; break;
2108-
default: ilevels = fp.z_handle.createTicks(true); handle.dogrid = true; break;
2110+
case 17:
2111+
need_palette = 2;
2112+
handle.dolines = false;
2113+
break;
2114+
case 14:
2115+
handle.dolines = false;
2116+
handle.donormals = true;
2117+
break;
2118+
case 16:
2119+
need_palette = 1;
2120+
handle.dogrid = true;
2121+
handle.dolines = false;
2122+
break;
2123+
default:
2124+
ilevels = fp.z_handle.createTicks(true);
2125+
handle.dogrid = true;
2126+
break;
21092127
}
21102128

21112129
if (need_palette > 0) {

modules/hist2d/TH1Painter.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,11 @@ class TH1Painter extends THistPainter {
167167

168168
if ((hmin === hmax) && (hmin !== kNoZoom)) {
169169
if (hmin < 0) {
170-
hmin *= 2; hmax = 0;
170+
hmin *= 2;
171+
hmax = 0;
171172
} else {
172-
hmin = 0; hmax *= 2;
173-
if (!hmax) hmax = 1;
173+
hmin = 0;
174+
hmax = 2 * hmax || 1;
174175
}
175176
}
176177

0 commit comments

Comments
 (0)