oneshotlm
Compare all models on this prompt →

Force-directed graph · glm-5.2

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
thinking
Let me build a self-contained index.html with d3 force-directed graph.
write /workspace/index.html (8702 bytes)
toolResult

Successfully wrote 8702 bytes to /workspace/index.html

assistant

Created `index.html` — a self-contained force-directed graph built on the local `d3.min.js`. Here's what it includes: **Graph data (inline, ~40 nodes, 5 clusters)** - 5 color-coded clusters: Frontend, Backend, Data, DevOps, Design - Each cluster has a ring + a couple of chords for cohesion - Inter-cluster bridges connect adjacent clusters (e.g. React↔Node, Node↔Docker, React↔Figma) **Interactions** - **Draggable nodes** — drag any node to reposition; simulation keeps it pinned while dragging and releases on drop - **Hover highlighting** — hovering a node highlights itself + direct neighbors and dims the rest; connected edges turn the cluster color and thicken; the info panel shows the node name, cluster, and connection count - **Zoom/pan** — scroll to zoom, drag the background to pan, plus +/−/reset buttons in the corner - **Responsive** — re-centers on window resize **Layout details** - `forceLink`, `forceManyBody`, `forceCollide`, and weak `forceX/forceY` produce a clustered-but-breathing layout - Dark theme matching the GitHub dark palette, with cluster-colored nodes and labeled-on-hover text Open `index.html` in a browser to use it.

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

modelglm-5.2
vendorZ.ai · GLM
harnesspi-agent
generated2026-07-08

EVALUATION

3/5 working

Force-directed clustered graph renders with drag and zoom/pan working; click and keyboard inputs show 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 drag3.9%
on wheel2.2%
on enter + space0.0%
on arrow keys0.0%
on w/a/s/d0.0%
frame spread14.7 / 255
console errors0
js errors none

METRICS

runtime48.1s
tokens in3.0k
tokens out3.1k
cached2.9k
cost / run$0.0128