This sample uses the Routing.AvoidsNodes as a form of rudimentary path finding with hidden Links and Nodes to move simulated people around a house. Each person will pick a random unique activity and then add a new Link to the diagram between them and the activity. Then the Node representing the person has their location changed to each point in Link.Points, this change uses an Animation with the easing function Animation.EaseLinear to appear like constant fluid motion.

Each activity also has a direction associated with it. So when a Link is created between two Nodes they will have their GraphObject.toSpot and GraphObject.fromSpot properties set so that the Link will go in the correct direction. This is important for the chairs so that people always get in and out of them without going through the back of the chair. This also helps with small spaces like the pantry.


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


Links

The Link class is used to implement a visual relationship between nodes. Links are normally created by the presence of link data objects in the GraphLinksModel.linkDataArray or by a parent key reference as the value of the TreeModel.nodeParentKeyProperty of a node data object in a TreeModel. More information can be found in the GoJS Intro.

Related samples