Entity

Type class

Base class.

Sources

Entity can be used (imported) via one of the following packages.

// Import Entity
import * as am5 from "@amcharts/amcharts5";

// Create Entity
am5.Entity.new(root, {
  // ... config if applicable
});
<!-- Load Entity -->
<script src="index.js"></script>

<script>
// Create Entity
am5.Entity.new(root, {
  // ... config if applicable
});
</script>

Inheritance

Entity extends Settings.

Entity is extended by ColorSet, Layout, Sprite, Pattern, Gradient, Bullet, AxisBullet, Modal, StockControl, Dropdown, StockToolbar, Serializer, InterfaceColors, NumberFormatter, DateFormatter, DurationFormatter, Language, Exporting, ExportingMenu, Annotator, PatternSet, DataProcessor, SliceGrouper.

Settings

Set these settings on a Entity object using its set() and setAll() methods.

Read about settings concept.

id
#

Type undefined | string

A custom string ID for the element.

If set, element can be looked up via am5.registry.entitiesById.

Will raise error if an element with the same ID already exists.

stateAnimationDuration
#

Type undefined | number

Duration of transition from one state to another.

stateAnimationEasing
#

Type $ease.Easing

Easing of transition from one state to another.

themeTags
#

Type Array

Tags which can be used by the theme rules.

Click here for more info

themeTagsSelf
#

Type Array

Tags which can be used by the theme rules.

These tags only apply to this object, not any children.

Click here for more info

themes
#

Type Array

A list of themes applied to the element.

userData
#

Type any

A storage for any custom user data that needs to be associated with the element.

Private settings

Properties

adapters
#

Type Adapters

Default new Adapters(this)

className
#

Static

Type string

Default "Entity"

classNames
#

Static

Type Array

Default "Entity"

events
#

Type EventDispatcher

Default this._createEvents()

root
#

Type Root

An instance of Root object.

@readonly
@since 5.0.6

states
#

Type States

Default new States(this)

template
#

Type Template | undefined

@todo needs description

uid
#

Type number

Default ++counter

Inherited from Settings

Unique ID.

There is 1 inherited item currently hidden from this list.

Methods

animate(

options: AnimationOptions

)

#

Returns Animation

Inherited from Settings

Animates setting values from current/start values to new ones.

Click here for more info

dispose()

#

Returns void

Inherited from Settings

Disposes this object.

get(

key: Key,
fallback: F

)

#

Returns NonNullable | F

Returns settings value for the specified key.

If there is no value, fallback is returned instead (if set).

Click here for more info

has(

key: Key

)

#

Returns boolean

Inherited from Settings

Returns true if the setting exists.

Click here for more info

isDisposed()

#

Returns boolean

Inherited from Settings

Returns true if this element is disposed.

isType(

type: string

)

#

Returns this

Checks if element is of certain class (or inherits one).

new(

root: Root,
settings: ITSettings,
template?: Template

)

#

Static

Returns T

Use this method to create an instance of this class.

Click here for more info

off(

key: Key,
callback?: undefined | ( value: [""], target: this, key: Key) => void

)

#

Returns void

Inherited from Settings

Removes a callback for when value of a setting changes.

Click here for more info
@since 5.9.2

offPrivate(

key: Key,
callback?: undefined | ( value: [""], target: this, key: Key) => void

)

#

Returns void

Inherited from Settings

Removes a callback for when value of a private setting changes.

Click here for more info
@since 5.9.2

on(

key: Key,
callback: ( value: [""], target: this, key: Key) => void

)

#

Returns IDisposer

Inherited from Settings

Sets a callback function to invoke when specific key of settings changes or is set.

Click here for more info

onPrivate(

key: Key,
callback: ( value: [""], target: this, key: Key) => void

)

#

Returns IDisposer

Inherited from Settings

Sets a callback function to invoke when specific key of private settings changes or is set.

Click here for more info

remove(

key: Key

)

#

Returns void

Removes a setting value for the specified key.

Click here for more info

removeAll()

#

Returns void

Inherited from Settings

Removes all keys;

Click here for more info

set(

key: Key,
value: Value

)

#

Returns Value

Sets a setting value for the specified key, and returns the same value.

Click here for more info

setAll(

settings: Partial

)

#

Returns void

Inherited from Settings

Sets multiple settings at once.

settings must be an object with key: value pairs.

Click here for more info

setTimeout(

fn: () => void,
delay: number

)

#

Returns IDisposer

Creates and returns a "disposable" timeout.

There are 10 inherited items currently hidden from this list.

Events

Entity does not have any events.