Skip to content

Commit

Permalink
refactor: Increase routing animation speed and remove unnecessary delay
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Nov 27, 2024
1 parent e33cc15 commit 07523fb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions hugo-site/static/js/small-world-routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ async function initVisualization() {
segmentLengths[i] = length;
}

const pixelsPerSecond = 600; // Constant speed in pixels per second
const pixelsPerSecond = 1200; // Constant speed in pixels per second
let startTime = null;
let lastSegmentStartTime = null;

Expand All @@ -286,11 +286,9 @@ async function initVisualization() {

if (currentPathSegment >= currentPath.length - 1) {
// Animation complete - wait 3 seconds then trigger new route
setTimeout(() => {
if (isPlaying) {
startNewRoute();
}
}, 500);
if (isPlaying) {
startNewRoute();
}
return;
}

Expand Down

0 comments on commit 07523fb

Please sign in to comment.