Force-directed graph · mercury-2
Output generated Cost / run $0.0038 Runtime 7.2s
Prompt for this run
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.
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
METRICS
Transcript · 8 messages
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.
{"command":"ls -1"}d3.min.js
index.html (3273 bytes)Successfully wrote 3273 bytes to index.html
{"command":"ls -l index.html"}-rw-r--r--. 1 node node 3283 Aug 1 20:03 index.html
The **index.html** file has been created in the current directory (`/tmp/ws`). It contains a self‑contained web page that: * Loads the provided `d3.min.js` library locally. * Generates a sample graph with ~40 nodes divided into clusters. * Renders an interactive force‑directed layout with: * Draggable nodes, * Hover highlighting of a node’s neighbors, * Zoom and pan support. You can open `index.html` in a browser to see the interactive graph. No external resources are required.