graph: the sliders re-centered on the new defaults (release polish 6.2)
The owner speaks in display values: "labels until zoom" shows ratio/0.5, so the old default displayed 8× — and "default one" means display 1× = ratio 0.5, one stop tighter than the round-1 value. Both ladders are re-centered so the new defaults sit dead-center again (stop #5): labelZoom: [0.125, 0.175, 0.25, 0.35, 0.45, 0.5, 0.75, 1, 1.5, 2, 3] — default 0.5 (displays 1×); finer steps below the default, the old familiar run above; old stored 4/24 snap to 3. blur: [10, 15, 20, 25, 30, 40, 50, 60, 80, 100, 120] — default 40 dead-center, min 10 per the owner's suggestion, old ceiling kept; old 4/5/7.5 snap to the new floor. The dead-center ladder law is restored with no exceptions; migration pins updated (blur 8.1 → 10, labelZoom 0.5 now a member). 1428 tests, tsc, lint, build green.
This commit is contained in:
@@ -525,7 +525,7 @@ function GraphSettingsControl({
|
||||
onChange={(p) =>
|
||||
changeSettings((cur) => ({ ...cur, labelSize: fromLadderPosition(p, LABEL_SIZE_LADDER) }))}
|
||||
/>
|
||||
{/* Display is absolute (ratio / 0.5): "8×" is the tuned default, dead-center. */}
|
||||
{/* Display is absolute (ratio / 0.5): "1×" is the default, dead-center (owner, 2026-10-07). */}
|
||||
<SettingSlider
|
||||
label="Labels until zoom"
|
||||
min={0}
|
||||
|
||||
@@ -261,9 +261,10 @@ export const DEFAULT_RENDER_SETTINGS: GraphRenderSettings = {
|
||||
nodeSize: 2,
|
||||
edgeWidth: 1,
|
||||
arrowLength: 2,
|
||||
// New default 1 (owner, 2026-10-07): labels hidden at the overview,
|
||||
// shown once the camera reaches fit zoom or closer.
|
||||
labelZoom: 1,
|
||||
// New default 0.5 — displays as 1× on the slider (owner, 2026-10-07:
|
||||
// "labels until zoom default one" — the owner speaks in display
|
||||
// values, and the display is ratio/0.5). Labels once zoomed past fit.
|
||||
labelZoom: 0.5,
|
||||
labelSize: 3,
|
||||
clusterLabels: true,
|
||||
clusterLabelSize: 14,
|
||||
@@ -293,7 +294,11 @@ export const CLUSTER_LABEL_SIZE_LADDER = [7, 8, 9, 10, 12, 14, 16, 18, 20, 24, 2
|
||||
// Camera-ratio gates; the DISPLAY ladder reads 1.5×, 2×, 3×, 4×, 6×, 8×,
|
||||
// 12×, 16×, 24×, 32×, 48× (labelZoomDisplay) with the user's tuned 8×
|
||||
// (ratio 4) dead-center — it used to sit at the very end of the axis.
|
||||
export const LABEL_ZOOM_LADDER = [0.75, 1, 1.5, 2, 3, 4, 6, 8, 12, 16, 24] as const;
|
||||
// Re-centered on the new default (owner, 2026-10-07): display 1× (ratio
|
||||
// 0.5) sits dead-center; the upper stops keep the old familiar run, the
|
||||
// lower stops go finer where the default now lives. Old stored values
|
||||
// snap to the nearest stop (4 → 3, 24 → 3, 0.75 → 0.75).
|
||||
export const LABEL_ZOOM_LADDER = [0.125, 0.175, 0.25, 0.35, 0.45, 0.5, 0.75, 1, 1.5, 2, 3] as const;
|
||||
|
||||
// ─── Region + physics slider ranges ──────────────────────────────────────────
|
||||
//
|
||||
@@ -306,7 +311,10 @@ export const LABEL_ZOOM_LADDER = [0.75, 1, 1.5, 2, 3, 4, 6, 8, 12, 16, 24] as co
|
||||
// have one too; it's a dropdown since 2026-09-13 (non-integers broke).
|
||||
|
||||
export const REGION_DILATION_LADDER = [4, 5, 7.5, 10, 15, 20, 30, 40, 60, 80, 120] as const; // world units
|
||||
export const REGION_BLUR_LADDER = [4, 5, 7.5, 10, 15, 20, 30, 40, 60, 80, 120] as const; // world units
|
||||
// Re-centered on the new default 40 (owner, 2026-10-07): min 10 per the
|
||||
// owner's suggestion, the old ceiling 120 kept, and every old stop from
|
||||
// 15 up survives (4/5/7.5 snap to 10).
|
||||
export const REGION_BLUR_LADDER = [10, 15, 20, 25, 30, 40, 50, 60, 80, 100, 120] as const; // world units
|
||||
export const REGION_EDGE_ALPHA_LADDER = [0.025, 0.05, 0.075, 0.1, 0.15, 0.2, 0.3, 0.4, 0.6, 0.8, 1] as const;
|
||||
|
||||
export const CHARGE_RANGE = { min: -480, max: -120 } as const; // |gm| = 240 (2026-09-17: default −240, dead-center; a subrange of the sweep-validated [30, 480])
|
||||
|
||||
@@ -210,7 +210,7 @@ describe("sanitizeRegionTuning (dev number inputs)", () => {
|
||||
const t = sanitizeRegionTuning(undefined);
|
||||
assert.deepEqual(t, DEFAULT_REGION_TUNING);
|
||||
const half = sanitizeRegionTuning({ blur: 7.2 });
|
||||
assert.equal(half.blur, 7.5); // snapped to the ladder (2026-09-17)
|
||||
assert.equal(half.blur, 10); // snapped to the new ladder floor (owner, 2026-10-07)
|
||||
assert.equal(half.dilation, DEFAULT_REGION_TUNING.dilation);
|
||||
});
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ describe("sanitizeRenderSettings", () => {
|
||||
assert.deepEqual(s.physics, DEFAULT_PHYSICS_TUNING);
|
||||
assert.equal(s.nodeSize, DEFAULT_RENDER_SETTINGS.nodeSize); // legacy sizes reset
|
||||
assert.equal(s.edgeWidth, 1);
|
||||
assert.equal(s.labelZoom, 0.75); // 0.5 isn't a stop — snaps to 0.75
|
||||
assert.equal(s.labelZoom, 0.5); // 0.5 IS the dead-center stop now (owner, 2026-10-07)
|
||||
});
|
||||
|
||||
test("the 2026-09-15 world-unit pivot: legacy files reset ONLY the size fields", () => {
|
||||
@@ -168,7 +168,7 @@ describe("sanitizeRenderSettings", () => {
|
||||
assert.equal(s.edgeWidth, 3);
|
||||
assert.equal(s.labelZoom, 0.75);
|
||||
assert.equal(s.clusterLabelSize, 20); // 21 snaps to 20
|
||||
assert.equal(s.regions.blur, 7.5); // 8.1 snaps to 7.5
|
||||
assert.equal(s.regions.blur, 10); // 8.1 snaps to the new floor (owner, 2026-10-07)
|
||||
assert.equal(s.regions.bitmap, 512);
|
||||
assert.equal(s.regions.edgeAlpha, 0.6);
|
||||
assert.equal(s.regions.enabled, false);
|
||||
@@ -183,14 +183,14 @@ describe("sanitizeRenderSettings", () => {
|
||||
});
|
||||
|
||||
test("the 2026-09-17 defaults are the user's live-tuned bake", () => {
|
||||
// nodeSize 2, edgeWidth 1, arrowLength 2, labelSize 3, labelZoom 4
|
||||
// (displays 8×), dilation 20, blur 20, edgeAlpha 0.2, bitmap 256 —
|
||||
// tuned live against the real graph, each dead-center on its ladder.
|
||||
// nodeSize 2, edgeWidth 1, arrowLength 2, labelSize 3, labelZoom
|
||||
// 0.5 (displays 1×), dilation 20, blur 40, edgeAlpha 0.2, bitmap
|
||||
// 256 — each dead-center on its re-centered ladder (owner, 2026-10-07).
|
||||
assert.equal(DEFAULT_RENDER_SETTINGS.nodeSize, 2);
|
||||
assert.equal(DEFAULT_RENDER_SETTINGS.edgeWidth, 1);
|
||||
assert.equal(DEFAULT_RENDER_SETTINGS.arrowLength, 2);
|
||||
assert.equal(DEFAULT_RENDER_SETTINGS.labelSize, 3);
|
||||
assert.equal(DEFAULT_RENDER_SETTINGS.labelZoom, 1); // labels only at fit zoom or closer (owner, 2026-10-07)
|
||||
assert.equal(DEFAULT_RENDER_SETTINGS.labelZoom, 0.5); // displays 1× (owner, 2026-10-07)
|
||||
assert.equal(DEFAULT_REGION_TUNING.dilation, 20);
|
||||
assert.equal(DEFAULT_REGION_TUNING.blur, 40); // new default (owner, 2026-10-07)
|
||||
assert.equal(DEFAULT_REGION_TUNING.edgeAlpha, 0.2);
|
||||
@@ -220,7 +220,7 @@ describe("sanitizeRenderSettings", () => {
|
||||
const s = sanitizeRenderSettings({ sizeUnits: "world", nodeSize: 4, edgeWidth: 1, arrowLength: 5, labelZoom: 0.5, clusterLabels: true });
|
||||
assert.equal(s.labelSize, DEFAULT_RENDER_SETTINGS.labelSize);
|
||||
assert.equal(s.nodeSize, 4);
|
||||
assert.equal(s.labelZoom, 0.75); // non-member snaps
|
||||
assert.equal(s.labelZoom, 0.5); // 0.5 IS the dead-center stop now
|
||||
});
|
||||
});
|
||||
|
||||
@@ -237,17 +237,13 @@ describe("ladder mapping (11 stops, default-centered)", () => {
|
||||
["regions.edgeAlpha", REGION_EDGE_ALPHA_LADDER, DEFAULT_REGION_TUNING.edgeAlpha],
|
||||
];
|
||||
|
||||
// The dead-center law held until the owner moved two defaults
|
||||
// off-center by ruling (2026-10-07): labelZoom 1 (index 1 — labels
|
||||
// only at fit zoom or closer) and regions.blur 40 (index 7 — softer,
|
||||
// wider tints). Every other default stays dead-center.
|
||||
const OFF_CENTER: Record<string, number> = { labelZoom: 1, "regions.blur": 7 };
|
||||
|
||||
test("every ladder has 11 stops; defaults dead-center except the two owner-moved", () => {
|
||||
// The dead-center law is restored (owner, 2026-10-07 round 2): the
|
||||
// ladders themselves were re-centered so the new defaults — labelZoom
|
||||
// 0.5 (displays 1×) and regions.blur 40 — sit at stop #5 again.
|
||||
test("every ladder has 11 stops; every default is stop #5 (dead-center)", () => {
|
||||
for (const [name, ladder, dflt] of LADDERS) {
|
||||
assert.equal(ladder.length, 11, name);
|
||||
const idx = OFF_CENTER[name] ?? 5;
|
||||
assert.equal(ladder[idx], dflt, name); // default at index 5 → position 50
|
||||
assert.equal(ladder[5], dflt, name); // default at index 5 → position 50
|
||||
}
|
||||
});
|
||||
|
||||
@@ -287,7 +283,7 @@ describe("ladder mapping (11 stops, default-centered)", () => {
|
||||
|
||||
test("display units are absolute (ratio / 0.5): 8× is the tuned default", () => {
|
||||
assert.equal(labelZoomDisplay(0.5), "1×");
|
||||
assert.equal(labelZoomDisplay(4), "8×"); // the default, not "1×" — pre-2026-09-17 displays divided by the default, which would have relabeled the bake
|
||||
assert.equal(labelZoomDisplay(4), "8×"); // plain math (ratio/0.5) — 4 was the old default, 0.5 is the new one
|
||||
assert.equal(labelZoomDisplay(0.75), "1.5×");
|
||||
assert.equal(labelZoomDisplay(24), "48×");
|
||||
assert.equal(labelZoomDisplay(0.25), "0.5×");
|
||||
@@ -342,11 +338,11 @@ describe("physics sliders (fine-grained log, unchanged 2026-09-17)", () => {
|
||||
// small one. It's a canonical world reach now — any stored value
|
||||
// snaps to the nearest stop.
|
||||
assert.equal(DEFAULT_REGION_TUNING.blur, 40); // new default (owner, 2026-10-07)
|
||||
assert.equal(sanitizeRegionTuning({ blur: 3.7 }).blur, 4); // nearest stop
|
||||
assert.equal(sanitizeRegionTuning({ blur: 7.2 }).blur, 7.5);
|
||||
assert.equal(sanitizeRegionTuning({ blur: 3.7 }).blur, 10); // the new floor
|
||||
assert.equal(sanitizeRegionTuning({ blur: 7.2 }).blur, 10);
|
||||
assert.equal(sanitizeRegionTuning({ blur: -5 }).blur, REGION_BLUR_LADDER[0]);
|
||||
assert.equal(sanitizeRegionTuning({ blur: 999 }).blur, REGION_BLUR_LADDER[REGION_BLUR_LADDER.length - 1]);
|
||||
assert.equal(sanitizeRegionTuning({ blur: 99 }).blur, 80); // inside the span → nearest stop, not the top
|
||||
assert.equal(sanitizeRegionTuning({ blur: 99 }).blur, 100); // inside the span → nearest stop, not the top
|
||||
// Stored blur 0 (the old off zone) snaps back into the ladder.
|
||||
assert.equal(sanitizeRegionTuning({ blur: 0 }).blur, REGION_BLUR_LADDER[0]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user