@andespindola/brainlink 0.1.0-beta.168 → 0.1.0-beta.169
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -575,7 +575,7 @@ const drawFallback = () => {
|
|
|
575
575
|
const p = worldToScreen(node[2], node[3])
|
|
576
576
|
const selected = state.selectedNodeId === node[0]
|
|
577
577
|
const color = segmentColor(node[5] || node[4] || node[1])
|
|
578
|
-
const radius = Math.max(2
|
|
578
|
+
const radius = Math.max(3.2, Math.min(16.5, 5 + node[7] * 0.65))
|
|
579
579
|
|
|
580
580
|
ctx2dFallback.beginPath()
|
|
581
581
|
ctx2dFallback.fillStyle = selected ? '#edf4ff' : color
|
|
@@ -1136,7 +1136,7 @@ const pickFallbackNode = (screenX, screenY) => {
|
|
|
1136
1136
|
const weight = Number(node[7])
|
|
1137
1137
|
if (!Number.isFinite(x) || !Number.isFinite(y)) continue
|
|
1138
1138
|
const point = worldToScreen(x, y)
|
|
1139
|
-
const radius = Math.max(2
|
|
1139
|
+
const radius = Math.max(3.2, Math.min(16.5, 5 + (Number.isFinite(weight) ? weight : 0) * 0.65))
|
|
1140
1140
|
const distance = Math.hypot(screenX - point.x, screenY - point.y)
|
|
1141
1141
|
if (distance <= radius && distance < bestDistance) {
|
|
1142
1142
|
bestDistance = distance
|
|
@@ -213,8 +213,8 @@ const ensureEdgeCapacity = (count) => {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
const nodeRadius = (relevance, kind) => {
|
|
216
|
-
const base = kind === 'cluster' ?
|
|
217
|
-
const modifier = Math.min(
|
|
216
|
+
const base = kind === 'cluster' ? 10.2 : 6.4
|
|
217
|
+
const modifier = Math.min(6.6, Math.max(0, relevance * 0.72))
|
|
218
218
|
return base + modifier
|
|
219
219
|
}
|
|
220
220
|
|
package/package.json
CHANGED