Remarks
- An animated object is first created using the constructor of a subclass.
- Immediately before the animation a client calls initialize.
- To change the state of the animated object a client does a series of calls to animate, usually with an increasing relative time parameter.
- If the animation is done, the client calls cleanUp once.
- While animate uses a relative time scheme, there might be an absolute time value for the preferred duration of the whole sequence of animation steps. Since an IAnimation instance has no control on the number of animate calls or the intervals between them, the preferred duration is only a hint on how long the animation should take. Clients can ask for that hint using preferredDuration and try to find a suitable sequence of animate calls in order to fulfill the preference.
See Also
Developer's Guide
Members
Properties
Gets the preferred duration of the animation.
Implemented in
ViewportAnimation.preferredDurationMethods
Parameters
- time: number
- The animation time in [0,1].
Implemented in
ViewportAnimation.animateImplemented in
ViewportAnimation.cleanUpCreates a delayed animation instance from this instance.
delay longer than the existing one.Parameters
- delay: TimeSpan
- The delay to wait before the provided animation starts.
Return Value
- IAnimation
- A new animation that will first wait before the animation starts.
Creates an eased animation for the given base animation.
The animation speed linearly increases up to a easeIn and linearly decreases from easeOut. Between those two points, the animation speed is constant.
The duration of the ease in and ease out is determined by a mapping [0,1] → [0,1]. The mapping has to be increasing to preserve the order of the frames in the decorated animation. In general, we consider continuously differentiable functions f where integral of f′ equals 1 a suitable choice for the mapping.
Parameters
- easeIn?: number
- The ratio for the ease-in time [0,1] where 0 is the start of the animation and 1 the end.
0.5is the default value. - easeOut?: number
- The ratio for the ease-out time [0,1] where 0 is the start of the animation and 1 the end.
0.5is the default value.
Return Value
- IAnimation
- The newly created IAnimation.
See Also
Developer's Guide
Implemented in
ViewportAnimation.initializeStatic Methods
Creates a delay animation that does nothing.
Parameters
- duration: TimeSpan
- The value for the preferredDuration of the created animation
Return Value
- IAnimation
- An animation that does nothing for the amount of time specified in
duration.
Creates a new IAnimation that animates the given edge's bends from its current shape linearly to the shape given by the endBends and final port locations.
edge's bends from its current shape linearly to the shape given by the endBends and final port locations.The bends of the edge layout are animated from their current location to their target locations. It is assumed that the edge style is a polyline style and the control points are the bends accordingly. The animation works for other styles too, but the effect might not be as expected. The number of bends in endBends can be different to the current number of bends. This will result in the animation automatically removing bends at the end of the animation or inserting new bends accordingly at the beginning of the animation.
The source and target points are also animated to new locations. However, the ports will not be moved by this animation. Instead a separate animation for the ports is needed to actually move IPorts at the ends of the edge if desired.
Parameters
- graph: IGraph
- The graph the animated edge belongs to.
- edge: IEdge
- The edge layout to animate.
- endBends: IPoint[]
- The bend positions after the animation.
- endSourceLocation: Point
- The absolute position of the source port after the animation.
- endTargetLocation: Point
- The absolute position of the target port after the animation.
- preferredDuration: TimeSpan
- The preferred duration of the animation.
Return Value
- IAnimation
- The newly created IAnimation.
See Also
Developer's Guide
Creates a new IAnimation that animates the given layout of all types of graph items.
Parameters
- graph: IGraph
- The graph for which the layout should be animated.
- targetNodeLayouts?: IMapper<INode, IRectangle>
- The node layouts after the animation.
- targetBendLocations?: IMapper<IEdge, IPoint[]>
- The bend locations after the animation, for each edge the points are interpreted as the position of the bends along the edge in the given order.
- targetPortLocations?: IMapper<IPort, IPortLocationModelParameter>
- The IPortLocationModelParameters for each IPort in the graph that will be animated.
- targetLayoutParameters?: IMapper<ILabel, ILabelModelParameter>
- The label model parameters for each label after the animation.
- preferredDuration?: TimeSpan
- The preferred duration of the animation.
Return Value
- IAnimation
- The newly created IAnimation.
See Also
Developer's Guide
Creates a new IAnimation that animates the given label from its current layout linearly to the layout given by the targetLayoutParameter.
label from its current layout linearly to the layout given by the targetLayoutParameter.targetLayoutParameter to the label at the end of the animation.Parameters
- graph: IGraph
- The graph that contains the labels.
- label: ILabel
- The label to animate the parameter of.
- targetLayoutParameter: ILabelModelParameter
- The target parameter of the label.
- preferredDuration: TimeSpan
- The preferred duration of the animation.
Return Value
- IAnimation
- A new instance of IAnimation.
See Also
Developer's Guide
Creates a new IAnimation instance that animates the current graph to the layout given by the layoutGraph instance of the given adapter.
adapter.LayoutExecutor type is available at runtime.Parameters
- graph: IGraph
- the graph for which the layout should be animated
- adapter: LayoutGraphAdapter
- the LayoutGraphAdapter that contains all target layout information
- preferredDuration: TimeSpan
- the preferred duration of the animation
Return Value
- IAnimation
- A new IAnimation instance that animates the current graph to the layout of the given layoutGraph.
Examples
const adapter = new LayoutGraphAdapter(graph)
const layoutGraph = adapter.layoutGraph
const layout = new OrthogonalLayout()
layout.applyLayout(layoutGraph)
const layoutAnimation = IAnimation.createLayoutAnimation(
graph,
adapter,
TimeSpan.fromSeconds(1),
)See Also
Developer's Guide
Creates a new IAnimation that animates the given node from its current layout to the new given targetLayout.
node from its current layout to the new given targetLayout.Parameters
- graph: IGraph
- The graph the animated node belongs to.
- node: INode
- The node whose layout to animate.
- targetLayout: IRectangle
- The expected node layout after the animation.
- preferredDuration: TimeSpan
- The preferred duration of the animation.
Return Value
- IAnimation
- A new instance of IAnimation.
See Also
Developer's Guide
Creates an IAnimation according to the composite design pattern that animates multiple animations in parallel.
Parameters
- animations: any
- The animations to run in parallel.
- synchronized?: boolean
- Whether all child animations should be adjusted to have the same (maximum) preferredDuration. By default this is enabled.
Return Value
- IAnimation
- A new instance that is the composite of the given animations.
See Also
Developer's Guide
Creates a new instance of an IAnimation that animates the given IMutablePoint along a path.
Parameters
- path: GeneralPath
- The path to animate the point along.
- animationPoint: IMutablePoint
- The mutable point instance that will be manipulated by the animation.
- preferredDuration: TimeSpan
- The preferred duration of the animation.
Return Value
- IAnimation
- The newly created IAnimation.
See Also
Developer's Guide
Creates a new IAnimation that animates the given port from its current location to the new location given by the targetLocationParameter.
port from its current location to the new location given by the targetLocationParameter.targetLocationParameter to the port at the end of the animation.Parameters
- graph: IGraph
- The graph that contains the port.
- port: IPort
- The port to animate.
- targetLocationParameter: IPortLocationModelParameter
- The parameter to linearly interpolate to.
- preferredDuration: TimeSpan
- The preferredDuration of this animation.
Return Value
- IAnimation
- A new instance of IAnimation.
See Also
Developer's Guide
Creates an IAnimation that animates multiple animations in sequence.
animations runs in sequence one after another. The duration of the sequential animation is the sum of its child animation durations.Parameters
- animations: any
- The animations to run in sequence.
Return Value
- IAnimation
- A new sequential animation from the given animations.
See Also
Developer's Guide
Creates a new IAnimation for the given table that animates the table and its stripes.
Parameters
- table: ITable
- The table to animate.
- columnLayout: number[]
- The sizes of the leaf columns, in natural order.
- rowLayout: number[]
- The sizes of the leaf rows, in natural order.
Return Value
- IAnimation
- The newly created IAnimation.
Creates an animation for the given delegate and preferredDuration.
Parameters
- callback: function(number): void
- The callback to use for the animation steps.
- duration: TimeSpan
- The duration that the animation should last.
Return Value
- IAnimation
- A new animation that will use the
callbackto perform the actions.