Version 3.17.2
Show:

AttributeLite Class

AttributeLite provides Attribute-like getters and setters for shape classes in the Graphics module. It provides a get/set API without the event infastructure. This class is temporary and a work in progress.

Constructor

AttributeLite

()

Item Index

Methods

Methods

_set

(
  • name
  • value
)
protected

Provides setter logic. Used by set.

Parameters:

  • name String | Object

    The name of the attribute. Alternatively, an object of key value pairs can be passed in to set multiple attributes at once.

  • value Any

    The value to set the attribute to. This value is ignored if an object is received as the name param.

addAttrs

(
  • cfg
)

Initializes the attributes for a shape. If an attribute config is passed into the constructor of the host, the initial values will be overwritten.

Parameters:

  • cfg Object

    Optional object containing attributes key value pairs to be set.

get

(
  • name
)
Any

For a given item, returns the value of the property requested, or undefined if not found.

Parameters:

  • name String

    The name of the item

Returns:

Any:

The value of the supplied property.

set

(
  • name
  • value
)

Sets the value of an attribute.

Parameters:

  • name String | Object

    The name of the attribute. Alternatively, an object of key value pairs can be passed in to set multiple attributes at once.

  • value Any

    The value to set the attribute to. This value is ignored if an object is received as the name param.