reverse Function (GPL)

Syntax

reverse()

Description

When used in conjunction with a scale, this function reverses the scale. For categorical scales, this function can be used in conjunction with an explicit sorting function.

When used in conjunction with a polar coordinate system, this function reverses the direction of the coordinate system. Thus, it would draw pie slices in a counterclockwise direction.

Examples

Figure 1. Example: Using reverse alpha-numeric sorting
SCALE: cat(dim(1), sort.natural(), reverse())
Figure 2. Example: Reversing a linear scale
SCALE: linear(dim(2), reverse())
Figure 3. Example: Reversing the direction of an aesthetic scale
SCALE: linear(aesthetic(aesthetic.color.brightness), reverse())
Figure 4. Example: Reversing the direction of a coordinate system
COORD: polar.theta(reverse())