This repository has been archived by the owner on Jul 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Network animation on load #2306
Milestone
Comments
Ah! Solved it myself already. Rather than network.on I should use network.once! So, this is what I got to make the animation start automatically and play once: network.once("beforeDrawing", function() {
network.focus(0, {scale:10});
}); network.once("afterDrawing", function(){
network.fit({animation: {duration:2500, easingFunction: 'easeOutQuint'}});
}); |
@TJRL That sounds interesting!! Maybe you can create a simple example that demonstrates this? We would be more than happy to include it in the examples. |
Added with #2476 |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, I'd like to add a fly in animation on the network, starting very much zoomed in on one node, than zooming out to fit. However, it should run only once, when the page is loaded. I tried to set the initial zoom level with the beforeDrawing event, but that event triggers apparently over and over again, which makes it return to this position each time you try to move or zoom out.
I also tried with javacript window.onload, but I think that triggers too early, so nothing happens.
Any suggestions how to do this?
The text was updated successfully, but these errors were encountered: