oneshotlm
Compare all models on this prompt →

Force-directed graph · kat-coder-pro-v2

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 · 4 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 create an interactive force-directed graph visualization using D3.js with all the requested features. Let me build this step by step.

write /workspace/index.html (15659 bytes)
toolResult

Successfully wrote 15659 bytes to /workspace/index.html

assistant

Perfect! I've created an interactive force-directed graph visualization in `/workspace/index.html`. Here's what's included: ## Features: - **40 nodes** organized into 5 colored clusters (Technology, Science, Arts, Business, Sports) - **70 links** with preferential attachment within clusters - **Draggable nodes** - click and drag to reposition - **Hover highlighting** - hover over nodes to see neighbors and connection info - **Zoom & pan** - mouse wheel to zoom, drag empty space to pan - **Interactive controls**: - Charge strength slider (repulsion between nodes) - Link distance slider (spacing between connected nodes) - Restart simulation button - Reset zoom button - Toggle labels button - **Tooltips** showing node details on hover - **Legend** showing cluster colors - **Zoom indicator** showing current zoom level The graph uses D3's force simulation with collision detection to create natural-looking clusters. Nodes are sized based on random values, and links have varying thickness based on connection strength. Open `index.html` in your browser to see the interactive visualization!

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

modelkat-coder-pro-v2
vendorKwaipilot
harnesspi-agent
generated2026-07-31

EVALUATION

3/5 working

D3 force-directed graph with clusters, drag pans/zoom works, but arrows/enter-space seem to just pan/zoom the view like scroll, not distinct actions.

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 motion0.0%
on click0.0%
on drag8.4%
on wheel4.5%
on enter + space35.6%
on arrow keys28.1%
on w/a/s/d0.0%
frame spread58.8 / 255
console errors0
js errors none

METRICS

runtime61.5s
tokens in8.0k
tokens out4.5k
cached0
cost / run$0.0078