Assists with building custom interactive data visualizations using D3.js. Use when creating charts, graphs, maps, force layouts, or hierarchical diagrams that require fine-grained control beyond what charting libraries provide. Trigger words: d3, data visualization, chart, svg, scales, force graph, treemap, choropleth.
D3.js is a low-level JavaScript library for building custom, interactive data visualizations by binding data to DOM elements. It provides scales, axes, shape generators, geographic projections, force simulations, and hierarchical layouts, giving developers full control over the visual output while integrating with React through computed scales and layouts.
.data(dataset).join("element") (D3 v6+) for the enter/update/exit pattern, setting attributes and styles from bound data via accessor functions.scaleLinear for continuous, scaleBand for categorical bars, scaleTime for dates, scaleOrdinal for color mapping) and always set domain from the data using d3.extent().d3.axisBottom(scale) or d3.axisLeft(scale), configure ticks and format labels with d3.format(), and regenerate on resize.d3.line(), d3.area(), d3.arc(), d3.pie(), d3.stack()) and layout functions (d3.treemap(), d3.forceSimulation(), d3.geoPath()) for complex visualizations..transition().duration(750)) for smooth data updates, tooltips on hover, and brushing/zooming for exploration.useMemo and using useEffect with refs for D3-driven animations.User request: "Create a dashboard with line charts, bar charts, and a pie chart from API data"
Actions:
d3.scaleTime() for the x-axis and d3.scaleLinear() for the y-axisd3.line() with smooth curve interpolation and area filld3.scaleBand() with staggered enter transitionsd3.pie() and d3.arc() with hover tooltipsOutput: A responsive dashboard with animated charts that update smoothly when data changes.
User request: "Visualize relationships between entities as an interactive network graph"
Actions:
d3.forceSimulation() with forceManyBody, forceLink, and forceCenterd3.scaleOrdinal() coloring by categoryd3.drag() to reposition nodesd3.zoom() and tooltips on hoverOutput: An interactive force-directed graph with draggable nodes, color-coded categories, and zoom navigation.
.join() instead of manual enter/update/exit for simpler, cleaner data binding.d3.extent()) rather than hardcoding ranges.d3.format() for axis labels and tooltips: ",.0f" for thousands, "$.2f" for currency.easeCubicInOut for smooth data update animations.ResizeObserver callbacks.aria-label to SVG elements and meaningful <title> tags for accessibility.npx skills add TerminalSkills/d3下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer