Skip to content

ISpriteEvents

Type interface

Defines available events available for Sprite.

Sources

ISpriteEvents is an interface: it describes a shape of data and is not imported on its own.

Inheritance

ISpriteEvents extends IInteractionObjectEvents.

ISpriteEvents is extended by IPointedShapeEvents, IPolylineEvents, IRectangleEvents, IContainerEvents, IGridEvents, ITickEvents, IAxisFillEvents, IAxisLineEvents, IRoundedRectangleEvents, ILineEvents, ICircleEvents, ITrapezoidEvents, ITriangleEvents, IPolygonEvents, IImageEvents, IStarEvents, IForceDirectedLinkEvents.

Properties

appeared

Type object

Invoked when Sprite appears. Sprite appears when sprite.appear() method is called and show animation is finished.

beforedisposed

Type object

Invoked just before Sprite is disposed.

beforevalidated

Type object

Invoked before Sprite is validated.

disabled

Type object

Invoked when sprite is disabled

doublehit

Type SpritePointerTypeEvent & SpritePointEvent & SpriteMouseTouchEvent

Invoked when Sprite is clicked or touched twice in rapid succession.

dragged

Type SpritePointerTypeEvent & SpriteShiftEvent & SpritePointEvent & { event: MouseEvent | TouchEvent | KeyboardEvent, startPoint: IPoint }

Invoked when draggable object is being dragged. (using mouse, touch or keyboard).

This is simmilar but different then "drag" event in that it kicks in after "drag" which modifies Sprite coordinates. This allows doing own manipulations and corrections to element positions.

enabled

Type object

Invoked when sprite is enabled

globalscalechanged

Type object

Invoked when the global scale changed, meaning that scale of Sprite or any of its ascendants changed.

hidden

Type object

Invoked when visible Sprite is hidden.

hit

Type SpritePointerTypeEvent & SpritePointEvent & SpriteMouseTouchEvent

Invoked when Sprite is clicked or touched.

inited

Type object

Invoked when Sprite is initialized.

maxsizechanged

Type { previousHeight: number, previousWidth: number }

Invoked when maximum available size of the Sprite changes, i.e. when the size of parent container changes.

parentset

Type object

Invoked when a sprite is added to a parent

positionchanged

Type object

Invoked when position of the Sprite changes.

propertychanged

Type { property: string }

Invoked when property of the Sprite changes.

ready

Type object

Invoked when Sprite is becomes ready, that is it has finished all calculations and building itself.

For Container object (and all those inheriting it, including charts) this event will fire when all children become ready.

removedfromqueue

Type object

Invoked when chart is shown if am4core.options.queue = true or/and am4core.options.onlyShowOnViewport = true.

shown

Type object

Invoked when hidden Sprite is shown.

sizechanged

Type object

Invoked when size of the Sprite changes.

toggled

Type object

Invoked when togglable Sprite is being toggled on and off. (its isActive property is being changed)

track

Type SpritePointerTypeEvent & SpritePointEvent & SpritePointerEvent & SpriteMouseTouchEvent

Invoked when pointer (mouse cursor or touch point) moves over trackable Sprite.

transformed

Type { dummyData: string }

transitionended

Type object

Invoked when Sprite completes transition to a SpriteState.

validated

Type object

Invoked when Sprite is validated. (on init or after update)

visibilitychanged

Type { visible: boolean }

Invoked when visibility of the Sprite changes. (from visible to hidden, and vice versa)

wheel

Type SpritePointEvent & SpriteShiftEvent & { event: WheelEvent }

Invoked when user turns mouse wheel while over the Sprite.

wheeldown

Type SpritePointEvent & SpriteShiftEvent & { event: WheelEvent }

Invoked when user turns mouse wheel downwards while over the Sprite.

wheelleft

Type SpritePointEvent & SpriteShiftEvent & { event: WheelEvent }

Invoked when user turns mouse wheel leftwards while over the Sprite.

wheelright

Type SpritePointEvent & SpriteShiftEvent & { event: WheelEvent }

Invoked when user turns mouse wheel rightwards while over the Sprite.

wheelup

Type SpritePointEvent & SpriteShiftEvent & { event: WheelEvent }

Invoked when user turns mouse wheel upwards while over the Sprite.

zIndexChanged

Type object

Invoked when zIndex of a sprite is changed

18 inherited items
blur

Type { event: FocusEvent }Inherited from IInteractionObjectEvents

Invoked when focusable object loses focus, e.g. by clicking outside it or pressing TAB button to focus on the next focusable object.

down

Type PointerTypeEvent & PointerEvent & MouseTouchEventInherited from IInteractionObjectEvents

Invoked when the mouse button is pressed or touch starts.

drag

Type PointerTypeEvent & ShiftEvent & PointEvent & { event: MouseEvent | TouchEvent | KeyboardEvent, startPoint: IPoint }Inherited from IInteractionObjectEvents

Invoked when draggable object is being dragged. (using mouse, touch or keyboard)

dragstart

Type PointerTypeEvent & { event: MouseEvent | TouchEvent | KeyboardEvent }Inherited from IInteractionObjectEvents

Invoked when draggable object dragging starts. This event is not invoked immediatelly after down, but only if there's a movement of the pointer.

dragstop

Type PointerTypeEvent & { event: MouseTouchEvent | KeyboardEvent }Inherited from IInteractionObjectEvents

Invoked when draggable object is released. This event will not fire if position of the object did not change.

focus

Type { event: FocusEvent }Inherited from IInteractionObjectEvents

Invoked when focusable object gains focus, e.g. by using TAB button.

input

Type { event: KeyboardEvent }Inherited from IInteractionObjectEvents

Invoked whenever information changes in the textual input elements, like <input>, <textarea>, etc.

keydown

Type { event: KeyboardEvent }Inherited from IInteractionObjectEvents

Invoked when the key is pressed on the keyboard.

keypress

Type { event: KeyboardEvent }Inherited from IInteractionObjectEvents

Invoked when the key generates a "press", e.g. pressing and holding a letter key will generate repeated "keypress" events.

keyup

Type { event: KeyboardEvent }Inherited from IInteractionObjectEvents

Invoked when the key is released on the keyboard.

out

Type PointerTypeEvent & MouseTouchEvent & PointerEventInherited from IInteractionObjectEvents

Invoked when mouse cursor moves out of hoverable object or it is no longer touched.

NOTE: this event might not always contains pointer parameter as event might be triggered by API?

over

Type PointerTypeEvent & MouseTouchEvent & PointerEventInherited from IInteractionObjectEvents

Invoked when mouse cursor moves over hoverable object or it is touched.

NOTE: this event might not always contains pointer parameter as event might be triggered by API?

resize

Type PointerTypeEvent & ScaleEvent & MouseTouchEvent & { point1: IPoint, point2: IPoint, startPoint1: IPoint, startPoint2: IPoint }Inherited from IInteractionObjectEvents

Invoked when resizable object is being resized either by mouse or touch pinch gesture.

rightclick

Type MouseTouchEventInherited from IInteractionObjectEvents

Invoked when right mouse button is clicked on the object.

swipe

Type PointerTypeEvent & MouseTouchEventInherited from IInteractionObjectEvents

Invoked when user performs "swiping" gesture (quick horizontal movement) on the object, either using mouse or touch.

swipeleft

Type PointerTypeEvent & MouseTouchEventInherited from IInteractionObjectEvents

Invoked when user performs "swiping" gesture towards left.

swiperight

Type PointerTypeEvent & MouseTouchEventInherited from IInteractionObjectEvents

Invoked when user performs "swiping" gesture towards right.

up

Type PointerTypeEvent & PointerEvent & MouseTouchEventInherited from IInteractionObjectEvents

Invoked when the mouse button is released or touch ends.