@hash/display-height-scale
Behavior
7
0
Public

Display Height - Scaling

This behavior allows you to drive the height of an agent from another property field on the agent. This is done by specifying the endpoints of two ranges: one for height, and one for the numeric values of the driving field. This behavior automaticall
Readme

This behavior allows you to drive the height of an agent from another property field on the agent. This is done by specifying the endpoints of two ranges: one for height, and one for the numeric values of the driving field. This behavior automatically maps the value of the specified field to a height within the range. The scaling between the two can be specified as either linear or logarithmic.

Agent Properties

An agent with this behavior needs the following corresponding agent properties:

{
  ...
  "height_scaling": {
    "field": string, // the field whose values will drive the height of the agent
    "field_bounds": [number], // the endpoints of the range of expected values of the field
    "bounds": [number], // the endpoints of the range of values for the height
    "scale": string // the type of scaling - "linear" or "log"
  }
}