encodeProfile
encodeProfile(
input):Profile
Defined in: packages/core/src/encode.ts:136
Works out what to draw for a dataset, before any view places it: one mark per item, in order, each with its colour, shape and lightness, plus a legend per encoded dimension.
encoding says which dimension arranges the marks and which drive colour, shape and lightness
(see Encoding); left out, the first dimension does all but lightness. Marks are sorted by the
arranging dimension’s category order, then by each other encoded dimension’s, then by item id,
so categories form runs. A view lays them out in that order.
A pure function of its input: the same items, dimensions, encoding and cap give the same profile whatever order the items arrive in. The items array is treated as immutable: work is cached against it.
Above maxMarks items, consecutive items that agree on every encoded dimension share a mark
(itemsPerMark > 1), so a mark never misrepresents any item in it. Nothing is sampled away.