Igor a610223309 Improve student view | 5 år sedan | |
---|---|---|
.. | ||
README.md | 5 år sedan | |
sigma.layout.noverlap.js | 5 år sedan |
Plugin developed by Andrew Pitts and published under the MIT license. Original algorithm by Mathieu Jacomy and ported to sigma.js with permission.
This plugin runs an algorithm which distributes nodes in the network, ensuring that they do not overlap and providing a margin where specified.
configure
Changes the layout's configuration.
var listener = s.configNoverlap(config);
start
Starts the layout. It is possible to pass a configuration if this is the first time you start the layout.
s.startNoverlap();
isRunning
Returns whether the layout is running.
s.isNoverlapRunning();
Algorithm configuration
5.0
: The additional minimum space to apply around each and every node.1.2
: A multiplier to apply to nodes such that larger nodes will have more space around them if this multiplier is greater than zero.20
: The number of rows and columns to use when dividing the nodes up into cells which the algorithm is applied to. Use more rows and columns for larger graphs for a more efficient algorithm.1.1
: At every step, this is the maximum ratio to apply to the bounding box, i.e. the maximum by which the network is permitted to expand.0
: The index of the renderer to use to compute overlap and collisions of the nodes.2
: A larger value increases the speed with which the algorithm will convergence at the cost of precision.500
: The maximum number of iterations to run the algorithm for before stopping it.Easing configuration
true
. The duration is specified by the Sigma settings animationsTime
. See sigma.utils.easing for available values.animationsTime
.The plugin dispatches the following events:
start
: on layout start.interpolate
: at the beginning of the layout animation if an easing function is specified and the layout is ran on background.stop
: on layout stop, will be dispatched after interpolate
.Example:
s = new sigma({
graph: g,
container: 'graph-container'
});
var config = {
nodeMargin: 3.0,
scaleNodes: 1.3
};
// Configure the algorithm
var listener = s.configNoverlap(config);
// Bind all events:
listener.bind('start stop interpolate', function(event) {
console.log(event.type);
});
// Start the algorithm:
s.startNoverlap();