d3-force/README.md

27 lines
961 B
Markdown
Raw Normal View History

2016-04-06 04:50:36 +08:00
# d3-force
## Installing
2016-04-26 01:53:56 +08:00
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.1.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:
2016-04-06 04:50:36 +08:00
```html
<script src="https://d3js.org/d3-collection.v0.1.min.js"></script>
2016-04-06 04:50:36 +08:00
<script src="https://d3js.org/d3-dispatch.v0.4.min.js"></script>
2016-04-23 00:45:03 +08:00
<script src="https://d3js.org/d3-quadtree.v0.7.min.js"></script>
2016-04-06 04:50:36 +08:00
<script src="https://d3js.org/d3-timer.v0.4.min.js"></script>
2016-04-26 01:53:56 +08:00
<script src="https://d3js.org/d3-force.v0.1.min.js"></script>
2016-04-06 04:50:36 +08:00
<script>
var simulation = d3_force.forceSimulation(nodes);
</script>
```
[Try d3-force in your browser.](https://tonicdev.com/npm/d3-force)
## API Reference