agentsclimarketplace

Run2 d3 force clustering

Skill cxcscmu/SkillLearnBench/skills/b2-self-feedback-gemini-3-flash-preview/stock-data-visualization/run2_d3-force-clustering

Advanced clustering techniques in D3.js force simulations for compact and aesthetically pleasing layouts.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill run2_d3-force-clustering

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

1.2 KB, 286 tokens by cl100k_base, as published. Nobody here has run it

Advanced D3 Force Clustering

This skill focuses on creating compact, sector-based clusters that are visually grouped but centrally located.

Dynamic Cluster Centers

Instead of a rigid grid, use a radial layout or a packed grid for cluster centers to keep them "close together".

const clusterCenters = sectors.map((s, i) => {
    const angle = (i / sectors.length) * 2 * Math.PI;
    const radius = 150; // Distance from center
    return {
        sector: s,
        x: width / 2 + radius * Math.cos(angle),
        y: height / 2 + radius * Math.sin(angle)
    };
});

Collision with Padding

Ensure bubbles don't overlap by adding padding to the collision force.

simulation.force("collide", d3.forceCollide().radius(d => getRadius(d) + 2).iterations(4));

Grouping Forces

Apply forces that pull nodes towards their specific cluster center.

simulation
    .force("x", d3.forceX(d => centers[d.sector].x).strength(0.2))
    .force("y", d3.forceY(d => centers[d.sector].y).strength(0.2))
    .force("center", d3.forceCenter(width / 2, height / 2));

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.