diff --git a/src/plot.js b/src/plot.js index 2665465c66..20a72eaa13 100644 --- a/src/plot.js +++ b/src/plot.js @@ -16,6 +16,11 @@ export function plot(options = {}) { // Flatten any nested marks. const marks = options.marks === undefined ? [] : options.marks.flat(Infinity); + for (const mark of marks) { + if (mark.initialize === undefined) { + mark.initialize = () => ({ index: [], channels: [] }); + } + } // A Map from Mark instance to an object of named channel values. const markChannels = new Map();