ADSB debugging

This commit is contained in:
2026-06-27 16:14:06 -04:00
parent a4f13d87ab
commit 579eed746e
2 changed files with 15 additions and 9 deletions

View File

@@ -16,7 +16,7 @@ let interval: ReturnType<typeof setInterval>;
let rafId: number;
let drawProgress = 0;
let lastTimestamp = 0;
const ANIM_DURATION = 1100;
const ANIM_DURATION = 1000;
let pointBuffer: { x: number; y: number }[] = [];
let prevMax = 1.0;
@@ -26,13 +26,13 @@ function buildBuffer(pts: number[]) {
const mid = H / 2, amp = H / 2 - 6;
const newMax = Math.max(...pts, 1.0);
prevMax = prevMax + (newMax - prevMax) * 0.15;
const max = prevMax;
const buf: { x: number; y: number }[] = [];
pts.forEach((v, i) => {
const prev = pts[i - 1] ?? v;
const prevNorm = (prev / max) * amp;
const norm = (v / max) * amp;
const max = prevMax;
const prevNorm = prev === 0 ? 0 : (prev / max) * amp;
const norm = v === 0 ? 0 : (v / max) * amp;
const baseX = i * SEG_W;
const s = SEG_W / SUB;