- Renamed storePosition to storePositions. Added deprication message and old name still works.
- Worked around hammer.js bug with multiple release listeners.
- Improved cleaning up after manipulation toolbar.
- Added getPositions() method to get the position of all nodes.
- Added getCenterCoordinates() method to get the x and y position in canvas space of the center of the view.
With the advent of the storePosition() function, the positions of the nodes can be saved after they are stabilized. The smoothCurves require support nodes and those positions are not stored. In order
to speed up the initialization of the network by using storePosition() and loading the nodes with the stored positions, the freezeForStabilization option freezes all nodes that have been supplied with
With the advent of the storePositions() function, the positions of the nodes can be saved after they are stabilized. The smoothCurves require support nodes and those positions are not stored. In order
to speed up the initialization of the network by using storePositions() and loading the nodes with the stored positions, the freezeForStabilization option freezes all nodes that have been supplied with
an x and y position in place during the stabilization. That way only the support nodes for the smooth curves have to stabilize, greatly speeding up the stabilization process with cached positions.
an x and y position in place during the stabilization. That way only the support nodes for the smooth curves have to stabilize, greatly speeding up the stabilization process with cached positions.
</td>
</td>
</tr>
</tr>
@ -2139,6 +2139,12 @@ var options: {
Zooming in is > 1.0, zooming out is <0.Scalecannotbesmallerorequalto0.
Zooming in is > 1.0, zooming out is <0.Scalecannotbesmallerorequalto0.
</td>
</td>
</tr>
</tr>
<tr>
<td>getCenterCoordinates()</td>
<td>Number</td>
<td>Returns the x and y coodinates of the center of the screen (in canvas space).
</td>
</tr>
<tr>
<tr>
<td>getSelection()</td>
<td>getSelection()</td>
<td>Array of ids</td>
<td>Array of ids</td>
@ -2171,13 +2177,6 @@ var options: {
<td>When locked on to a node, this function releases it again. If the view is not locked onto a node due to the focusOnNode locked option, nothing happens.
<td>When locked on to a node, this function releases it again. If the view is not locked onto a node due to the focusOnNode locked option, nothing happens.
</td>
</td>
</tr>
</tr>
<tr>
<td>storePosition()</td>
<td>none</td>
<td>This will put the X and Y positions of all nodes in the dataset. It will also include allowedToMoveX and allowedToMoveY with the correct values.
You can use this to stablize your network once, then save the positions in a database so the next time you load the nodes, stabilization will be near instantaneous.
</td>
</tr>
<tr>
<tr>
<td>DOMtoCanvas(pos)</td>
<td>DOMtoCanvas(pos)</td>
<td>object</td>
<td>object</td>
@ -2285,7 +2284,19 @@ var options: {
containing a new size for the visualization. Size can be provided in pixels
containing a new size for the visualization. Size can be provided in pixels
or in percentages.</td>
or in percentages.</td>
</tr>
</tr>
<tr>
<td>getPositions()</td>
<td>none</td>
<td>This will return an object of all nodes' positions. Data can be accessed with object[nodeId].x and .y.
</td>
</tr>
<tr>
<td>storePositions()</td>
<td>none</td>
<td>This will put the X and Y positions of all nodes in the dataset. It will also include allowedToMoveX and allowedToMoveY with the correct values.
You can use this to stablize your network once, then save the positions in a database so the next time you load the nodes, stabilization will be near instantaneous.
<td>Fired every time the network has been stabilized. This event can be used to trigger the .storePosition() function after stabilization. Fired with an object having the following properties:</td>
<td>Fired every time the network has been stabilized. This event can be used to trigger the .storePositions() function after stabilization. Fired with an object having the following properties:</td>
<td>
<td>
<ul>
<ul>
<li><code>iterations</code>: number of iterations used to stabilize</li>
<li><code>iterations</code>: number of iterations used to stabilize</li>