Prompt specification
Build or customize the Three.js 3D scene "Where the Metaphor Breaks" inside the active workspace.
Engineering Constraints:
1. Runtime & Orbit: Use Three.js r160 with OrbitControls (damping enabled) and ACESFilmicToneMapping.
2. Frame Timing: Drive all motion strictly with clock.getDelta() so animation speed is FPS-independent.
3. Viewport Hygiene: Handle window resize cleanly, cap DPR at Math.min(window.devicePixelRatio, 2), and dispose geometries/materials/renderer on unmount.
Scene Metadata:
Scene: Where the Metaphor Breaks
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/where-the-metaphor-breaks-x3392
Scene Description Prompt:
Where the metaphor breaks. Build paired literal and metaphorical displays of a network growing. Let users inspect which relations correspond and which physical features do not transfer to the abstract concept. Please build this with Three.js from cdnjs in one self-contained HTML file, using visible voxel blocks.
Working Three.js Starter (where-the-metaphor-breaks-x3392):
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#07100f" />
<title>Where the Metaphor Breaks</title>
<style>
:root {
color-scheme: dark;
--bg: #07100f;
--panel: #0c1716;
--panel-2: #101d1b;
--line: rgba(219, 239, 228, 0.13);
--line-strong: rgba(219, 239, 228, 0.24);
--text: #e8f0e9;
--muted: #8fa59a;
--literal: #73e7b5;
--abstract: #bea7ff;
--mint: #a8f0ce;
--orange: #ffb35c;
--red: #ff8c82;
--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
--sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* {
box-sizing: border-box;
}
html {
background: var(--bg);
}
body {
margin: 0;
min-width: 320px;
color: var(--text);
font-family: var(--sans);
background:
radial-gradient(circle at 15% 0%, rgba(68, 151, 113, 0.13), transparent 28rem),
radial-gradient(circle at 90% 12%, rgba(140, 103, 214, 0.12), transparent 31rem),
var(--bg);
}
button,
input,
select {
font: inherit;
}
button,
select {
color: inherit;
}
button {
cursor: pointer;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
canvas:focus-visible {
outline: 2px solid var(--mint);
outline-offset: 3px;
}
.app {
width: min(1500px, calc(100% - 40px));
margin: 0 auto;
padding: 28px 0 36px;
}
.topbar {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
gap: 32px;
align-items: end;
padding: 10px 2px 28px;
border-bottom: 1px solid var(--line);
}
.eyebrow,
.panel-index,
.mono-label {
font-family: var(--mono);
font-size: 10px;
font-weight: 700;
letter-spacing: 0.16em;
text-transform: uppercase;
}
.eyebrow {
display: flex;
align-items: center;
gap: 10px;
color: var(--muted);
}
.eyebrow::before {
content: "";
width: 22px;
height: 1px;
background: var(--mint);
}
h1 {
max-width: 850px;
margin: 12px 0 10px;
font-size: clamp(38px, 5.4vw, 78px);
font-weight: 520;
line-height: 0.95;
letter-spacing: -0.055em;
}
.dek {
max-width: 720px;
margin: 0;
color: #afc0b6;
font-size: clamp(15px, 1.4vw, 18px);
line-height: 1.55;
}
.model-status {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 13px;
border: 1px solid var(--line-strong);
border-radius: 999px;
color: #c8d6cd;
background: rgba(8, 18, 16, 0.68);
font-family: var(--mono);
font-size: 10px;
letter-spacing: 0.12em;
white-space: nowrap;
}
.status-dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--mint);
box-shadow: 0 0 0 4px rgba(168, 240, 206, 0.1);
animation: breathe 1.8s ease-in-out infinite;
}
@keyframes breathe {
50% { opacity: 0.45; transform: scale(0.8); }
}
.workspace {
position: relative;
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap: 42px;
margin-top: 22px;
}
.view {
min-width: 0;
overflow: hidden;
border: 1px solid var(--line);
border-radius: 20px;
background: linear-gradient(180deg, rgba(18, 30, 28, 0.95), rgba(8, 17, 16, 0.96));
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
}
.view.abstract-view {
background: linear-gradient(180deg, rgba(26, 20, 34, 0.96), rgba(11, 10, 19, 0.98));
}
.view-header {
display: grid;
grid-template-columns: 1fr auto;
gap: 18px;
align-items: start;
min-height: 112px;
padding: 20px 22px 17px;
border-bottom: 1px solid var(--line);
}
.panel-index {
margin-bottom: 7px;
color: var(--literal);
}
.abstract-view .panel-index {
color: var(--abstract);
}
.view h2 {
margin: 0;
font-size: 20px;
font-weight: 560;
letter-spacing: -0.025em;
}
.view-description {
max-width: 460px;
margin: 6px 0 0;
color: var(--muted);
font-size: 12px;
line-height: 1.5;
}
.space-badge {
padding: 7px 9px;
border: 1px solid rgba(115, 231, 181, 0.25);
border-radius: 999px;
color: var(--literal);
background: rgba(115, 231, 181, 0.06);
font-family: var(--mono);
font-size: 9px;
letter-spacing: 0.12em;
white-space: nowrap;
}
.abstract-view .space-badge {
color: var(--abstract);
border-color: rgba(190, 167, 255, 0.27);
background: rgba(190, 167, 255, 0.06);
}
.canvas-wrap {
position: relative;
height: clamp(360px, 38vw, 510px);
overflow: hidden;
background: #071312;
}
.abstract-view .canvas-wrap {
background: #100c17;
}
canvas {
display: block;
width: 100%;
height: 100%;
touch-action: none;
cursor: grab;
}
canvas:active {
cursor: grabbing;
}
.pair-flag {
position: absolute;
z-index: 2;
top: 14px;
left: 50%;
max-width: calc(100% - 32px);
transform: translateX(-50%);
padding: 7px 11px;
border: 1px solid rgba(222, 241, 230, 0.16);
border-radius: 999px;
color: #c8d6cd;
background: rgba(5, 12, 11, 0.72);
backdrop-filter: blur(10px);
font-family: var(--mono);
font-size: 9px;
letter-spacing: 0.07em;
text-align: center;
pointer-events: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.abstract-view .pair-flag {
background: rgba(13, 8, 20, 0.76);
}
.legend {
position: absolute;
z-index: 2;
right: 14px;
bottom: 13px;
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
gap: 8px 12px;
max-width: calc(100% - 28px);
color: #91a69b;
font-family: var(--mono);
font-size: 9px;
pointer-events: none;
}
.legend-item {
display: inline-flex;
align-items: center;
gap: 6px;
}
.legend-block {
width: 8px;
height: 8px;
background: var(--literal);
box-shadow: 0 0 8px rgba(115, 231, 181, 0.35);
}
.abstract-view .legend-block {
background: var(--abstract);
box-shadow: 0 0 8px rgba(190, 167, 255, 0.35);
}
.legend-line {
width: 18px;
height: 3px;
background: #70d9df;
box-shadow: 0 0 7px rgba(112, 217, 223, 0.3);
}
.legend-metric {
width: 8px;
height: 8px;
border: 1px solid var(--orange);
background: rgba(255, 179, 92, 0.32);
}
.tooltip {
position: absolute;
z-index: 5;
display: none;
max-width: 230px;
padding: 9px 11px;
border: 1px solid var(--line-strong);
border-radius: 9px;
color: var(--text);
background: rgba(7, 14, 13, 0.94);
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
font-family: var(--mono);
font-size: 10px;
line-height: 1.45;
pointer-events: none;
}
.abstract-view .tooltip {
background: rgba(17, 10, 25, 0.95);
}
.tooltip strong {
color: var(--mint);
font-weight: 700;
}
.abstract-view .tooltip strong {
color: var(--abstract);
}
.bridge {
position: absolute;
z-index: 4;
top: 47%;
left: 50%;
display: grid;
place-items: center;
width: 44px;
height: 44px;
transform: translate(-50%, -50%);
border: 1px solid var(--line-strong);
border-radius: 50%;
color: var(--mint);
background: #0a1412;
box-shadow: 0 0 0 8px rgba(7, 16, 15, 0.9);
font-family: var(--mono);
font-size: 13px;
}
.bridge::before,
.bridge::after {
content: "";
position: absolute;
top: 50%;
width: 22px;
height: 1px;
background: var(--line-strong);
}
.bridge::before { right: 100%; }
.bridge::after { left: 100%; }
.analysis {
display: grid;
grid-template-columns: minmax(320px, 0.9fr) minmax(480px, 1.3fr);
gap: 18px;
margin-top: 18px;
}
.card {
border: 1px solid var(--line);
border-radius: 18px;
background: rgba(12, 23, 22, 0.86);
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.13);
}
.control-card,
.inspector-card {
padding: 20px;
}
.card-header,
.inspector-heading,
.relation-index-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 14px;
}
.card-title {
margin: 0;
font-size: 15px;
font-weight: 590;
letter-spacing: -0.015em;
}
.phase {
color: var(--mint);
font-family: var(--mono);
font-size: 9px;
letter-spacing: 0.1em;
text-transform: uppercase;
}
.transport {
display: flex;
align-items: center;
gap: 8px;
margin-top: 17px;
}
.icon-button,
.soft-button,
.toggle-button {
min-height: 36px;
border: 1px solid var(--line-strong);
border-radius: 9px;
background: rgba(255, 255, 255, 0.035);
transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.icon-button:hover,
.soft-button:hover,
.toggle-button:hover {
border-color: rgba(168, 240, 206, 0.42);
background: rgba(168, 240, 206, 0.08);
}
.icon-button:active,
.soft-button:active,
.toggle-button:active {
transform: translateY(1px);
}
.icon-button {
min-width: 38px;
padding: 0 10px;
font-family: var(--mono);
font-size: 12px;
}
#playButton {
min-width: 88px;
color: #07100f;
border-color: var(--mint);
background: var(--mint);
font-weight: 750;
}
#playButton:hover {
background: #c0f5db;
}
.speed-select {
height: 36px;
padding: 0 28px 0 10px;
border: 1px solid var(--line-strong);
border-radius: 9px;
background: #101b19;
font-family: var(--mono);
font-size: 10px;
}
.timeline-wrap {
position: relative;
margin-top: 21px;
}
input[type="range"] {
width: 100%;
height: 4px;
margin: 0;
border-radius: 999px;
outline: none;
appearance: none;
background:
linear-gradient(90deg, var(--mint) 0 var(--progress, 0%), rgba(255,255,255,.11) var(--progress, 0%) 100%);
cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
width: 15px;
height: 15px;
border: 3px solid #0c1716;
border-radius: 50%;
appearance: none;
background: var(--mint);
box-shadow: 0 0 0 1px var(--mint), 0 0 16px rgba(168, 240, 206, 0.4);
}
input[type="range"]::-moz-range-thumb {
width: 10px;
height: 10px;
border: 3px solid #0c1716;
border-radius: 50%;
background: var(--mint);
box-shadow: 0 0 0 1px var(--mint);
}
.timeline-labels {
display: flex;
justify-content: space-between;
margin-top: 10px;
color: #70847a;
font-family: var(--mono);
font-size: 8px;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.metrics {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
margin-top: 20px;
}
.metric {
padding: 12px;
border: 1px solid var(--line);
border-radius: 11px;
background: rgba(255, 255, 255, 0.025);
}
.metric-label {
display: block;
margin-bottom: 6px;
color: var(--muted);
font-family: var(--mono);
font-size: 8px;
letter-spacing: 0.1em;
text-transform: uppercase;
}
.metric-value {
display: block;
font-size: 17px;
font-weight: 560;
letter-spacing: -0.03em;
}
.control-footer {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-top: 16px;
}
.toggle-button {
padding: 0 11px;
color: #b9c8bf;
font-family: var(--mono);
font-size: 9px;
}
.toggle-button[aria-pressed="true"] {
color: var(--orange);
border-color: rgba(255, 179, 92, 0.4);
background: rgba(255, 179, 92, 0.08);
}
.linked-note {
color: #758a7f;
font-family: var(--mono);
font-size: 9px;
white-space: nowrap;
}
.linked-note::before {
content: "";
display: inline-block;
width: 5px;
height: 5px;
margin-right: 7px;
border-radius: 50%;
background: var(--mint);
vertical-align: 1px;
}
.inspector-heading {
align-items: flex-start;
}
.inspector-kicker {
display: flex;
align-items: center;
gap: 8px;
color: var(--muted);
font-family: var(--mono);
font-size: 9px;
letter-spacing: 0.12em;
text-transform: uppercase;
}
.inspector-kicker::before {
content: "";
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--mint);
}
.clear-button {
padding: 0;
border: 0;
color: #758a7f;
background: none;
font-family: var(--mono);
font-size: 9px;
}
.clear-button:hover {
color: var(--text);
}
.selection-title {
margin: 13px 0 4px;
font-size: clamp(22px, 2.3vw, 31px);
font-weight: 530;
line-height: 1.12;
letter-spacing: -0.035em;
}
.selection-subtitle {
min-height: 20px;
margin: 0;
color: var(--muted);
font-size: 12px;
line-height: 1.5;
}
.mapping-strip {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1px;
margin-top: 17px;
overflow: hidden;
border: 1px solid var(--line);
border-radius: 11px;
background: var(--line);
}
.mapping-cell {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 10px 12px;
background: #101b19;
font-family: var(--mono);
font-size: 9px;
letter-spacing: 0.06em;
}
.mapping-cell span {
color: var(--muted);
}
.mapping-cell strong {
color: var(--mint);
font-weight: 700;
}
.mapping-cell:last-child strong {
color: var(--orange);
}
.compare-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
margin-top: 12px;
}
.cue-list {
padding: 14px;
border: 1px solid var(--line);
border-radius: 12px;
background: rgba(255, 255, 255, 0.022);
}
.cue-list.breaks {
border-color: rgba(255, 179, 92, 0.19);
background: rgba(255, 179, 92, 0.025);
}
.cue-heading {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 10px;
font-size: 12px;
font-weight: 650;
}
.cue-icon {
display: grid;
place-items: center;
width: 17px;
height: 17px;
border-radius: 50%;
color: #07100f;
background: var(--mint);
font-family: var(--mono);
font-size: 10px;
font-weight: 900;
}
.breaks .cue-icon {
color: #201307;
background: var(--orange);
}
.cue-list ul {
display: grid;
gap: 8px;
margin: 0;
padding: 0;
list-style: none;
}
.cue-list li {
position: relative;
padding-left: 12px;
color: #9fb2a7;
font-size: 11px;
line-height: 1.45;
}
.cue-list li::before {
content: "";
position: absolute;
top: 0.58em;
left: 0;
width: 4px;
height: 4px;
border-radius: 50%;
background: rgba(168, 240, 206, 0.7);
}
.breaks li::before {
background: rgba(255, 179, 92, 0.8);
}
.pair-data {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
margin-top: 12px;
}
.data-column {
padding: 13px;
border: 1px solid var(--line);
border-radius: 12px;
}
.data-column h4 {
margin: 0 0 10px;
color: var(--literal);
font-family: var(--mono);
font-size: 9px;
letter-spacing: 0.1em;
text-transform: uppercase;
}
.data-column.abstract-data h4 {
color: var(--abstract);
}
.data-row {
display: grid;
grid-template-columns: 1fr auto;
gap: 14px;
padding: 6px 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.055);
color: #8fa59a;
font-size: 10px;
}
.data-row:last-child {
border-bottom: 0;
}
.data-row strong {
color: #d9e4dc;
font-weight: 500;
text-align: right;
}
.break-note {
display: grid;
grid-template-columns: auto 1fr;
gap: 13px;
align-items: start;
margin-top: 12px;
padding: 12px 14px;
border-left: 2px solid var(--orange);
border-radius: 0 10px 10px 0;
color: #c9d3cc;
background: rgba(255, 179, 92, 0.055);
font-size: 11px;
line-height: 1.5;
}
.break-note span {
color: var(--orange);
font-family: var(--mono);
font-size: 9px;
font-weight: 700;
letter-spacing: 0.1em;
}
.relation-index {
margin-top: 15px;
padding-top: 14px;
border-top: 1px solid var(--line);
}
.relation-index-header {
margin-bottom: 9px;
color: var(--muted);
font-family: var(--mono);
font-size: 9px;
letter-spacing: 0.09em;
text-transform: uppercase;
}
.relation-chips {
display: grid;
grid-template-columns: repeat(8, minmax(0, 1fr));
gap: 5px;
}
.relation-chip {
min-width: 0;
padding: 7px 3px;
border: 1px solid var(--line);
border-radius: 7px;
color: #80968b;
background: rgba(255, 255, 255, 0.025);
font-family: var(--mono);
font-size: 9px;
transition: 140ms ease;
}
.relation-chip:hover,
.relation-chip.incident {
color: var(--text);
border-color: var(--line-strong);
background: rgba(255, 255, 255, 0.06);
}
.relation-chip.active {
color: #07100f;
border-color: var(--mint);
background: var(--mint);
font-weight: 800;
}
.footer {
display: flex;
justify-content: space-between;
gap: 24px;
margin-top: 18px;
padding: 0 3px;
color: #6f8378;
font-family: var(--mono);
font-size: 9px;
line-height: 1.6;
}
.footer strong {
color: #9db0a5;
font-weight: 500;
}
.loading {
position: absolute;
z-index: 6;
inset: 0;
display: grid;
place-items: center;
color: var(--mint);
background: #071312;
font-family: var(--mono);
font-size: 10px;
letter-spacing: 0.12em;
text-transform: uppercase;
transition: opacity 350ms ease;
}
.abstract-view .loading {
color: var(--abstract);
background: #100c17;
}
.loading.hidden {
opacity: 0;
pointer-events: none;
}
@media (max-width: 1080px) {
.analysis {
grid-template-columns: 1fr;
}
.relation-chips {
grid-template-columns: repeat(8, minmax(0, 1fr));
}
}
@media (max-width: 820px) {
.app {
width: min(100% - 24px, 1500px);
padding-top: 18px;
}
.topbar {
grid-template-columns: 1fr;
gap: 18px;
}
.model-status {
justify-self: start;
}
.workspace {
grid-template-columns: 1fr;
gap: 18px;
}
.bridge {
display: none;
}
.canvas-wrap {
height: 420px;
}
.view-header {
min-height: 102px;
}
.relation-chips {
grid-template-columns: repeat(8, minmax(0, 1fr));
}
}
@media (max-width: 560px) {
.view-header {
grid-template-columns: 1fr;
gap: 10px;
}
.space-badge {
justify-self: start;
}
.canvas-wrap {
height: 360px;
}
.compare-grid,
.pair-data,
.mapping-strip {
grid-template-columns: 1fr;
}
.relation-chips {
grid-template-columns: repeat(4, 1fr);
}
.metrics {
grid-template-columns: 1fr;
}
.control-footer,
.footer {
align-items: flex-start;
flex-direction: column;
}
.legend {
justify-content: flex-start;
}
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
scroll-behavior: auto !important;
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
</style>
</head>
<body>
<main class="app">
<header class="topbar">
<div>
<div class="eyebrow">Topology study / paired systems</div>
<h1>Where the metaphor breaks.</h1>
<p class="dek">
Two networks grow in parallel. Their relations correspond; their physical
properties do not. Inspect what survives the translation—and what does not.
</p>
</div>
<div class="model-status" aria-live="polite">
<span class="status-dot"></span>
<span id="modelStatus">Model growing</span>
</div>
</header>
<section class="workspace" aria-label="Paired literal and metaphorical network displays">
<article class="view literal-view">
<header class="view-header">
<div>
<div class="panel-index">01 / Literal</div>
<h2>Fiber infrastructure</h2>
<p class="view-description">
Facilities, cable routes, engineered distance, capacity, and propagation delay.
</p>
</div>
<span class="space-badge">Metric space</span>
</header>
<div class="canvas-wrap">
<canvas
id="literalCanvas"
tabindex="0"
aria-label="Interactive three-dimensional literal fiber infrastructure network"
></canvas>
<div class="loading" id="literalLoading">Assembling literal voxels…</div>
<div class="pair-flag" id="literalPair">Select a block to inspect its pair</div>
<div class="tooltip" id="literalTooltip"></div>
<div class="legend" aria-hidden="true">
<span class="legend-item"><i class="legend-block"></i> Facility</span>
<span class="legend-item"><i class="legend-line"></i> Cable route</span>
<span class="legend-item"><i class="legend-metric"></i> Literal-only cue</span>
</div>
</div>
</article>
<div class="bridge" aria-hidden="true">R↔R</div>
<article class="view abstract-view">
<header class="view-header">
<div>
<div class="panel-index">02 / Metaphorical</div>
<h2>Coordination network</h2>
<p class="view-description">
Communities, working relationships, and shared context in an illustrative layout.
</p>
</div>
<span class="space-badge">Illustrative space</span>
</header>
<div class="canvas-wrap">
<canvas
id="abstractCanvas"
tabindex="0"
aria-label="Interactive three-dimensional metaphorical coordination network"
></canvas>
<div class="loading" id="abstractLoading">Assembling abstract voxels…</div>
<div class="pair-flag" id="abstractPair">Select a block to inspect its pair</div>
<div class="tooltip" id="abstractTooltip"></div>
<div class="legend" aria-hidden="true">
<span class="legend-item"><i class="legend-block"></i> Group / role</span>
<span class="legend-item"><i class="legend-line"></i> Social relation</span>
<span class="legend-item">Shared color = relation ID</span>
</div>
</div>
</article>
</section>
<section class="analysis" aria-label="Growth controls and mapping inspector">
<article class="card control-card">
<div class="card-header">
<h2 class="card-title">Growth clock</h2>
<span class="phase" id="phaseLabel">Exchange formation</span>
</div>
<div class="transport">
<button class="icon-button" id="resetButton" title="Restart growth" aria-label="Restart growth">↺</button>
<button class="icon-button" id="playButton" aria-label="Pause growth">
<span id="playGlyph">Ⅱ</span><span id="playText"> Pause</span>
</button>
<button class="icon-button" id="stepButton" title="Advance five time units" aria-label="Advance five time units">+5</button>
<select class="speed-select" id="speedSelect" aria-label="Playback speed">
<option value="0.5">0.5×</option>
<option value="1" selected>1×</option>
<option value="2">2×</option>
</select>
</div>
<div class="timeline-wrap">
<input
id="timeline"
type="range"
min="0"
max="110"
step="0.1"
value="24"
aria-label="Network growth time"
/>
<div class="timeline-labels">
<span>0 / exchange</span>
<span>30 / backbone</span>
<span>65 / branches</span>
<span>110 / dense</span>
</div>
</div>
<div class="metrics">
<div class="metric">
<span class="metric-label">Facilities visible</span>
<strong class="metric-value" id="nodeMetric">0 / 12</strong>
</div>
<div class="metric">
<span class="metric-label">Relations active</span>
<strong class="metric-value" id="relationMetric">0 / 16</strong>
</div>
<div class="metric">
<span class="metric-label">Simulation time</span>
<strong class="metric-value" id="timeMetric">24.0</strong>
</div>
</div>
<div class="control-footer">
<button class="toggle-button" id="breaksToggle" aria-pressed="true">
Physical-only cues: on
</button>
<button class="toggle-button" id="resetViewButton">Reset view</button>
<span class="linked-note">Cameras linked</span>
</div>
</article>
<article class="card inspector-card">
<div class="inspector-heading">
<div class="inspector-kicker">Mapping inspector</div>
<button class="clear-button" id="clearSelection">Clear selection</button>
</div>
<h2 class="selection-title" id="selectionTitle">R04 · West feeder</h2>
<p class="selection-subtitle" id="selectionSubtitle"></p>
<div class="mapping-strip">
<div class="mapping-cell"><span>Topology</span><strong>Transfers</strong></div>
<div class="mapping-cell"><span>Physical geometry</span><strong>Breaks</strong></div>
</div>
<div class="compare-grid">
<section class="cue-list">
<div class="cue-heading"><span class="cue-icon">✓</span> What transfers</div>
<ul id="transferList"></ul>
</section>
<section class="cue-list breaks">
<div class="cue-heading"><span class="cue-icon">×</span> What breaks</div>
<ul id="breakList"></ul>
</section>
</div>
<div class="pair-data">
<section class="data-column literal-data">
<h4>Literal attributes</h4>
<div id="literalData"></div>
</section>
<section class="data-column abstract-data">
<h4>Abstract attributes</h4>
<div id="abstractData"></div>
</section>
</div>
<div class="break-note">
<span>THE BREAK</span>
<p id="breakNote"></p>
</div>
<div class="relation-index">
<div class="relation-index-header">
<span>Correspondence index / select relation</span>
<span id="activationState">Active at t=21</span>
</div>
<div class="relation-chips" id="relationIndex"></div>
</div>
</article>
</section>
<footer class="footer">
<span><strong>Method:</strong> the two displays share relation IDs, endpoint role pairs, and growth timing.</span>
<span><strong>Controls:</strong> drag to orbit · scroll to zoom · click a block to pair · double-click to reset view</span>
</footer>
</main>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
// -------------------------------------------------------------------------
// Model data
// -------------------------------------------------------------------------
const nodes = [
{
id: "N01",
literal: "North exchange",
abstract: "Harbor circle",
litPos: [-6.0, 0.0, -3.0],
absPos: [-6.0, 0.0, 3.0],
literalData: { Capacity: "48 Gbps", Altitude: "42 m", Footprint: "18 m²" },
abstractData: { Trust: "0.91", Role: "Convener", Reach: "1.2k" }
},
{
id: "N02",
literal: "Valley relay",
abstract: "Signal room",
litPos: [-3.0, 0.0, -5.0],
absPos: [-2.0, 0.0, 5.0],
literalData: { Capacity: "24 Gbps", Altitude: "86 m", Footprint: "9 m²" },
abstractData: { Trust: "0.73", Role: "Maintainer", Reach: "640" }
},
{
id: "N03",
literal: "Research hub",
abstract: "Open studio",
litPos: [0.0, 0.0, -4.0],
absPos: [2.0, 0.0, 4.0],
literalData: { Capacity: "80 Gbps", Altitude: "31 m", Footprint: "31 m²" },
abstractData: { Trust: "0.84", Role: "Co-maker", Reach: "2.8k" }
},
{
id: "N04",
literal: "Civic node",
abstract: "Public forum",
litPos: [3.0, 0.0, -2.0],
absPos: [6.0, 0.0, 2.0],
literalData: { Capacity: "32 Gbps", Altitude: "12 m", Footprint: "22 m²" },
abstractData: { Trust: "0.76", Role: "Moderator", Reach: "4.1k" }
},
{
id: "N05",
literal: "Coastal depot",
abstract: "Makers’ guild",
litPos: [6.0, 0.0, -1.0],
absPos: [4.0, 0.0, -2.0],
literalData: { Capacity: "18 Gbps", Altitude: "9 m", Footprint: "14 m²" },
abstractData: { Trust: "0.88", Role: "Steward", Reach: "920" }
},
{
id: "N06",
literal: "Archive vault",
abstract: "Memory commons",
litPos: [-5.0, 0.0, 1.0],
absPos: [0.0, 0.0, -3.0],
literalData: { Capacity: "64 Gbps", Altitude: "18 m", Footprint: "28 m²" },
abstractData: { Trust: "0.94", Role: "Curator", Reach: "1.6k" }
},
{
id: "N07",
literal: "Market gateway",
abstract: "Market network",
litPos: [-2.0, 0.0, 2.0],
absPos: [-4.0, 0.0, -4.0],
literalData: { Capacity: "40 Gbps", Altitude: "5 m", Footprint: "16 m²" },
abstractData: { Trust: "0.62", Role: "Broker", Reach: "3.2k" }
},
{
id: "N08",
literal: "Campus core",
abstract: "Campus network",
litPos: [1.0, 0.0, 3.0],
absPos: [-2.0, 0.0, 0.0],
literalData: { Capacity: "96 Gbps", Altitude: "54 m", Footprint: "40 m²" },
abstractData: { Trust: "0.81", Role: "Connector", Reach: "5.4k" }
},
{
id: "N09",
literal: "Field station",
abstract: "Field team",
litPos: [4.0, 0.0, 4.0],
absPos: [2.0, 0.0, 0.0],
literalData: { Capacity: "12 Gbps", Altitude: "112 m", Footprint: "7 m²" },
abstractData: { Trust: "0.79", Role: "Observer", Reach: "480" }
},
{
id: "N10",
literal: "Media tower",
abstract: "Broadcast group",
litPos: [-1.0, 0.0, 0.0],
absPos: [0.0, 0.0, 1.0],
literalData: { Capacity: "72 Gbps", Altitude: "67 m", Footprint: "24 m²" },
abstractData: { Trust: "0.69", Role: "Publisher", Reach: "8.7k" }
},
{
id: "N11",
literal: "Partner edge",
abstract: "Partner consortium",
litPos: [4.0, 0.0, -5.0],
absPos: [6.0, 0.0, -5.0],
literalData: { Capacity: "28 Gbps", Altitude: "23 m", Footprint: "11 m²" },
abstractData: { Trust: "0.86", Role: "Liaison", Reach: "1.1k" }
},
{
id: "N12",
literal: "Backup vault",
abstract: "Care reserve",
litPos: [-7.0, 0.0, 4.0],
absPos: [-7.0, 0.0, -2.0],
literalData: { Capacity: "36 Gbps", Altitude: "8 m", Footprint: "20 m²" },
abstractData: { Trust: "0.90", Role: "Keeper", Reach: "760" }
}
];
const relations = [
{
id: "R01", a: "N01", b: "N02", start: 2,
literalName: "North trunk", abstractName: "Mutual aid",
length: "3.2 km", latency: "2 ms", redundancy: "No alternate route",
trust: "0.91", context: "Operations", direction: "Reciprocal",
bend: [0.3, 0.4, 0.8]
},
{
id: "R02", a: "N02", b: "N03", start: 9,
literalName: "Valley spur", abstractName: "Research exchange",
length: "8.7 km", latency: "7 ms", redundancy: "Protected ring",
trust: "0.74", context: "Methods", direction: "Reciprocal",
bend: [-0.5, 0.7, -0.6]
},
{
id: "R03", a: "N01", b: "N06", start: 15,
literalName: "Metro run", abstractName: "Archive covenant",
length: "4.4 km", latency: "3 ms", redundancy: "No alternate route",
trust: "0.94", context: "Memory", direction: "Reciprocal",
bend: [0.7, 0.5, -0.3]
},
{
id: "R04", a: "N02", b: "N06", start: 21,
literalName: "West feeder", abstractName: "Shared stewardship",
length: "6.1 km", latency: "5 ms", redundancy: "Dual route",
trust: "0.92", context: "Care", direction: "Reciprocal",
bend: [-0.8, 0.6, 0.7]
},
{
id: "R05", a: "N03", b: "N07", start: 28,
literalName: "Campus link", abstractName: "Open exchange",
length: "2.8 km", latency: "2 ms", redundancy: "No alternate route",
trust: "0.78", context: "Knowledge", direction: "Reciprocal",
bend: [-0.4, 0.5, 0.6]
},
{
id: "R06", a: "N03", b: "N04", start: 34,
literalName: "Hill segment", abstractName: "Civic translation",
length: "11.3 km", latency: "12 ms", redundancy: "Protected ring",
trust: "0.76", context: "Public work", direction: "Two-way",
bend: [0.7, 0.8, -0.4]
},
{
id: "R07", a: "N04", b: "N05", start: 41,
literalName: "South reach", abstractName: "Community compact",
length: "9.6 km", latency: "8 ms", redundancy: "No alternate route",
trust: "0.88", context: "Resilience", direction: "Reciprocal",
bend: [-0.8, 0.6, -0.5]
},
{
id: "R08", a: "N05", b: "N09", start: 47,
literalName: "Coastal spur", abstractName: "Field collaboration",
length: "14.2 km", latency: "18 ms", redundancy: "No alternate route",
trust: "0.79", context: "Observation", direction: "Reciprocal",
bend: [-0.7, 0.8, 0.5]
},
{
id: "R09", a: "N07", b: "N08", start: 54,
literalName: "Market lane", abstractName: "Skills alliance",
length: "5.5 km", latency: "4 ms", redundancy: "Dual route",
trust: "0.82", context: "Practice", direction: "Reciprocal",
bend: [0.4, 0.6, 0.5]
},
{
id: "R10", a: "N08", b: "N09", start: 60,
literalName: "Learning loop", abstractName: "Training pact",
length: "7.8 km", latency: "9 ms", redundancy: "No alternate route",
trust: "0.81", context: "Learning", direction: "Reciprocal",
bend: [-0.5, 0.7, -0.6]
},
{
id: "R11", a: "N06", b: "N10", start: 67,
literalName: "Broadcast relay", abstractName: "Narrative channel",
length: "12.4 km", latency: "15 ms", redundancy: "Protected ring",
trust: "0.69", context: "Visibility", direction: "One-way",
bend: [0.7, 0.7, 0.5]
},
{
id: "R12", a: "N08", b: "N10", start: 73,
literalName: "Media bridge", abstractName: "Influence partnership",
length: "6.9 km", latency: "6 ms", redundancy: "No alternate route",
trust: "0.69", context: "Attention", direction: "Reciprocal",
bend: [-0.6, 0.6, -0.3]
},
{
id: "R13", a: "N09", b: "N11", start: 80,
literalName: "Remote join", abstractName: "Remote partnership",
length: "18.6 km", latency: "26 ms", redundancy: "No alternate route",
trust: "0.86", context: "Distance", direction: "Reciprocal",
bend: [0.5, 0.9, -0.7]
},
{
id: "R14", a: "N04", b: "N11", start: 87,
literalName: "City-to-city line", abstractName: "Policy coalition",
length: "22.1 km", latency: "31 ms", redundancy: "Dual route",
trust: "0.86", context: "Policy", direction: "Reciprocal",
bend: [-0.9, 0.7, 0.4]
},
{
id: "R15", a: "N05", b: "N12", start: 94,
literalName: "Emergency hop", abstractName: "Care network",
length: "15.7 km", latency: "21 ms", redundancy: "No alternate route",
trust: "0.90", context: "Emergency", direction: "Reciprocal",
bend: [0.6, 0.8, 0.7]
},
{
id: "R16", a: "N07", b: "N12", start: 100,
literalName: "Wholesale route", abstractName: "Resource barter",
length: "10.3 km", latency: "10 ms", redundancy: "Protected ring",
trust: "0.62", context: "Trade", direction: "Reciprocal",
bend: [-0.7, 0.7, -0.5]
}
];
const nodeById = new Map(nodes.map(n => [n.id, n]));
const relationById = new Map(relations.map(r => [r.id, r]));
for (const node of nodes) {
const incident = relations.filter(r => r.a === node.id || r.b === node.id);
node.born = Math.min(...incident.map(r => r.start)) - 4;
}
// -------------------------------------------------------------------------
// DOM references and shared state
// -------------------------------------------------------------------------
const $ = selector => document.querySelector(selector);
const literalCanvas = $("#literalCanvas");
const abstractCanvas = $("#abstractCanvas");
const literalTooltip = $("#literalTooltip");
const abstractTooltip = $("#abstractTooltip");
const timeline = $("#timeline");
const playButton = $("#playButton");
const playGlyph = $("#playGlyph");
const playText = $("#playText");
const speedSelect = $("#speedSelect");
const phaseLabel = $("#phaseLabel");
const nodeMetric = $("#nodeMetric");
const relationMetric = $("#relationMetric");
const timeMetric = $("#timeMetric");
const modelStatus = $("#modelStatus");
const breaksToggle = $("#breaksToggle");
const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
let time = 24;
let playing = !reducedMotion;
let playbackSpeed = 1;
let showBreaks = true;
let selected = { type: "edge", id: "R04" };
const relationPalette = [
"#63e6bd", "#75b7ff", "#f3c969", "#ed8ac7",
"#67d9e8", "#9ee37e", "#ff9f78", "#bca7ff"
];
// -------------------------------------------------------------------------
// Renderer, scenes, camera, and shared orbit controls
// -------------------------------------------------------------------------
function makeRenderer(canvas) {
const renderer = new THREE.WebGLRenderer({
canvas,
antialias: true,
powerPreference: "high-performance"
});
renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.18;
return renderer;
}
const literalRenderer = makeRenderer(literalCanvas);
const abstractRenderer = makeRenderer(abstractCanvas);
const literalScene = new THREE.Scene();
literalScene.background = new THREE.Color("#071312");
literalScene.fog = new THREE.FogExp2("#071312", 0.026);
const abstractScene = new THREE.Scene();
abstractScene.background = new THREE.Color("#100c17");
abstractScene.fog = new THREE.FogExp2("#100c17", 0.021);
function addLights(scene, literal) {
scene.add(new THREE.HemisphereLight(
literal ? "#d8fff0" : "#eadfff",
literal ? "#08120f" : "#140c1b",
2.0
));
const key = new THREE.DirectionalLight(
literal ? "#a7ffe1" : "#d4c1ff",
3.1
);
key.position.set(7, 11, 8);
scene.add(key);
const rim = new THREE.DirectionalLight(
literal ? "#4abf9e" : "#8d70d8",
1.7
);
rim.position.set(-8, 4, -7);
scene.add(rim);
}
addLights(literalScene, true);
addLights(abstractScene, false);
const camera = new THREE.PerspectiveCamera(42, 1, 0.1, 100);
const viewState = {
yaw: -0.62,
pitch: 0.52,
radius: 19
};
function resetCamera() {
viewState.yaw = -0.62;
viewState.pitch = 0.52;
viewState.radius = 19;
}
function updateCamera() {
const { yaw, pitch, radius } = viewState;
camera.position.set(
radius * Math.cos(pitch) * Math.sin(yaw),
radius * Math.sin(pitch),
radius * Math.cos(pitch) * Math.cos(yaw)
);
camera.lookAt(0, 0, 0);
}
function resizeRenderer(renderer, canvas) {
const width = Math.max(1, canvas.clientWidth);
const height = Math.max(1, canvas.clientHeight);
renderer.setSize(width, height, false);
camera.aspect = width / height;
camera.updateProjectionMatrix();
}
const literalResizeObserver = new ResizeObserver(() => {
resizeRenderer(literalRenderer, literalCanvas);
});
const abstractResizeObserver = new ResizeObserver(() => {
resizeRenderer(abstractRenderer, abstractCanvas);
});
literalResizeObserver.observe(literalCanvas);
abstractResizeObserver.observe(abstractCanvas);
resizeRenderer(literalRenderer, literalCanvas);
resizeRenderer(abstractRenderer, abstractCanvas);
// A literal metric ground plane made from small blocks.
{
const cols = 17;
const rows = 13;
const spacing = 1;
const geometry = new THREE.BoxGeometry(0.16, 0.045, 0.16);
const material = new THREE.MeshBasicMaterial({
color: "#285047",
transparent: true,
opacity: 0.34
});
const grid = new THREE.InstancedMesh(geometry, material, cols * rows);
const matrixHelper = new THREE.Object3D();
let index = 0;
for (let z = 0; z < rows; z++) {
for (let x = 0; x < cols; x++) {
matrixHelper.position.set(
(x - (cols - 1) / 2) * spacing,
-1.3,
(z - (rows - 1) / 2) * spacing
);
matrixHelper.updateMatrix();
grid.setMatrixAt(index++, matrixHelper.matrix);
}
}
grid.instanceMatrix.needsUpdate = true;
literalScene.add(grid);
}
// -------------------------------------------------------------------------
// Voxel construction
// -------------------------------------------------------------------------
const nodeGeometry = new THREE.BoxGeometry(0.44, 0.44, 0.44);
const edgeGeometry = new THREE.BoxGeometry(0.18, 0.18, 0.18);
const markerGeometry = new THREE.BoxGeometry(0.15, 0.15, 0.15);
const nodeViews = {
literal: new Map(),
abstract: new Map()
};
const relationViews = {
literal: new Map(),
abstract: new Map()
};
const pickables = {
literal: [],
abstract: []
};
const literalOffsets = [
[0, 0, 0],
[0.44, 0, 0], [-0.44, 0, 0],
[0, 0.44, 0], [0, -0.44, 0],
[0, 0, 0.44], [0, 0, -0.44],
[0.22, 0.22, 0.22], [-0.22, -0.22, -0.22]
];
const abstractOffsets = [
[0, 0, 0],
[0.42, 0, 0], [-0.42, 0, 0],
[0, 0.42, 0], [0, -0.42, 0],
[0, 0, 0.42], [0, 0, -0.42]
];
function makeNode(panel, node, scene) {
const group = new THREE.Group();
group.position.fromArray(panel === "literal" ? node.litPos : node.absPos);
const accent = panel === "literal" ? "#73e7b5" : "#bea7ff";
const material = new THREE.MeshStandardMaterial({
color: accent,
emissive: accent,
emissiveIntensity: 0.16,
roughness: 0.5,
metalness: 0.12,
transparent: true,
opacity: 0.95
});
const offsets = panel === "literal" ? literalOffsets : abstractOffsets;
for (const offset of offsets) {
const mesh = new THREE.Mesh(nodeGeometry, material);
mesh.position.fromArray(offset);
mesh.userData.pick = { type: "node", id: node.id, panel };
group.add(mesh);
pickables[panel].push(mesh);
}
const markers = [];
if (panel === "literal") {
const markerMaterial = new THREE.MeshStandardMaterial({
color: "#ffb35c",
emissive: "#ff7f26",
emissiveIntensity: 0.7,
roughness: 0.45
});
const markerGroup = new THREE.Group();
markerGroup.position.copy(group.position);
for (let i = 0; i < 3; i++) {
const marker = new THREE.Mesh(markerGeometry, markerMaterial);
const angle = i * Math.PI * 2 / 3;
marker.position.set(
Math.cos(angle) * 0.78,
0.28 + i * 0.2,
Math.sin(angle) * 0.78
);
marker.visible = false;
markerGroup.add(marker);
markers.push(marker);
}
scene.add(markerGroup);
}
scene.add(group);
nodeViews[panel].set(node.id, {
group,
material,
markers
});
}
for (const node of nodes) {
makeNode("literal", node, literalScene);
makeNode("abstract", node, abstractScene);
}
function makeRelationCurve(panel, relation) {
const nodeA = nodeById.get(relation.a);
const nodeB = nodeById.get(relation.b);
const start = new THREE.Vector3().fromArray(
panel === "literal" ? nodeA.litPos : nodeA.absPos
);
const end = new THREE.Vector3().fromArray(
panel === "literal" ? nodeB.litPos : nodeB.absPos
);
const middle = start.clone().add(end).multiplyScalar(0.5);
if (panel === "literal") {
middle.x += relation.bend[0];
middle.y += relation.bend[1];
middle.z += relation.bend[2];
} else {
middle.y += 1.05;
middle.x += relation.bend[0] * 0.16;
middle.z += relation.bend[2] * 0.16;
}
return new THREE.CatmullRomCurve3(
[start, middle, end],
false,
"catmullrom",
0.35
);
}
function makeRelation(panel, relation, scene) {
const curve = makeRelationCurve(panel, relation);
const color = relationPalette[relations.indexOf(relation) % relationPalette.length];
const material = new THREE.MeshStandardMaterial({
color,
emissive: color,
emissiveIntensity: 0.32,
roughness: 0.44,
metalness: 0.08,
transparent: true,
opacity: 0.86
});
const group = new THREE.Group();
const curveLength = curve.getLength();
const blockCount = panel === "literal"
? THREE.MathUtils.clamp(Math.round(curveLength * 1.22), 10, 24)
: 14;
const meshes = [];
for (let i = 0; i < blockCount; i++) {
const t = blockCount === 1 ? 0 : i / (blockCount - 1);
const point = curve.getPointAt(t);
const tangent = curve.getTangentAt(t);
const mesh = new THREE.Mesh(edgeGeometry, material);
mesh.position.copy(point);
mesh.rotation.y = Math.atan2(tangent.x, tangent.z);
mesh.userData.pick = { type: "edge", id: relation.id, panel };
group.add(mesh);
meshes.push(mesh);
pickables[panel].push(mesh);
}
const markers = [];
if (panel === "literal") {
const markerMaterial = new THREE.MeshStandardMaterial({
color: "#ffb35c",
emissive: "#ff7f26",
emissiveIntensity: 0.9,
roughness: 0.4
});
for (const t of [0.22, 0.53, 0.81]) {
const marker = new THREE.Mesh(markerGeometry, markerMaterial);
marker.position.copy(curve.getPointAt(t));
marker.position.y += 0.54;
marker.visible = false;
group.add(marker);
markers.push(marker);
}
}
scene.add(group);
relationViews[panel].set(relation.id, {
group,
material,
meshes,
markers,
blockCount
});
}
for (const relation of relations) {
makeRelation("literal", relation, literalScene);
makeRelation("abstract", relation, abstractScene);
}
// -------------------------------------------------------------------------
// Selection and visual-state updates
// -------------------------------------------------------------------------
function incidentRelations(nodeId) {
return relations
.filter(r => r.a === nodeId || r.b === nodeId)
.map(r => r.id);
}
function selectedEdgeIds() {
if (!selected) return [];
if (selected.type === "edge") return [selected.id];
if (selected.type === "node") {
return incidentRelations(selected.id);
}
return [];
}
function selectedNodeIds() {
if (!selected) return [];
if (selected.type === "node") return [selected.id];
if (selected.type === "edge") {
const relation = relationById.get(selected.id);
return relation ? [relation.a, relation.b] : [];
}
return [];
}
function easeOutBack(value) {
const c1 = 1.70158;
const c3 = c1 + 1;
return 1 + c3 * Math.pow(value - 1, 3) + c1 * Math.pow(value - 1, 2);
}
function updateScene(now) {
const highlightedEdges = new Set(selectedEdgeIds());
const highlightedNodes = new Set(selectedNodeIds());
const pulse = 1 + Math.sin(now * 0.0035) * 0.065;
for (const panel of ["literal", "abstract"]) {
for (const node of nodes) {
const view = nodeViews[panel].get(node.id);
const born = node.born;
const appears = THREE.MathUtils.clamp((time - born) / 3, 0, 1);
const isHighlighted = highlightedNodes.has(node.id);
const isDimmed = selected && !isHighlighted;
view.group.visible = time >= born;
const scale = Math.max(0.001, easeOutBack(appears));
view.group.scale.setScalar(scale);
view.material.opacity = isHighlighted ? 1 : isDimmed ? 0.22 : 0.94;
view.material.emissiveIntensity = isHighlighted ? 0.85 : 0.16;
const markerVisible = panel === "literal"
&& showBreaks
&& selected?.type === "node"
&& selected.id === node.id
&& time >= born;
for (const marker of view.markers) {
marker.visible = markerVisible;
marker.scale.setScalar(isHighlighted ? pulse : 1);
}
}
for (const relation of relations) {
const view = relationViews[panel].get(relation.id);
const progress = THREE.MathUtils.clamp((time - relation.start) / 8, 0, 1);
const visibleCount = Math.ceil(progress * view.blockCount);
const isHighlighted = highlightedEdges.has(relation.id);
const isDimmed = selected && !isHighlighted;
view.group.visible = progress > 0;
view.material.opacity = isHighlighted ? 1 : isDimmed ? 0.14 : 0.76;
view.material.emissiveIntensity = isHighlighted ? 1.05 : 0.22;
for (let i = 0; i < view.meshes.length; i++) {
const mesh = view.meshes[i];
mesh.visible = i < visibleCount;
const localProgress = THREE.MathUtils.clamp(
progress * view.blockCount - i,
0,
1
);
let scale = THREE.MathUtils.lerp(0.35, 1, localProgress);
if (isHighlighted && i === visibleCount - 1) scale *= pulse;
mesh.scale.setScalar(scale);
}
const showRelationMarkers = panel === "literal"
&& showBreaks
&& selected?.type === "edge"
&& selected.id === relation.id
&& progress > 0;
for (const marker of view.markers) {
marker.visible = showRelationMarkers;
marker.scale.setScalar(isHighlighted ? pulse : 1);
}
}
}
}
function updatePairFlags() {
const literalFlag = $("#literalPair");
const abstractFlag = $("#abstractPair");
if (!selected) {
literalFlag.textContent = "Select a block to inspect its pair";
abstractFlag.textContent = "Select a block to inspect its pair";
return;
}
if (selected.type === "edge") {
const relation = relationById.get(selected.id);
literalFlag.textContent = `${relation.id} · ${relation.literalName} / paired route`;
abstractFlag.textContent = `${relation.id} · ${relation.abstractName} / paired relation`;
} else {
const node = nodeById.get(selected.id);
literalFlag.textContent = `${node.id} · ${node.literal} / physical role`;
abstractFlag.textContent = `${node.id} · ${node.abstract} / abstract role`;
}
}
// -------------------------------------------------------------------------
// Inspector
// -------------------------------------------------------------------------
function dataRows(items) {
return Object.entries(items)
.map(([key, value]) => `
<div class="data-row">
<span>${key}</span>
<strong>${value}</strong>
</div>
`)
.join("");
}
function renderInspector() {
const title = $("#selectionTitle");
const subtitle = $("#selectionSubtitle");
const transferList = $("#transferList");
const breakList = $("#breakList");
const literalData = $("#literalData");
const abstractData = $("#abstractData");
const breakNote = $("#breakNote");
const activationState = $("#activationState");
if (!selected) {
title.textContent = "Choose a relation";
subtitle.textContent = "Click a colored edge or facility in either display.";
transferList.innerHTML = `
<li>Relation IDs pair one literal edge with one abstract relation.</li>
<li>Endpoint roles and the growth clock are shared.</li>
<li>The graph’s topology survives the translation.</li>
`;
breakList.innerHTML = `
<li>Physical length is not abstract distance.</li>
<li>Latency is not attention, trust, or response time.</li>
<li>Literal coordinates do not encode affinity.</li>
`;
literalData.innerHTML = dataRows({
"Facilities": "12",
"Cable routes": "16",
"Metrics": "Geographic + engineered"
});
abstractData.innerHTML = dataRows({
"Groups": "12",
"Relations": "16",
"Metrics": "Contextual + interpretive"
});
breakNote.textContent =
"The metaphor works at the level of connected roles. It fails when physical measures are treated as abstract ones.";
activationState.textContent = "No relation selected";
} else if (selected.type === "edge") {
const relation = relationById.get(selected.id);
const nodeA = nodeById.get(relation.a);
const nodeB = nodeById.get(relation.b);
title.textContent = `${relation.id} · ${relation.literalName}`;
subtitle.textContent =
`${nodeA.literal} ↔ ${nodeB.literal} / ${relation.abstractName}`;
transferList.innerHTML = `
<li>The edge exists in both systems as the same relation pair.</li>
<li>Endpoint roles map one-to-one: ${nodeA.abstract} ↔ ${nodeB.abstract}.</li>
<li>Both versions activate at t=${relation.start}; chronology is shared.</li>
<li>Topological degree is preserved at both endpoints.</li>
`;
breakList.innerHTML = `
<li>${relation.length} of cable does not become abstract “distance.”</li>
<li>${relation.latency} of propagation is not reply time, attention, or trust.</li>
<li>${relation.redundancy.toLowerCase()} describes failure tolerance, not relational resilience.</li>
<li>Bends, junctions, and geographic route shape belong only to infrastructure.</li>
`;
literalData.innerHTML = dataRows({
"Route length": relation.length,
"Propagation": relation.latency,
"Redundancy": relation.redundancy
});
abstractData.innerHTML = dataRows({
"Trust": relation.trust,
"Context": relation.context,
"Direction": relation.direction
});
breakNote.textContent =
`The strongest literal cue—${relation.length} of physical cable—has no scalar equivalent in the abstract relation. The pair preserves a connection, not a measurement.`;
activationState.textContent =
time >= relation.start + 8
? `Active at t=${relation.start}`
: `Begins at t=${relation.start}`;
} else {
const node = nodeById.get(selected.id);
const linked = incidentRelations(node.id);
title.textContent = `${node.id} · ${node.literal}`;
subtitle.textContent = `${node.literal} ↔ ${node.abstract} / role-paired node`;
transferList.innerHTML = `
<li>The role slot is paired: ${node.literal} ↔ ${node.abstract}.</li>
<li>The node appears at t=${node.born} in both growth sequences.</li>
<li>Its topological degree is shared: ${linked.length} incident relations.</li>
<li>The same relation IDs connect it in both systems.</li>
`;
breakList.innerHTML = `
<li>Physical footprint (${node.literalData.Footprint}) is not social importance.</li>
<li>Installed capacity (${node.literalData.Capacity}) is not influence or reach.</li>
<li>Altitude and coordinate describe terrain, not affinity.</li>
<li>Maintenance access and physical failure modes have no direct abstract copy.</li>
`;
literalData.innerHTML = dataRows(node.literalData);
abstractData.innerHTML = dataRows(node.abstractData);
breakNote.textContent =
`The node’s size and position may imply importance in the literal view, but the abstract system encodes context and trust instead. ${node.literalData.Capacity} does not become ${node.abstractData.Reach} people.`;
activationState.textContent = `Node begins at t=${node.born}`;
}
for (const chip of document.querySelectorAll(".relation-chip")) {
chip.classList.toggle("active", selected?.type === "edge" && chip.dataset.rel === selected.id);
chip.classList.toggle(
"incident",
selected?.type === "node" && incidentRelations(selected.id).includes(chip.dataset.rel)
);
}
}
const relationIndex = $("#relationIndex");
for (const relation of relations) {
const button = document.createElement("button");
button.className = "relation-chip";
button.dataset.rel = relation.id;
button.textContent = relation.id;
button.title = `${relation.literalName} ↔ ${relation.abstractName}`;
button.setAttribute("aria-label", `Inspect ${relation.id}, ${relation.literalName}, paired with ${relation.abstractName}`);
relationIndex.appendChild(button);
}
relationIndex.addEventListener("click", event => {
const button = event.target.closest("button[data-rel]");
if (!button) return;
selected = { type: "edge", id: button.dataset.rel };
renderInspector();
updatePairFlags();
});
function selectEntity(type, id) {
selected = { type, id };
renderInspector();
updatePairFlags();
}
$("#clearSelection").addEventListener("click", () => {
selected = null;
renderInspector();
updatePairFlags();
});
// -------------------------------------------------------------------------
// Raycasting and direct canvas controls
// -------------------------------------------------------------------------
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
function isTreeVisible(object) {
let current = object;
while (current) {
if (!current.visible) return false;
current = current.parent;
}
return true;
}
function pickAt(event, canvas, scene, panel) {
const rect = canvas.getBoundingClientRect();
pointer.x = ((event.clientX - rect.left) / rect.width) * 2 - 1;
pointer.y = -((event.clientY - rect.top) / rect.height) * 2 + 1;
camera.aspect = rect.width / rect.height;
camera.updateProjectionMatrix();
raycaster.setFromCamera(pointer, camera);
const intersections = raycaster.intersectObjects(pickables[panel], false);
return intersections.find(hit => isTreeVisible(hit.object)) || null;
}
function tooltipContent(hit, panel) {
const data = hit.object.userData.pick;
if (data.type === "edge") {
const relation = relationById.get(data.id);
const literal = panel === "literal";
return `<strong>${relation.id}</strong><br>${
literal ? relation.literalName : relation.abstractName
}<br>Click to inspect the paired relation`;
}
const node = nodeById.get(data.id);
const literal = panel === "literal";
return `<strong>${node.id}</strong><br>${
literal ? node.literal : node.abstract
}<br>Click to inspect the role pair`;
}
function bindCanvas(canvas, scene, panel, tooltip) {
let pointerDown = null;
let dragging = false;
canvas.addEventListener("pointerdown", event => {
if (event.button !== 0) return;
pointerDown = {
x: event.clientX,
y: event.clientY,
lastX: event.clientX,
lastY: event.clientY
};
dragging = false;
canvas.setPointerCapture(event.pointerId);
tooltip.style.display = "none";
});
canvas.addEventListener("pointermove", event => {
if (pointerDown) {
const dx = event.clientX - pointerDown.lastX;
const dy = event.clientY - pointerDown.lastY;
if (Math.hypot(
event.clientX - pointerDown.x,
event.clientY - pointerDown.y
) > 4) {
dragging = true;
}
if (dragging) {
viewState.yaw -= dx * 0.006;
viewState.pitch = THREE.MathUtils.clamp(
viewState.pitch + dy * 0.005,
0.13,
1.28
);
}
pointerDown.lastX = event.clientX;
pointerDown.lastY = event.clientY;
return;
}
const hit = pickAt(event, canvas, scene, panel);
if (hit) {
canvas.style.cursor = "pointer";
tooltip.innerHTML = tooltipContent(hit, panel);
const rect = canvas.getBoundingClientRect();
const localX = event.clientX - rect.left;
const localY = event.clientY - rect.top;
tooltip.style.display = "block";
tooltip.style.left = `${Math.min(localX + 13, rect.width - 225)}px`;
tooltip.style.top = `${Math.max(10, Math.min(localY + 13, rect.height - 90))}px`;
} else {
canvas.style.cursor = "grab";
tooltip.style.display = "none";
}
});
canvas.addEventListener("pointerup", event => {
if (pointerDown && !dragging) {
const hit = pickAt(event, canvas, scene, panel);
if (hit) {
const data = hit.object.userData.pick;
selectEntity(data.type, data.id);
}
}
pointerDown = null;
dragging = false;
if (canvas.hasPointerCapture(event.pointerId)) {
canvas.releasePointerCapture(event.pointerId);
}
});
canvas.addEventListener("pointercancel", () => {
pointerDown = null;
dragging = false;
});
canvas.addEventListener("pointerleave", () => {
if (!pointerDown) tooltip.style.display = "none";
});
canvas.addEventListener("wheel", event => {
event.preventDefault();
viewState.radius = THREE.MathUtils.clamp(
viewState.radius + event.deltaY * 0.012,
11,
28
);
}, { passive: false });
canvas.addEventListener("dblclick", resetCamera);
canvas.addEventListener("keydown", event => {
const key = event.key;
if (["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "+", "=", "-"].includes(key)) {
event.preventDefault();
}
if (key === "ArrowLeft") viewState.yaw += 0.08;
if (key === "ArrowRight") viewState.yaw -= 0.08;
if (key === "ArrowUp") viewState.pitch = Math.min(1.28, viewState.pitch + 0.06);
if (key === "ArrowDown") viewState.pitch = Math.max(0.13, viewState.pitch - 0.06);
if (key === "+" || key === "=") viewState.radius = Math.max(11, viewState.radius - 1);
if (key === "-") viewState.radius = Math.min(28, viewState.radius + 1);
if (key === "Home") resetCamera();
});
}
bindCanvas(literalCanvas, literalScene, "literal", literalTooltip);
bindCanvas(abstractCanvas, abstractScene, "abstract", abstractTooltip);
// -------------------------------------------------------------------------
// Timeline and playback
// -------------------------------------------------------------------------
function phaseForTime(value) {
if (value < 18) return "Exchange formation";
if (value < 43) return "Backbone emerges";
if (value < 74) return "Branches connect";
return "Network densifies";
}
function updateTimelineUI() {
timeline.value = time;
timeline.style.setProperty("--progress", `${time / 110 * 100}%`);
phaseLabel.textContent = phaseForTime(time);
timeMetric.textContent = time.toFixed(1);
const visibleNodes = nodes.filter(node => time >= node.born).length;
const activeRelations = relations.filter(relation => time >= relation.start).length;
nodeMetric.textContent = `${visibleNodes} / ${nodes.length}`;
relationMetric.textContent = `${activeRelations} / ${relations.length}`;
modelStatus.textContent = playing ? "Model growing" : time >= 110 ? "Model complete" : "Model paused";
if (selected?.type === "edge") {
const relation = relationById.get(selected.id);
$("#activationState").textContent =
time >= relation.start + 8
? `Active at t=${relation.start}`
: `Begins at t=${relation.start}`;
}
}
function updatePlayButton() {
playGlyph.textContent = playing ? "Ⅱ" : "▶";
playText.textContent = playing ? " Pause" : " Play";
playButton.setAttribute("aria-label", playing ? "Pause growth" : "Play growth");
}
playButton.addEventListener("click", () => {
if (!playing && time >= 110) time = 0;
playing = !playing;
updatePlayButton();
});
$("#resetButton").addEventListener("click", () => {
time = 0;
playing = false;
updatePlayButton();
});
$("#stepButton").addEventListener("click", () => {
time = Math.min(110, time + 5);
playing = false;
updatePlayButton();
});
speedSelect.addEventListener("change", () => {
playbackSpeed = Number(speedSelect.value);
});
timeline.addEventListener("input", () => {
time = Number(timeline.value);
playing = false;
updatePlayButton();
});
breaksToggle.addEventListener("click", () => {
showBreaks = !showBreaks;
breaksToggle.setAttribute("aria-pressed", String(showBreaks));
breaksToggle.textContent = `Physical-only cues: ${showBreaks ? "on" : "off"}`;
});
$("#resetViewButton").addEventListener("click", resetCamera);
// -------------------------------------------------------------------------
// Animation loop
// -------------------------------------------------------------------------
let previousFrame = performance.now();
function animate(now) {
requestAnimationFrame(animate);
const delta = Math.min((now - previousFrame) / 1000, 0.05);
previousFrame = now;
if (playing) {
time = Math.min(110, time + delta * 3.8 * playbackSpeed);
if (time >= 110) {
playing = false;
updatePlayButton();
}
}
updateCamera();
updateScene(now);
updateTimelineUI();
literalRenderer.render(literalScene, camera);
abstractRenderer.render(abstractScene, camera);
}
renderInspector();
updatePairFlags();
updatePlayButton();
updateTimelineUI();
updateScene(performance.now());
updateCamera();
requestAnimationFrame(animate);
requestAnimationFrame(() => {
$("#literalLoading").classList.add("hidden");
$("#abstractLoading").classList.add("hidden");
});
</script>
</body>
</html>
```