oneshotlm
Compare all models on this prompt →

Force-directed graph · minimax-m2.7

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 · 6 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
The user wants me to create an interactive force-directed graph using D3.js. Let me plan this out:

1. Create a single index.html file with:
   - D3.js loaded from local file (d3.min.js)
   - CSS styling for the visualization
   - Inline JavaScript with:
     - Sample nodes and links (about 40 nodes in several clusters)
     - Force-directed layout simulation
     - Draggable nodes
     - Hover highlighting of neighbors
     - Zoom/pan functionality

Let me write this as a complete, self-contained file.
write /workspace/index.html (14282 bytes)
toolResult

Successfully wrote 14282 bytes to /workspace/index.html

assistant
thinking
I've created the interactive force-directed graph. Let me verify the file exists and check it.
bash {"command":"ls -la /workspace/index.html /workspace/d3.min.js"}
toolResult

-rw-r--r-- 1 node node 279706 Jul 8 00:38 /workspace/d3.min.js -rw-r--r-- 1 node node 14282 Jul 8 00:38 /workspace/index.html

assistant
thinking
Both files are present. The index.html is self-contained with all CSS and JavaScript inline. Let me provide a summary of what was created.

Done! Created `index.html` with a fully interactive force-directed graph featuring: **Data Structure:** - 40 nodes organized into 6 clusters: Engineering, Design, Product, Marketing, Operations, and Data Science - ~60 links including intra-cluster and cross-functional connections - Leadership nodes (CEO, CTO, CFO) bridging clusters **Interactions:** - **Drag nodes** - Click and drag any node to reposition it; simulation re-stabilizes on release - **Hover highlighting** - Hovering a node highlights it and all connected nodes/links in green/red - **Tooltip** - Shows node name and group on hover - **Zoom/Pan** - Scroll to zoom, click+drag background to pan the entire graph **Visual Design:** - Dark theme (#1a1a2e background) - Color-coded node groups (6 distinct colors) - Smooth transitions on hover states - Legend showing all categories - Instructions panel at bottom-left **Technical Features:** - Custom cluster force pulling nodes toward their group centers - Collision detection preventing node overlap - D3 v7 drag behavior with proper alpha restart/stop - Zoom constraints (0.2x - 4x) - Responsive resize handling

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

modelminimax-m2.7
vendorMiniMax
harnesspi-agent
generated2026-07-08

EVALUATION

4/5 working

Clustered force-directed graph with color-coded groups, draggable nodes, and zoom/pan responding to wheel and drag; keyboard inputs correctly 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 motion9.1%
on click0.1%
on drag9.3%
on wheel6.1%
on enter + space0.0%
on arrow keys0.0%
on w/a/s/d0.0%
frame spread23.7 / 255
console errors0
js errors none

METRICS

runtime20.7s
tokens in14k
tokens out4.8k
cached256
cost / run$0.0079