feat: exponentially decreasing edge weight

and adjustment of negative weight
This commit is contained in:
julius 2025-06-20 14:01:04 +02:00
parent 710b0770cc
commit 1626751083
Signed by: julius
GPG Key ID: C80A63E6A5FD7092

View File

@ -160,15 +160,16 @@ def graph_json(
if p_id not in player_map:
continue
p = player_map[p_id]
weight = 0.9**i
edges.append(
{
"id": f"{user}->{p}",
"source": user,
"target": p,
"size": max(1.0 - 0.1 * i, 0.3),
"size": weight,
"data": {
"relation": 2,
"origSize": max(1.0 - 0.1 * i, 0.3),
"origSize": weight,
"origFill": "#bed4ff",
},
}
@ -182,7 +183,7 @@ def graph_json(
"id": f"{user}-x>{p}",
"source": user,
"target": p,
"size": 0.3,
"size": 0.5,
"data": {"relation": 0, "origSize": 0.3, "origFill": "#ff7c7c"},
"fill": "#ff7c7c",
}