feat: add settings

This commit is contained in:
2026-04-06 01:09:02 +02:00
parent 20e41f7680
commit 6e8a4af40d
11 changed files with 425 additions and 45 deletions

View File

@@ -66,8 +66,10 @@ export function buildGraphArrays(
positions[i * 2] = prevPositions[prevIdx * 2]!;
positions[i * 2 + 1] = prevPositions[prevIdx * 2 + 1]!;
} else {
positions[i * 2] = CENTER + (Math.random() - 0.5) * SPACE_SIZE * 0.5;
positions[i * 2 + 1] = CENTER + (Math.random() - 0.5) * SPACE_SIZE * 0.5;
// Tighter initial spread for small graphs so they don't scatter
const spread = n <= 20 ? 0.1 : n <= 100 ? 0.25 : 0.5;
positions[i * 2] = CENTER + (Math.random() - 0.5) * SPACE_SIZE * spread;
positions[i * 2 + 1] = CENTER + (Math.random() - 0.5) * SPACE_SIZE * spread;
}
// Self node = bright white, others by status
@@ -79,7 +81,8 @@ export function buildGraphArrays(
colors[i * 4 + 2] = rgba[2];
colors[i * 4 + 3] = rgba[3];
sizes[i] = 3;
// Scale node size inversely with count: bigger dots when fewer nodes
sizes[i] = n <= 10 ? 8 : n <= 50 ? 5 : n <= 200 ? 4 : 3;
// Cluster assignment
if (i === selfIndex) {