1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-09 09:35:02 +09:00

Link distance and node radius updates

This commit is contained in:
Andrew Simachev 2024-07-09 10:42:23 +02:00
parent d3dcc58ff7
commit 6ab7e6516b
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8

View file

@ -172,7 +172,7 @@ initForces = () => {
simulation.force('link')
.links(edges)
.distance(link.distance)
.strength(d => d.source.layout == d.target.layout ? 1 : 0.5);
.strength(d => d.source.type == d.target.type ? 1 : 0.5);
simulation.force('forceX')
.strength(d => d.isOrphan ? forceX.strength : 0)
@ -802,7 +802,7 @@ const getRadius = (d) => {
maxEdges = Math.max(maxEdges, e);
if (maxEdges > 0) {
k += e / maxEdges;
k += Math.min(1, e / maxEdges);
};
return d.radius / transform.k * k;