oneshotlm
Compare all models on this prompt →

Force-directed graph · llama-3.3-70b-instruct

Output generated Cost / run $0.0012 Runtime 28.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.

⛨ sandboxed Open in new tab ↗

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

modelllama-3.3-70b-instruct
vendorMeta · Llama
harnesspi-agent
generated2026-08-01

METRICS

runtime28.2s
tokens in4.7k
tokens out1.4k
cached0
cost / run$0.0012
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
→ write index.html (3064 bytes)
toolResult

Successfully wrote 3064 bytes to index.html

assistant

The code creates a simple force-directed graph with 40 nodes and several clusters. The nodes are draggable, and hovering over a node highlights its neighbors. The graph also supports zooming and panning. Please note that this is a basic example and might need to be adjusted based on your specific requirements. For example, you might want to add more nodes or links, or adjust the simulation parameters to get the desired layout. Also, keep in mind that this code uses the d3.min.js library, which is already present in the current directory. If you want to use a different version of the library or include it from a CDN, you will need to adjust the script tag accordingly. Finally, this code assumes that the graph should be rendered in an SVG element with a width of 800 pixels and a height of 600 pixels. If you want to use a different size or rendering element, you will need to adjust the code accordingly.