3d-force-graph: a WebGL graph element with two physics engines behind it
3D force-directed graph component using ThreeJS/WebGL
At a glance
- What is it?
- 3d-force-graph is a web component that lays out graph data in three dimensions with ThreeJS and WebGL, using either d3-force-3d or ngraph for the layout. It ships as an element rather than a React component, and it names its own alternatives: a 2D canvas version, a VR version, an AR version and React bindings.
- Who is it for?
- Adopt 3d-force-graph when the graph is the interface and you want it rendered in 3D with no layout engine of your own: the component ships one element, a build step and about thirty example pages that each isolate a single capability. Do not adopt it as a general graph viewer for readers who need to find a specific node, because a force layout puts no two nodes in a predictable place.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 10 days ago.
- What is it written in?
- Mainly HTML, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- vasturiano/3d-force-graph6,565 ★ · +152
| Repository | 2026-09-23 | 2026-11-15 |
|---|---|---|
| vasturiano/3d-force-graph | 6.4k | 6.6k |
152 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
One element, two physics engines, one author
3d-force-graph describes itself in a single line: a web component that represents a graph data structure in a three dimensional space using a force-directed iterative layout. Rendering is ThreeJS on WebGL. The layout is not part of the component at all, and that is the design decision worth noticing before anything else: the project plugs in either d3-force-3d or ngraph, so the physics is a replaceable part rather than a hardwired algorithm.
The naming is easy to misread. The npm package is 3d-force-graph, while the dependencies that do the work are three-forcegraph and three-render-objects, with kapsule and accessor-fn in support. Nobody types 3d-force-graph expecting d3-force to appear in the dependency list.
The same author maintains a family around it: a 2D canvas version, a VR version, an AR version, and React bindings under a different package name. Four sibling projects with one author means a bug fixed here may need fixing in each of them.
package.json fixes the three range to >=0.179 <1
The dependency list is where the cost of adoption first becomes visible. three is declared as ">=0.179 <1", which is a range rather than a pinned copy. d3-force-3d is not a declared dependency at all, even though the README names it as one of the two layout engines, so it arrives through three-forcegraph or through the examples' own loading.
Version and packaging facts are unusually explicit here. The package version is 1.80.1. main, module and the default export all resolve to dist/3d-force-graph.mjs, jsdelivr and unpkg point at dist/3d-force-graph.min.js, and types resolves to dist/3d-force-graph.d.ts. The type field is module, so the package is ESM, and the exports map carries three conditions: types, umd and default.
Two smaller signals are worth reading before you install. files allows only dist/**/* and example/**/*, so the src directory never ships to consumers. And sideEffects names ./src/*.css, a pattern that references a source path the published files exclude, which reads like a leftover from a build layout rather than a live dependency edge.
The build is rimraf plus rollup, and prepare runs it for you
Three scripts cover the whole build surface. Building deletes the output directory and then runs rollup with the default config:
"build": "rimraf dist && rollup -c"Watching runs the dev config instead, and a prepare script runs the build for consumers:
"dev": "rollup -w -c rollup.config.dev.js",
"prepare": "npm run build"Two rollup configs sit at the top level, rollup.config.js and rollup.config.dev.js, and a .babelrc sits beside them, so Babel is applied during bundling. The dev dependency list is what makes that pipeline concrete: rollup plus @rollup/plugin-node-resolve, @rollup/plugin-commonjs, @rollup/plugin-babel and @rollup/plugin-terser for minification, rollup-plugin-dts for the declaration bundle, postcss for styles, and rimraf for the clean step.
A bare script tag is the documented install path
For script-tag use, the jsdelivr and unpkg fields point at dist/3d-force-graph.min.js, so a browser can load the compiled bundle directly. For bundler users, the same package resolves through main and module to dist/3d-force-graph.mjs, and type: module means the import is an ESM import.
The examples are single HTML files, one per directory under example/. Each has an index.html that can be opened on its own, which is why example/basic/ is the shortest path to a working graph: copy its import line and its element, change the data, and you have a render. The repository has no test directory and no test script, so nothing in it tells you what a correct layout looks like.
Source lives under src/ and the built output under dist/. Top-level entries are a working set for a single package: .babelrc, rollup.config.js, rollup.config.dev.js, _config.yml, LICENSE, README.md, package.json, yarn.lock, plus .github/ and example/ directories. The lockfile is yarn's even though the prepare script calls npm, which is a small inconsistency to be aware of when you fork it.
Examples isolate one physics or rendering variable each
The example directory is the real documentation, and its structure is deliberate. Each folder answers a single question, and each is published as a page alongside its source. Read the names in order and you get the capability list without opening any of them: async-load, auto-colored, bloom-effect, camera-auto-orbit, click-to-focus, collision-detection, controls-fly, controls-orbit, curved-links, custom-node-geometry, dag-yarn, directional-links-arrows, directional-links-particles, dynamic, emit-particles, expandable-nodes, fit-to-canvas, fix-dragged-nodes, gradient-links, highlight, html-nodes, img-nodes, large-graph, multi-selection, text-nodes and text-links.
Three of those carry the most information about the physics layer. Manipulate link force distance changes one parameter of the force model and lets you see its effect. Node collision detection adds a repulsion term that keeps overlapping nodes apart. dag-yarn renders a real dependency graph, the yarn.lock of a JavaScript project, in directed acyclic graph mode, which is the honest test of a layout engine on structured data rather than random positions.
Two others mark the limits of the component's scope. Controls-fly and controls-orbit are separate examples, one for fly controls and one for orbit controls. And the large-graph example is titled with roughly four thousand elements, a scale claim stated in an example title rather than in a benchmark, with no frame rate, memory figure or test behind it.
VR, AR and React are separate packages, not modes
The README points at a VR version, an AR version and a set of React bindings, each in its own repository. That is the clearest architectural statement in the project. WebXR, immersive rendering and a React reconciler are three separate maintenance surfaces, so each was factored out rather than bolted on as a prop.
The cost is that none of them are options inside 3d-force-graph. If your application is React, this package is not the one you install: the React bindings package is what the README points you to. Same for a headset application. Same for AR.
What you lose by staying in the base package is any trace of the other modes. The README points to separate repositories for the VR, AR and React versions. The two-dimensional sibling is the same story in a different axis: force-graph is a canvas component for 2D, kept in its own repository.
A LICENSE file and a push six days ago
Maintenance facts here are short and positive. The repository is not archived, the last push was on 2026-09-29, and LICENSE sits at the top level alongside an MIT field in package.json. That is a real file on disk rather than a licence asserted in prose, which puts this project ahead of packages whose grant exists only in a README sentence.
There are no GitHub releases to read, so version history is not in the repository. The version in package.json is 1.80.1, and the README badges point outward for the rest: build size, download count and the npm package page. What the repository does not carry is a changelog. With yarn.lock present, build scripts committed, and a push on 2026-09-29, this is an actively developed single maintainer project rather than a stalled one.
Expect a single bus factor and an author who maintains several siblings at once. That is the shape of the risk: no company behind it, no release notes to diff, and a dependency range on three that lets a breaking upstream release reach you without a version bump here.
Editorial conclusion
Adopt 3d-force-graph when the graph is the interface and you want it rendered in 3D with no layout engine of your own: the component ships one element, a build step and about thirty example pages that each isolate a single capability. Do not adopt it as a general graph viewer for readers who need to find a specific node, because a force layout puts no two nodes in a predictable place. Before you commit, open example/basic/index.html and copy that import and element, then check the bundled three range, since the dependency is declared as ">=0.179 <1" and an older copy in your tree will not satisfy it.
Frequently asked questions
What is 3d-force-graph and what does it need?
It is a web component that draws graph data in three dimensions with ThreeJS and WebGL, using a force-directed iterative layout from either d3-force-3d or ngraph. It installs from npm as 3d-force-graph at version 1.80.1, or from a CDN pointing at dist/3d-force-graph.min.js.
Does 3d-force-graph work in React?
Not directly: React bindings live in a separate package that the project links alongside the base component. The base package is a plain web component, and the README sends React users to the react-force-graph repository.
Which layout engine does 3d-force-graph use?
Two, and the choice is the project's: d3-force-3d or ngraph. Both are named in the README as the underlying physics engines, and neither appears in the package.json dependency list.
What license is 3d-force-graph under?
MIT. The package.json license field says MIT, and a LICENSE file sits at the repository top level rather than only being asserted in the README.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/vasturiano-3d-force-graph)Star history chart for your README
[](https://hysenlabs.com/projects/vasturiano-3d-force-graph)Was this useful?