d3-force project
Go to file
Mike Bostock e532b18700 Fix #18 - allow manual ticking.
Calling simulation.stop no longer resets the alpha, so a subsequent call to
simulation.start now resumes the simulation, and you can call simulation.tick to
run the simulation manually.

This commit also removes the start event. There’s not much of a point to the
start event since it’s impossible to listen for it in the normal case: the event
is dispatched during the construction of the simulation before any listeners can
be registered. Even in other cases, the simulation is always restarted manually,
so you could always notify a listener manually at the same time. Furthermore,
supporting a start event would require us to track whether the timer is running,
so it’s simpler to just leave it out. (And lastly, eliminating the start event
avoids some confusion about the relationship between simulation.stop and the end
event, which are unrelated!)

Lastly, simplify the recalculation of the current iteration when changing the
alpha decay rate constant.
2016-04-26 09:18:51 -07:00
src Fix #18 - allow manual ticking. 2016-04-26 09:18:51 -07:00
.eslintrc Initial commit. 2016-04-05 13:50:36 -07:00
.gitignore Initial commit. 2016-04-05 13:50:36 -07:00
.npmignore Initial commit. 2016-04-05 13:50:36 -07:00
d3-force.sublime-project Initial commit. 2016-04-05 13:50:36 -07:00
index.js Add d3.forceContain. 2016-04-23 10:24:15 -07:00
LICENSE Initial commit. 2016-04-05 13:50:36 -07:00
package.json 0.1.0 2016-04-25 10:54:00 -07:00
README.md Prepare for minor release. 2016-04-25 10:53:56 -07:00

d3-force

Installing

If you use NPM, npm install d3-force. Otherwise, download the latest release. You can also load directly from d3js.org, either as a standalone library or as part of D3 4.0 alpha. AMD, CommonJS, and vanilla environments are supported. In vanilla, a d3_force global is exported:

<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.7.min.js"></script>
<script src="https://d3js.org/d3-timer.v0.4.min.js"></script>
<script src="https://d3js.org/d3-force.v0.1.min.js"></script>
<script>

var simulation = d3_force.forceSimulation(nodes);

</script>

Try d3-force in your browser.

API Reference