d3-fundamentals

d3-fundamentals is a skill for Claude Code, Codex from cxcscmu/SkillLearnBench. It costs 30 tokens per session (840 once invoked), scanned A, original, MIT.

An introduction to D3.js version 6, a JavaScript library for creating web visualisations from data. It explains selecting page elements, connecting data to them, scaling values, and drawing SVG graphics.

In plain words
What is it for?
Use it to bind arrays to page elements, create and update SVG shapes, map data values to positions or colours, and manage added, changed, or removed chart elements.
Why use it?
D3.js combines data with browser elements, but its core concepts can be unfamiliar. This gives the basic building blocks needed before creating charts or interactive graphics.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to bind arrays to page elements, create and update SVG…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cxcscmu/skilllearnbench/d3-fundamentals
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cxcscmu/SkillLearnBench --skill d3-fundamentals
Clone the repo
git clone --depth 1 https://github.com/cxcscmu/SkillLearnBench

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for d3-fundamentals

README.md
[![agentmods](https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/d3-fundamentals.svg)](https://agentmods.dev/skills/cxcscmu/skilllearnbench/d3-fundamentals)
Your own site
<a href="https://agentmods.dev/skills/cxcscmu/skilllearnbench/d3-fundamentals"><img src="https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/d3-fundamentals.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 840 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.00840
Opus 5 $0.00015 $0.00420
Sonnet 5 $0.00006 $0.00168
Haiku 4.5 $0.00003 $0.00084

Measured 7d ago against content hash 52355d6d7552, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

d3-fundamentals scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/b1-one-shot-claude-haiku-4-5/stock-data-visualization/d3-fundamentals/SKILL.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

D3.js v6 Fundamentals

Overview

D3.js v6 (Data-Driven Documents) is a JavaScript library for manipulating documents based on data. Essential for creating scalable vector graphics (SVG) visualizations.

Core Concepts

1. Selections

Select DOM elements and bind data to them:

// Select elements
d3.select("body")                    // single element
d3.selectAll(".dots")                // multiple elements

// Data binding
d3.selectAll("circle")
  .data(dataArray, d => d.id)       // bind data with key function
  .join(                             // handle enter/update/exit
    enter => enter.append("circle"),
    update => update,
    exit => exit.remove()
  )

2. Scales

Map data values to visual dimensions:

// Linear scale (continuous input → continuous output)
const xScale = d3.scaleLinear()
  .domain([0, 100])           // input range
  .range([0, width]);         // output range

// Other common scales:
const colorScale = d3.scaleOrdinal()
  .domain(["A", "B", "C"])
  .range(["red", "blue", "green"]);

const sizeScale = d3.scaleSqrt()   // square root scale (better for areas)
  .domain([0, max])
  .range([0, 100]);

3. SVG Elements

Common SVG elements for visualization:

// Circle (bubble chart)
g.append("circle")
  .attr("cx", d => xScale(d.x))
  .attr("cy", d => yScale(d.y))
  .attr("r", d => rScale(d.value))
  .attr("fill", d => colorScale(d.category));

// Text (labels)
g.append("text")
  .text(d => d.label)
  .attr("text-anchor", "middle")
  .attr("dominant-baseline", "central");

// Rect (table cells, bars)
g.append("rect")
  .attr("width", width)
  .attr("height", height);

4. Margins Convention

Standard pattern for creating SVG containers:

const margin = {top: 20, right: 20, bottom: 20, left: 20};
const width = 800 - margin.left - margin.right;
const height = 600 - margin.top - margin.bottom;

const svg = d3.select("body")
  .append("svg")
  .attr("width", width + margin.left + margin.right)
  .attr("height", height + margin.top + margin.bottom)
  .append("g")
  .attr("transform", `translate(${margin.left},${margin.top})`);

Read the full file on GitHub · 125 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 125 lines · 30 tokens per session scan A 52355d6d7552

Subscribe to this mod's changes

d3-fundamentals is a skill published in the GitHub repository cxcscmu/SkillLearnBench (83 stars, last pushed 1mo ago), licensed MIT. It adds 30 tokens to every session and 840 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

d3-visualization

Build deterministic, verifiable data visualizations with D3.js (v6). Generate standalone HTML/SVG (and optional PNG) from local data files without external network dependencies. Use when tasks require charts, plots, axes/scales, legends, tooltips, or data-driven SVG output.

benchflow-ai/skillsbench · 64 tokens

web-interface-guidelines

Vercel's comprehensive UI guidelines for building accessible, performant web interfaces. Use this skill when reviewing or building UI components for compliance with best practices around accessibility, performance, animations, and visual stability.

benchflow-ai/skillsbench · 45 tokens

Popular Web Designs

Design contemporary web layouts, visual systems, and polished interface patterns.

Raidriar7170/hermes-skilleval · 17 tokens

browser-visual-review

Use when reviewing local browser screenshots for layout shifts, visual regressions, and viewport state.

Raidriar7170/hermes-skilleval · 23 tokens

react-best-practices

IMPORTANT: Any change to React or Next.js code must read through this skill first. React and Next.js guidelines from Vercel Engineering covering visual instability, layout shifts, CLS, flickering, hydration issues, and font loading.

benchflow-ai/skillsbench · 54 tokens

frontend-engineer

Pro frontend engineering discipline. Enforces build-test-verify workflow for every web project. Never declare done until the site is built, tested, responsive, accessible, and visually verified in a real browser. Use alongside vercel-cli for production-quality deployments.

suyoumo/ClawProBench · 54 tokens