Skip to content

Commit

Permalink
Timeline: remove printouts and improve tick placement
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTipson committed Jul 7, 2024
1 parent 8ccb2ca commit 913a38f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Slider } from "@/components/ui/slider"
import { useMemo, useState } from "react";

function calculateTicks(limit: number) {
console.log("Calculating ticks...");
const gap = Math.max(1, Math.ceil((limit - 1) / 10));
let spacing = 1;
let flag = false;
Expand All @@ -14,11 +13,12 @@ function calculateTicks(limit: number) {
if (spacing > 1) {
ticks.push(1);
}
for (let i = spacing; i < limit; i += spacing) {
for (let i = spacing; i <= limit - gap / 2; i += spacing) {
ticks.push(i);
}
ticks.push(limit);
console.log("Ticks:", ticks);
if (limit > 1) {
ticks.push(limit);
}
return ticks;
}

Expand Down

0 comments on commit 913a38f

Please sign in to comment.