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: CHANGELOG.md
+110-5Lines changed: 110 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,111 @@
1
1
# Observable Plot - Changelog
2
2
3
+
## 0.6.3
4
+
5
+
[Released February 6, 2023.](https://github.com/observablehq/plot/releases/tag/v0.6.3)
6
+
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,
8
+
9
+
[<imgsrc="./img/auto-dot.webp"width="640"alt="A scatterplot height and weight of olympic athletes.">](https://observablehq.com/@observablehq/plot-auto)
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
24
+
25
+
[<imgsrc="./img/auto-line.webp"width="640"alt="A line chart of Apple stock price.">](https://observablehq.com/@observablehq/plot-auto)
26
+
27
+
```js
28
+
Plot.auto(aapl, {x:"Date", y:"Close"}).plot()
29
+
```
30
+
31
+
makes a line chart (equivalent to [lineY](./README.md#plotlineydata-options); chosen because the selected *x* dimension *Date* is temporal and monotonic, _i.e._, the data is in chronological order);
32
+
33
+
[<imgsrc="./img/auto-bin.webp"width="640"alt="A histogram of penguin body mass.">](https://observablehq.com/@observablehq/plot-auto)
34
+
35
+
```js
36
+
Plot.auto(penguins, {x:"body_mass_g"}).plot()
37
+
```
38
+
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
40
+
41
+
[<imgsrc="./img/auto-group.webp"width="640"alt="A vertical bar chart of penguins by island.">](https://observablehq.com/@observablehq/plot-auto)
42
+
43
+
```js
44
+
Plot.auto(penguins, {x:"island"}).plot()
45
+
```
46
+
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.
48
+
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.
50
+
51
+
[<imgsrc="./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)
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
+
[<imgsrc="./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
+
```
80
+
81
+
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.
82
+
83
+
[<imgsrc="./img/facet-axes.webp"width="640"alt="A scatterplot showing the culmen length and depth of various penguins, faceted by species and sex; the facets are arranged in a grid, with the y-axis on the left and the x-axis on the bottom.">](https://observablehq.com/@observablehq/plot-axes)
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
+
100
+
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.
101
+
102
+
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.
103
+
104
+
The [frame mark](./README.md#frame)’s new **anchor** option allows you to draw a line on one side of the frame (as opposed to the default behavior where a rect is drawn around all four sides); this feature is now used by the *scale*.**line** option for *x* and *y* scales. The [text mark](./README.md#text) now supports soft hyphens (`\xad`); lines are now eligible to break at soft hyphens, in which case a hyphen (-) will appear at the end of the line before the break. The [raster mark](./README.md#raster) no longer crashes with an _identity_ color scale. The [voronoi mark](./README.md#plotvoronoidata-options) now correctly respects the **target**, **mixBlendMode**, and **opacity** options.
105
+
3
106
## 0.6.2
4
107
5
-
*Not yet released. These are forthcoming changes in the main branch.*
108
+
[Released January 18, 2023.](https://github.com/observablehq/plot/releases/tag/v0.6.2)
6
109
7
110
The new [raster mark](./README.md#raster) and [contour mark](./README.md#contour) generate a raster image and smooth contours, respectively, from spatial samples. For example, the plot below shows a gridded digital elevation model of Maungawhau (R’s [`volcano` dataset](./test/data/volcano.json)) with contours every 10 meters:
8
111
@@ -39,7 +142,7 @@ Plot.plot({
39
142
40
143
The same data, with a smidge of blur, as filled contours in projected coordinates:
41
144
42
-
[<imgsrc="./img/ca55-contours.webp"width="650"alt="A map showing the varying intensity of the magnetic field as periodically observed from an airplane flying in an approximate grid pattern">](https://observablehq.com/@observablehq/plot-raster)
145
+
[<imgsrc="./img/ca55-contours.webp"width="650"alt="A map showing the varying intensity of the magnetic field as periodically observed from an airplane flying in an approximate grid pattern">](https://observablehq.com/@observablehq/plot-contour)
43
146
44
147
```js
45
148
Plot.plot({
@@ -106,7 +209,7 @@ Plot.plot({
106
209
107
210
The [vector mark](./README.md#vector) now supports the **shape** constant option; the built-in shapes are *arrow* (default) and *spike*. A custom shape can also be implemented, returning the corresponding SVG path data for the desired shape. The new [spike convenience constructor](./README.md#plotspikedata-options) creates a vector suitable for spike maps. The vector mark also now supports an **r** constant option to set the shape radius.
108
211
109
-
[<imgsrc="./img/spike-map.webp"width="640"alt="A spike map of U.S. county population">](https://observablehq.com/@observablehq/plot-vector)
212
+
[<imgsrc="./img/spike-map.webp"width="640"alt="A spike map of U.S. county population">](https://observablehq.com/@observablehq/plot-spike)
110
213
111
214
```js
112
215
Plot.plot({
@@ -124,9 +227,11 @@ Plot.plot({
124
227
});
125
228
```
126
229
127
-
The new [geoCentroid transform](./README.md#plotgeocentroidoptions) and [centroid initializer](./README.md#plotcentroidoptions) compute the spherical and projected planar centroids of geometry, respectively.
230
+
The new [geoCentroid transform](./README.md#plotgeocentroidoptions) and [centroid initializer](./README.md#plotcentroidoptions) compute the spherical and projected planar centroids of geometry, respectively. The new [identity](./README.md#plotidentity) channel helper returns a source array as-is, avoiding an extra copy.
231
+
232
+
The **interval** option now supports named time intervals such as “sunday” and “hour”, equivalent to the corresponding d3-time interval (_e.g._, d3.utcSunday and d3.utcHour). The [bin transform](./README.md#bin) is now many times faster, especially when there are many bins and when binning temporal data.
128
233
129
-
Diverging scales now correctly handle descending domains. When the stack **order** option is used without a *z* channel, a helpful error message is now thrown. The **clip** option *frame* now correctly handles band scales. Using D3 7.8, generated SVG path data is now rounded to three decimal points to reduce output size.
234
+
Diverging scales now correctly handle descending domains. When the stack **order** option is used without a *z* channel, a helpful error message is now thrown. The **clip** option *frame* now correctly handles band scales. Using D3 7.8, generated SVG path data is now rounded to three decimal points to reduce output size. Fix a crash when a facet scale’s domain includes a value for which there is no corresponding facet data. The bin, group, and hexbin transforms now correctly ignore undefined outputs. Upgrade D3 to 7.8.2.
0 commit comments