Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Barplot clicking #504

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Show selected node menu at clicked barplots!
Doesn't work well with zooming/panning/etc tho yet.

We _should_ modify the selected node menu class so that
updateMenuPosition() is only called after a node has already
been selected, I guess...? Or, like, rather than following a node's
position, it now follows the barplot's position. Or the node's
position at some barplot displacement. IDK.
  • Loading branch information
fedarko committed Oct 20, 2020
commit a1127d3988a725d7274138a4fd71ecc0828860d1
13 changes: 6 additions & 7 deletions empress/support_files/js/select-node-menu.js
Original file line number Diff line number Diff line change
@@ -514,17 +514,16 @@ define(["underscore", "util"], function (_, util) {
return;
}

var tableLoc;
var x,y, tableLoc;
if (_.isUndefined(customX) && _.isUndefined(customY)) {
console.log("case1");
var nodeToPositionAt = this.nodeKeys[0];
var x = this.empress.getX(nodeToPositionAt);
var y = this.empress.getY(nodeToPositionAt);
tableLoc = this.drawer.toScreenSpace(x, y);
x = this.empress.getX(nodeToPositionAt);
y = this.empress.getY(nodeToPositionAt);
} else {
console.log("case2");
tableLoc = {x: customX, y: customY};
x = customX;
y = customY;
}
tableLoc = this.drawer.toScreenSpace(x, y);

// set table location. add slight offset to location so menu appears
// next to the node instead of on top of it.