NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #2281 most downloaded on npm
Force-directed graph layout using velocity Verlet integration.
Last release 5 years ago
no release in 18 months
Release timing varies
gaps range from 1 weeks to 1.4 years
Most releases are documented
notes for 28 of 35 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
37 releases · first in 2016
This package now requires Node.js 12 or higher. For more, please read Sindre Sorhus’s FAQ .
This package now requires Node.js 12 or higher. For more, please read Sindre Sorhus’s FAQ.
Upgrade D3 dependencies
One column per quarter.
v2.1.1
Compare
Add forceCenter .strength . #81
Nothing published for this version
Nothing published for this version
Fix bug when initializing nodes with fixed positions.
Adopt ES Map in favor of d3-collection dependency.
This release adopts ES2015 language features such as for-of and drops support for older browsers, including IE. If you need to support pre-ES2015 environments, you should stick with d3-force 1.x or use a transpiler.
Fix bug when initializing nodes with fixed positions.
Add iterations argument to simulation .tick . Thanks, @vasturiano !
Housekeeping.
v1.1.1 Compare # Choose a tag to compare
v1.1.1
Compare
Fix treatment of negative strengths in d3.forceManyBody. (#98) Thanks, @vasturiano!
Nothing published for this version
Nothing published for this version
Allow forces to be isolated to a subset of nodes (#72).
Fix bug where calling _collide_.radius had no effect.
Add module entry point to package.json.
module entry point to package.json.Nothing published for this version
Remove _simulation_.fix and _simulation_.unfix[All]; use _node_.fx and _node_.fy instead (#35).
The force layout d3.layout.force has been renamed to d3.forceSimulation. The force simulation now uses velocity Verlet integration rather than position Verlet, tracking the nodes’ positions (node.x, node.y) and velocities (node.vx, node.vy) rather than their previous positions (node.px, node.py).
Rather than hard-coding a set of built-in forces, the force simulation is now extensible: you specify which forces you want! The approach affords greater flexibility through composition. The new forces are more flexible, too: force parameters can typically be configured per-node or per-link. There are separate positioning forces for x and y that replace force.gravity; x.x and y.y replace force.size. The new link force replaces force.linkStrength and employs better default heuristics to improve stability. The new many-body force replaces force.charge and supports a new minimum-distance parameter and performance improvements thanks to 4.0’s new quadtrees. There are also brand-new forces for centering nodes and collision resolution.
The new forces and simulation have been carefully crafted to avoid nondeterminism. Rather than initializing nodes randomly, if the nodes do not have preset positions, they are placed in a phyllotaxis pattern:
<img alt="Phyllotaxis" src="https://raw.githubusercontent.com/d3/d3-force/master/img/phyllotaxis.png" width="420" height="219">
Random jitter is still needed to resolve link, collision and many-body forces if there are coincident nodes, but at least in the common case, the force simulation (and the resulting force-directed graph layout) is now consistent across browsers and reloads. D3 no longer plays dice!
The force simulation has several new methods for greater control over heating, such as simulation.alphaMin and simulation.alphaDecay, and the internal timer. Calling simulation.alpha now has no effect on the internal timer, which is controlled independently via simulation.stop and simulation.restart. The force layout’s internal timer now starts automatically on creation, removing force.start. As in 3.x, you can advance the simulation manually using simulation.tick. The force.friction parameter is replaced by simulation.velocityDecay. A new simulation.alphaTarget method allows you to set the desired alpha (temperature) of the simulation, such that the simulation can be smoothly reheated during interaction, and then smoothly cooled again. This improves the stability of the graph during interaction.
The force layout no longer depends on the drag behavior, though you can certainly create draggable force-directed graphs! Set node.fx and node.fy to fix a node’s position. As an alternative to a Voronoi SVG overlay, you can now use simulation.find to find the closest node to a pointer.
See CHANGES for all D3 changes since 3.x.
Nothing published for this version
Export to the global d3 in vanilla environments (d3/d3#2840).
d3 in vanilla environments (d3/d3#2840).- Update d3-collection to 0.2.
Treat strength as zero if _x_.x or _y_.y is NaN.
Reduce the default _link_.strength on heavily-connected nodes (#30).
Add _simulation_.fix and _simulation_.unfix (#27).
Replace d3.forcePosition with d3.forceX and d3.forceY.
Fix bug in d3.forceLink initialization.
Change the default _simulation_.alphaMin to 0.001.
Rename _simulation_.start to _simulation_.restart.
Change _simulation_.tick to always advance the simulation by one step, to not dispatch a _tick_ event, and to return alpha < alphaMin. (The _tick_ eve
Deterministic initialization using phyllotaxis!
Changed _force_.initialize to take an array of _nodes_, not the _simulation_.
Rename _simulation_.friction to _simulation_.drag.
Increase the stability of d3.forceCollide.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →