Сохранили цвет сияющих связей V3

This commit is contained in:
AidarKC
2026-11-11 00:56:37 +03:00
parent e7f6e0580c
commit 84f2400bef
3 changed files with 14 additions and 4 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
client.version=1.20.29 client.version=1.20.30
server.version=1.16.19 server.version=1.16.19
@@ -1042,9 +1042,9 @@ export function createForceGraph({ stage, model, onCenterTap, onNodeTap, onNodeL
const c2x = x1 + 2 * (x2 - x1) / 3 + bowX - pnx * amp; const c2x = x1 + 2 * (x2 - x1) / 3 + bowX - pnx * amp;
const c2y = y1 + 2 * (y2 - y1) / 3 + bowY - pny * amp; const c2y = y1 + 2 * (y2 - y1) / 3 + bowY - pny * amp;
const d = `M${x1.toFixed(1)} ${y1.toFixed(1)} C${c1x.toFixed(1)} ${c1y.toFixed(1)} ${c2x.toFixed(1)} ${c2y.toFixed(1)} ${x2.toFixed(1)} ${y2.toFixed(1)}`; const d = `M${x1.toFixed(1)} ${y1.toFixed(1)} C${c1x.toFixed(1)} ${c1y.toFixed(1)} ${c2x.toFixed(1)} ${c2y.toFixed(1)} ${x2.toFixed(1)} ${y2.toFixed(1)}`;
parts.push(`<path class="fg-plasma-flare" d="${d}" opacity="${(0.42 * opacity).toFixed(3)}" />`); parts.push(`<path class="fg-plasma-flare" d="${d}" stroke="${edgeStroke}" opacity="${(0.42 * opacity).toFixed(3)}" />`);
parts.push(`<path class="fg-plasma-tube" d="${d}" opacity="${(0.85 * opacity).toFixed(3)}" />`); parts.push(`<path class="fg-plasma-tube" d="${d}" stroke="${edgeStroke}" opacity="${(0.85 * opacity).toFixed(3)}" />`);
parts.push(`<path class="fg-plasma-core" d="${d}" opacity="${opacity.toFixed(3)}" />`); parts.push(`<path class="fg-plasma-core" d="${d}" stroke="${edgeStroke}" opacity="${opacity.toFixed(3)}" />`);
} else { } else {
const d = `M${x1.toFixed(1)} ${y1.toFixed(1)} Q${cpx.toFixed(1)} ${cpy.toFixed(1)} ${x2.toFixed(1)} ${y2.toFixed(1)}`; const d = `M${x1.toFixed(1)} ${y1.toFixed(1)} Q${cpx.toFixed(1)} ${cpy.toFixed(1)} ${x2.toFixed(1)} ${y2.toFixed(1)}`;
const col = edgeStroke; const col = edgeStroke;
@@ -121,3 +121,13 @@ test('V3: взаимная связь сохраняет оба типа для
assert.equal(edge.reverseRelationType, 'close_friend'); assert.equal(edge.reverseRelationType, 'close_friend');
assert.equal(edge.mutual, true); assert.equal(edge.mutual, true);
}); });
test('V3: сияние не стирает тип связи у красно-синего перехода', () => {
const g = createExplorerGraph();
g.add(friends('a', ['b'], [], [], [['a', true], ['b', true]]));
g.add(friends('b', [], ['a'], [], [['a', true], ['b', true]]));
const edge = find(g.snapshot('a', { depth: 0 }), 'b').edgeParents[0];
assert.equal(edge.relationType, 'friend');
assert.equal(edge.reverseRelationType, 'close_friend');
assert.equal(find(g.snapshot('a', { depth: 0 }), 'b').shining, true);
});