Skip to content

Commit

Permalink
Update CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Dec 8, 2021
1 parent 8673ed6 commit 2255b5f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,22 @@

Released December 4, 2021.

Plot can now produce [legends for *color* and *opacity* scales](https://github.com/observablehq/plot/blob/main/README.md#legends)! The new *plot*.legend(*name*) function returns a legend for the scale with the given *name* (*color* or *opacity*). Alternatively, the top-level plot *scale*.**legend** option generates an inline legend. The new standalone Plot.**legend**(*options*) function allows you to create a legend independently of a chart. Two forms of color legend are provided: *swatches* for ordinal or discrete scales (*e.g.*, threshold color scales), and *ramp* for continuous scales.
Plot can now produce [legends for *color* and *opacity* scales](https://github.com/observablehq/plot/blob/main/README.md#legends)!

[<img src="./img/legend.png" width="660" height="437" alt="a scatterplot with a color legend">](https://observablehq.com/@observablehq/plot-legends)

```js
Plot.plot({
color: {
legend: true
},
marks: [
Plot.dot(athletes, {x: "weight", y: "height", stroke: "sex"})
]
})
```

The new *plot*.legend(*name*) function returns a legend for the scale with the given *name* (*color* or *opacity*). Alternatively, the top-level plot *scale*.**legend** option generates an inline legend. The new standalone Plot.**legend**(*options*) function allows you to create a legend independently of a chart. Two forms of color legend are provided: *swatches* for ordinal or discrete scales (*e.g.*, threshold color scales), and *ramp* for continuous scales.

The new [Plot.image](https://github.com/observablehq/plot/blob/main/README.md#image) mark centers an image on the given *xy* position.

Expand Down
Binary file added img/legend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2255b5f

Please sign in to comment.