Abandon velocity-weighted region opacity (owner-rejected, buggy at scale)
Per-node speed is invisible inside a cluster blob (still neighbors' skeleton strokes dominate the local area), and per-cluster max-speed couples everything: dragging ONE node dimmed the whole cluster's blob to nothing — including disconnected members at near-zero velocity. Neither granularity is right, so the idea is withdrawn entirely. Manual revert of the velocity parts (a git revert of 154f6c8 would have resurrected the frame fade): weight ramp, position stamps, EMA state, motion-pending flush, per-edge stroke batching, and the tests. Region splat is back to full-opacity coverage at rest AND in motion (2026-09-14 no-stacking invariant). The regions.enabled compute off switch stays.
This commit is contained in:
@@ -17,7 +17,6 @@ import {
|
||||
fitTransform,
|
||||
labelAlpha,
|
||||
pickNearest,
|
||||
regionVelocityWeight,
|
||||
zoomRatioOf,
|
||||
LABELS_FADE_SPAN,
|
||||
} from "../components/graph-canvas.ts";
|
||||
@@ -228,28 +227,3 @@ describe("sanitizePhysicsTuning (physics controls)", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("regionVelocityWeight", () => {
|
||||
test("still nodes: at or below the still threshold → full opacity", () => {
|
||||
assert.equal(regionVelocityWeight(0), 1);
|
||||
assert.equal(regionVelocityWeight(1.5), 1);
|
||||
});
|
||||
|
||||
test("fast nodes: at or above the moving threshold → blob off", () => {
|
||||
assert.equal(regionVelocityWeight(8), 0);
|
||||
assert.equal(regionVelocityWeight(100), 0);
|
||||
});
|
||||
|
||||
test("linear ramp between the thresholds, monotone decreasing", () => {
|
||||
const mid = regionVelocityWeight((1.5 + 8) / 2);
|
||||
assert.ok(Math.abs(mid - 0.5) < 1e-12);
|
||||
// strictly decreasing across the ramp
|
||||
for (let s = 1.5; s <= 8; s += 0.25) {
|
||||
assert.ok(regionVelocityWeight(s) >= regionVelocityWeight(s + 0.25));
|
||||
}
|
||||
// never leaves [0, 1]
|
||||
for (let s = -10; s <= 50; s += 1.7) {
|
||||
const w = regionVelocityWeight(s);
|
||||
assert.ok(w >= 0 && w <= 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user