Skip to content

Commit e17607a

Browse files
authored
(Non)Position aesthetics name formatting (#241)
* review docs * 'Non-position(al)' to 'Material' * Rename 'positional' -> 'position' * fix few vague descriptors of material aesthetics * Lingering positional -> position
1 parent 21b26a5 commit e17607a

42 files changed

Lines changed: 493 additions & 482 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,7 @@ PROJECT [<aesthetic>, ...] TO <coord_type>
13961396

13971397
**Components**:
13981398

1399-
- **Aesthetics** (optional): Comma-separated list of positional aesthetic names. If omitted, uses coord defaults.
1399+
- **Aesthetics** (optional): Comma-separated list of position aesthetic names. If omitted, uses coord defaults.
14001400
- **TO**: Required keyword separating aesthetics from coord type.
14011401
- **coord_type**: Either `cartesian` or `polar`.
14021402
- **SETTING** (optional): Additional properties.
@@ -1437,7 +1437,7 @@ Note: For axis limits, use `SCALE x FROM [min, max]` or `SCALE y FROM [min, max]
14371437

14381438
1. **Axis limits**: Use `SCALE x/y FROM [min, max]` to set axis limits
14391439
2. **Aesthetic domains**: Use `SCALE <aesthetic> FROM [...]` to set aesthetic domains
1440-
3. **Custom aesthetics**: User can define custom positional names (e.g., `PROJECT a, b TO cartesian`)
1440+
3. **Custom aesthetics**: User can define custom position names (e.g., `PROJECT a, b TO cartesian`)
14411441
4. **Multi-layer support**: All projection transforms apply to all layers
14421442

14431443
**Status**:

doc/get_started/the_rest.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Thankfully, we will give you a bit more help than the illustration above in unde
1111
## Coordinate systems
1212
In the earlier section we talked about position aesthetics being special because they are being orchestrated by the coordinate system. The coordinate system is the entity that takes care of the spatial arrangement of graphic objects based on their position aesthetic mapping. When thinking about a coordinate system we tend to think about a Cartesian coordinate system which has a horizontal x-axis and a vertical y-axis. There are others though, like polar systems, cartographic maps, and ternary systems.
1313

14-
At the most basics a coordinate system is a projection function that takes the position aesthetic and projects them into a 2 dimensional plane on the screen or paper. While we commonly have 2 position aesthetics that gets projected to a 2 dimensional plane, this is not a necessity. 3 positional aesthetics could be projected to 2 dimensions using a perspective transform or by using a special coordinate system such as a ternary layout.
14+
At the most basics a coordinate system is a projection function that takes the position aesthetic and projects them into a 2 dimensional plane on the screen or paper. While we commonly have 2 position aesthetics that gets projected to a 2 dimensional plane, this is not a necessity. 3 position aesthetics could be projected to 2 dimensions using a perspective transform or by using a special coordinate system such as a ternary layout.
1515

1616
## Faceting
1717
Faceting is the process of dividing your data by one or more variables and visualizing each group as a small version next to the other group. This technique is also known as creating small multiples. Often, each single plot will share the same position scales so that it is very easy to compare the small representations against each other.

doc/syntax/clause/facet.qmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
title: "Create small multiples with `FACET`"
33
---
44

5-
The `FACET` clause allows you to split your data, by one or two variables, and plot each group as a small version of the plot: a technique called 'small multiples'. The technique is great for preventing overplotting. Because each small plot shares the same positional scales by default, visual comparisons between groups become easy.
5+
The `FACET` clause allows you to split your data, by one or two variables, and plot each group as a small version of the plot: a technique called 'small multiples'.
6+
The technique is great for preventing overplotting.
7+
Because each small plot shares the same position scales by default, visual comparisons between groups become easy.
68

79
## Clause syntax
810
The `FACET` syntax contains a number of subclauses that are all optional
@@ -28,7 +30,7 @@ SETTING <parameter> => <value>, ...
2830

2931
This clause behaves much like the `SETTINGS` clause in `DRAW`, in that it allows you to fine-tune specific behavior of the faceting. The following parameters exist:
3032

31-
* `free`: Controls whether the positional scales are independent across the small multiples. Permissible values are:
33+
* `free`: Controls whether the position scales are independent across the small multiples. Permissible values are:
3234
* `null` or omitted (default): Shared/fixed scales across all panels
3335
* `'x'`: Independent x-axis scale, shared y-axis scale
3436
* `'y'`: Shared x-axis scale, independent y-axis scale

doc/syntax/clause/project.qmd

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Control the coordinate system with `PROJECT`"
33
---
44

5-
The `PROJECT` clause defines the projection of the plot, that is, how abstract positional aesthetics are translated (projected) onto the plane defined by the screen/paper where the plot is viewed on.
5+
The `PROJECT` clause defines the projection of the plot, that is, how abstract position aesthetics are translated (projected) onto the plane defined by the screen/paper where the plot is viewed on.
66

77
## Clause syntax
88
The `PROJECT` syntax contains a number of subclauses
@@ -12,14 +12,19 @@ PROJECT <aesthetic>, ... TO <coordinate-system>
1212
SETTING <parameter> => <value>, ...
1313
```
1414

15-
The comma-separated list of `aesthetic` names are optional but allows you to define the names of the positional aesthetics in the plot. If omitted, the default aesthetic names of the coordinate system is used. The order given matters as the first name is used for the primary aesthetic, the second name for the secondary aesthetic and so on. For instance, using `PROJECT y, x TO cartesian` will flip the plot as anything mapped to `y` will now relate to the horizontal axis, and anything mapped to `x` will relate to the vertical axis. Note that it is not allowed to use the name of already established aesthetics as positional aesthetics, e.g. `PROJECT fill, stroke TO polar` is not allowed.
15+
The comma-separated list of `aesthetic` names are optional but allows you to define the names of the position aesthetics in the plot.
16+
If omitted, the default aesthetic names of the coordinate system is used.
17+
The order given matters as the first name is used for the primary aesthetic, the second name for the secondary aesthetic and so on.
18+
For instance, using `PROJECT y, x TO cartesian` will flip the plot as anything mapped to `y` will now relate to the horizontal axis, and anything mapped to `x` will relate to the vertical axis.
19+
Note that it is not allowed to use the name of already established aesthetics as position aesthetics, e.g. `PROJECT fill, stroke TO polar` is not allowed.
1620

1721
### `TO`
1822
```ggsql
1923
TO <coordinate-system>
2024
```
2125

22-
The `TO` clause is required and is followed by the name of the [coordinate system](../index.qmd#coordinate-systems). The coordinate system provides default names for the positional aesthetics and is responsible for how to translate values mapped to these onto the plane defined by the screen or paper.
26+
The `TO` clause is required and is followed by the name of the [coordinate system](../index.qmd#coordinate-systems).
27+
The coordinate system provides default names for the position aesthetics and is responsible for how to translate values mapped to these onto the plane defined by the screen or paper.
2328

2429
### `SETTING`
2530
```ggsql

doc/syntax/clause/scale.qmd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ The `type` defines the class of scale to use. It can be one of four different ty
2323

2424
Read more about each type at their dedicated documentation. You do not have to specify the type as it is deduced from the transform, input range, or data if left blank.
2525

26-
You *must* specify an aesthetic so that the scale knows which mapping it belongs to. For positional aesthetics you will provide the base name (`x` or `y`) even though you are mapping to e.g. `xmin`. Creating a scale for `colour` (or `color`) will create a scale for both fill and stroke colour based on the settings.
26+
You *must* specify an aesthetic so that the scale knows which mapping it belongs to.
27+
For position aesthetics you will provide the base name (`x` or `y`) even though you are mapping to e.g. `xmin`.
28+
Creating a scale for `colour` (or `color`) will create a scale for both fill and stroke colour based on the settings.
2729

2830
### `FROM`
2931
```ggsql

doc/syntax/coord/cartesian.qmd

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
title: Cartesian
33
---
44

5-
The Cartesian coordinate system is the most well-known and the default for ggsql. It maps the primary positional aesthetic along a horizontal axis and the secondary along a perpendicular vertical axis.
5+
The Cartesian coordinate system is the most well-known and the default for ggsql.
6+
It maps the primary position aesthetic along a horizontal axis and the secondary along a perpendicular vertical axis.
67

78
## Default aesthetics
8-
The Cartesian coordinate system has the following default positional aesthetics which will be used if no others have been provided:
9+
The Cartesian coordinate system has the following default position aesthetics which will be used if no others have been provided:
910

1011
* **Primary**: `x` (horizontal position)
1112
* **Secondary**: `y` (vertical position)
@@ -16,15 +17,15 @@ Users can provide their own aesthetic names if needed, e.g.
1617
PROJECT p, q TO cartesian
1718
```
1819

19-
assuming they do not try to use a name that is already being used by any facet or non-positional aesthetics (e.g. `PROJECT fill, panel TO cartesian` is not allowed).
20+
assuming they do not try to use a name that is already being used by any facet or material aesthetics (e.g. `PROJECT fill, panel TO cartesian` is not allowed).
2021

2122
## Settings
2223
* `clip`: Should data be removed if it appears outside the bounds of the coordinate system. Defaults to `true`
2324
* `ratio`: The aspect ratio between the steps on the vertical and horizontal axis (must be > 0 if specified). Defaults to `null` (no enforced aspect ratio)
2425

2526
## Examples
2627

27-
### Use custom positional aesthetic names
28+
### Use custom position aesthetic names
2829

2930
```{ggsql}
3031
VISUALISE bill_len AS p, bill_dep AS q FROM ggsql:penguins

doc/syntax/coord/polar.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Polar
55
The polar coordinate system interprets its primary aesthetic as the angular position relative to the center, and the secondary aesthetic as the distance from the center. It is most often used for pie-charts and radar plots.
66

77
## Default aesthetics
8-
The polar coordinate system has the following default positional aesthetics which will be used if no others have been provided:
8+
The polar coordinate system has the following default position aesthetics which will be used if no others have been provided:
99

1010
* **Primary**: `radius` (distance from center)
1111
* **Secondary**: `angle` (angular position)

doc/syntax/index.qmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ A scale is responsible for translating a data value to an aesthetic literal, e.g
6161
- [`identity`](scale/type/identity.qmd) scales passes the data through unchanged
6262

6363
## Coordinate systems
64-
The coordinate system defines how the abstract positional aesthetics are projected onto the screen or paper where the final plot appears. As such, it has great influence over the final look of the plot.
64+
The coordinate system defines how the abstract position aesthetics are projected onto the screen or paper where the final plot appears.
65+
As such, it has great influence over the final look of the plot.
6566

6667
- [`cartesian`](coord/cartesian.qmd) is the classic coordinate system consisting of two perpendicular axes, one being horizontal and one being vertical
6768
- [`polar`](coord/polar.qmd) interprets the primary position as the angular location relative to the center and the secondary position as the distance (radius) from the center, and this creates a circular coordinate system

doc/syntax/scale/aesthetic/0_position.qmd

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,31 @@
22
title: "Position"
33
---
44

5-
Position aesthetics relate data to placement in the coordinate system of the plot. All layers need at least one of each positional aesthetic mapped in order to show its data. However, the layer may compute positional aesthetics from the mapping. For example, a bar plot calculates the `y` aesthetic by counting the number of records in each group defined by the mapped `x` aesthetic.
5+
Position aesthetics relate data to placement in the coordinate system of the plot.
6+
All layers need at least one of each position aesthetic mapped in order to show its data.
7+
However, the layer may compute position aesthetics from the mapping.
8+
For example, a bar plot calculates the `y` aesthetic by counting the number of records in each group defined by the mapped `x` aesthetic.
69

7-
In the above we use `x`and `y` as examples of position aesthetics but in reality the position aesthetic names are defined by the coordinate system in use. A Cartesian coordinate system recognizes `x` and `y` whereas a polar coordinate system recognizes `radius` and `angle`. You can implicitly choose the coordinate system by mapping to the aesthetics that it uses, i.e. if you map to `radius` and `angle` then a polar coordinate system will be chosen for you.
10+
In the above we use `x`and `y` as examples of position aesthetics, but in reality the position aesthetic names are defined by the coordinate system in use.
11+
A Cartesian coordinate system recognizes `x` and `y` whereas a polar coordinate system recognizes `radius` and `angle`.
12+
You can implicitly choose the coordinate system by mapping to the aesthetics that it uses, i.e. if you map to `radius` and `angle` then a polar coordinate system will be chosen for you.
813

914
## Literal values
10-
Scales for position aesthetics never use an output range and always relate to the input range. This is a practical decision by ggsql because different writers may treat the positional aesthetic in different ways. ^[In reality one could easily think of positional literal values as either normalized position along the x or y axis, or absolute units of distance from the bottom left corner of the coordinate system.]
15+
Scales for position aesthetics never use an output range and always relate to the input range.
16+
This is a practical decision by ggsql because different writers may treat the position aesthetic in different ways. ^[In reality one could easily think of position literal values as either normalized position along the x or y axis, or absolute units of distance from the bottom left corner of the coordinate system.]
1117

1218
::: {.callout-note}
1319
The lack of true literal values in position means that it is currently hard to place data and annotation "in-between" breaks in a discrete position scale.
1420
:::
1521

1622
## Aesthetic families
17-
Positional aesthetics have variants defined by a suffix attached to the primary name (e.g. `x`). The recognized suffixes are:
23+
Position aesthetics have variants defined by a suffix attached to the primary name (e.g. `x`).
24+
The recognized suffixes are:
1825

1926
* `end`
2027
* `min`
2128
* `max`
2229

23-
Which version of an aesthetic to use depends on the layer, but all aesthetics within a family is scaled by the same scale, which is named after its primary aesthetic. This means that even when rendering a layer that only uses `xmin` and `xmax`, you will still scale it by writing `SCALE x ...` and label it by writing `LABEL x => ...`
30+
Which version of an aesthetic to use depends on the layer.
31+
All aesthetics within a family use the same scale, which is named after its primary aesthetic.
32+
This means that even when rendering a layer that only uses `xmin` and `xmax`, you will still scale it by writing `SCALE x ...` and label it by writing `LABEL x => ...`

doc/syntax/scale/aesthetic/Z_faceting.qmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ SCALE x
2323
SETTING breaks => 'weeks'
2424
```
2525

26-
In order to show data where the facet variable is null, it is necessary to explicitly include `null` in the input range of a facet aesthetic scale. Just like discrete positional aesthetics. You can also use `RENAMING` on the scale to customize facet strip labels.
26+
In order to show data where the facet variable is null, it is necessary to explicitly include `null` in the input range of a facet aesthetic scale.
27+
Just like discrete position aesthetics. You can also use `RENAMING` on the scale to customize facet strip labels.
2728

2829
```{ggsql}
2930
VISUALISE sex AS x FROM ggsql:penguins

0 commit comments

Comments
 (0)