|
2 | 2 |
|
3 | 3 | Year: **Current (2023)** · [2022](./CHANGELOG-2022.md) · [2021](./CHANGELOG-2021.md)
|
4 | 4 |
|
| 5 | +## 0.6.10 |
| 6 | + |
| 7 | +[Released August 14, 2023.](https://github.com/observablehq/plot/releases/tag/v0.6.10) |
| 8 | + |
| 9 | +The new **title** and **subtitle** [plot options](https://observablehq.com/plot/features/plots#other-options) specify a primary and secondary heading. Headings are implemented as h2 and h3 elements by default, but you can provide existing elements instead of text for greater control. Like the existing **caption** option, headings add context and assist interpretation. |
| 10 | + |
| 11 | +<img src="./img/title-subtitle.png" width="691" alt="A chart with a title, subtitle, and caption."> |
| 12 | + |
| 13 | +```js |
| 14 | +Plot.plot({ |
| 15 | + title: "For charts, an informative title", |
| 16 | + subtitle: "Subtitle to follow with additional context", |
| 17 | + caption: "Figure 1. A chart with a title, subtitle, and caption.", |
| 18 | + marks: [ |
| 19 | + Plot.frame(), |
| 20 | + Plot.text(["Titles, subtitles, captions, and annotations assist interpretation by telling the reader what’s interesting. Don’t make the reader work to find what you already know."], {lineWidth: 30, frameAnchor: "middle"}) |
| 21 | + ] |
| 22 | +}) |
| 23 | +``` |
| 24 | + |
| 25 | +When a chart has a title, subtitle, caption, or legend, Plot automatically wraps the chart’s SVG element with an HTML figure element. The new **figure** plot option, if true, wraps the chart in a figure even if it doesn’t have these other elements; likewise, if false, Plot ignores these other elements and returns a bare SVG element. The figure element now has an associated class (`plot-d6a7b5-figure`). |
| 26 | + |
| 27 | +The new **clip** plot option determines the default clipping behavior if the [**clip** mark option](https://observablehq.com/plot/features/marks#mark-options) is not specified; set it to true to enable clipping. This option does not affect axis, grid, and frame marks, whose **clip** option defaults to false. |
| 28 | + |
| 29 | +<img src="./img/clip.png" width="621" alt="A line chart of the AAPL ticker, clipped to the frame."> |
| 30 | + |
| 31 | +```js |
| 32 | +Plot.plot({ |
| 33 | + clip: true, |
| 34 | + x: {domain: [new Date(2015, 0, 1), new Date(2015, 3, 1)]}, |
| 35 | + y: {grid: true}, |
| 36 | + marks: [ |
| 37 | + Plot.areaY(aapl, {x: "Date", y: "Close", fillOpacity: 0.1}), |
| 38 | + Plot.lineY(aapl, {x: "Date", y: "Close"}), |
| 39 | + Plot.ruleY([0], {clip: false}) |
| 40 | + ] |
| 41 | +}); |
| 42 | +``` |
| 43 | + |
| 44 | +The new [bollinger mark](https://observablehq.com/plot/marks/bollinger) composes a line representing a moving average and an area representing volatility as a band; the band thickness is proportional to the deviation of nearby values. The bollinger mark is built on the new [bollinger map method](https://observablehq.com/plot/marks/bollinger#bollinger), and is often used to analyze the price of financial instruments such as stocks. |
| 45 | + |
| 46 | +<img src="./img/bollinger.png" width="668" alt="A bollinger chart of the AAPL ticker, computed on a window of the 20 most recent values and a bandwidth of 2 standard deviations."> |
| 47 | + |
| 48 | +```js |
| 49 | +Plot.bollingerY(aapl, {x: "Date", y: "Close", n: 20, k: 2}).plot() |
| 50 | +``` |
| 51 | + |
| 52 | +The [arrow mark](https://observablehq.com/plot/marks/arrow) supports a new **sweep** option to control the bend orientation. Below, we set this option to *-y* to draw arrows bulging right, independent of the relative vertical positions of its source and target. |
| 53 | + |
| 54 | +[<img src="./img/arc-diagram.png" width="521" alt="Detail of an arc diagram connecting characters in Les Misérables that appear in the same chapters.">](https://observablehq.com/@observablehq/plot-arc-diagram?intent=fork) |
| 55 | + |
| 56 | +```js |
| 57 | +Plot.plot({ |
| 58 | + height: 1080, |
| 59 | + marginLeft: 100, |
| 60 | + axis: null, |
| 61 | + x: {domain: [0, 1]}, // see https://github.com/observablehq/plot/issues/1541 |
| 62 | + color: {domain: d3.range(10), unknown: "#ccc"}, |
| 63 | + marks: [ |
| 64 | + Plot.dot(miserables.nodes, {x: 0, y: "id", fill: "group", sort: {y: "fill"}}), |
| 65 | + Plot.text(miserables.nodes, {x: 0, y: "id", text: "id", textAnchor: "end", dx: -6, fill: "group"}), |
| 66 | + Plot.arrow(miserables.links, {x: 0, y1: "source", y2: "target", sweep: "-y", bend: 90, headLength: 0, stroke: samegroup, sort: samegroup, reverse: true}) |
| 67 | + ] |
| 68 | +}) |
| 69 | +``` |
| 70 | + |
| 71 | +The [auto mark](https://observablehq.com/plot/marks/auto) now does a better job determining the appropriate bar mark implementation, such as with ordinal time series bar charts. |
| 72 | + |
| 73 | +<img src="./img/auto-bar.png" width="596" alt="A stacked bar chart from a time series."> |
| 74 | + |
| 75 | +```js |
| 76 | +Plot.auto(timeSeries, {x: "date", y: {value: "value", reduce: "sum"}, color: "type", mark: "bar"}).plot() |
| 77 | +``` |
| 78 | + |
| 79 | +The [pointerX and pointerY transform](https://observablehq.com/plot/interactions/pointer) now use unscaled distance to decide the closest point across facets, preventing points from distant facets from being considered closest. The pointer transform now correctly reports the closest point when moving between facets, and no longer reports multiple closest points if they are the same distance across facets. |
| 80 | + |
| 81 | +Plot’s documentation now has an [API index](https://observablehq.com/plot/api), version badges pointing to the release notes for a particular feature (or to the pull request for a prerelease feature), and shorter anchors. |
| 82 | + |
| 83 | +The [tip mark](https://observablehq.com/plot/marks/tip) now shows both labels for paired channels such as *y1*–*y2* or *x1*–*y2* when the channel labels differ. When the **tip** option is set to true on a [geo mark](https://observablehq.com/plot/marks/geo) without a projection, as when using preprojected planar geometry, the display no longer collapses. |
| 84 | + |
| 85 | +The [stack transform](https://observablehq.com/plot/transforms/stack) now emits a friendlier error message when the supplied value is null. |
| 86 | + |
5 | 87 | ## 0.6.9
|
6 | 88 |
|
7 | 89 | [Released June 27, 2023.](https://github.com/observablehq/plot/releases/tag/v0.6.9)
|
|
0 commit comments