Добавили свечение односторонних связей

This commit is contained in:
AidarKC
2026-11-11 01:07:37 +03:00
parent 6031d95fe8
commit afece72444
2 changed files with 14 additions and 6 deletions
@@ -1020,17 +1020,25 @@ export function createForceGraph({ stage, model, onCenterTap, onNodeTap, onNodeL
const strength = Math.max(0, Math.min(1, Number(ref?.strength) || Number(n.strength) || 0.5));
const opacity = Math.min(childOpacity, parentOpacity);
const shine = Boolean(parent.shining && n.shining) && !n.hidden;
if (ref?.mutual === false) {
parts.push(...directedFriendEdgePaths(x1, y1, cpx, cpy, x2, y2, relationColor(relationType), opacity * 0.82));
continue;
}
let edgeStroke = relationColor(relationType);
if (reverseRelationType && reverseRelationType !== relationType) {
const gradientId = `fg-relation-gradient-${gradientIndex++}`;
defs.push(`<linearGradient id="${gradientId}" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" stop-color="${relationColor(relationType)}"/><stop offset="100%" stop-color="${relationColor(reverseRelationType)}"/></linearGradient>`);
edgeStroke = `url(#${gradientId})`;
}
if (ref?.mutual === false) {
if (shine) {
const gradientId = `fg-directed-shine-${gradientIndex++}`;
defs.push(`<linearGradient id="${gradientId}" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" stop-color="${edgeStroke}" stop-opacity="0.98"/><stop offset="100%" stop-color="${edgeStroke}" stop-opacity="0.06"/></linearGradient>`);
const d = `M${x1.toFixed(1)} ${y1.toFixed(1)} Q${cpx.toFixed(1)} ${cpy.toFixed(1)} ${x2.toFixed(1)} ${y2.toFixed(1)}`;
parts.push(`<path class="fg-plasma-flare" d="${d}" style="stroke:url(#${gradientId})" stroke-dasharray="20 4" opacity="${(0.42 * opacity).toFixed(3)}" />`);
parts.push(`<path class="fg-plasma-tube" d="${d}" style="stroke:url(#${gradientId})" stroke-dasharray="20 4" opacity="${(0.85 * opacity).toFixed(3)}" />`);
parts.push(`<path class="fg-plasma-core" d="${d}" style="stroke:url(#${gradientId})" stroke-dasharray="20 4" opacity="${opacity.toFixed(3)}" />`);
} else {
parts.push(...directedFriendEdgePaths(x1, y1, cpx, cpy, x2, y2, edgeStroke, opacity * 0.82));
}
continue;
}
if (shine) {
const pnx = -uy;
const pny = ux;