Skip to content

Commit c6c1080

Browse files
committed
Provide tooltip for TGraph2D
1 parent 30a94ee commit c6c1080

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

scripts/JSRootPainter.hist3d.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3099,20 +3099,23 @@
30993099
var p = this.painter,
31003100
grx = p.grx(this.graph.fX[indx]),
31013101
gry = p.gry(this.graph.fY[indx]),
3102-
grz = p.grz(this.graph.fZ[indx]),
3103-
tip = { info: this.tip_name + "<br/>" +
3104-
"pnt: " + indx + "<br/>" +
3105-
"x: " + p.x_handle.format(this.graph.fX[indx]) + "<br/>" +
3106-
"y: " + p.y_handle.format(this.graph.fY[indx]) + "<br/>" +
3107-
"z: " + p.z_handle.format(this.graph.fZ[indx]) };
3108-
3109-
tip.x1 = grx - this.scale0; tip.x2 = grx + this.scale0;
3110-
tip.y1 = gry - this.scale0; tip.y2 = gry + this.scale0;
3111-
tip.z1 = grz - this.scale0; tip.z2 = grz + this.scale0;
3112-
3113-
tip.color = this.tip_color;
3114-
3115-
return tip;
3102+
grz = p.grz(this.graph.fZ[indx]);
3103+
3104+
return {
3105+
x1: grx - this.scale0,
3106+
x2: grx + this.scale0,
3107+
y1: gry - this.scale0,
3108+
y2: gry + this.scale0,
3109+
z1: grz - this.scale0,
3110+
z2: grz + this.scale0,
3111+
color: this.tip_color,
3112+
lines: [ this.tip_name,
3113+
"pnt: " + indx,
3114+
"x: " + p.x_handle.format(this.graph.fX[indx]),
3115+
"y: " + p.y_handle.format(this.graph.fY[indx]),
3116+
"z: " + p.z_handle.format(this.graph.fZ[indx])
3117+
]
3118+
}
31163119
}
31173120

31183121
TGraph2DPainter.prototype.Redraw = function() {
@@ -3147,9 +3150,9 @@
31473150
}
31483151

31493152
var markeratt = new JSROOT.TAttMarkerHandler(graph),
3150-
palette = null,
3151-
levels = [main.scale_zmin, main.scale_zmax],
3152-
scale = main.size_xy3d / 100 * markeratt.GetFullSize();
3153+
palette = null,
3154+
levels = [main.scale_zmin, main.scale_zmax],
3155+
scale = main.size_xy3d / 100 * markeratt.GetFullSize();
31533156

31543157
if (this.options.Circles) scale = 0.06*main.size_xy3d;
31553158

0 commit comments

Comments
 (0)