oneshotlm
Compare all models on this prompt →

Force-directed graph · claude-opus-4.8

Using the pre-provided d3.min.js (global d3), render an interactive force-directed graph of about 40 nodes in several clusters with draggable nodes, hover highlighting of neighbors, and zoom/pan. Define the sample nodes and links inline.

⛨ sandboxed Open in new tab ↗
transcript · 8 messages
user

Using the pre-provided d3.min.js (global d3), render an interactive force-directed graph of about 40 nodes in several clusters with draggable nodes, hover highlighting of neighbors, and zoom/pan. Define the sample nodes and links inline.

assistant
thinking
I'm setting up the HTML file with a d3 force-directed graph visualization and verifying that the d3 library file is available.
bash {"command":"ls -la /workspace"}
toolResult

total 324 drwxrwxrwx 3 node node 96 Jul 8 02:59 . drwxr-xr-x 1 root root 4096 Jul 8 02:59 .. -rw-r--r-- 1 node node 279706 Jul 8 02:59 d3.min.js

assistant
thinking
Now I'm setting up the HTML file.
write /workspace/index.html (5751 bytes)
toolResult

Successfully wrote 5751 bytes to /workspace/index.html

assistant
bash {"command":"cd /workspace && node -e \"const d3=require('./d3.min.js'); console.log('d3 loaded', typeof d3.forceSimulation)\" 2>&1 | head"}
toolResult

d3 loaded function

assistant

Done. `index.html` is a self-contained single-page app that loads the local `d3.min.js` and renders an interactive force-directed graph. Features implemented: - **~40 nodes** across 5 clusters (Core, Frontend, Backend, Data, Ops), color-coded, defined inline. - **Links** generated inline: intra-cluster (hub star + chain) plus inter-cluster bridges. - **Draggable nodes** — drag pins a node while the simulation reheats, releases on drop. - **Hover highlighting** — hovering fades everything except the node's neighbors and colors the connecting edges. - **Zoom/pan** — scroll to zoom (0.2×–5×), drag the background to pan. - Responsive to window resize, no external resources or network calls.

TAKE IT TO CODE

A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.

RUN

modelclaude-opus-4.8
vendorAnthropic · Claude
harnesspi-agent
generated2026-07-08

EVALUATION

3/5 working

Force-directed clustered graph with drag/zoom/pan working; nodes drift naturally, keyboard input has no effect as expected.

Vision grade · anthropic/claude-sonnet-5

MEASUREMENTS

Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.

idle motion3.9%
on click2.2%
on drag6.4%
on wheel3.4%
on enter + space0.0%
on arrow keys0.0%
on w/a/s/d0.0%
frame spread10.7 / 255
console errors0
js errors none

METRICS

runtime47.5s
tokens in6.3k
tokens out3.3k
cached8.4k
cost / run$0.1246