Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

fix(viewer): keep relationship labels at the 6px floor in a first-screen fit

tt-a1icf326adcbf03
diff --git a/archify.zip b/archify.zip
index c84bbb41..55904a95 100644
Binary files a/archify.zip and b/archify.zip differ
diff --git a/archify/assets/template.html b/archify/assets/template.html
index 7a4c53bb..65e53821 100644
--- a/archify/assets/template.html
+++ b/archify/assets/template.html
@@ -9414,24 +9414,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/archify/examples/dataflow-product-analytics.html b/archify/examples/dataflow-product-analytics.html
index 65b29542..ac1d6fca 100644
--- a/archify/examples/dataflow-product-analytics.html
+++ b/archify/examples/dataflow-product-analytics.html
@@ -9525,24 +9525,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/archify/examples/lifecycle-agent-run.html b/archify/examples/lifecycle-agent-run.html
index c0493ab1..19b70312 100644
--- a/archify/examples/lifecycle-agent-run.html
+++ b/archify/examples/lifecycle-agent-run.html
@@ -9470,24 +9470,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/archify/examples/sequence-cache-miss-request.html b/archify/examples/sequence-cache-miss-request.html
index 622b1504..980545e8 100644
--- a/archify/examples/sequence-cache-miss-request.html
+++ b/archify/examples/sequence-cache-miss-request.html
@@ -9540,24 +9540,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/archify/examples/web-app-rendered.html b/archify/examples/web-app-rendered.html
index 59fdbc34..fdc9292b 100644
--- a/archify/examples/web-app-rendered.html
+++ b/archify/examples/web-app-rendered.html
@@ -9513,24 +9513,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/archify/examples/workflow-agent-tool-call-rendered.html b/archify/examples/workflow-agent-tool-call-rendered.html
index 7f602057..b638951b 100644
--- a/archify/examples/workflow-agent-tool-call-rendered.html
+++ b/archify/examples/workflow-agent-tool-call-rendered.html
@@ -9531,24 +9531,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/archify/test/architecture-reading-size-browser.test.mjs b/archify/test/architecture-reading-size-browser.test.mjs
index 5c89a927..69b3635f 100644
--- a/archify/test/architecture-reading-size-browser.test.mjs
+++ b/archify/test/architecture-reading-size-browser.test.mjs
@@ -119,3 +119,45 @@ test('a narrow tall architecture fits the first screen without enlarging the oth
fs.rmSync(dir, { recursive: true, force: true });
}
});
+
+test('a first-screen fit never pushes relationship labels below the 6px floor', async (t) => {
+ if (!Object.hasOwn(process.env, 'ARCHIFY_CHROME')) return t.skip('Set ARCHIFY_CHROME for real browser checks');
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-edge-floor-'));
+ const input = path.join(dir, 'input.json');
+ const output = path.join(dir, 'output.html');
+ // Titles only, 8px relationship labels: without the edge floor the titles'
+ // 7.5px target alone would project the labels to about 5.5px.
+ fs.writeFileSync(input, JSON.stringify({
+ schema_version: 1, diagram_type: 'architecture',
+ meta: { title: 'Tall request path', output: 'output.html', quality_profile: 'showcase' },
+ components: [
+ { id: 'client', type: 'frontend', label: 'Client', pos: [40, 40], size: [140, 60] },
+ { id: 'api', type: 'backend', label: 'API', pos: [40, 480], size: [140, 60] },
+ { id: 'db', type: 'database', label: 'Store', pos: [40, 920], size: [140, 60] },
+ ],
+ connections: [{ from: 'client', to: 'api', label: 'request' }, { from: 'api', to: 'db', label: 'persist' }],
+ }));
+ execFileSync(process.execPath, [path.join(root, 'bin/archify.mjs'), 'render', 'architecture', input, output]);
+ const browser = new ChromeVisualBrowser(findChrome());
+ try {
+ await browser.inspect({ artifactPath: output, width: 1440, height: 900, theme: 'light' });
+ const session = await browser.sessionPromise;
+ const result = await browser.cdp.send('Runtime.evaluate', { returnByValue: true, expression: `(() => {
+ const svg = document.querySelector('.diagram-container > svg');
+ const scale = svg.getBoundingClientRect().width / svg.viewBox.baseVal.width;
+ return {
+ edges: [...svg.querySelectorAll('g[data-detail="context"][data-edge-from] text')].map(text => Number(text.getAttribute('font-size')) * scale),
+ overflow: document.documentElement.getAttribute('data-reader-overflow'),
+ };
+ })()` }, session);
+ assert.equal(result.exceptionDetails, undefined);
+ const { edges, overflow } = result.result.value;
+ assert.ok(edges.length === 2, JSON.stringify(edges));
+ assert.ok(edges.every(size => size >= 6), JSON.stringify(edges));
+ // This graph is taller than the floor allows, so it scrolls as authored.
+ assert.equal(overflow, 'authored');
+ } finally {
+ await browser.close();
+ fs.rmSync(dir, { recursive: true, force: true });
+ }
+});
diff --git a/docs/assets/archify-live-proof.gif b/docs/assets/archify-live-proof.gif
index abc7fdbc..f11858db 100644
Binary files a/docs/assets/archify-live-proof.gif and b/docs/assets/archify-live-proof.gif differ
diff --git a/docs/assets/archify-live-proof.json b/docs/assets/archify-live-proof.json
index bbc53005..80d811f9 100644
--- a/docs/assets/archify-live-proof.json
+++ b/docs/assets/archify-live-proof.json
@@ -7,13 +7,13 @@
"fps": 10,
"frameCount": 54,
"durationSeconds": 5.4,
- "bytes": 823212,
- "sha256": "478bae9e8784f1697dd4ed0ee0a625d956fb10d39e239b9cab0eae067437ecc0",
+ "bytes": 818216,
+ "sha256": "76393a564a6f2308f5b43dbb45abb3b5c30d4769d7bd7e652f0cafc77ff3888f",
"scenes": [
{
"id": "signal-flow",
"artifact": "docs/gallery/artifacts/agent-tool-call.workflow.html",
- "artifactSha256": "24a4dcac1de00f308cde2c7462d2a17b50dec693ae9c832061d7127da1bac7d0",
+ "artifactSha256": "b1782672eaf42be1cd727ffc680a640ca80d6ac8a34f06df9fb378d812749f81",
"hash": "#focus=planner&reach=downstream",
"eyebrow": "WORKFLOW · SIGNAL FLOW",
"title": "Agent Tool Call",
@@ -22,7 +22,7 @@
{
"id": "blueprint",
"artifact": "docs/gallery/artifacts/production-deployment.architecture.html",
- "artifactSha256": "29f7a68fcc47247626565ba8075ab8a30ad07aebdc00b56506ecfa6557fc26ff",
+ "artifactSha256": "9519f52cb31452614de1eb8c038439109795512ad85afefae2330f884dcfce70",
"hash": "#lens=backend~database",
"eyebrow": "ARCHITECTURE · BLUEPRINT",
"title": "Production Deployment",
@@ -31,7 +31,7 @@
{
"id": "classic",
"artifact": "docs/gallery/artifacts/cache-miss.sequence.html",
- "artifactSha256": "d440be3d2cfe129fade532d4451df960147704962769704d0d07743ad40bc8da",
+ "artifactSha256": "cee1dc2aa4b5a00d086c97c4de4276642f51ede49a686882489bdb947f241307",
"hash": "#route=web~db",
"eyebrow": "SEQUENCE · CLASSIC",
"title": "Cache Miss Request",
diff --git a/docs/cases/mco-runtime.architecture.html b/docs/cases/mco-runtime.architecture.html
index 6f5be6f7..c740a7c4 100644
--- a/docs/cases/mco-runtime.architecture.html
+++ b/docs/cases/mco-runtime.architecture.html
@@ -9575,24 +9575,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/docs/gallery.html b/docs/gallery.html
index 274a2c45..10e5dc2e 100644
--- a/docs/gallery.html
+++ b/docs/gallery.html
@@ -298,7 +298,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 11E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="24a4dcac1de00f308cde2c7462d2a17b50dec693ae9c832061d7127da1bac7d0">24a4dcac1de0</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="b1782672eaf42be1cd727ffc680a640ca80d6ac8a34f06df9fb378d812749f81">b1782672eaf4</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/agent-tool-call.workflow.html#focus=planner" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -328,7 +328,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="29f7a68fcc47247626565ba8075ab8a30ad07aebdc00b56506ecfa6557fc26ff">29f7a68fcc47</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="9519f52cb31452614de1eb8c038439109795512ad85afefae2330f884dcfce70">9519f52cb314</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/production-deployment.architecture.html#focus=gateway" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -357,7 +357,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="d440be3d2cfe129fade532d4451df960147704962769704d0d07743ad40bc8da">d440be3d2cfe</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="cee1dc2aa4b5a00d086c97c4de4276642f51ede49a686882489bdb947f241307">cee1dc2aa4b5</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/cache-miss.sequence.html#focus=redis" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -386,7 +386,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="2960bc9db427c854b6bc9e60bd2d45d4e879871844b0a6f835738afdeaf842fa">2960bc9db427</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="aeb0e57d564dbd09beac61069f44baab1cbd5b719ff006dc544902377d962af8">aeb0e57d564d</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/release-delivery.workflow.html#focus=approval" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -415,7 +415,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="62eb4b9de2fca5c8a175bf9ecd61aad5963175420d9b61f5606770a9e9fdd16c">62eb4b9de2fc</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="e0bc1abe26183623e4932c60ec046317b05d203402e7cb705bf527a47ba146e5">e0bc1abe2618</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/incident-response.workflow.html#focus=triage" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -444,7 +444,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="6a80413f9f9995e917db4c16426b0b96526ff1da218090a63f998ce1ffb8201c">6a80413f9f99</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="003f222205f3d7f755df5cb5d3056c24b276670f13ae8e73569865e2afc24857">003f222205f3</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/product-analytics.dataflow.html#focus=consent" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -473,7 +473,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 14E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="bca371d94625a542c20ced0e113bdfb77fafce847fa0d9adeb7f8e17f1b90866">bca371d94625</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="5ed60d29979165950a59d9cab3d9544f9be65990c85657b3c97b02eabbc02393">5ed60d299791</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/async-job-roundtrip.sequence.html#focus=queue" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -502,7 +502,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="1212d3391067efa1b0bbb8d92f77a32ec1d17c26148293c2247bb1ddb346f718">1212d3391067</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="1ec4a5f9a031fd12ea147466ffd5272702d40d18d3d24a6500e34a808656c54d">1ec4a5f9a031</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/event-stream.dataflow.html#focus=orders" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -531,7 +531,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 6E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="ad938300467d05f959afd54ee0a95975ac510a667317678637230bb82e9a92da">ad938300467d</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="3c73655d1c1972288f0ec6a3fcd20e6a8f87310012726785f8c4a44e24bdca33">3c73655d1c19</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/agent-run.lifecycle.html#focus=approval" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -560,7 +560,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 11E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="8cb194d9d30aaeb7e14de02b057b98f3061fb14f8066a4bdcde0b5b4dcd0bc29">8cb194d9d30a</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="5b4203d7824bd7877f79857634d2daa220e7e7ca6a1fc3688cdc8fccbcd79546">5b4203d7824b</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/deployment-release.lifecycle.html#focus=live" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -589,7 +589,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 9E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="b23a7a66751d4b21ffeb2103a7212ab06d71749fb78eedb4b227db115ec482dc">b23a7a66751d</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="47596a8d853f7763fbc287dbcebbf47c81781de5b2c80afa0fdbd83f26cd82f8">47596a8d853f</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/web-app.architecture.html#focus=api" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -667,8 +667,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 11,
- "artifactBytes": 766520,
- "artifactSha256": "24a4dcac1de00f308cde2c7462d2a17b50dec693ae9c832061d7127da1bac7d0",
+ "artifactBytes": 767515,
+ "artifactSha256": "b1782672eaf42be1cd727ffc680a640ca80d6ac8a34f06df9fb378d812749f81",
"sourceBytes": 4939,
"sourceSha256": "d67965d50872c97e4ff3476271e645bf19fab6b3ab44e111bdb44b063e3aa36f",
"checks": [
@@ -802,8 +802,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": "deployment-ownership",
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 769247,
- "artifactSha256": "29f7a68fcc47247626565ba8075ab8a30ad07aebdc00b56506ecfa6557fc26ff",
+ "artifactBytes": 770242,
+ "artifactSha256": "9519f52cb31452614de1eb8c038439109795512ad85afefae2330f884dcfce70",
"sourceBytes": 4734,
"sourceSha256": "cb54bad2dfd0c2d02aa5b496bde6839789a0f07f23062343c4458b8d38806c13",
"checks": [
@@ -935,8 +935,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 12,
- "artifactBytes": 761014,
- "artifactSha256": "d440be3d2cfe129fade532d4451df960147704962769704d0d07743ad40bc8da",
+ "artifactBytes": 762009,
+ "artifactSha256": "cee1dc2aa4b5a00d086c97c4de4276642f51ede49a686882489bdb947f241307",
"sourceBytes": 3805,
"sourceSha256": "f5c2e44f9a44000adc7c3b3040c4fcd88fe50b7cf8761302c21eb0c184e5780a",
"checks": [
@@ -1057,8 +1057,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 762034,
- "artifactSha256": "2960bc9db427c854b6bc9e60bd2d45d4e879871844b0a6f835738afdeaf842fa",
+ "artifactBytes": 763029,
+ "artifactSha256": "aeb0e57d564dbd09beac61069f44baab1cbd5b719ff006dc544902377d962af8",
"sourceBytes": 4510,
"sourceSha256": "dbd5c174af66296caec372e7214cf4df7158b50a563508e16826b95ab8d1cd6c",
"checks": [
@@ -1197,8 +1197,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 10,
- "artifactBytes": 759354,
- "artifactSha256": "62eb4b9de2fca5c8a175bf9ecd61aad5963175420d9b61f5606770a9e9fdd16c",
+ "artifactBytes": 760349,
+ "artifactSha256": "e0bc1abe26183623e4932c60ec046317b05d203402e7cb705bf527a47ba146e5",
"sourceBytes": 4723,
"sourceSha256": "630be98449925d2716ecb8439f404b2bff5fe65ba905b0ad0baea6d96890c526",
"checks": [
@@ -1383,8 +1383,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 763354,
- "artifactSha256": "6a80413f9f9995e917db4c16426b0b96526ff1da218090a63f998ce1ffb8201c",
+ "artifactBytes": 764349,
+ "artifactSha256": "003f222205f3d7f755df5cb5d3056c24b276670f13ae8e73569865e2afc24857",
"sourceBytes": 5035,
"sourceSha256": "8a635db9e51a5b1a8d2955b9d66f5b9a450e0a298432ce8f2e2f0be11f372e05",
"checks": [
@@ -1518,8 +1518,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 14,
- "artifactBytes": 760095,
- "artifactSha256": "bca371d94625a542c20ced0e113bdfb77fafce847fa0d9adeb7f8e17f1b90866",
+ "artifactBytes": 761090,
+ "artifactSha256": "5ed60d29979165950a59d9cab3d9544f9be65990c85657b3c97b02eabbc02393",
"sourceBytes": 3766,
"sourceSha256": "b8c6c52f1763ede2933c77deb8da59b3e06917bc41d27e66df896136456b859a",
"checks": [
@@ -1658,8 +1658,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 767274,
- "artifactSha256": "1212d3391067efa1b0bbb8d92f77a32ec1d17c26148293c2247bb1ddb346f718",
+ "artifactBytes": 768269,
+ "artifactSha256": "1ec4a5f9a031fd12ea147466ffd5272702d40d18d3d24a6500e34a808656c54d",
"sourceBytes": 4769,
"sourceSha256": "3bdd77674282009c7c68d588cf8a3c495bc98a3be1b9c45327fd1801a6f83a23",
"checks": [
@@ -1810,8 +1810,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 6,
- "artifactBytes": 757664,
- "artifactSha256": "ad938300467d05f959afd54ee0a95975ac510a667317678637230bb82e9a92da",
+ "artifactBytes": 758659,
+ "artifactSha256": "3c73655d1c1972288f0ec6a3fcd20e6a8f87310012726785f8c4a44e24bdca33",
"sourceBytes": 3405,
"sourceSha256": "230242a7557663877766c43a9fe7cffe8b4fb66e4866457dccd24c63175b4917",
"checks": [
@@ -1981,8 +1981,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 11,
- "artifactBytes": 764719,
- "artifactSha256": "8cb194d9d30aaeb7e14de02b057b98f3061fb14f8066a4bdcde0b5b4dcd0bc29",
+ "artifactBytes": 765714,
+ "artifactSha256": "5b4203d7824bd7877f79857634d2daa220e7e7ca6a1fc3688cdc8fccbcd79546",
"sourceBytes": 3507,
"sourceSha256": "f565a8acfebdb21453e2bccd82d3760b4736e38fe194fb2f0804b57817eba813",
"checks": [
@@ -2103,8 +2103,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 9,
- "artifactBytes": 761060,
- "artifactSha256": "b23a7a66751d4b21ffeb2103a7212ab06d71749fb78eedb4b227db115ec482dc",
+ "artifactBytes": 762055,
+ "artifactSha256": "47596a8d853f7763fbc287dbcebbf47c81781de5b2c80afa0fdbd83f26cd82f8",
"sourceBytes": 3197,
"sourceSha256": "95e051b27a9e4a3307e194c0f666fca4af51470be7e2228d400ff48aea5b353b",
"checks": [
diff --git a/docs/gallery/artifacts/agent-run.lifecycle.html b/docs/gallery/artifacts/agent-run.lifecycle.html
index c0493ab1..19b70312 100644
--- a/docs/gallery/artifacts/agent-run.lifecycle.html
+++ b/docs/gallery/artifacts/agent-run.lifecycle.html
@@ -9470,24 +9470,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/docs/gallery/artifacts/agent-tool-call.workflow.html b/docs/gallery/artifacts/agent-tool-call.workflow.html
index 7f602057..b638951b 100644
--- a/docs/gallery/artifacts/agent-tool-call.workflow.html
+++ b/docs/gallery/artifacts/agent-tool-call.workflow.html
@@ -9531,24 +9531,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/docs/gallery/artifacts/async-job-roundtrip.sequence.html b/docs/gallery/artifacts/async-job-roundtrip.sequence.html
index ba733333..974302c2 100644
--- a/docs/gallery/artifacts/async-job-roundtrip.sequence.html
+++ b/docs/gallery/artifacts/async-job-roundtrip.sequence.html
@@ -9552,24 +9552,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/docs/gallery/artifacts/cache-miss.sequence.html b/docs/gallery/artifacts/cache-miss.sequence.html
index 622b1504..980545e8 100644
--- a/docs/gallery/artifacts/cache-miss.sequence.html
+++ b/docs/gallery/artifacts/cache-miss.sequence.html
@@ -9540,24 +9540,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/docs/gallery/artifacts/deployment-release.lifecycle.html b/docs/gallery/artifacts/deployment-release.lifecycle.html
index e3e0bc02..918455b4 100644
--- a/docs/gallery/artifacts/deployment-release.lifecycle.html
+++ b/docs/gallery/artifacts/deployment-release.lifecycle.html
@@ -9543,24 +9543,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/docs/gallery/artifacts/event-stream.dataflow.html b/docs/gallery/artifacts/event-stream.dataflow.html
index a7273327..fe51ee7d 100644
--- a/docs/gallery/artifacts/event-stream.dataflow.html
+++ b/docs/gallery/artifacts/event-stream.dataflow.html
@@ -9564,24 +9564,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/docs/gallery/artifacts/incident-response.workflow.html b/docs/gallery/artifacts/incident-response.workflow.html
index 40a17877..ea584c51 100644
--- a/docs/gallery/artifacts/incident-response.workflow.html
+++ b/docs/gallery/artifacts/incident-response.workflow.html
@@ -9491,24 +9491,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/docs/gallery/artifacts/product-analytics.dataflow.html b/docs/gallery/artifacts/product-analytics.dataflow.html
index 65b29542..ac1d6fca 100644
--- a/docs/gallery/artifacts/product-analytics.dataflow.html
+++ b/docs/gallery/artifacts/product-analytics.dataflow.html
@@ -9525,24 +9525,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/docs/gallery/artifacts/production-deployment.architecture.html b/docs/gallery/artifacts/production-deployment.architecture.html
index 9357be4c..f330848d 100644
--- a/docs/gallery/artifacts/production-deployment.architecture.html
+++ b/docs/gallery/artifacts/production-deployment.architecture.html
@@ -9568,24 +9568,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/docs/gallery/artifacts/release-delivery.workflow.html b/docs/gallery/artifacts/release-delivery.workflow.html
index ac600e75..c996f294 100644
--- a/docs/gallery/artifacts/release-delivery.workflow.html
+++ b/docs/gallery/artifacts/release-delivery.workflow.html
@@ -9517,24 +9517,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/docs/gallery/artifacts/web-app.architecture.html b/docs/gallery/artifacts/web-app.architecture.html
index 59fdbc34..fdc9292b 100644
--- a/docs/gallery/artifacts/web-app.architecture.html
+++ b/docs/gallery/artifacts/web-app.architecture.html
@@ -9513,24 +9513,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/docs/gallery/manifest.json b/docs/gallery/manifest.json
index 3f8795a7..50f2c4c1 100644
--- a/docs/gallery/manifest.json
+++ b/docs/gallery/manifest.json
@@ -19,8 +19,8 @@
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 11,
- "artifactBytes": 766520,
- "artifactSha256": "24a4dcac1de00f308cde2c7462d2a17b50dec693ae9c832061d7127da1bac7d0",
+ "artifactBytes": 767515,
+ "artifactSha256": "b1782672eaf42be1cd727ffc680a640ca80d6ac8a34f06df9fb378d812749f81",
"sourceBytes": 4939,
"sourceSha256": "d67965d50872c97e4ff3476271e645bf19fab6b3ab44e111bdb44b063e3aa36f",
"checks": [
@@ -154,8 +154,8 @@
"engineeringProfile": "deployment-ownership",
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 769247,
- "artifactSha256": "29f7a68fcc47247626565ba8075ab8a30ad07aebdc00b56506ecfa6557fc26ff",
+ "artifactBytes": 770242,
+ "artifactSha256": "9519f52cb31452614de1eb8c038439109795512ad85afefae2330f884dcfce70",
"sourceBytes": 4734,
"sourceSha256": "cb54bad2dfd0c2d02aa5b496bde6839789a0f07f23062343c4458b8d38806c13",
"checks": [
@@ -287,8 +287,8 @@
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 12,
- "artifactBytes": 761014,
- "artifactSha256": "d440be3d2cfe129fade532d4451df960147704962769704d0d07743ad40bc8da",
+ "artifactBytes": 762009,
+ "artifactSha256": "cee1dc2aa4b5a00d086c97c4de4276642f51ede49a686882489bdb947f241307",
"sourceBytes": 3805,
"sourceSha256": "f5c2e44f9a44000adc7c3b3040c4fcd88fe50b7cf8761302c21eb0c184e5780a",
"checks": [
@@ -409,8 +409,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 762034,
- "artifactSha256": "2960bc9db427c854b6bc9e60bd2d45d4e879871844b0a6f835738afdeaf842fa",
+ "artifactBytes": 763029,
+ "artifactSha256": "aeb0e57d564dbd09beac61069f44baab1cbd5b719ff006dc544902377d962af8",
"sourceBytes": 4510,
"sourceSha256": "dbd5c174af66296caec372e7214cf4df7158b50a563508e16826b95ab8d1cd6c",
"checks": [
@@ -549,8 +549,8 @@
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 10,
- "artifactBytes": 759354,
- "artifactSha256": "62eb4b9de2fca5c8a175bf9ecd61aad5963175420d9b61f5606770a9e9fdd16c",
+ "artifactBytes": 760349,
+ "artifactSha256": "e0bc1abe26183623e4932c60ec046317b05d203402e7cb705bf527a47ba146e5",
"sourceBytes": 4723,
"sourceSha256": "630be98449925d2716ecb8439f404b2bff5fe65ba905b0ad0baea6d96890c526",
"checks": [
@@ -735,8 +735,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 763354,
- "artifactSha256": "6a80413f9f9995e917db4c16426b0b96526ff1da218090a63f998ce1ffb8201c",
+ "artifactBytes": 764349,
+ "artifactSha256": "003f222205f3d7f755df5cb5d3056c24b276670f13ae8e73569865e2afc24857",
"sourceBytes": 5035,
"sourceSha256": "8a635db9e51a5b1a8d2955b9d66f5b9a450e0a298432ce8f2e2f0be11f372e05",
"checks": [
@@ -870,8 +870,8 @@
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 14,
- "artifactBytes": 760095,
- "artifactSha256": "bca371d94625a542c20ced0e113bdfb77fafce847fa0d9adeb7f8e17f1b90866",
+ "artifactBytes": 761090,
+ "artifactSha256": "5ed60d29979165950a59d9cab3d9544f9be65990c85657b3c97b02eabbc02393",
"sourceBytes": 3766,
"sourceSha256": "b8c6c52f1763ede2933c77deb8da59b3e06917bc41d27e66df896136456b859a",
"checks": [
@@ -1010,8 +1010,8 @@
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 767274,
- "artifactSha256": "1212d3391067efa1b0bbb8d92f77a32ec1d17c26148293c2247bb1ddb346f718",
+ "artifactBytes": 768269,
+ "artifactSha256": "1ec4a5f9a031fd12ea147466ffd5272702d40d18d3d24a6500e34a808656c54d",
"sourceBytes": 4769,
"sourceSha256": "3bdd77674282009c7c68d588cf8a3c495bc98a3be1b9c45327fd1801a6f83a23",
"checks": [
@@ -1162,8 +1162,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 6,
- "artifactBytes": 757664,
- "artifactSha256": "ad938300467d05f959afd54ee0a95975ac510a667317678637230bb82e9a92da",
+ "artifactBytes": 758659,
+ "artifactSha256": "3c73655d1c1972288f0ec6a3fcd20e6a8f87310012726785f8c4a44e24bdca33",
"sourceBytes": 3405,
"sourceSha256": "230242a7557663877766c43a9fe7cffe8b4fb66e4866457dccd24c63175b4917",
"checks": [
@@ -1333,8 +1333,8 @@
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 11,
- "artifactBytes": 764719,
- "artifactSha256": "8cb194d9d30aaeb7e14de02b057b98f3061fb14f8066a4bdcde0b5b4dcd0bc29",
+ "artifactBytes": 765714,
+ "artifactSha256": "5b4203d7824bd7877f79857634d2daa220e7e7ca6a1fc3688cdc8fccbcd79546",
"sourceBytes": 3507,
"sourceSha256": "f565a8acfebdb21453e2bccd82d3760b4736e38fe194fb2f0804b57817eba813",
"checks": [
@@ -1455,8 +1455,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 9,
- "artifactBytes": 761060,
- "artifactSha256": "b23a7a66751d4b21ffeb2103a7212ab06d71749fb78eedb4b227db115ec482dc",
+ "artifactBytes": 762055,
+ "artifactSha256": "47596a8d853f7763fbc287dbcebbf47c81781de5b2c80afa0fdbd83f26cd82f8",
"sourceBytes": 3197,
"sourceSha256": "95e051b27a9e4a3307e194c0f666fca4af51470be7e2228d400ff48aea5b353b",
"checks": [
diff --git a/examples/checkout-platform-delta.html b/examples/checkout-platform-delta.html
index 40691ea5..fe5e5a78 100644
--- a/examples/checkout-platform-delta.html
+++ b/examples/checkout-platform-delta.html
@@ -14164,24 +14164,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- &#39;text[data-node-label], text[data-boundary-label], text[data-detail=&quot;context&quot;]&#39;
- ];
- if (measuredHeightFit &amp;&amp; ratio &gt;= WIDE_RATIO &amp;&amp; Number.isFinite(declaredMinimumText)) {
- selectors.push(&#39;g[data-detail=&quot;context&quot;][data-edge-from][data-edge-to] &gt; text&#39;);
- }
- Array.from(svg.querySelectorAll(selectors.join(&#39;, &#39;))).forEach(function (text) {
- if (text.getAttribute(&#39;data-detail&#39;) === &#39;context&#39; &amp;&amp; !text.closest(&#39;[data-node-id]&#39;)) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = &#39;text[data-node-label], text[data-boundary-label], text[data-detail=&quot;context&quot;], g[data-detail=&quot;context&quot;] text&#39;;
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute(&#39;data-detail&#39;) === &#39;fine&#39; || text.closest(&#39;[data-detail=&quot;fine&quot;]&#39;)) return;
var sourceFontPx = parseFloat(text.getAttribute(&#39;font-size&#39;) || &#39;&#39;);
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute(&#39;data-node-label&#39;) || text.hasAttribute(&#39;data-boundary-label&#39;);
+ var context = text.getAttribute(&#39;data-detail&#39;) === &#39;context&#39; || Boolean(text.closest(&#39;g[data-detail=&quot;context&quot;]&#39;));
+ if (!primary &amp;&amp; context &amp;&amp; text.closest(&#39;[data-edge-from][data-edge-to]&#39;)) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest(&#39;[data-node-id]&#39;)) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit &amp;&amp; ratio &gt;= WIDE_RATIO &amp;&amp; Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale &gt; 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll(&#39;text[data-node-label]&#39;)).forEach(function (text) {
@@ -28205,24 +28215,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- &#39;text[data-node-label], text[data-boundary-label], text[data-detail=&quot;context&quot;]&#39;
- ];
- if (measuredHeightFit &amp;&amp; ratio &gt;= WIDE_RATIO &amp;&amp; Number.isFinite(declaredMinimumText)) {
- selectors.push(&#39;g[data-detail=&quot;context&quot;][data-edge-from][data-edge-to] &gt; text&#39;);
- }
- Array.from(svg.querySelectorAll(selectors.join(&#39;, &#39;))).forEach(function (text) {
- if (text.getAttribute(&#39;data-detail&#39;) === &#39;context&#39; &amp;&amp; !text.closest(&#39;[data-node-id]&#39;)) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = &#39;text[data-node-label], text[data-boundary-label], text[data-detail=&quot;context&quot;], g[data-detail=&quot;context&quot;] text&#39;;
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute(&#39;data-detail&#39;) === &#39;fine&#39; || text.closest(&#39;[data-detail=&quot;fine&quot;]&#39;)) return;
var sourceFontPx = parseFloat(text.getAttribute(&#39;font-size&#39;) || &#39;&#39;);
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute(&#39;data-node-label&#39;) || text.hasAttribute(&#39;data-boundary-label&#39;);
+ var context = text.getAttribute(&#39;data-detail&#39;) === &#39;context&#39; || Boolean(text.closest(&#39;g[data-detail=&quot;context&quot;]&#39;));
+ if (!primary &amp;&amp; context &amp;&amp; text.closest(&#39;[data-edge-from][data-edge-to]&#39;)) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest(&#39;[data-node-id]&#39;)) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit &amp;&amp; ratio &gt;= WIDE_RATIO &amp;&amp; Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale &gt; 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll(&#39;text[data-node-label]&#39;)).forEach(function (text) {
diff --git a/examples/checkout-platform-delta.receipt.json b/examples/checkout-platform-delta.receipt.json
index 3dd615f6..7d9a22cc 100644
--- a/examples/checkout-platform-delta.receipt.json
+++ b/examples/checkout-platform-delta.receipt.json
@@ -219,8 +219,8 @@
"Boundary identity is conservatively derived from kind + label."
],
"artifact": {
- "sha256": "8220fc86cdf943baf70be82b6e5ee164e97cb5b4ea1ad950910af133ef379129",
- "bytes": 2121217
+ "sha256": "ccf83bec59edc2c57834e2c8c7c00e73c60ab1088ba98e617e832b37548a2192",
+ "bytes": 2123343
},
"validation": {
"checksPassed": 28,
diff --git a/examples/dataflow-product-analytics.html b/examples/dataflow-product-analytics.html
index 65b29542..ac1d6fca 100644
--- a/examples/dataflow-product-analytics.html
+++ b/examples/dataflow-product-analytics.html
@@ -9525,24 +9525,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/examples/lifecycle-agent-run.html b/examples/lifecycle-agent-run.html
index c0493ab1..19b70312 100644
--- a/examples/lifecycle-agent-run.html
+++ b/examples/lifecycle-agent-run.html
@@ -9470,24 +9470,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/examples/sequence-cache-miss-request.html b/examples/sequence-cache-miss-request.html
index 622b1504..980545e8 100644
--- a/examples/sequence-cache-miss-request.html
+++ b/examples/sequence-cache-miss-request.html
@@ -9540,24 +9540,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/examples/web-app-rendered.html b/examples/web-app-rendered.html
index 59fdbc34..fdc9292b 100644
--- a/examples/web-app-rendered.html
+++ b/examples/web-app-rendered.html
@@ -9513,24 +9513,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/examples/web-app.html b/examples/web-app.html
index 59fdbc34..fdc9292b 100644
--- a/examples/web-app.html
+++ b/examples/web-app.html
@@ -9513,24 +9513,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/examples/workflow-agent-tool-call-rendered.html b/examples/workflow-agent-tool-call-rendered.html
index 7f602057..b638951b 100644
--- a/examples/workflow-agent-tool-call-rendered.html
+++ b/examples/workflow-agent-tool-call-rendered.html
@@ -9531,24 +9531,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/experiments/mco-showcase/mco-runtime.html b/experiments/mco-showcase/mco-runtime.html
index 7e8306a2..50a08bff 100644
--- a/experiments/mco-showcase/mco-runtime.html
+++ b/experiments/mco-showcase/mco-runtime.html
@@ -9538,24 +9538,34 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
diff --git a/viewer/reader-layout.js b/viewer/reader-layout.js
index 7127da18..4b99e1a2 100644
--- a/viewer/reader-layout.js
+++ b/viewer/reader-layout.js
@@ -71,24 +71,34 @@
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ // Smallest scale that keeps node text at the requested floor and
+ // context relationship labels readable. A declared wide reader holds
+ // relationship labels to the requested floor too; every other reader
+ // still keeps them at the 6px hard floor the browser gate enforces, so
+ // a first-screen fit can never push them below it.
function minimumReadableScale() {
- var sourceMinimum = null;
- var selectors = [
- 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
- ];
- if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
- selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
- }
- Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
- if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var nodeMinimum = null;
+ var edgeMinimum = null;
+ var selectors = 'text[data-node-label], text[data-boundary-label], text[data-detail="context"], g[data-detail="context"] text';
+ Array.from(svg.querySelectorAll(selectors)).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'fine' || text.closest('[data-detail="fine"]')) return;
var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
- if (Number.isFinite(sourceFontPx)) {
- sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ if (!Number.isFinite(sourceFontPx)) return;
+ var primary = text.hasAttribute('data-node-label') || text.hasAttribute('data-boundary-label');
+ var context = text.getAttribute('data-detail') === 'context' || Boolean(text.closest('g[data-detail="context"]'));
+ if (!primary && context && text.closest('[data-edge-from][data-edge-to]')) {
+ edgeMinimum = edgeMinimum == null ? sourceFontPx : Math.min(edgeMinimum, sourceFontPx);
+ } else if (primary || text.closest('[data-node-id]')) {
+ nodeMinimum = nodeMinimum == null ? sourceFontPx : Math.min(nodeMinimum, sourceFontPx);
}
});
- return sourceMinimum != null
- ? Math.min(1, requestedMinimumText / sourceMinimum)
- : 1;
+ var edgeTarget = measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? requestedMinimumText
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var scale = 0;
+ if (nodeMinimum != null) scale = Math.max(scale, requestedMinimumText / nodeMinimum);
+ if (edgeMinimum != null) scale = Math.max(scale, edgeTarget / edgeMinimum);
+ return scale > 0 ? Math.min(1, scale) : 1;
}
var sourcePrimary = null;
if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {