Class Properties

Represents the collection of properties of a visualization. A get function is available to retrieve the value of a property by name. The dirty and active status of a property can be determined by the isDirty and isActive functions repectively. The properties collection can be accessed through RenderBase.properties or through UpdateInfo.props.

Hierarchy

  • Properties

Index

Properties

Methods

Properties

palettes

palettes: ReadonlyMap<string, CatPalette | ContPalette>

Map holding wrappers for palette properties. This map is filled at construction time and holds a wrapper Palette object for each palette property. It is used in the get function of this class and internally by the Encoding class, but may also be used externally (in a RenderBase subclass).

Methods

get

  • get(_name: string): any
  • Retrieves the value of a property. For numbers, strings, boolean and enum values the native value type is returned. A Color, Length and Font is returned as a object which contains a toString method. A palette is returned as a CatPalette or a ContPalette object.

    Parameters

    • _name: string

      Name of the property.

    Returns any

    The value of the property or null if the property does not exist. The return value can be a string, number, boolean, Color, Length, Font, CatPalette, ContPalette or null.

isActive

  • isActive(_name: string): boolean
  • Parameters

    • _name: string

      Name of the property.

    Returns boolean

    True if the property is active, false otherwise.

isDirty

  • isDirty(_name: string): boolean
  • The dirty state of a property tells you if the value of the property has changed since the last RenderBase.update call.

    Parameters

    • _name: string

      Name of the property.

    Returns boolean

    True if the property is dirty, false otherwise.

peek

  • peek(_name: string): any
  • Retrieves the value of a property. The difference between peek and get is that get retrieves the locked value of a property, while peek circumvents the locking mechanism and returns the value directly from the host application.

    In general you should use get to retrieve the value of a property since locking ensures that the value will not change during asynchronous render operations.

    In some situations however you want to circumvent the locking mechanism. For instance if in the updateProperty method you want to set the active state of one property based on the value of another property, then you need to get the 'peek' value of that other property.

    Note that 'peek' can not be used for palette properties.

    Parameters

    • _name: string

      Name of the property.

    Returns any

    The value of the property or null if the property does not exist. The return value can be a string, number, boolean, Color, Length, Font, CatPalette, ContPalette or null.

setActive

  • setActive(_name: string, _active: boolean): void
  • Parameters

    • _name: string

      Name of the property.

    • _active: boolean

      Active state. Marks a property as active or inactive.

    Returns void