Fix: add data boundaries to spectrum pan + bump cache versions

The spectrum chart was missing xMin/xMax persistence and data boundary
clamping in enablePan(). Align with the background/cps chart patterns.
Bump cache versions to force browser refresh.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Jacquin Antoine
2026-05-20 00:50:56 +02:00
parent c764a5c264
commit 6c78c13622
7 changed files with 225 additions and 23 deletions

View File

@ -2,6 +2,33 @@ const API_BASE = '';
let refreshInterval = null;
const REFRESH_MS = 30000; // 30 seconds
// Load detector config
const DETECTOR_CONFIG = {};
async function loadDetectorConfig() {
try {
const resp = await fetch(`${API_BASE}/static/js/detectors.json`);
if (!resp.ok) return;
const data = await resp.json();
Object.assign(DETECTOR_CONFIG, data);
if (DETECTOR_CONFIG.default) {
const d = DETECTOR_CONFIG.detectors[DETECTOR_CONFIG.default]?.display || {};
Object.assign(DETECTOR_CONFIG, d);
// Apply default chart settings from config
if (typeof d.default_log_scale === 'boolean') {
const el = document.getElementById('log-scale');
if (el) el.checked = d.default_log_scale;
const el2 = document.getElementById('bg-scale-log');
if (el2) el2.checked = d.default_log_scale;
}
if (typeof d.default_smooth === 'boolean') {
const el = document.getElementById('show-bg-smooth');
if (el) el.checked = d.default_smooth;
}
}
} catch { /* use defaults */ }
}
loadDetectorConfig();
// Tab navigation
document.querySelectorAll('nav a').forEach(link => {
link.addEventListener('click', e => {