oneshotlm
Compare all models on this prompt →

Force-directed graph · claude-opus-5

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 · 10 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

I'll build the force-directed graph app in one self-contained file.

bash {"command":"ls -la /tmp/ws"}
toolResult

total 276 drwxr-sr-x. 2 node node 23 Aug 3 00:22 . drwxrwsrwx. 3 root node 16 Aug 3 00:22 .. -rw-r--r--. 1 node node 279706 Aug 3 00:22 d3.min.js

assistant
write /tmp/ws/index.html (14217 bytes)
toolResult

Successfully wrote 14217 bytes to /tmp/ws/index.html

assistant
bash {"command":"cd /tmp/ws && node -e \"\nconst fs=require('fs');const h=fs.readFileSync('index.html','utf8');\nconst js=h.match(/<script>([\\s\
toolResult

parsed ok nodes 7 links 63 bad refs [ 'api-gateway', 'auth-service', 'user-service', 'billing', 'search-api', 'webhooks', 'scheduler', 'postgres', 'redis', 'kafka', 's3-blobs', 'etl-worker', 'clickhouse', 'web-app', 'mobile-app', 'docs-site', 'graphql-bff', 'cdn-edge', 'dns', 'kubernetes', 'terraform', 'service-mesh', 'prometheus', 'grafana', 'loki-logs', 'ci-runner', 'vault', 'model-train', 'model-serve', 'recommender', 'ab-testing', 'dashboards', 'anomaly-det' ]

assistant
thinking
I need to fix the node ID regex pattern since it was too restrictive with its spacing requirements.
bash {"command":"cd /tmp/ws && node -e \"\nconst fs=require('fs');const h=fs.readFileSync('index.html','utf8');\nconst js=h.match(/<script>([\\s\
toolResult

nodes 40 40 links 63 bad refs [] isolated []

assistant
thinking
The regex is working correctly and includes the feature-store entries as expected. The node text opacity toggling is functioning properly with the selector, and while the click handler fires after panning, it doesn't cause any issues since the zoom interaction uses drag on the SVG. Everything checks out.

`index.html` is written and validated: 40 unique nodes, 63 links, no dangling or isolated references. **Features** - **Data inline**: 40 nodes in 5 colored clusters (Core Platform, Data & Storage, Frontend, Infrastructure, ML/Analytics) plus 63 weighted links; node radius scales with degree, link width with weight. - **Layout**: `forceLink` (shorter/stronger intra-cluster distances), `forceManyBody`, `forceCollide`, and per-cluster `forceX/forceY` anchors arranged on a circle for clean cluster separation. - **Drag**: nodes stay pinned where dropped (white ring marks pinned); click a pinned node to release it. - **Hover**: tooltip with group + degree, non-neighbors fade, incident links highlight in blue and raise above. - **Zoom/pan**: scroll/pinch zoom 0.2×–6×, background drag to pan, labels auto-hide when zoomed far out. - **Controls**: Reset view (animated zoom transform), Release pinned, Re-simulate; responsive on window resize. Open `/tmp/ws/index.html` directly in a browser — it loads only the local `d3.min.js`.

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-5
vendorAnthropic · Claude
harnesspi-agent
generated2026-08-03

EVALUATION

3/5 working

Node-link infrastructure graph with pan/zoom via drag and wheel, but click and keyboard inputs have no effect.

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 motion1.3%
on click0.0%
on drag6.2%
on wheel3.8%
on enter + space0.0%
on arrow keys0.0%
on w/a/s/d0.0%
frame spread15.3 / 255
console errors0
js errors none

METRICS

runtime84.4s
tokens in34k
tokens out7.7k
cached25k
cost / run$0.2606