Prompt specification
Build or customize the Three.js 3D scene "Data exploration exhibition room" 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: Data exploration exhibition room
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/data-exploration-exhibition-room-x1815
Scene Description Prompt:
Build a self-contained HTML scene with Three.js from cdnjs featuring false positives across multiple statistical tests. Compose a fictional analyst desk with many synthetic comparisons and selected highlights; reveal the full search count so apparent standout results retain their context. Voxel style.
Working Three.js Starter (data-exploration-exhibition-room-x1815):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>False Positive Field Lab</title>
<style>
:root {
--ink: #dcebe8;
--muted: #87a4a6;
--panel: rgba(8, 20, 25, 0.88);
--line: rgba(139, 220, 211, 0.22);
--cyan: #61e1d6;
--pink: #ff5277;
--amber: #ffc65a;
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #071116;
color: var(--ink);
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
"Liberation Mono", monospace;
}
body {
user-select: none;
}
#scene {
position: fixed;
inset: 0;
}
canvas {
display: block;
width: 100%;
height: 100%;
outline: none;
cursor: grab;
}
canvas:active {
cursor: grabbing;
}
.vignette {
position: fixed;
inset: 0;
pointer-events: none;
background:
radial-gradient(circle at 50% 43%, transparent 42%, rgba(2, 8, 11, 0.44) 100%),
linear-gradient(180deg, rgba(5, 13, 17, 0.22), transparent 22%, transparent 78%, rgba(5, 13, 17, 0.35));
}
.hud {
position: fixed;
z-index: 10;
pointer-events: none;
}
#brand {
top: 24px;
left: 26px;
max-width: 440px;
}
.eyebrow {
color: var(--cyan);
font-size: 10px;
font-weight: 800;
letter-spacing: 0.18em;
text-transform: uppercase;
}
#brand h1 {
margin: 7px 0 8px;
font-size: clamp(20px, 2.3vw, 34px);
line-height: 0.95;
letter-spacing: -0.05em;
text-transform: uppercase;
}
#brand p {
margin: 0;
color: var(--muted);
font-size: 11px;
line-height: 1.6;
}
#search-panel {
top: 24px;
right: 26px;
width: min(420px, calc(100vw - 52px));
padding: 15px 16px 13px;
border: 1px solid var(--line);
background: var(--panel);
box-shadow: 0 14px 40px rgba(0, 0, 0, 0.26);
}
.search-head {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 18px;
padding-bottom: 11px;
border-bottom: 1px solid var(--line);
}
.search-number {
color: var(--ink);
font-size: clamp(28px, 3vw, 43px);
font-weight: 900;
line-height: 0.85;
letter-spacing: -0.07em;
}
.search-label {
margin-bottom: 2px;
color: var(--muted);
font-size: 9px;
line-height: 1.4;
letter-spacing: 0.12em;
text-align: right;
text-transform: uppercase;
}
.search-metrics {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
margin-top: 11px;
}
.metric {
min-width: 0;
padding-left: 9px;
border-left: 2px solid var(--cyan);
}
.metric:nth-child(2) {
border-color: var(--amber);
}
.metric:nth-child(3) {
border-color: var(--pink);
}
.metric b {
display: block;
color: var(--ink);
font-size: 16px;
line-height: 1;
}
.metric span {
display: block;
margin-top: 5px;
color: var(--muted);
font-size: 8px;
line-height: 1.35;
letter-spacing: 0.06em;
text-transform: uppercase;
}
#selection-panel {
left: 26px;
bottom: 25px;
width: min(455px, calc(100vw - 52px));
padding: 15px 16px;
border: 1px solid rgba(255, 82, 119, 0.34);
border-left: 4px solid var(--pink);
background: var(--panel);
box-shadow: 0 16px 45px rgba(0, 0, 0, 0.3);
}
.selection-top {
display: flex;
align-items: center;
justify-content: space-between;
gap: 14px;
}
#selection-title {
color: var(--pink);
font-size: 13px;
font-weight: 900;
letter-spacing: 0.06em;
}
#selection-p {
color: var(--amber);
font-size: 11px;
white-space: nowrap;
}
#selection-body {
margin: 10px 0 0;
color: #a9c0c1;
font-size: 10px;
line-height: 1.65;
}
#controls {
right: 26px;
bottom: 25px;
display: flex;
gap: 8px;
pointer-events: auto;
}
button {
border: 1px solid rgba(139, 220, 211, 0.36);
border-radius: 0;
padding: 11px 13px;
background: rgba(8, 20, 25, 0.92);
color: var(--ink);
font: 800 9px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
letter-spacing: 0.09em;
text-transform: uppercase;
cursor: pointer;
}
button:hover,
button.active {
border-color: var(--cyan);
color: var(--cyan);
background: rgba(17, 43, 49, 0.95);
}
button.active {
border-color: var(--pink);
color: var(--pink);
}
#legend {
top: 174px;
right: 26px;
display: flex;
gap: 13px;
align-items: center;
padding: 8px 10px;
border: 1px solid var(--line);
background: rgba(8, 20, 25, 0.68);
color: var(--muted);
font-size: 8px;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.swatch {
display: inline-block;
width: 8px;
height: 8px;
margin-right: 5px;
vertical-align: -1px;
background: #39797c;
}
.swatch.hot {
background: var(--pink);
}
.swatch.expected {
background: var(--amber);
}
#loading {
position: fixed;
z-index: 100;
inset: 0;
display: grid;
place-items: center;
background: #071116;
color: var(--cyan);
font-size: 11px;
letter-spacing: 0.15em;
text-transform: uppercase;
transition: opacity 0.35s;
}
#loading.hidden {
opacity: 0;
pointer-events: none;
}
@media (max-width: 780px) {
#brand {
top: 16px;
left: 16px;
}
#brand p,
#legend {
display: none;
}
#search-panel {
top: 104px;
right: 16px;
width: 280px;
}
#selection-panel {
left: 16px;
bottom: 16px;
width: calc(100vw - 32px);
}
#controls {
right: 16px;
bottom: 155px;
flex-direction: column;
}
}
</style>
</head>
<body>
<div id="scene"></div>
<div class="vignette"></div>
<section id="brand" class="hud">
<div class="eyebrow">Analyst desk / synthetic study / batch 07</div>
<h1>False Positive<br />Field Lab</h1>
<p>
Drag to orbit · wheel to zoom · click a magenta result.
The search space never leaves the frame.
</p>
</section>
<section id="search-panel" class="hud" aria-label="Full search count">
<div class="search-head">
<div class="search-number">18,432</div>
<div class="search-label">
Total synthetic<br />comparisons searched
</div>
</div>
<div class="search-metrics">
<div class="metric">
<b>6,144</b>
<span>t-tests</span>
</div>
<div class="metric">
<b>8,256</b>
<span>ANOVA tests</span>
</div>
<div class="metric">
<b>4,032</b>
<span>chi-square tests</span>
</div>
</div>
</section>
<section id="legend" class="hud">
<span><i class="swatch"></i>Context</span>
<span><i class="swatch hot"></i>Selected</span>
<span><i class="swatch expected"></i>α = 0.05</span>
</section>
<section id="selection-panel" class="hud" aria-live="polite">
<div class="selection-top">
<div id="selection-title">T-0231 / T-TEST</div>
<div id="selection-p">p = 0.002 · z = 2.12</div>
</div>
<p id="selection-body">
One of 7 selected from 18,432 synthetic comparisons. Under 5% null
thresholds, about 922 tail hits are expected. This is a review candidate,
not a discovery.
</p>
</section>
<nav id="controls" class="hud" aria-label="Scene controls">
<button id="dim-button" type="button">Dim context</button>
<button id="reset-button" type="button">Reset view</button>
</nav>
<div id="loading">Building analyst desk…</div>
<script type="module">
import * as THREE from
"https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
// -------------------------------------------------------------------------
// Renderer, scene, and directly implemented orthographic camera controls.
// -------------------------------------------------------------------------
const host = document.getElementById("scene");
const renderer = new THREE.WebGLRenderer({
antialias: true,
powerPreference: "high-performance"
});
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.18;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
host.appendChild(renderer.domElement);
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x071116);
scene.fog = new THREE.Fog(0x071116, 29, 58);
const camera = new THREE.OrthographicCamera(-10, 10, 8, -8, 0.1, 100);
const controls = {
target: new THREE.Vector3(0, 2.05, 0),
radius: 28,
theta: 0.43,
phi: 1.03,
zoom: 1
};
const defaultControls = { ...controls };
function updateCamera() {
const sinPhi = Math.sin(controls.phi);
camera.position.set(
controls.target.x +
controls.radius * sinPhi * Math.sin(controls.theta),
controls.target.y + controls.radius * Math.cos(controls.phi),
controls.target.z +
controls.radius * sinPhi * Math.cos(controls.theta)
);
camera.lookAt(controls.target);
camera.zoom = controls.zoom;
camera.updateProjectionMatrix();
}
function resize() {
const aspect = window.innerWidth / window.innerHeight;
const viewHeight = 14.6;
camera.left = (-viewHeight * aspect) / 2;
camera.right = (viewHeight * aspect) / 2;
camera.top = viewHeight / 2;
camera.bottom = -viewHeight / 2;
camera.updateProjectionMatrix();
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
}
window.addEventListener("resize", resize);
resize();
updateCamera();
// -------------------------------------------------------------------------
// Lights and materials.
// -------------------------------------------------------------------------
scene.add(new THREE.HemisphereLight(0x9dd9dc, 0x101820, 2.0));
const keyLight = new THREE.DirectionalLight(0xffe7c8, 3.2);
keyLight.position.set(8, 15, 10);
keyLight.castShadow = true;
keyLight.shadow.mapSize.set(2048, 2048);
keyLight.shadow.camera.left = -14;
keyLight.shadow.camera.right = 14;
keyLight.shadow.camera.top = 13;
keyLight.shadow.camera.bottom = -11;
keyLight.shadow.camera.near = 1;
keyLight.shadow.camera.far = 38;
keyLight.shadow.bias = -0.0004;
scene.add(keyLight);
const rimLight = new THREE.DirectionalLight(0x56d9dc, 1.7);
rimLight.position.set(-9, 8, -5);
scene.add(rimLight);
const deskLight = new THREE.PointLight(0xffbc72, 22, 12, 2);
deskLight.position.set(-6.8, 4.8, 1.6);
scene.add(deskLight);
const M = {
wall: new THREE.MeshStandardMaterial({
color: 0x102229,
roughness: 0.95
}),
floor: new THREE.MeshStandardMaterial({
color: 0x0b171c,
roughness: 1
}),
grid: new THREE.MeshStandardMaterial({
color: 0x173039,
roughness: 1
}),
desk: new THREE.MeshStandardMaterial({
color: 0x344a4b,
roughness: 0.88
}),
deskEdge: new THREE.MeshStandardMaterial({
color: 0x17272b,
roughness: 0.82
}),
deskTrim: new THREE.MeshStandardMaterial({
color: 0x6a8077,
roughness: 0.72
}),
frame: new THREE.MeshStandardMaterial({
color: 0x091318,
roughness: 0.76,
metalness: 0.18
}),
frameEdge: new THREE.MeshStandardMaterial({
color: 0x24444b,
roughness: 0.64,
metalness: 0.22
}),
screen: new THREE.MeshStandardMaterial({
color: 0x0b1b21,
emissive: 0x061116,
emissiveIntensity: 0.35,
roughness: 0.6
}),
panel: new THREE.MeshStandardMaterial({
color: 0x10262c,
roughness: 0.82
}),
panelAlt: new THREE.MeshStandardMaterial({
color: 0x132c31,
roughness: 0.8
}),
cyan: new THREE.MeshStandardMaterial({
color: 0x58d9ce,
emissive: 0x164c4c,
emissiveIntensity: 0.38,
roughness: 0.55
}),
cyanDim: new THREE.MeshStandardMaterial({
color: 0x28585d,
emissive: 0x0b2428,
emissiveIntensity: 0.12,
roughness: 0.7
}),
hot: new THREE.MeshStandardMaterial({
color: 0xff5277,
emissive: 0x9b1739,
emissiveIntensity: 0.8,
roughness: 0.48
}),
amber: new THREE.MeshStandardMaterial({
color: 0xffc65a,
emissive: 0x6c3b06,
emissiveIntensity: 0.38,
roughness: 0.5
}),
paper: new THREE.MeshStandardMaterial({
color: 0xcbd4c5,
roughness: 1
}),
paperDark: new THREE.MeshStandardMaterial({
color: 0x81948c,
roughness: 1
}),
coral: new THREE.MeshStandardMaterial({
color: 0xd86458,
roughness: 0.72
}),
purple: new THREE.MeshStandardMaterial({
color: 0x665678,
roughness: 0.72
}),
black: new THREE.MeshStandardMaterial({
color: 0x11191c,
roughness: 0.82
}),
mug: new THREE.MeshStandardMaterial({
color: 0xe0a45c,
roughness: 0.72
})
};
function makeBox(
width,
height,
depth,
material,
x = 0,
y = 0,
z = 0,
parent = scene,
castShadow = true
) {
const mesh = new THREE.Mesh(
new THREE.BoxGeometry(width, height, depth),
material
);
mesh.position.set(x, y, z);
mesh.castShadow = castShadow;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
// Crisp canvas labels used as thin display surfaces.
function addLabel(
parent,
text,
worldWidth,
worldHeight,
x,
y,
z,
options = {}
) {
const density = 150;
const canvasWidth = THREE.MathUtils.clamp(
Math.round(worldWidth * density),
256,
2048
);
const canvasHeight = Math.max(24, Math.round(worldHeight * density));
const canvas = document.createElement("canvas");
canvas.width = canvasWidth;
canvas.height = canvasHeight;
const context = canvas.getContext("2d");
context.clearRect(0, 0, canvasWidth, canvasHeight);
const lines = String(text).split("\n");
const requested = options.fontSize || Math.floor(canvasHeight * 0.57);
let fontSize = requested;
context.font = `${options.weight || 700} ${fontSize}px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`;
const longest = Math.max(
...lines.map((line) => context.measureText(line).width)
);
const available = canvasWidth - (options.padding || 12) * 2;
if (longest > available && longest > 0) {
fontSize = Math.floor(fontSize * (available / longest));
}
context.font = `${options.weight || 700} ${fontSize}px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`;
context.fillStyle = options.color || "#dcebe8";
context.textAlign = options.align || "left";
context.textBaseline = "middle";
const alignX =
options.align === "center"
? canvasWidth / 2
: options.align === "right"
? canvasWidth - (options.padding || 12)
: options.padding || 12;
const lineHeight = fontSize * 1.18;
const startY =
canvasHeight / 2 - ((lines.length - 1) * lineHeight) / 2;
lines.forEach((line, index) => {
context.fillText(line, alignX, startY + index * lineHeight);
});
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
texture.minFilter = THREE.LinearMipmapLinearFilter;
texture.magFilter = THREE.LinearFilter;
texture.anisotropy = Math.min(
8,
renderer.capabilities.getMaxAnisotropy()
);
const material = new THREE.MeshBasicMaterial({
map: texture,
transparent: true,
alphaTest: 0.02,
depthWrite: false,
toneMapped: false,
side: THREE.DoubleSide
});
const mesh = new THREE.Mesh(
new THREE.PlaneGeometry(worldWidth, worldHeight),
material
);
mesh.position.set(x, y, z);
parent.add(mesh);
return mesh;
}
// -------------------------------------------------------------------------
// Room and desk.
// -------------------------------------------------------------------------
makeBox(30, 0.35, 25, M.floor, 0, -4.15, 0);
makeBox(25, 13, 0.42, M.wall, 0, 2.1, -4.85);
for (let x = -11; x <= 11; x += 1) {
makeBox(0.025, 0.018, 20, M.grid, x, -3.965, 0, scene, false);
}
for (let z = -8; z <= 9; z += 1) {
makeBox(24, 0.018, 0.025, M.grid, 0, -3.96, z, scene, false);
}
// Desk slab and trim.
makeBox(18, 0.72, 9.8, M.desk, 0, -0.65, 0.35);
makeBox(18.18, 0.16, 0.18, M.deskTrim, 0, -0.39, 5.22);
makeBox(0.18, 0.16, 9.9, M.deskTrim, -9.02, -0.39, 0.35);
makeBox(0.18, 0.16, 9.9, M.deskTrim, 9.02, -0.39, 0.35);
// Blocky legs and drawer.
[-7.6, 7.6].forEach((x) => {
[-3.3, 3.5].forEach((z) => {
makeBox(0.65, 3.25, 0.65, M.deskEdge, x, -2.35, z);
makeBox(0.82, 0.18, 0.82, M.black, x, -3.92, z);
});
});
makeBox(4.8, 1.65, 0.45, M.deskEdge, -4.2, -1.55, -3.95);
makeBox(1.5, 0.08, 0.12, M.deskTrim, -4.2, -1.15, -3.68);
// -------------------------------------------------------------------------
// Main voxel dashboard.
// -------------------------------------------------------------------------
const board = new THREE.Group();
scene.add(board);
makeBox(15.45, 7.95, 0.38, M.frame, 0, 3.9, -3.55, board);
makeBox(14.85, 7.38, 0.12, M.screen, 0, 3.9, -3.29, board);
makeBox(15.45, 0.25, 0.5, M.frameEdge, 0, 7.78, -3.29, board);
makeBox(15.45, 0.25, 0.5, M.frameEdge, 0, 0.02, -3.29, board);
makeBox(0.25, 7.7, 0.5, M.frameEdge, -7.6, 3.9, -3.29, board);
makeBox(0.25, 7.7, 0.5, M.frameEdge, 7.6, 3.9, -3.29, board);
// Screen stand.
makeBox(0.42, 2.1, 0.42, M.frameEdge, -4.8, -0.65, -3.85, board);
makeBox(0.42, 2.1, 0.42, M.frameEdge, 4.8, -0.65, -3.85, board);
makeBox(10.4, 0.18, 0.62, M.frameEdge, 0, -1.53, -3.85, board);
// Header.
addLabel(
board,
"FALSE POSITIVE / MULTI-TEST LAB",
8.1,
0.43,
-6.92,
7.06,
-2.98,
{ color: "#e3f1ed", fontSize: 30 }
);
addLabel(
board,
"NULL BATCH 07 • CONTEXT VISIBLE",
3.65,
0.22,
3.65,
7.05,
-2.97,
{ color: "#61e1d6", align: "right", fontSize: 16 }
);
function addPanel(x, y, width, height, alternate = false) {
return makeBox(
width,
height,
0.08,
alternate ? M.panelAlt : M.panel,
x,
y,
-3.12,
board,
false
);
}
// -------------------------------------------------------------------------
// Full search-count panel.
// -------------------------------------------------------------------------
addPanel(-5.52, 4.56, 3.72, 3.48, true);
addLabel(
board,
"FULL SEARCH SPACE",
2.9,
0.23,
-7.1,
6.03,
-2.98,
{ color: "#8eafb0", fontSize: 17 }
);
addLabel(
board,
"18,432",
3.0,
0.74,
-7.08,
5.28,
-2.95,
{ color: "#e5f2ed", fontSize: 86, weight: 900 }
);
addLabel(
board,
"SYNTHETIC COMPARISONS",
2.9,
0.21,
-7.08,
4.67,
-2.96,
{ color: "#61e1d6", fontSize: 15 }
);
makeBox(3.12, 0.035, 0.035, M.frameEdge, -5.53, 4.43, -2.99, board, false);
addLabel(
board,
"p < 0.05 EXPECTED",
1.9,
0.18,
-7.05,
4.13,
-2.96,
{ color: "#91acad", fontSize: 13 }
);
addLabel(
board,
"~922",
0.75,
0.25,
-4.57,
4.12,
-2.94,
{ color: "#ffc65a", align: "right", fontSize: 20 }
);
addLabel(
board,
"SELECTED FOR REVIEW",
2.1,
0.18,
-7.05,
3.69,
-2.96,
{ color: "#91acad", fontSize: 13 }
);
addLabel(
board,
"7",
0.42,
0.3,
-4.6,
3.68,
-2.94,
{ color: "#ff5277", align: "right", fontSize: 23 }
);
addLabel(
board,
"7 IS NOT THE NUMBER OF DISCOVERIES",
3.1,
0.18,
-7.05,
3.19,
-2.96,
{ color: "#ff8ba3", fontSize: 12 }
);
// -------------------------------------------------------------------------
// Three synthetic-test histograms.
// -------------------------------------------------------------------------
const selectedItems = [
{
id: "T-0231",
test: "t-test",
p: 0.002,
z: 2.12,
note: "Smallest p-value in the batch, but still drawn from a synthetic null."
},
{
id: "A-1184",
test: "ANOVA",
p: 0.004,
z: 2.34,
note: "A three-group comparison selected from thousands of synthetic nulls."
},
{
id: "X-0772",
test: "chi-square",
p: 0.009,
z: 2.19,
note: "An apparent category association inside the expected null tail."
},
{
id: "T-0449",
test: "t-test",
p: 0.011,
z: 2.14,
note: "A small tail probability replicated across many attempted comparisons."
},
{
id: "A-2201",
test: "ANOVA",
p: 0.013,
z: 2.09,
note: "One of several group comparisons retained for an independent check."
},
{
id: "X-0194",
test: "chi-square",
p: 0.017,
z: 2.02,
note: "A tail result whose context is dominated by the full comparison set."
},
{
id: "T-0903",
test: "t-test",
p: 0.021,
z: 1.98,
note: "Selected after screening, not significant after accounting for the search."
}
];
const chartBars = [];
function makeHistogram(cx, title, count, heights, hotIndex = 0) {
addPanel(cx, 4.56, 2.13, 3.48);
addLabel(
board,
title,
1.75,
0.27,
cx - 0.86,
6.04,
-2.97,
{ color: "#e3f1ed", fontSize: 20 }
);
addLabel(
board,
`n = ${count.toLocaleString()}`,
1.75,
0.19,
cx - 0.86,
5.72,
-2.97,
{ color: "#61e1d6", fontSize: 13 }
);
const baseY = 3.38;
const maxHeight = 1.72;
const barWidth = 0.15;
const gap = 0.1;
const startX = cx - 0.86;
heights.forEach((factor, index) => {
const height = maxHeight * factor;
const isHot = index === hotIndex;
const material = isHot
? M.hot
: new THREE.MeshStandardMaterial({
color: 0x34777a,
emissive: 0x0c292d,
emissiveIntensity: 0.2,
roughness: 0.72
});
const bar = makeBox(
barWidth,
height,
0.13,
material,
startX + index * (barWidth + gap),
baseY + height / 2,
-2.94,
board,
false
);
if (!isHot) {
chartBars.push({
mesh: bar,
material,
baseColor: material.color.clone(),
dimColor: new THREE.Color(0x14262b)
});
}
if (isHot) {
makeBox(
0.19,
0.1,
0.17,
M.hot,
startX + index * (barWidth + gap),
baseY + height + 0.02,
-2.91,
board,
false
);
}
});
makeBox(
1.83,
0.035,
0.05,
M.frameEdge,
cx,
baseY - 0.02,
-2.96,
board,
false
);
// p = 0.05 threshold.
makeBox(
0.035,
1.82,
0.04,
M.amber,
cx - 0.735,
baseY + 0.85,
-2.88,
board,
false
);
addLabel(
board,
"0",
0.2,
0.16,
cx - 0.9,
3.12,
-2.94,
{ color: "#78989a", fontSize: 11 }
);
addLabel(
board,
".05",
0.36,
0.16,
cx - 0.89,
3.12,
-2.94,
{ color: "#ffc65a", fontSize: 11 }
);
addLabel(
board,
"1",
0.2,
0.16,
cx + 0.72,
3.12,
-2.94,
{ color: "#78989a", align: "right", fontSize: 11 }
);
addLabel(
board,
"NULL P-VALUES",
1.82,
0.16,
cx - 0.91,
2.95,
-2.95,
{ color: "#678789", fontSize: 10 }
);
}
makeHistogram(-2.04, "t-test", 6144, [1.12, 0.92, 1.04, 0.88, 1.09, 0.97, 1.02, 0.91], 0);
makeHistogram(0.34, "ANOVA", 8256, [0.91, 1.08, 0.95, 1.12, 0.88, 1.01, 0.94, 1.07], 0);
makeHistogram(2.72, "chi-square", 4032, [1.07, 0.89, 1.13, 0.96, 1.02, 0.9, 1.08, 0.94], 0);
// -------------------------------------------------------------------------
// Selected-results list.
// -------------------------------------------------------------------------
const pickables = [];
addPanel(5.68, 4.56, 3.02, 3.48, true);
addLabel(
board,
"APPARENT STANDOUTS",
2.45,
0.25,
4.46,
6.05,
-2.96,
{ color: "#e3f1ed", fontSize: 19 }
);
addLabel(
board,
"7 selected / full context retained",
2.45,
0.17,
4.46,
5.74,
-2.96,
{ color: "#8da7a8", fontSize: 11 }
);
selectedItems.forEach((item, index) => {
const y = 5.43 - index * 0.37;
const row = makeBox(
2.48,
0.28,
0.055,
index % 2 === 0 ? M.panel : M.panelAlt,
5.68,
y,
-2.97,
board,
false
);
row.userData.item = item;
pickables.push(row);
const swatch = makeBox(
0.12,
0.12,
0.08,
M.hot,
4.53,
y,
-2.9,
board,
false
);
swatch.userData.item = item;
pickables.push(swatch);
addLabel(
board,
`${item.id} p=${item.p.toFixed(3)}`,
2.05,
0.17,
4.72,
y,
-2.82,
{ color: "#d6e5e1", fontSize: 12 }
);
});
// -------------------------------------------------------------------------
// Exact context field: 96 tiles × 192 comparisons = 18,432.
// -------------------------------------------------------------------------
addPanel(0, 1.25, 14.45, 1.64, false);
addLabel(
board,
"CONTEXT FIELD / EVERY TILE = 192 COMPARISONS",
6.4,
0.2,
-6.88,
1.85,
-2.96,
{ color: "#d9e9e5", fontSize: 15 }
);
addLabel(
board,
"96 TILES × 192 = 18,432",
4.3,
0.2,
2.55,
1.85,
-2.95,
{ color: "#61e1d6", align: "right", fontSize: 14 }
);
const selectedTileIndices = new Set([7, 19, 31, 42, 58, 73, 89]);
const itemByTile = new Map();
selectedTileIndices.forEach((tileIndex, itemIndex) => {
itemByTile.set(tileIndex, selectedItems[itemIndex]);
});
const contextTiles = [];
const tileWidth = 0.5;
const tileGap = 0.08;
const tileStartX = -6.91;
const tileRows = [1.52, 1.27, 1.02, 0.77];
for (let row = 0; row < 4; row++) {
for (let column = 0; column < 24; column++) {
const index = row * 24 + column;
const isSelected = selectedTileIndices.has(index);
const lightness = 0.23 + ((index * 17) % 13) / 100;
const baseColor = new THREE.Color().setHSL(
0.49 + ((index * 7) % 5) / 100,
0.31,
lightness
);
const material = isSelected
? M.hot
: new THREE.MeshStandardMaterial({
color: baseColor,
emissive: 0x071a1d,
emissiveIntensity: 0.18,
roughness: 0.78
});
const tile = makeBox(
tileWidth,
0.135,
0.14,
material,
tileStartX + column * (tileWidth + tileGap),
tileRows[row],
-2.91,
board,
false
);
if (isSelected) {
const item = itemByTile.get(index);
tile.userData.item = item;
pickables.push(tile);
makeBox(
0.11,
0.18,
0.19,
M.hot,
tile.position.x,
tile.position.y + 0.12,
-2.85,
board,
false
);
} else {
contextTiles.push({
mesh: tile,
material,
baseColor,
dimColor: new THREE.Color(0x142329)
});
}
}
}
// Subtle scanning indicator.
const scanMaterial = new THREE.MeshBasicMaterial({
color: 0x76efe3,
transparent: true,
opacity: 0.32,
depthWrite: false,
toneMapped: false
});
const scanLine = makeBox(
0.025,
0.88,
0.025,
scanMaterial,
-6.9,
1.26,
-2.74,
board,
false
);
// -------------------------------------------------------------------------
// Desk objects: keyboard, papers, folders, lamp, and mug.
// -------------------------------------------------------------------------
// Keyboard chassis and voxel keys.
makeBox(6.25, 0.18, 2.05, M.black, 0.2, -0.18, 2.35);
makeBox(5.95, 0.045, 1.76, M.deskEdge, 0.2, -0.055, 2.35);
const keyMaterial = new THREE.MeshStandardMaterial({
color: 0x3d5556,
roughness: 0.72
});
for (let row = 0; row < 4; row++) {
for (let column = 0; column < 14; column++) {
makeBox(
0.32,
0.11,
0.27,
keyMaterial,
-2.25 + column * 0.38,
0.025,
1.72 + row * 0.4
);
}
}
makeBox(1.65, 0.11, 0.3, M.cyanDim, 0.05, 0.025, 3.18);
// Mouse.
makeBox(0.72, 0.28, 1.12, M.black, 4.0, -0.08, 2.45);
makeBox(0.035, 0.03, 0.42, M.cyan, 4.0, 0.075, 2.15);
// Notebook and loose sheets.
makeBox(2.55, 0.18, 2.4, M.purple, -4.45, -0.15, 2.15);
makeBox(2.35, 0.07, 2.2, M.paper, -4.42, -0.015, 2.15);
makeBox(0.07, 0.04, 1.85, M.hot, -4.42, 0.03, 2.15);
makeBox(2.05, 0.1, 1.55, M.paperDark, 6.45, -0.19, 1.72);
makeBox(1.92, 0.08, 1.42, M.paper, 6.5, -0.1, 1.75);
makeBox(0.85, 0.04, 0.08, M.amber, 6.5, -0.04, 1.55);
// Stacked folders.
makeBox(2.3, 0.18, 2.85, M.coral, 6.55, -0.08, -0.25);
makeBox(2.22, 0.16, 2.7, M.purple, 6.55, 0.08, -0.18);
makeBox(2.3, 0.17, 2.75, M.cyanDim, 6.55, 0.24, -0.3);
// Voxel mug.
makeBox(0.72, 0.72, 0.72, M.mug, -6.65, 0.08, 2.55);
makeBox(0.62, 0.08, 0.62, M.black, -6.65, 0.47, 2.55);
makeBox(0.18, 0.48, 0.18, M.mug, -6.18, 0.12, 2.55);
makeBox(0.18, 0.18, 0.48, M.mug, -6.18, 0.3, 2.79);
// Blocky desk lamp.
makeBox(1.25, 0.16, 1.25, M.frameEdge, -7.35, -0.16, 0.65);
makeBox(0.25, 3.7, 0.25, M.frameEdge, -7.35, 1.65, 0.65);
makeBox(1.65, 0.22, 0.25, M.frameEdge, -6.65, 3.45, 0.65);
makeBox(1.25, 0.35, 0.8, M.amber, -5.95, 3.25, 0.65);
makeBox(0.92, 0.16, 0.62, M.amber, -5.95, 3.02, 0.65);
// Pencil.
makeBox(0.1, 0.1, 2.25, M.amber, -2.75, 0.02, 3.48);
makeBox(0.1, 0.1, 0.28, M.hot, -2.75, 0.02, 2.18);
// Small loose sticky notes attached to the right edge of the display.
makeBox(0.72, 0.72, 0.06, M.amber, 7.9, 2.05, -3.2);
makeBox(0.65, 0.65, 0.06, M.paper, 7.9, 1.18, -3.2);
// -------------------------------------------------------------------------
// Context-dimming behavior.
// -------------------------------------------------------------------------
let contextDimmed = false;
const dimButton = document.getElementById("dim-button");
function applyContextDim() {
for (const entry of contextTiles) {
entry.material.color.copy(
contextDimmed ? entry.dimColor : entry.baseColor
);
entry.material.emissiveIntensity = contextDimmed ? 0.04 : 0.18;
}
for (const entry of chartBars) {
entry.material.color.copy(
contextDimmed ? entry.dimColor : entry.baseColor
);
entry.material.emissiveIntensity = contextDimmed ? 0.02 : 0.2;
}
dimButton.classList.toggle("active", contextDimmed);
dimButton.textContent = contextDimmed ? "Show context" : "Dim context";
}
dimButton.addEventListener("click", () => {
contextDimmed = !contextDimmed;
applyContextDim();
});
// -------------------------------------------------------------------------
// Selectable result details.
// -------------------------------------------------------------------------
const selectionTitle = document.getElementById("selection-title");
const selectionP = document.getElementById("selection-p");
const selectionBody = document.getElementById("selection-body");
function selectItem(item) {
if (!item) return;
selectionTitle.textContent = `${item.id} / ${item.test.toUpperCase()}`;
selectionP.textContent = `p = ${item.p.toFixed(3)} · z = ${item.z.toFixed(2)}`;
selectionBody.textContent =
`${item.note} It is one of 7 selected results from 18,432 synthetic ` +
`comparisons; about 922 p < 0.05 tail hits are expected under the null. ` +
`Treat it as a review candidate, not a discovery.`;
}
// -------------------------------------------------------------------------
// Pointer interaction and raycasting.
// -------------------------------------------------------------------------
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
function setPointer(event) {
const rect = renderer.domElement.getBoundingClientRect();
pointer.x = ((event.clientX - rect.left) / rect.width) * 2 - 1;
pointer.y = -((event.clientY - rect.top) / rect.height) * 2 + 1;
}
function hitTest(event) {
setPointer(event);
raycaster.setFromCamera(pointer, camera);
const intersections = raycaster.intersectObjects(pickables, false);
return intersections.length ? intersections[0].object.userData.item : null;
}
let dragging = false;
let moved = false;
let lastX = 0;
let lastY = 0;
renderer.domElement.addEventListener("pointerdown", (event) => {
dragging = true;
moved = false;
lastX = event.clientX;
lastY = event.clientY;
renderer.domElement.setPointerCapture(event.pointerId);
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (dragging) {
const dx = event.clientX - lastX;
const dy = event.clientY - lastY;
if (Math.abs(event.clientX - lastX) + Math.abs(event.clientY - lastY) > 1) {
moved = true;
}
controls.theta = THREE.MathUtils.clamp(
controls.theta - dx * 0.005,
-0.95,
0.95
);
controls.phi = THREE.MathUtils.clamp(
controls.phi - dy * 0.0045,
0.66,
1.38
);
lastX = event.clientX;
lastY = event.clientY;
updateCamera();
return;
}
const item = hitTest(event);
renderer.domElement.style.cursor = item ? "pointer" : "grab";
});
renderer.domElement.addEventListener("pointerup", (event) => {
if (!moved) {
selectItem(hitTest(event));
}
dragging = false;
if (renderer.domElement.hasPointerCapture(event.pointerId)) {
renderer.domElement.releasePointerCapture(event.pointerId);
}
});
renderer.domElement.addEventListener("pointercancel", () => {
dragging = false;
});
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
controls.zoom = THREE.MathUtils.clamp(
controls.zoom * (event.deltaY > 0 ? 0.91 : 1.1),
0.72,
1.55
);
updateCamera();
},
{ passive: false }
);
document.getElementById("reset-button").addEventListener("click", () => {
controls.theta = defaultControls.theta;
controls.phi = defaultControls.phi;
controls.zoom = defaultControls.zoom;
controls.target.copy(defaultControls.target);
updateCamera();
});
window.addEventListener("keydown", (event) => {
if (event.key.toLowerCase() === "d") {
contextDimmed = !contextDimmed;
applyContextDim();
}
if (event.key.toLowerCase() === "r") {
controls.theta = defaultControls.theta;
controls.phi = defaultControls.phi;
controls.zoom = defaultControls.zoom;
controls.target.copy(defaultControls.target);
updateCamera();
}
});
// -------------------------------------------------------------------------
// Animation.
// -------------------------------------------------------------------------
const clock = new THREE.Clock();
const reducedMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)"
).matches;
function animate() {
requestAnimationFrame(animate);
const elapsed = clock.getElapsedTime();
if (!reducedMotion) {
M.hot.emissiveIntensity = 0.72 + Math.sin(elapsed * 3.1) * 0.22;
M.cyan.emissiveIntensity = 0.32 + Math.sin(elapsed * 1.7) * 0.07;
const scanPosition = ((elapsed * 0.34) % 1) * 13.8 - 6.9;
scanLine.position.x = scanPosition;
scanMaterial.opacity = 0.2 + Math.sin(elapsed * 2.2) * 0.08;
}
renderer.render(scene, camera);
}
animate();
document.getElementById("loading").classList.add("hidden");
setTimeout(() => document.getElementById("loading").remove(), 450);
</script>
</body>
</html>
```