From 45034813ad1880419c50563a0d5211e7d0a02497 Mon Sep 17 00:00:00 2001 From: TianXuan Developer Date: Sat, 25 Jul 2026 14:48:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=AF=8F=E5=B8=A7=E4=BB=85=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BD=93=E5=89=8D=E7=AA=97=E5=8F=A3=E8=BE=B9,?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E6=B7=B7=E5=90=88=E4=B8=A4=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 放弃交叉淡入淡出(两条边透明度叠加难以区分), 改为仅显示当前窗口的边(t<0.5→w0, t>=0.5→w1), 不同窗口不同边集一目了然。 Co-Authored-By: Claude --- .../simple_analysis/simple_analysis.html | 29 +++++-------------- 1 file changed, 8 insertions(+), 21 deletions(-) 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);