Encoding
An Encoding object records information about a visual encoding. When a mark’s visual channel is specified to encode a data field through the encode method in the Scene class, an Encoding object is created and returned.
Properties
property | explanation | type | default value |
---|---|---|---|
channel | the visual channel | String | |
dataTable | the data table used in this encoding | String | |
field | the data field | String | |
aggregator | aggregator for data values | String | “sum” |
scale | the scale of the encoding | Scale | |
scaleType | the type of scale | String | depends on field and channel |
includeZero | whether the scale domain includes 0 | Boolean | false |
rangeExtent | the extent of the scale range | Number | |
mapping | user defined mapping between field values and visual properties | Object | |
scheme | the color scheme | String | |
startAngle | the start angle in degrees when encoding using the “angle” channel | Number | 90 |
angleDirection | the direction to encode angles | String | “clockwise” |
Methods
method | explanation | return type |
---|---|---|
getScaleRange(item) | get the scale range for this encoding for the specified item item (Mark or Group, optional): an example item with this encoding | Array |