Skip to content

Commit 70346cb

Browse files
committed
Update CHANGELOG
1 parent 98f9475 commit 70346cb

File tree

3 files changed

+37
-7
lines changed

3 files changed

+37
-7
lines changed

CHANGELOG.md

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44

55
*Not yet released. These are forthcoming changes in the main branch.*
66

7-
The new [auto mark](./README.md#auto) ([Plot.auto](./README.md#plotautodata-options)) automatically selects a mark type that best represents the dimensions of the given data according to some simple heuristics. The auto mark is intended to support fast exploratory analysis where the goal is to get a useful plot as quickly as possible. It’s also great if you’re new to Plot, since you can get started with a minimal API. For example,
7+
The new [auto mark](./README.md#auto) ([Plot.auto](./README.md#plotautodata-options)) automatically selects a mark type that best represents the given dimensions of data according to some simple heuristics. For example,
88

99
[<img src="./img/auto-dot.webp" width="640" alt="A scatterplot height and weight of olympic athletes.">](https://observablehq.com/@observablehq/plot-auto)
1010

1111
```js
1212
Plot.auto(olympians, {x: "height", y: "weight"}).plot()
1313
```
1414

15-
makes a scatterplot (equivalent to [dot](./README.md#plotdotdata-options)); while adding **color**
15+
makes a scatterplot (equivalent to [dot](./README.md#plotdotdata-options)); adding **color** as
1616

1717
[<img src="./img/auto-bin-color.webp" width="640" alt="A heatmap of .">](https://observablehq.com/@observablehq/plot-auto)
1818

1919
```js
2020
Plot.auto(olympians, {x: "height", y: "weight", color: "count"}).plot()
2121
```
2222

23-
makes a heatmap (equivalent to [rect](./README.md#plotrectdata-options) and [bin](./README.md#plotbinoutputs-options); chosen since _height_ and _weight_ are quantitative);
23+
makes a heatmap (equivalent to [rect](./README.md#plotrectdata-options) and [bin](./README.md#plotbinoutputs-options); chosen since _height_ and _weight_ are quantitative); switching to
2424

2525
[<img src="./img/auto-line.webp" width="640" alt="A line chart of Apple stock price.">](https://observablehq.com/@observablehq/plot-auto)
2626

@@ -36,19 +36,47 @@ makes a line chart (equivalent to [lineY](./README.md#plotlineydata-options); ch
3636
Plot.auto(penguins, {x: "body_mass_g"}).plot()
3737
```
3838

39-
makes a histogram (equivalent to [rectY](./README.md#plotrectydata-options) and [binX](./README.md#plotbinxoutputs-options); chosen because the _body_mass_g_ column is quantitative);
39+
makes a histogram (equivalent to [rectY](./README.md#plotrectydata-options) and [binX](./README.md#plotbinxoutputs-options); chosen because the _body_mass_g_ column is quantitative); and
4040

4141
[<img src="./img/auto-group.webp" width="640" alt="A vertical bar chart of penguins by island.">](https://observablehq.com/@observablehq/plot-auto)
4242

4343
```js
4444
Plot.auto(penguins, {x: "island"}).plot()
4545
```
4646

47-
makes a bar chart (equivalent to [barY](./README.md#plotbarydata-options) and [groupX](./README.md#plotgroupxoutputs-options); chosen because the _island_ column is categorical).
47+
makes a bar chart (equivalent to [barY](./README.md#plotbarydata-options) and [groupX](./README.md#plotgroupxoutputs-options); chosen because the _island_ column is categorical). The auto mark is intended to support fast exploratory analysis where the goal is to get a useful plot as quickly as possible. It’s also great if you’re new to Plot, since you can get started with a minimal API.
4848

49-
Plot’s [axes](./README.md#axis) and [grids](./README.md#axis) are now proper marks, affording a high degree of customizability. This has been one of our most asked-for features, closing more than a dozen feature requests!
49+
Plot’s new [axis](./README.md#axis) and [grid](./README.md#axis) marks allow customization and styling of axes. This has been one of our most asked-for features, closing more than a dozen feature requests (see [#1197](https://github.com/observablehq/plot/pull/1197))! The new axis mark composes a [vector](./README.md#vector) for tick marks and a [text](./README.md#text) for tick and axis labels. As such, you can use the rich capabilities of these marks, such the **lineWidth** option to wrap long text labels.
5050

51-
TODO Add a bunch of examples (see [Plot: Axes](https://observablehq.com/@observablehq/plot-axes)) that demonstrate some of the new configuration possibilities with axes, including: white grid lines overlaying marks, perhaps ggplot2-style; multi-line tick labels; repeated _both_ axes; and NYT-style dashed grid lines.
51+
[<img src="./img/axis-multiline.webp" width="640" alt="A bar chart of parodical survey responses demonstrating text wrapping of long axis labels.">](https://observablehq.com/@observablehq/plot-auto)
52+
53+
```js
54+
Plot.plot({
55+
y: {percent: true},
56+
marks: [
57+
Plot.axisX({label: null, lineWidth: 8, marginBottom: 40}),
58+
Plot.axisY({label: "↑ Responses (%)"}),
59+
Plot.barY(responses, {x: "name", y: "value"}),
60+
Plot.ruleY([0])
61+
]
62+
})
63+
```
64+
65+
And since axes and grids are now proper marks, you can interleave them with other marks, for example to produce ggplot2-style axes with a gray background and white grid lines.
66+
67+
[<img src="./img/axis-ggplot.webp" width="640" alt="A line chart of Apple’s stock price demonstrating styled axes with a gray background overlaid with white grid lines.">](https://observablehq.com/@observablehq/plot-auto)
68+
69+
```js
70+
Plot.plot({
71+
inset: 10,
72+
marks: [
73+
Plot.frame({fill: "#eaeaea"}),
74+
Plot.gridY({stroke: "#fff", strokeOpacity: 1}),
75+
Plot.gridX({stroke: "#fff", strokeOpacity: 1}),
76+
Plot.line(aapl, {x: "Date", y: "Close"})
77+
]
78+
})
79+
```
5280

5381
The *x* and *y* axes are now automatically repeated in empty facets, improving readability by reducing eye travel to read tick values. Below, note that the *x* axis for culmen depth (with ticks at 15 and 20 mm) is rendered below the Adelie/null-sex facet in the top-right.
5482

@@ -67,6 +95,8 @@ Plot.plot({
6795
})
6896
```
6997

98+
See [Plot: Axes](https://observablehq.com/@observablehq/plot-axes) for more examples, including the new _both_ **axis** option to repeat axes on both sides of the plot, dashed grid lines via the **strokeDasharray** option, data-driven tick placement, and layering axes to show hierarchical time intervals (years, months, weeks).
99+
70100
Marks can now declare default margins via the **marginTop**, **marginRight**, **marginBottom**, and **marginLeft** options, and the **margin** shorthand. For each side, the maximum corresponding margin across marks becomes the plot’s default. While most marks default to zero margins (because they are drawn inside the chart area), Plot‘s axis mark provides default margins depending on their anchor. The facet margin options (*e.g.*., facet.**marginRight**) now correctly affect the positioning of the *x* and *y* axis labels.
71101

72102
The new [*mark*.**facetAnchor**](#facetanchor) mark option controls the facets in which the mark will appear when faceting. It defaults to null for all marks except for axis marks, where it defaults to *top-empty* if the axis anchor is *top*, *right-empty* if anchor is *right*, *bottom-empty* if anchor is *bottom*, and *left-empty* if anchor is *left*. This ensures the proper positioning of the axes with respect to empty facets.

img/axis-ggplot.webp

21.1 KB
Binary file not shown.

img/axis-multiline.webp

17.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)