react-vis is a collection of React components designed for rendering common data visualization charts, including line/area/bar charts, heat maps, scatterplots, and more complex visualizations like sunbursts and treemaps. Its current stable version is 1.12.1. While previously maintained by Uber, the library's README indicates it is now "under new management" and a deprecation shield points to a status as of 2020. This suggests an irregular or stalled release cadence. Key differentiators include its simplicity, requiring minimal data visualization library knowledge to get started, and its flexibility, offering modular components like separate X and Y axis components for fine-grained layout control. It integrates well with React's lifecycle and avoids unnecessary DOM nodes, though its long-term maintenance status is unclear.
npm install react-visVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to create a basic line chart with react-vis, including X and Y axes and horizontal grid lines within an XYPlot container. It also shows the necessary CSS import.
For new projects, evaluate actively maintained data visualization libraries like Nivo, Recharts, or TanStack Query. For existing projects, be aware that security updates, bug fixes, or new features are unlikely.
Ensure you import the main CSS file: `import 'react-vis/dist/style.css';` or selectively import specific styles: `import 'react-vis/dist/styles/legends.css';`
Upgrade to react-vis v1.11.7 or newer. If issues persist, verify Webpack configuration and dependency resolution.
The correct import path includes the `dist` directory: `import 'react-vis/dist/style.css';`
Ensure data objects are in the format `{x: value, y: value}` for XYPlot series components. For other chart types, check their specific data requirements in the documentation.Ensure you are using React Hooks only within functional components, or convert your component to a functional component if you intend to use hooks. `react-vis` itself can be used with both class and functional components.