animate
Call Signature
Section titled “Call Signature”animate(
options):ArrayAnimation
Defined in: src/util/animation/animate.ts:50
Changes value(s) from startValue to endValue within a certain period of time, invoking callbacks as the value(s) change.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”ArrayAnimation
Examples
Section titled “Examples”animate({ startValue: 1, endValue: 0, onChange: (v) => { obj.set('opacity', v); // since we are running in a requested frame we should call `renderAll` and not `requestRenderAll` canvas.renderAll(); }});Using lists:animate({ startValue: [1, 2, 3], endValue: [2, 4, 6], onChange: ([x, y, zoom]) => { canvas.zoomToPoint(new Point(x, y), zoom); canvas.renderAll(); }});Call Signature
Section titled “Call Signature”animate(
options):ValueAnimation
Defined in: src/util/animation/animate.ts:51
Changes value(s) from startValue to endValue within a certain period of time, invoking callbacks as the value(s) change.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”ValueAnimation
Examples
Section titled “Examples”animate({ startValue: 1, endValue: 0, onChange: (v) => { obj.set('opacity', v); // since we are running in a requested frame we should call `renderAll` and not `requestRenderAll` canvas.renderAll(); }});Using lists:animate({ startValue: [1, 2, 3], endValue: [2, 4, 6], onChange: ([x, y, zoom]) => { canvas.zoomToPoint(new Point(x, y), zoom); canvas.renderAll(); }});Call Signature
Section titled “Call Signature”animate<
T>(options):TextendsPartial<TAnimationBaseOptions<number[]> &TAnimationCallbacks<number[]> &object> ?ArrayAnimation:ValueAnimation
Defined in: src/util/animation/animate.ts:52
Changes value(s) from startValue to endValue within a certain period of time, invoking callbacks as the value(s) change.
Type Parameters
Section titled “Type Parameters”T extends Partial<TAnimationBaseOptions<number> & TAnimationCallbacks<number> & object> | Partial<TAnimationBaseOptions<number[]> & TAnimationCallbacks<number[]> & object>
Parameters
Section titled “Parameters”options
Section titled “options”T
Returns
Section titled “Returns”T extends Partial<TAnimationBaseOptions<number[]> & TAnimationCallbacks<number[]> & object> ? ArrayAnimation : ValueAnimation
Examples
Section titled “Examples”animate({ startValue: 1, endValue: 0, onChange: (v) => { obj.set('opacity', v); // since we are running in a requested frame we should call `renderAll` and not `requestRenderAll` canvas.renderAll(); }});Using lists:animate({ startValue: [1, 2, 3], endValue: [2, 4, 6], onChange: ([x, y, zoom]) => { canvas.zoomToPoint(new Point(x, y), zoom); canvas.renderAll(); }});