From ffca60dcabf2e3ad7e67b4e3c9e067e0600511d5 Mon Sep 17 00:00:00 2001 From: Fabian Kessler Date: Sat, 20 Apr 2013 23:48:58 +0300 Subject: [PATCH] Documented that start() is silently ignored if running. --- springy.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/springy.js b/springy.js index e9fdfff..fdda419 100644 --- a/springy.js +++ b/springy.js @@ -483,7 +483,10 @@ }), root); - // start simulation + /** + * Start simulation if it's not running already. + * In case it's running then the call is ignored, and none of the callbacks passed is ever executed. + */ Layout.ForceDirected.prototype.start = function(render, done) { var t = this; @@ -640,6 +643,12 @@ }; /** + * Starts the simulation of the layout in use. + * + * Note that in case the algorithm is still or already running then the layout that's in use + * might silently ignore the call, and your optional done callback is never executed. + * At least the built-in ForceDirected layout behaves in this way. + * * @param done An optional callback function that gets executed when the springy algorithm stops, * either because it ended or because stop() was called. */