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

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