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

propertyexplanationtypedefault value
aggregatoraggregator for data valuesString“sum”
angleDirectionthe direction to encode anglesString“clockwise”
channel the visual channelString
dataTable the data table used in this encodingString
field the data fieldString
includeZerowhether the scale domain includes 0Booleanfalse
mappinguser defined mapping between field values and visual propertiesObject
rangeExtentthe extent of the scale rangeNumber
scalethe scale of the encodingScale
scaleTypethe type of scaleStringdepends on
field and channel
schemethe color schemeString
startAnglethe start angle in degrees when encoding using the “angle” channelNumber90

Methods

methodexplanationreturn 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