InteractionObjectEventDispatcher
Type class
Represents an Event Dispatcher for InteractionObject.
Besides regular EventDispatcher functionality it adds new events with direct application to DOM nodes. Primarily used to handle keyboard events, but can turn into something else moving forward.
Sources
InteractionObjectEventDispatcher can be used (imported) via one of the following packages.
/** * Import from: "core.ts" * Use like: am4core.InteractionObjectEventDispatcher */import * as am4core from "@amcharts/amcharts4/core";/** * Include via: <script src="core.js"></script> * Access items like: am4core.InteractionObjectEventDispatcher */Inheritance
InteractionObjectEventDispatcher extends TargetedEventDispatcher.
InteractionObjectEventDispatcher is not extended by any other symbol.
Properties
1 inherited item
targetType
TargetInherited fromTargetedEventDispatcherA target object which is originating events using this dispatcher.
Methods
constructor(target:InteractionObject)Returns
InteractionObjectEventDispatcherConstructor
17 inherited items
copyFrom(source:this)Returns
voidInherited fromTargetedEventDispatcherCopies all dispatcher parameters, including listeners, from another event dispatcher.
disable()Returns
voidInherited fromEventDispatcherDisable dispatching of events until re-enabled by
enable().disableType(type:Key,
amount:number)Returns
voidInherited fromEventDispatcherDisable dispatching of events for a certain event type.
Optionally, can set how many dispatches to skip before automatically re-enabling the dispatching.
dispatch(type:Key,
event:T[""])Returns
voidInherited fromEventDispatcherShelves the event to be dispatched within next update cycle.
dispatchImmediately(type:Key,
event:T[""])Returns
voidInherited fromEventDispatcherDispatches an event immediately without waiting for next cycle.
dispose()Returns
voidInherited fromEventDispatcherDispose (destroy) this object.
enable()Returns
voidInherited fromEventDispatcherEnable dispatching of events if they were previously disabled by
disable().enableType(type:Key)Returns
voidInherited fromEventDispatcherEnable dispatching particular event, if it was disabled before by
disableType().has(type:Key,
callback?: (this:C, event:T[""]) =>void,
context?:C)Returns
booleanInherited fromEventDispatcherChecks if there's already a listener with specific parameters.
hasListeners()Returns
booleanInherited fromEventDispatcherChecks if this particular event dispatcher has any listeners set.
hasListenersByType(type:Key)Returns
booleanInherited fromEventDispatcherChecks if this particular event dispatcher has any particular listeners set.
isDisposed()Returns
booleanInherited fromEventDispatcherReturns if this object has been already disposed.
isEnabled(type:Key)Returns
booleanInherited fromEventDispatcherChecks if dispatching for particular event type is enabled.
off(type:Key,
callback?: (this:C, event:T[""]) =>void,
context?:C)Returns
voidInherited fromEventDispatcherRemoves the event listener with specific parameters.
on(type:Key,
callback: (this:C, event:T[""]) =>void,
context?:C,
shouldClone:boolean)Returns
IDisposerInherited fromEventDispatcherCreates an event listener to be invoked on a specific event type.
series.events.on("hidden", (ev) => { console.log("Series hidden: " + ev.target.name); }, this);series.events.on("hidden", function(ev) { console.log("Series hidden: " + ev.target.name); }, this);{ // ... "series": [{ // ... "events": { "hidden": function(ev) { console.log("Series hidden: " + ev.target.name); } } }] }The above will invoke our custom event handler whenever series we put event on is hidden.
onAll(callback: (this:C, type:Key, event:T[""]) =>void,
context?:C,
shouldClone:boolean)Returns
IDisposerInherited fromEventDispatcherCreates an event listener to be invoked on any event.
once(type:Key,
callback: (this:C, event:T[""]) =>void,
context?:C,
shouldClone:boolean)Returns
IDisposerInherited fromEventDispatcherCreates an event listener to be invoked on a specific event type once.
Once the event listener is invoked, it is automatically disposed.
series.events.on("hidden", (ev) => { console.log("Series hidden: " + ev.target.name); }, this);series.events.on("hidden", function(ev) { console.log("Series hidden: " + ev.target.name); }, this);{ // ... "series": [{ // ... "events": { "hidden": function(ev) { console.log("Series hidden: " + ev.target.name); } } }] }The above will invoke our custom event handler the first time series we put event on is hidden.
Events
InteractionObjectEventDispatcher does not have any events.