Igor a610223309 Improve student view | 5 年 前 | |
---|---|---|
.. | ||
README.md | 5 年 前 | |
sigma.plugins.animate.js | 5 年 前 |
Plugin developed by Alexis Jacomy.
This plugin provides a method to animate a sigma instance by interpolating some node properties. Check the sigma.plugins.animate
function doc or the examples/animate.html
code sample to know more.
Interpolate coordinates as follows:
sigma.plugins.animate(
s,
{
x: 'target_x',
y: 'target_y',
}
);
Interpolate colors and sizes as follows:
sigma.plugins.animate(
s,
{
size: 'target_size',
color: 'target_color'
}
);
Animate a subset of nodes as follows:
sigma.plugins.animate(
s,
{
x: 'to_x',
y: 'to_y',
size: 'to_size',
color: 'to_color'
},
{
nodes: ['n0', 'n1', 'n2']
}
);
Example using all options:
sigma.plugins.animate(
s,
{
x: 'to_x',
y: 'to_y',
size: 'to_size',
color: 'to_color'
},
{
nodes: ['n0', 'n1', 'n2'],
easing: 'cubicInOut',
duration: 300,
onComplete: function() {
// do stuff here after animation is complete
}
}
);