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/layer/type/point.qmd
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23,9 +23,10 @@ The following aesthetics are recognised by the point layer.
23
23
24
24
## Settings
25
25
*`position`: Position adjustment. One of `'identity'` (default), `'stack'`, `'dodge'`, or `'jitter'`
26
+
*`aggregate`: Aggregation functions to apply per group. Either a single string or an array of strings. See an overview of aggregation function in [the `DRAW` documentation](../../clause/draw.qmd#aggregate) and more information in the *Data transformation* section below.
26
27
27
28
## Data transformation
28
-
The point layer does not transform its data but passes it through unchanged
29
+
This layer supports aggregation through the `aggregate` setting. Within each group, defined by `PARTITION BY` and all discrete mappings, aggregates will be calculated and used as the values to plot. Multiple aggregates will give rise to multiple separate groups in the end. These can be distinguished through the added `aggregate` column you can remap to, e.g. `REMAPPING aggregate AS color`
29
30
30
31
## Orientation
31
32
The point layer has no orientation. The axes are treated symmetrically.
Copy file name to clipboardExpand all lines: doc/syntax/layer/type/rule.qmd
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -25,8 +25,10 @@ The following aesthetics are recognised by the rule layer.
25
25
26
26
## Settings
27
27
*`position`: Position adjustment. One of `'identity'` (default), `'stack'`, `'dodge'`, or `'jitter'`
28
+
*`aggregate`: Aggregation functions to apply per group. Either a single string or an array of strings. See an overview of aggregation function in [the `DRAW` documentation](../../clause/draw.qmd#aggregate) and more information in the *Data transformation* section below.
28
29
29
30
## Data transformation
31
+
This layer supports aggregation through the `aggregate` setting. Within each group, defined by `PARTITION BY` and all discrete mappings, aggregates will be calculated and used as the values to plot. Multiple aggregates will give rise to multiple separate groups in the end. These can be distinguished through the added `aggregate` column you can remap to, e.g. `REMAPPING aggregate AS color`
30
32
31
33
For diagonal lines, the position aesthetic determines the intercept:
32
34
@@ -110,4 +112,14 @@ VISUALISE FROM ggsql:penguins
Copy file name to clipboardExpand all lines: doc/syntax/layer/type/segment.qmd
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,10 @@ For axis-aligned intervals where one coordinate is shared between the start and
25
25
26
26
## Settings
27
27
*`position`: Position adjustment. One of `'identity'` (default), `'stack'`, `'dodge'`, or `'jitter'`
28
+
*`aggregate`: Aggregation functions to apply per group. Either a single string or an array of strings. See an overview of aggregation function in [the `DRAW` documentation](../../clause/draw.qmd#aggregate) and more information in the *Data transformation* section below.
28
29
29
30
## Data transformation
30
-
The segment layer does not transform its data but passes it through unchanged.
31
+
This layer supports aggregation through the `aggregate` setting. Within each group, defined by `PARTITION BY` and all discrete mappings, aggregates will be calculated and used as the values to plot. Multiple aggregates will give rise to multiple separate groups in the end. These can be distinguished through the added `aggregate` column you can remap to, e.g. `REMAPPING aggregate AS color`
31
32
32
33
## Orientation
33
34
The segment layer has no orientations. The axes are treated symmetrically.
Copy file name to clipboardExpand all lines: doc/syntax/layer/type/text.qmd
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,7 @@ The following aesthetics are recognised by the text layer.
35
35
* a 2-element numeric array `[h, v]` where the first number is the horizontal offset and the second number is the vertical offset.
36
36
*`format` Formatting specifier, see explanation below.
37
37
*`position`: Position adjustment. One of `'identity'` (default), `'stack'`, `'dodge'`, or `'jitter'`
38
+
*`aggregate`: Aggregation functions to apply per group. Either a single string or an array of strings. See an overview of aggregation function in [the `DRAW` documentation](../../clause/draw.qmd#aggregate) and more information in the *Data transformation* section below.
38
39
39
40
### Format
40
41
The `format` setting can take a string that will be used in formatting the `label` aesthetic.
@@ -66,7 +67,7 @@ Known formatters are:
66
67
*`x`/`X`: Unsigned hexadecimal
67
68
68
69
## Data transformation
69
-
The text layer does not transform its data but passed it through unchanged.
70
+
This layer supports aggregation through the `aggregate` setting. Within each group, defined by `PARTITION BY` and all discrete mappings, aggregates will be calculated and used as the values to plot. Multiple aggregates will give rise to multiple separate groups in the end. These can be distinguished through the added `aggregate` column you can remap to, e.g. `REMAPPING aggregate AS color`
70
71
71
72
## Orientation
72
73
The text layer has no orientation. The axes are treated symmetrically.
@@ -146,3 +147,14 @@ PLACE text
146
147
x => (40, 50, 50),
147
148
y => (19, 19, 15)
148
149
```
150
+
151
+
Use aggregation to place labels at their centroid
152
+
153
+
```{ggsql}
154
+
VISUALISE bill_len AS x, bill_dep AS y FROM ggsql:penguins
0 commit comments