Skip to content

Commit 520e712

Browse files
committed
Fix problem with colz drawing
Use correct min/max values to estimate labels widths. Still room for improvement
1 parent 597bd99 commit 520e712

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

changes.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# JSROOT changelog
22

33
## Changes in master
4-
1. Let use HTML element pointer in JSROOT.draw function like:
4+
1. Let use HTML element pointer in JSROOT.draw function like:
55

66
JSROOT.draw(document.getElementsByTagName("div")[0], obj, "hist");
77

@@ -59,16 +59,16 @@
5959
8. Fix problem with GetBBox - it only can be used for visible elements in mozilla.
6060
9. Support drawing of fit parameters in stat box, use (as far as possible) stat and
6161
fit format for statistic display
62-
10.Implement 'g' formatting kind for stat box output - one need to checks
63-
significant digits when producing output.
64-
11.Support new draw options for TGraph: 'C', 'B1', '0', '2', '3', '4', '[]'
65-
12.Primary support for STL containers in IO part. Allows to read ROOT6 TF1.
66-
13.Full support of TGraphBentErrors
67-
14.Support objects drawing from JSON files in default user interface, including
68-
monitoring. One could open file from link like:
69-
https://root.cern.ch/js/dev/?json=demo/canvas_tf1.json
70-
15.Introduce JSROOT.FFormat function to convert numeric values into string according
71-
format like 6.4g or 5.7e. Used for statistic display.
62+
10. Implement 'g' formatting kind for stat box output - one need to checks
63+
significant digits when producing output.
64+
11. Support new draw options for TGraph: 'C', 'B1', '0', '2', '3', '4', '[]'
65+
12. Primary support for STL containers in IO part. Allows to read ROOT6 TF1.
66+
13. Full support of TGraphBentErrors
67+
14. Support objects drawing from JSON files in default user interface, including
68+
monitoring. One could open file from link like:
69+
https://root.cern.ch/js/dev/?json=demo/canvas_tf1.json
70+
15. Introduce JSROOT.FFormat function to convert numeric values into string according
71+
format like 6.4g or 5.7e. Used for statistic display.
7272

7373

7474
## Changes in 3.5

scripts/JSRootPainter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6357,7 +6357,7 @@
63576357
var axisfont = JSROOT.Painter.getFontDetails(axis['fLabelFont'], axis['fLabelSize'] * height);
63586358

63596359
var ticks = d3.scale.linear().clamp(true)
6360-
.domain([ this.minbin, this.maxbin ])
6360+
.domain([ this.gminbin, this.gmaxbin ])
63616361
.range([ height, 0 ]).nice().ticks(axis['fNdiv'] % 100);
63626362

63636363
var maxlen = 0;
@@ -6366,7 +6366,7 @@
63666366
if (len > maxlen) maxlen = len;
63676367
}
63686368

6369-
var rel = (maxlen + axisOffset) / width;
6369+
var rel = (maxlen + 5 + axisOffset) / width;
63706370

63716371
if (pal['fX2NDC'] + rel > 0.98) {
63726372
var shift = pal['fX2NDC'] + rel - 0.98;
@@ -6876,6 +6876,7 @@
68766876
// check if we need to create palette
68776877
if ((this.FindPalette() == null) && this.create_canvas && (this.options.Zscale > 0)) {
68786878
// create pallette
6879+
68796880
var shrink = this.CreatePalette(0.04);
68806881
this.svg_frame().property('frame_painter').Shrink(0, shrink);
68816882
this.svg_frame().property('frame_painter').Redraw();

0 commit comments

Comments
 (0)