Skip to content

Operators

Graphical operators are used to used to arrange, overlay, and connect visual elements.

Usage

spread

The spread operator is used to spread the data across the x or y axis.

chart(seafood).flow(spread('lake', { dir: 'x' })).mark(rect({ h: 'count' }));
          

stack

The stack operator is used to stack the data across the x or y axis.

chart(seafood).flow(stack('lake', { dir: 'x' })).mark(rect({ h: 'count' }));
          

scatter

The scatter operator is used to scatter the data across the x or y axis.

chart(seafood).flow(scatter('lake', { dir: 'x' })).mark(rect({ h: 'count' }));
          

group

The group operator is used to group the data by a given key.

chart(seafood).flow(group('lake')).mark(rect({ h: 'count' }));
          

derive

The derive operator is used to derive a new column from the data.

chart(seafood).flow(derive((d) => d.count * 2)).mark(rect({ h: 'count' }));
          

Components