/swarming-graph:embed-swarming-graphfrom swarming-graph
Embeds the @nirholas/swarming 3D force-directed graph via CDN script tag or ES module, supporting static data or live WebSocket streams. Useful for real-time network or transaction graph visualization.
Ships in swarming-graph. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
@nirholas/swarming renders thousands of nodes with bloom and a physics simulation using React Three Fiber and d3-force-3d. It is published on npm (0.1.0). The root repo is a Next.js app that uses it; you only need the package.
The UMD bundle includes React, Three.js and React Three Fiber and exposes window.Swarming:
<div id="viz" style="width: 100%; height: 600px"></div>
<script src="https://unpkg.com/@nirholas/swarming/dist/swarming.umd.js"></script>
<script>
const viz = Swarming.create('#viz', { source: 'wss://my-data-stream' });
viz.on('data', ({ nodeCount, edgeCount }) => console.log(nodeCount, edgeCount));
</script>
Pin a version in the URL for production (@nirholas/[email protected]). The container needs an explicit height.
npm install @nirholas/swarming react react-dom three @react-three/fiber @react-three/drei @react-three/postprocessing postprocessing
import { Swarming } from '@nirholas/swarming';
const viz = Swarming.create('#viz', {
data: {
nodes: [
{ id: 'a', label: 'Node A', group: 'cluster-1' },
{ id: 'b', label: 'Node B', group: 'cluster-1' },
],
edges: [{ source: 'a', target: 'b' }],
},
theme: 'dark',
});
Swarming.create(selector, options) mounts into the first element matching the selector and throws if none exists.
source (WebSocket URL, reconnects with backoff), data ({ nodes, edges? }, an alternative to source), theme ('dark' | 'light', default dark), maxNodes (default 2000; the smallest hub is evicted past it), simulationConfig, fov (45), cameraPosition ([0, 160, 40]), showLabels (true), postProcessing (true; turn off on weak GPUs).
Node: { id, label, group?, radius?, color? }. Edge: { source, target, label? }.
Each WebSocket message is JSON. A hub is added or grown by { "type": "tokenCreate", "data": { "tokenAddress": "hub-1", "symbol": "HUB", "volume": 10 } }. An edge from a satellite to a hub is { "type": "trade", "data": { "trader": "wallet-1", "tokenAddress": "hub-1", "volume": 2 } }. txType: "create" and txType: "buy" | "sell" are accepted aliases and mint replaces tokenAddress. Malformed messages are ignored.
pause(), resume() (stop or restart applying stream data), setTheme(theme), setMaxNodes(max), addNode(node), removeNode(id), on(event, cb) and off(event, cb) for 'ready', 'data' and 'error', and destroy() to close the stream and unmount. Call destroy() when removing the container.
Inside an existing React Three Fiber scene, use the SwarmingRenderer component instead (props such as topTokens, traderEdges, background, groundColor, showLabels).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub nirholas/visualize-web3-realtime --plugin swarming-graphOther plugins' skills for the same job