Add comments 2

This commit is contained in:
Pitchaya Boonsarngsuk
2018-01-31 15:52:15 +00:00
parent 6a297dd17e
commit 8422175f0a

View File

@@ -33,16 +33,17 @@ function startLinkSimulation() {
}
/* Add force
* Please add the distance function before feeding the force
* it to the simulation or adding links.
* Please add the distance function, links, and set simulation nodes
* before feeding the force to the simulation.
*
* On setting the distance fn and being initialized by the simulation, the
* On setting the distance fn or being initialized by the simulation, the
* force will pre-calculate high-dimensional distances of every link and
* store that as cache.
* Adding distance fn before links means that the first pre-calculation will
* calculate noting as there was no link.
* Adding distance fn and links before being initialize by the simulation
* means that the first pre-calculation will calculate noting as there was
* no nodes list.
* The full pre-calculation will then occur once when the force is being
* initialized by the simulation.
* initialized by the simulation where nodes list is given.
*/
simulation