Did some arrows stuff
This commit is contained in:
@@ -3,9 +3,12 @@
|
||||
// Arrows go from the bottom-center of the source
|
||||
// to the top-center of the target.
|
||||
const CONNECTIONS = [
|
||||
['n0', 'n1'],
|
||||
['n1', 'n2'],
|
||||
['n2', 'n3'],
|
||||
['proj', 'fich'],
|
||||
['proj', 'hack'],
|
||||
['fich', 'rust'],
|
||||
['rust', 'alac'],
|
||||
['hack', 'alac'],
|
||||
['alac', 'mine'],
|
||||
];
|
||||
|
||||
// ─── Setup ────────────────────────────────────────────────────
|
||||
@@ -65,6 +68,13 @@ function redraw() {
|
||||
};
|
||||
|
||||
pathEls[i].setAttribute('d', manhattanPath(r1, r2));
|
||||
if (tgt.left > src.left) {
|
||||
pathEls[i].style.stroke = "#008000";
|
||||
} else if (tgt.left < src.left){
|
||||
pathEls[i].style.stroke = "#ff0000";
|
||||
} else {
|
||||
pathEls[i].style.stroke = "#0000ff";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user