react-force-graph
TypeScript icon, indicating that this package has built-in type declarations

1.47.7 • Public • Published

react-force-graph

2D: NPM package Build Size NPM Downloads

3D: NPM package Build Size NPM Downloads

VR: NPM package Build Size NPM Downloads

AR: NPM package Build Size NPM Downloads

React bindings for the force-graph suite of components: force-graph (2D HTML Canvas), 3d-force-graph (ThreeJS/WebGL), 3d-force-graph-vr (A-Frame) and 3d-force-graph-ar (AR.js).

This module exports 4 stand-alone React component packages with identical interfaces: react-force-graph-2d, react-force-graph-3d, react-force-graph-vr and react-force-graph-ar. Each can be used to represent a graph data structure in a 2 or 3-dimensional space using a force-directed iterative layout.

Uses canvas/WebGL for rendering and d3-force-3d for the underlying physics engine. Supports zooming/panning, node dragging and node/link hover/click interactions.

See also the react-three-fiber component.

Examples

❤️ Support This Project

If you find this module useful and would like to support its development, you can buy me a ☕. Your contributions help keep open-source sustainable! paypal

Quick start

import ForceGraph2D from 'react-force-graph-2d';
import ForceGraph3D from 'react-force-graph-3d';
import ForceGraphVR from 'react-force-graph-vr';
import ForceGraphAR from 'react-force-graph-ar';

or using a script tag