Click on this button to select a node at random, scroll to it, and animate a copy of it -- all to draw attention to it.

This calls CommandHandler.scrollToPart, which conducts an animation to scroll the viewport to where the node is. Note that if the node is close to the edge of the document, the viewport cannot be scrolled so that the node is nearer to the center of the viewport unless you increase the Diagram.scrollMargin.

This also creates an Animation that operates on a temporary copy of the selected node, making it appear much larger but animating the scale so that it appears to shrink to be the selected node where it is in the diagram.


GoJS Features in this sample

Animation

GoJS offers several built-in animations, enabled by default, as well as the ability to create arbitrary animations.

The Diagram.animationManager handles animations within a Diagram. The AnimationManager automatically sets up and dispatches default animations, and has properties to customize and disable them. Custom animations are possible by creating instances of Animation or AnimationTrigger. More information can be found in the GoJS Intro.

Related samples