diff --git a/simple_analysis/templates/simple_analysis/simple_analysis.html b/simple_analysis/templates/simple_analysis/simple_analysis.html index 71e898d..40bc9a8 100644 --- a/simple_analysis/templates/simple_analysis/simple_analysis.html +++ b/simple_analysis/templates/simple_analysis/simple_analysis.html @@ -2784,17 +2784,24 @@ function renderTrafficCrossfade() { // Each frame: add w0 edges with fade-out, w1 edges with fade-in const edgeMap = {}; function add(edges, w) { - if (!edges || w <= 0) return; + if (!edges || w < 0.03) return; edges.forEach(e => { const k = e.source + '|' + e.target; if (!edgeMap[k]) edgeMap[k] = {source:e.source, target:e.target, weight:0, count:0}; - // Use the FRESHEST weight (not max accumulation), so old edges fade out if (w > edgeMap[k].weight) edgeMap[k].weight = w; if ((e.count||0) > edgeMap[k].count) edgeMap[k].count = e.count||0; }); } add(w0?w0.edges:[], 1-t); add(w1?w1.edges:[], t); + // Also blend in edges that are about to appear (smooth entry) + if (mix.i + 2 < wins.length) { + add(wins[mix.i + 2].edges, Math.max(0, t - 0.85)); + } + // Blend out edges from previous window (smooth exit) + if (mix.i > 0) { + add(wins[mix.i - 1].edges, Math.max(0, 0.15 - t)); + } const edges = Object.values(edgeMap); if (!edges.length) return;