d3-force/README.md
Mike Bostock bbaa4d61e5 Improvements.
Fix #7 - forces are now mutable, so it’s easier to change their settings and
they behave more like other configurable objects in D3 (though less like curves,
easing functions and interpolators).

Fix #9 - forces now have a dedicated interface rather than just being beforetick
listeners. This allows forces to be re-initialized when the nodes change.

Fix #10 - d3.forcePosition now initializes node positions and velocities.
2016-04-07 11:32:34 -07:00

27 lines
961 B
Markdown

# d3-force
## Installing
If you use NPM, `npm install d3-force`. Otherwise, download the [latest release](https://github.com/d3/d3-force/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-force.v0.0.min.js) or as part of [D3 4.0 alpha](https://github.com/mbostock/d3/tree/4). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3_force` global is exported:
```html
<script src="https://d3js.org/d3-collection.v0.1.min.js"></script>
<script src="https://d3js.org/d3-dispatch.v0.4.min.js"></script>
<script src="https://d3js.org/d3-quadtree.v0.2.min.js"></script>
<script src="https://d3js.org/d3-timer.v0.4.min.js"></script>
<script src="https://d3js.org/d3-force.v0.0.min.js"></script>
<script>
var simulation = d3_force.forceSimulation(nodes);
</script>
```
[Try d3-force in your browser.](https://tonicdev.com/npm/d3-force)
## API Reference