Skip to main content
A highlight emphasises the observations that match a predicate by de-emphasising the ones that don’t. You describe what to match — not which pixels to paint — so the highlight tracks the data through re-sorts, filters, and updates.

Predicates

The first argument to highlight() is a predicate — a test against your post-transform columns. Field predicates name a variable and a comparison:
Ordered operators (gt, gte, lt, lte, range) need a numeric or date column. Using one against a categorical field is a compile-time validation error, surfaced as a diagnostic rather than a silent no-op.
Combine predicates with the logical forms and, or, and not:

Scope

By default a highlight matches individual observations. The scope option expands each match to a larger visual unit:

Scoping to one layer

In a multi-layer chart (say bars plus a trend line), bind the highlight to a single layer: name the layer with id and point at it with layerId. Observations in other layers are never tested, so a Q4 highlight on the bars leaves the trend line untouched:
Omit layerId to evaluate the predicate against every layer. A layer you never name gets an id assigned at resolve time, so scoping is the one case where naming it yourself matters.

Combining highlights

Multiple highlight() calls accumulate, and the engine unions their matches — an observation matched by any highlight is emphasised. So two separate highlights behave like an or:
Because the union is exactly an or, this is equivalent to a single highlight with an or predicate — same matched observations, same result:
Reach for the single or predicate when the two conditions are one idea; reach for two separate highlights when they’re independent emphases you might toggle separately.

Styling the de-emphasis

How the un-matched observations recede is stylesheet paint: entries scoped to the 'dimmed' state. The built-in stylesheet dims to alpha: 0.4; declare your own dimmed entry to change the look:
alpha lowers the opacity of non-matched observations; saturation: 0 drains their color toward grey.