diff --git a/simple_analysis/templates/simple_analysis/simple_analysis.html b/simple_analysis/templates/simple_analysis/simple_analysis.html index 40bc9a8..e49cb4d 100644 --- a/simple_analysis/templates/simple_analysis/simple_analysis.html +++ b/simple_analysis/templates/simple_analysis/simple_analysis.html @@ -2782,26 +2782,14 @@ function renderTrafficCrossfade() { const t = mix.t; // Each frame: add w0 edges with fade-out, w1 edges with fade-in + // Only show current window edges — clean switch, no blending + // Brief fade-in for newly appearing edges + const curEdges = t < 0.5 ? (w0 ? w0.edges : []) : (w1 ? w1.edges : []); const edgeMap = {}; - function add(edges, w) { - 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}; - 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)); - } + curEdges.forEach(e => { + const k = e.source + '|' + e.target; + edgeMap[k] = {source:e.source, target:e.target, weight:1.0, count:e.count||0}; + }); const edges = Object.values(edgeMap); if (!edges.length) return; @@ -2822,9 +2810,8 @@ function renderTrafficCrossfade() { if (!p1 || !p2) return; const midX = (p1.x + p2.x) / 2; const midY = (p1.y + p2.y) / 2 - Math.abs(p2.x - p1.x) * 0.1; - if (e.weight < 0.05) return; // skip near-invisible edges const ratio = Math.min(1, e.count / maxCount); - const alpha = 0.08 + 0.92 * e.weight; + const alpha = 0.6 + 0.4 * ratio; // Edge trace with src→dst color gradient const grad = ctx.createLinearGradient(p1.x, p1.y, p2.x, p2.y);