D3.js is the foundational low-level library for data-driven DOM manipulation, offering complete control over SVG, Canvas, and HTML rendering with a functional, framework-agnostic API. visx is a collection of React component primitives built on top of D3's mathematical utilities, designed specifically to avoid D3's imperative DOM manipulation patterns in favor of declarative React patterns.
This comparison matters because choosing between them fundamentally depends on your framework context and abstraction preference. D3 developers work directly with selections, enter/update/exit patterns, and have granular control over every pixel. visx developers compose reusable React components like
Choose visx if you're building data visualizations in a React application and want to work with React patterns rather than against them. The productivity gain from declarative components, TypeScript support, and elimination of lifecycle conflicts outweighs the slight reduction in low-level control for most standard chart types (line charts, bar charts, scatter plots, pie charts, heatmaps). You'll write less code, onboard teammates faster, and maintain consistency with the rest of your React codebase. visx is the pragmatic choice for 80% of React-based dashboard, analytics, and reporting interfaces.
Choose D3 if you need framework independence, are creating novel visualization types that don't fit standard chart primitives, or require D3's advanced features like force simulations, complex geographic projections, or intricate custom animations. Also choose D3 if you're working outside React entirely—it remains the only serious option for framework-agnostic visualization libraries. The learning investment pays off when you need that last 20% of control that component abstractions can't provide, or when your visualization needs to run in vanilla JS, Vue, Angular, or server-side environments.