diff --git a/src/compile/mark/encode/conditional.ts b/src/compile/mark/encode/conditional.ts index 7a9aca8082..8985d71943 100644 --- a/src/compile/mark/encode/conditional.ts +++ b/src/compile/mark/encode/conditional.ts @@ -58,7 +58,10 @@ export function wrapCondition 1) { + if ( + valueRefs.length > 1 || + (valueRefs.length === 1 && Boolean(valueRefs[0].test)) // We must use array form valueRefs if test exists, otherwise Vega won't execute the test. + ) { return {[vgChannel]: valueRefs}; } else if (valueRefs.length === 1) { return {[vgChannel]: valueRefs[0]};