Skip to content

Commit

Permalink
Merge pull request #420 from RohitPaul0007/patch-63
Browse files Browse the repository at this point in the history
Update coordinate-system.js
  • Loading branch information
rustedgrail committed Sep 11, 2023
2 parents da83461 + df83223 commit 3cc73bc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/coordinate-system.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ module.exports = {
};

function adjust(g) {
var rankDir = g.graph().rankdir.toLowerCase();
let rankDir = g.graph().rankdir.toLowerCase();
if (rankDir === "lr" || rankDir === "rl") {
swapWidthHeight(g);
}
}

function undo(g) {
var rankDir = g.graph().rankdir.toLowerCase();
let rankDir = g.graph().rankdir.toLowerCase();
if (rankDir === "bt" || rankDir === "rl") {
reverseY(g);
}
Expand All @@ -30,7 +30,7 @@ function swapWidthHeight(g) {
}

function swapWidthHeightOne(attrs) {
var w = attrs.width;
let w = attrs.width;
attrs.width = attrs.height;
attrs.height = w;
}
Expand All @@ -39,7 +39,7 @@ function reverseY(g) {
g.nodes().forEach(v => reverseYOne(g.node(v)));

g.edges().forEach(e => {
var edge = g.edge(e);
let edge = g.edge(e);
edge.points.forEach(reverseYOne);
if (edge.hasOwnProperty("y")) {
reverseYOne(edge);
Expand All @@ -55,7 +55,7 @@ function swapXY(g) {
g.nodes().forEach(v => swapXYOne(g.node(v)));

g.edges().forEach(e => {
var edge = g.edge(e);
let edge = g.edge(e);
edge.points.forEach(swapXYOne);
if (edge.hasOwnProperty("x")) {
swapXYOne(edge);
Expand All @@ -64,7 +64,7 @@ function swapXY(g) {
}

function swapXYOne(attrs) {
var x = attrs.x;
let x = attrs.x;
attrs.x = attrs.y;
attrs.y = x;
}

0 comments on commit 3cc73bc

Please sign in to comment.