Skip to content

Commit

Permalink
Update bk.js
Browse files Browse the repository at this point in the history
  • Loading branch information
RohitPaul0007 committed Sep 11, 2023
1 parent 215449a commit 0aaa2a6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/position/bk.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

var Graph = require("@dagrejs/graphlib").Graph;
var util = require("../util");
let Graph = require("@dagrejs/graphlib").Graph;
let util = require("../util");

/*
* This module provides coordinate assignment based on Brandes and Köpf, "Fast
Expand Down Expand Up @@ -39,10 +39,10 @@ module.exports = {
* single node in the layers being scanned.
*/
function findType1Conflicts(g, layering) {
var conflicts = {};
let conflicts = {};

function visitLayer(prevLayer, layer) {
var
let
// last visited node in the previous layer that is incident on an inner
// segment.
k0 = 0,
Expand All @@ -53,13 +53,13 @@ function findType1Conflicts(g, layering) {
lastNode = layer[layer.length - 1];

layer.forEach((v, i) => {
var w = findOtherInnerSegmentNode(g, v),
let w = findOtherInnerSegmentNode(g, v),
k1 = w ? g.node(w).order : prevLayerLength;

if (w || v === lastNode) {
layer.slice(scanPos, i+1).forEach(scanNode => {
g.predecessors(scanNode).forEach(u => {
var uLabel = g.node(u),
let uLabel = g.node(u),
uPos = uLabel.order;
if ((uPos < k0 || k1 < uPos) &&
!(uLabel.dummy && g.node(scanNode).dummy)) {
Expand All @@ -80,10 +80,10 @@ function findType1Conflicts(g, layering) {
}

function findType2Conflicts(g, layering) {
var conflicts = {};
let conflicts = {};

function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) {
var v;
let v;
util.range(southPos, southEnd).forEach(i => {
v = south[i];
if (g.node(v).dummy) {
Expand Down

0 comments on commit 0aaa2a6

Please sign in to comment.