> d3
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.
curl "https://skillshub.wtf/TerminalSkills/skills/d3?format=md"D3.js
Overview
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.
Instructions
- When binding data, use
.data(dataset).join("element")(D3 v6+) for the enter/update/exit pattern, setting attributes and styles from bound data via accessor functions. - When creating scales, choose the appropriate type (
scaleLinearfor continuous,scaleBandfor categorical bars,scaleTimefor dates,scaleOrdinalfor color mapping) and always set domain from the data usingd3.extent(). - When building axes, create them with
d3.axisBottom(scale)ord3.axisLeft(scale), configure ticks and format labels withd3.format(), and regenerate on resize. - When creating chart types, use shape generators (
d3.line(),d3.area(),d3.arc(),d3.pie(),d3.stack()) and layout functions (d3.treemap(),d3.forceSimulation(),d3.geoPath()) for complex visualizations. - When adding interactivity, use transitions (
.transition().duration(750)) for smooth data updates, tooltips on hover, and brushing/zooming for exploration. - When integrating with React, use D3 for math (scales, layouts, data transforms) and React for DOM rendering, computing values in
useMemoand usinguseEffectwith refs for D3-driven animations.
Examples
Example 1: Build a real-time dashboard with multiple chart types
User request: "Create a dashboard with line charts, bar charts, and a pie chart from API data"
Actions:
- Set up shared scales with
d3.scaleTime()for the x-axis andd3.scaleLinear()for the y-axis - Build a line chart using
d3.line()with smooth curve interpolation and area fill - Build a grouped bar chart using
d3.scaleBand()with staggered enter transitions - Build a donut chart using
d3.pie()andd3.arc()with hover tooltips
Output: A responsive dashboard with animated charts that update smoothly when data changes.
Example 2: Create a force-directed network graph
User request: "Visualize relationships between entities as an interactive network graph"
Actions:
- Set up
d3.forceSimulation()withforceManyBody,forceLink, andforceCenter - Render nodes as circles with
d3.scaleOrdinal()coloring by category - Add drag interaction with
d3.drag()to reposition nodes - Implement zoom and pan with
d3.zoom()and tooltips on hover
Output: An interactive force-directed graph with draggable nodes, color-coded categories, and zoom navigation.
Guidelines
- Use D3 for scales, layouts, and data processing; let React handle DOM rendering in React apps.
- Use
.join()instead of manual enter/update/exit for simpler, cleaner data binding. - Always set scale domains from data (
d3.extent()) rather than hardcoding ranges. - Use
d3.format()for axis labels and tooltips:",.0f"for thousands,"$.2f"for currency. - Add transitions of 750ms with
easeCubicInOutfor smooth data update animations. - Make visualizations responsive by recalculating scales on
ResizeObservercallbacks. - Add
aria-labelto SVG elements and meaningful<title>tags for accessibility.
> related_skills --same-repo
> zustand
You are an expert in Zustand, the small, fast, and scalable state management library for React. You help developers manage global state without boilerplate using Zustand's hook-based stores, selectors for performance, middleware (persist, devtools, immer), computed values, and async actions — replacing Redux complexity with a simple, un-opinionated API in under 1KB.
> zoho
Integrate and automate Zoho products. Use when a user asks to work with Zoho CRM, Zoho Books, Zoho Desk, Zoho Projects, Zoho Mail, or Zoho Creator, build custom integrations via Zoho APIs, automate workflows with Deluge scripting, sync data between Zoho apps and external systems, manage leads and deals, automate invoicing, build custom Zoho Creator apps, set up webhooks, or manage Zoho organization settings. Covers Zoho CRM, Books, Desk, Projects, Creator, and cross-product integrations.
> zod
You are an expert in Zod, the TypeScript-first schema declaration and validation library. You help developers define schemas that validate data at runtime AND infer TypeScript types at compile time — eliminating the need to write types and validators separately. Used for API input validation, form validation, environment variables, config files, and any data boundary.
> zipkin
Deploy and configure Zipkin for distributed tracing and request flow visualization. Use when a user needs to set up trace collection, instrument Java/Spring or other services with Zipkin, analyze service dependencies, or configure storage backends for trace data.