Skip to content

Commit

Permalink
perf: Increase route animation speed and remove delay between routes
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Nov 27, 2024
1 parent 07523fb commit e60cddf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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 = 1200; // Constant speed in pixels per second
const pixelsPerSecond = 2400; // Constant speed in pixels per second
let startTime = null;
let lastSegmentStartTime = null;

Expand All @@ -285,9 +285,9 @@ async function initVisualization() {
currentPathSegment++;

if (currentPathSegment >= currentPath.length - 1) {
// Animation complete - wait 3 seconds then trigger new route
// Animation complete - immediately start new route
if (isPlaying) {
startNewRoute();
requestAnimationFrame(() => startNewRoute());
}
return;
}
Expand Down

0 comments on commit e60cddf

Please sign in to comment.