little comment

This commit is contained in:
Ruben van de Ven 2019-04-06 12:09:29 +02:00
parent 9a13c0730b
commit 746596e5f3

View file

@ -1247,13 +1247,13 @@ class Graph {
this.data.push( dir ); this.data.push( dir );
let skipDistances; let skipDistances;
// orphaned target and source has no other destinations. We can copy the position: // orphaned target and source has no other destinations. We can copy the vertical position:
if(this.getDirectionsFrom( source ).length < 1 && this.getDirectionsFrom( target ).length < 1 && this.getDirectionsTo( target ).length < 1) { if(this.getDirectionsFrom( source ).length < 1 && this.getDirectionsFrom( target ).length < 1 && this.getDirectionsTo( target ).length < 1) {
skipDistances = true; skipDistances = true;
let distance = this.distances[source['@id']]; let distance = this.distances[source['@id']];
console.log('source distance', distance);
let d = [distance[0] + 1, distance[1]]; let d = [distance[0] + 1, distance[1]];
console.log('target distance', d); // create a distance based on source's position
// this saves us from running the slow calculateDistancesFromStart
this.distances[target['@id']] = d; this.distances[target['@id']] = d;
} else { } else {
skipDistances = false; skipDistances = false;