From cbaf7587cccaedd3e8c75862ed33ba5ebb5e51b1 Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Mon, 24 Mar 2014 10:15:47 +0100 Subject: [PATCH] added stabilized event to trigger storePositions() --- docs/graph.html | 9 +++++++++ src/graph/Graph.js | 1 + 2 files changed, 10 insertions(+) diff --git a/docs/graph.html b/docs/graph.html index 748a43cd..7f394700 100644 --- a/docs/graph.html +++ b/docs/graph.html @@ -2002,6 +2002,15 @@ graph.off('select', onSelect); + + stabilized + Fired when the graph has been stabilized after initialization. This event can be used to trigger the .storePosition() function after stabilization. + + + + diff --git a/src/graph/Graph.js b/src/graph/Graph.js index d1428cb1..b9863e74 100644 --- a/src/graph/Graph.js +++ b/src/graph/Graph.js @@ -1724,6 +1724,7 @@ Graph.prototype._stabilize = function() { } this.zoomExtent(false,true); + this.emit("stabilized",{iterations:count}); };