You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/syntax/scale/type/continuous.qmd
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ The input range for continuous scales are defined by their minimum and maximum v
12
12
Position aesthetics (`x` and `y`) will have their range expanded based on the `expand` setting.
13
13
If values in the mapped data falls outside of the input domain the values will be changed based on the `oob` setting.
14
14
15
-
The input range is converted to the type defined by the transform. This means that a time range can both be given as a `%H:%M:%S` string or as a numeric giving the number of nanoseconds since midnight.
15
+
The input range is converted to the type defined by the transformation. This means that a time range can both be given as a `%H:%M:%S` string or as a numeric giving the number of nanoseconds since midnight.
16
16
17
17
### Examples
18
18
@@ -62,23 +62,23 @@ DRAW point
62
62
SCALE color TO ['black', 'red', 'white']
63
63
```
64
64
65
-
## Transform
66
-
The transform of the scale both defines how the input data is parsed as well as any mathematical transform applied before it is mapped to the output range. The default transform is deduced from a combination of the mapped data and the aesthetic the scale is applied to.
65
+
## Transformation
66
+
The transformation of the scale both defines how the input data is parsed as well as any mathematical transformation applied before it is mapped to the output range. The default transformation is deduced from a combination of the mapped data and the aesthetic the scale is applied to.
67
67
68
-
*`linear`: The default transform unless stated otherwise. Creates a linear mapping between the input and output range.
68
+
*`linear`: The default transformation unless stated otherwise. Creates a linear mapping between the input and output range.
69
69
*`log`/`log2`/`ln`: Creates a mapping between the logarithm of the input to the output range.
70
-
*`exp10`/`exp2`/`exp`: Inverse of the log transforms
70
+
*`exp10`/`exp2`/`exp`: Inverse of the log transformations
71
71
*`sqrt`: Creates a mapping between the square root of the input to the output range.
72
-
*`square`: Inverse of `sqrt`transform
72
+
*`square`: Inverse of `sqrt`transformation
73
73
*`asinh`: Creates a mapping between the inverse hyperbolic sine of the input to the output range. This approaches the natural logarithm but is well defined for negative values as well, which can make it a good choice for transforming values that exhibit logarithmic growth but span positive and negative values.
74
-
*`pseudo_log`/`pseudo_log2`/`pseudo_ln`: A slightly different transform that exhibits the same characteristics as `asinh` but where it is possible to choose the base of the logarithm it should approach.
74
+
*`pseudo_log`/`pseudo_log2`/`pseudo_ln`: A slightly different transformation that exhibits the same characteristics as `asinh` but where it is possible to choose the base of the logarithm it should approach.
75
75
*`integer`: Like `linear` but will convert input to integer by removing the decimal part.
76
76
*`date`: Default when mapping a DATE column. Like `linear` but will cast input to date if not already (for strings this assumes the date is formatted as YYYY-MM-DD, for numbers it will be the number of days since 1970-01-01).
77
77
*`datetime`: Default when mapping a DATETIME column. Like `linear` but will cast input to datetime if not already (for strings a range of different permutations of the YYYY-MM-DDTHH:MM:SS.fTZ is tried, for number it will be the number of microseconds since 1970-01-01T00:00:00).
78
78
*`time`: Default when mapping a TIME column. Like `linear` but will cast input to time if not already (for strings it assumes the time is formatted as HH:MM:SS.f with both the fractional and second part optional, for number it will be the number of nanoseconds since start of measurement).
79
79
80
80
### Breaks
81
-
If not provided explicitly by the user the breaks for the scales will be calculated for you. The transform will be responsible for the algorithm used to find good break values. It will use the breaks setting and the pretty setting and make a best effort at honouring this.
81
+
If not provided explicitly by the user the breaks for the scales will be calculated for you. The transformation will be responsible for the algorithm used to find good break values. It will use the breaks setting and the pretty setting and make a best effort at honouring this.
82
82
83
83
*`linear`:
84
84
-`pretty => true`: Will use Wilkinsons Extended algorithm to attempt to find nice breaks in the given interval close to the number of breaks requested
@@ -96,23 +96,23 @@ If not provided explicitly by the user the breaks for the scales will be calcula
96
96
-`pretty => false`: Linear spacing in integer space as close to the requested number of breaks
97
97
98
98
### The size aesthetic
99
-
The size aesthetic requires special attention. To the user, size is given as radius in points (1/72 inch), but internally the provided values are converted to area, and the scale operates on area transformed values. This means that while you provide the output range in radius, the scaling is proportional to the area, even when using the default linear transform. While this seems somewhat complicated we have chosen this approach to satisfy two opposing needs:
99
+
The size aesthetic requires special attention. To the user, size is given as radius in points (1/72 inch), but internally the provided values are converted to area, and the scale operates on area transformed values. This means that while you provide the output range in radius, the scaling is proportional to the area, even when using the default linear transformation. While this seems somewhat complicated we have chosen this approach to satisfy two opposing needs:
100
100
101
101
1. Humans are better at understanding a size when provided as radius/diameter
102
102
2. When making comparison between shape sizes we should compare area
103
103
104
-
If you wish to scale by the radius (not advised) you should do so using the `square`transform (`SCALE size VIA square`)
104
+
If you wish to scale by the radius (not advised) you should do so using the `square`transformation (`SCALE size VIA square`)
105
105
106
106
### Examples
107
107
108
-
#### Automatic use of date transform for x axis
108
+
#### Automatic use of date transformation for x axis
109
109
110
110
```{ggsql}
111
111
VISUALISE Date AS x, Temp AS y FROM ggsql:airquality
112
112
DRAW line
113
113
```
114
114
115
-
#### Applying a log transform to the y axis
115
+
#### Applying a log transformation to the y axis
116
116
117
117
```{ggsql}
118
118
VISUALISE Date AS x, Temp AS y FROM ggsql:airquality
0 commit comments