WLJS LogoWLJS Notebook

TransitionType

acts as an option and a context modifier for Graphics that tells the transition function for graphics primitives (coordinate changes, and etc) once one of dependencies has been updated

global

Graphics[..., "TransitionType"->type_String]

local

Graphics[{Directive["TransitionType"->type_String], ...}]

Types

"Linear"

"CubicInOut"

None

No transition. Works best for fast animation

Example

Let us see how it works with a moving object

cell 1
object = {-1.,0.};
Graphics[{
	{Directive["TransitionType" -> "Linear"], Disk[(object + {0,0.5}) // Offload, 0.2]},
	{Directive["TransitionType" -> "CubicInOut"], Disk[(object - {0,0}) // Offload, 0.2]},
   {Directive["TransitionType" -> None], Disk[(object - {0,0.5}) // Offload, 0.2]}
}, PlotRange->{{-1,1}, {-1,1.5}}, "TransitionDuration"->500]

and then in the next cell

object = {1.,0};

On this page