Each cell output can display either a table of results (the default) or a visual.
You can switch between a table and visual using the 'Show visual' button in the cell output:
Click the 'Expand' button to reveal the visual editor.
The visual editor allows you to assign columns from the results table onto different chart axis. Each chart is made up of a number Subplots, Layers and Groups.
We'll now dive into each of these concepts in more detail.
Layers are where we map columns to axes. They are the most fundamental part of each visual.
For each layer you can pick:
The layer type (
Text) - this determines how each element in a column in displayed on the visual.
X - the column to place on the x-axis.
Y - the column to place on the y-axis.
Color - a single color for the layer, or a column to determine the color of each element.
Size - a single size for the layer, or a column to determine the size of each element.
Line only) - a column to determine in which order the lines in the layer are joined up.
Text only) - a column to determine the text shown for each element in a text layer.
Detail - any number of columns to determine the values shown in the tooltip.
Layers become most powerful when you have more than one layer on a single plot. By default, Count will lay each layer on top of each other, sharing the same axes if possible. But you can always use the secondary X2 (top), and Y2 (right) axes.
For example, if we want to add a line to the chart above to show the total number of streams for their top 10 tracks for each artist, we can do the following:
This layer now has the same y-axis,
artist , but
streams is now on the bottom X2 axis instead of the top since their scales are very different.
To map something on one of the Secondary Axes (Top, or Right), use the X2 and Y2 buttons on the layers.
You can plot multiple layers on the same axes but they will all have to use the same scale.
Subplots define the grid of independent plots we want in our final visual. You can add multiple subplots if you want to display data side by side.
The video below shows how to create and use subplots:
In the example above, we created 2 subplots, one on top of the other. These subplots had different independent y-axes, but they shared an x-axis (
month). This is because
month was on a Group. Let's learn more about those now...
Groups are a great way to partition your chart, and create hierarchical axes. Groups are like axes that sit at the highest level so they apply to all subplots and all layers.
The image below shows how to use groups to make a hierarchical axis.
We put both artist and track name in the Y Group. If we were to add any subplots or new axes, that Y Grouping would persist.
Once you have the chart you want, formatting that chart can make all the difference when communicating with others.
To customize the chart styling, select the Style tab in the expanded visual view:
The following image explains the style options:
When you select an axis in your Edit Visual builder a new menu will appear that lets you customize your axis including the title, the format, and scale of the values.
There are no restrictions on what you can name your axis, so be as descriptive as you need to make your chart easy to understand. You can even use emojis (👍)
To sort your chart by one of your axes, you can tick the box for Ascending, Descending, or None in the Sorting section of the menu.
By default, the axis will scale to show the full range of values, but if you want to specify the range, and the scale (e.g. Linear, or Logarithmic), you can do so in the Scale section of the menu.
To change the way your axis labels are formatted, you can specify exactly how you want them displayed in the Labels section. This includes:
Numbers (e.g. 3M)
Currency (e.g. £343.56)
Datetime (e.g. 10/10/2020)
Percentage (e.g. 12%)
Scientific (e.g. 3E10)
For each of the above Label Types, you can also customize:
Decimal places displayed
Display Units: 1000 -> 1K
Negative Values: -123.45 or (123.45)
Prefix: string to put at the start of the label
Suffix: string to add to the end of the label
Thousands operator: 1,000 or 1000
And for dates, the options are:
Short date: 10/11/2020
Long date: Tuesday, November 10, 2020
You can customize the color of a layer in several ways:
If you have not placed a column on the color axis of a layer, you can select a uniform color for the layer by clicking on the Color axis, and selecting a color from the picker:
Continuous color scale
If there is a numerical or datetime column on the color axis, you can choose to use a continuous color scale. In this type of scale, the color of an element in the visual varies smoothly between different color stops. In the image below, the stops are the circles overlaid on the color bar.
Color stops can be dragged left and right to adjust the color scale. If you click on a color stop, you can edit precise details about its position and color. If you press the delete or backspace key while a color stop is open, it will be deleted.
Categorical color scale
If there is any column on the color axis (including string columns), you can choose to use a categorical color scale. In a categorical color scale, you pick a fixed palette of colors which repeat for all of the distinct values in the column on the color axis. You can also pick color overrides, which only affect single values from the column. In the example below, the pink color for Albuquerque has been overriden to red.
You can adjust the size of elements in your visual by clicking the size axis. This will adjust:
The radius of circles in a Circle layer
The width of lines in a Line layer
The width of bars in a Bar layer
The width of squares in a Square layer
The height of text in a Text layer
(No effect on an Area layer)
If you have placed a column on the size axis, you can adjust more options by clicking on the Size text:
Domain (min/max) - these are the values in the column which define the smallest and largest sizes (not available for string column types).
Size (min/max) - these are the maximum and minimum sizes that will appear on the visual.
Reversed - flip the direction of the size scale so that, for example, a value of Domain (min) will appear at a size of Size (max).
See more visual examples here:
*Gotta love wikipedia.