Facet

Split visuals into separate rows and cols.

Faceting allows you to repeat a visual across all values of a column, and provide a way to create hierarchical axes.

For example, the following chart is grouping the Total Sales by Region (Central, East, etc.). This is achieved by putting Region in the Rows field under Facet.

Using facets in a visual

In this example, the Region column has also been added to the Color channel to help visually distinguish the data for each region.

  • Facets group the data into distinct partitions, and repeat the subplot(s) for each partition

  • Facets can contain hierarchies with up to 8 levels

Layouts for tables and heatmaps

Another common way to use facet is to create tables or cohort charts. The following example uses the Rows to show two columns in the data, and the Cols to generate the columns in the table.

In this case, the Rows aren't hierarchies but by placing them under Facet as Rows we can have as many columns as we want.

Cohort chart using facets

Layouts for repeated marks

A third way to use facet is if you want to repeat a mark across several different categories. For example, in this chart a track's danceability and energy is repeated across each individual artist. This is achieved by putting main_artist in the Rows field under Facet.

Last updated