Skip to content

Commit 50c2b23

Browse files
committed
Build with custom click handler
1 parent 51ec87a commit 50c2b23

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

build/jsroot.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108775,7 +108775,7 @@ let TGraphPainter$1 = class TGraphPainter extends ObjectPainter {
108775108775
}
108776108776

108777108777
/** @summary Complete moving */
108778-
moveEnd(not_changed) {
108778+
moveEnd(not_changed, evnt) {
108779108779
const graph = this.getGraph(), last = graph?.fNpoints - 1;
108780108780
let exec = '';
108781108781

@@ -108805,6 +108805,17 @@ let TGraphPainter$1 = class TGraphPainter extends ObjectPainter {
108805108805
else
108806108806
this.drawGraph();
108807108807
}
108808+
} else if (not_changed) {
108809+
const fp = this.getFramePainter(),
108810+
m = pointer(evnt, fp.getFrameSvg().node()),
108811+
fw = fp.getFrameWidth(), fh = fp.getFrameHeight(),
108812+
valid_x = (m[0] >= 0) && (m[0] <= fw),
108813+
valid_y = (m[1] >= 0) && (m[1] <= fh);
108814+
if (valid_x && valid_y) {
108815+
evnt.preventDefault();
108816+
evnt.stopPropagation();
108817+
fp.processFrameClick({ x: m[0], y: m[1] });
108818+
}
108808108819
} else {
108809108820
changeBin(this.#move_bin);
108810108821
this.#move_binindx = undefined;

changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
1. Implements `TTree` branches filtering via context menu #364
2121
1. Let define alternative draw function #378
2222
1. Implement padsN draw option for `THStack` and `TMultiGraph`
23+
1. Support custom click handler for `TGraph` https://root-forum.cern.ch/t/64744
2324
1. Use `resvg-js` backend for PNG support in node.js #391, thanks to https://github.com/OmarMesqq
2425
1. Remove support for deprectaed `TH1K` class
2526
1. Introduce `settings.ServerTimeout` global timeout for THttpServer operations

0 commit comments

Comments
 (0)