|
2 | 2 |
|
3 | 3 | Year: **Current (2024)** · [2023](./CHANGELOG-2023.md) · [2022](./CHANGELOG-2022.md) · [2021](./CHANGELOG-2021.md)
|
4 | 4 |
|
| 5 | +## 0.6.16 |
| 6 | + |
| 7 | +[Released August 6, 2024.](https://github.com/observablehq/plot/releases/tag/v0.6.16) |
| 8 | + |
| 9 | +The new [waffle mark](https://observablehq.com/plot/marks/waffle) 🧇 displays a quantity (or quantitative extent) for a given category; unlike a [bar](https://observablehq.com/plot/marks/bar), a waffle is subdivided into cells that allow easier counting, making waffles useful for reading and comparing exact quantities. Plot’s waffle mark is highly configurable: it supports stacking, positive and negative values, rounded corners, partial cells for fractional counts, automatic row or column size determination (with optional override), and more! |
| 10 | + |
| 11 | +[<img src="./img/waffle.png" width="708" alt="a waffle chart of Olympic athletes by weight">](https://observablehq.com/plot/marks/waffle) |
| 12 | + |
| 13 | +```js |
| 14 | +Plot.plot({ |
| 15 | + fx: {interval: 10}, |
| 16 | + color: {legend: true}, |
| 17 | + marks: [Plot.waffleY(olympians, Plot.groupZ({y: "count"}, {fill: "sex", sort: "sex", fx: "weight", unit: 10}))] |
| 18 | +}) |
| 19 | +``` |
| 20 | + |
| 21 | + |
| 22 | +All marks now support GeoJSON data and GeoJSON property shorthand, making it easier to work with GeoJSON. For example, below the data `counties` is a GeoJSON FeatureCollection, and `unemployment` refers to a property on each feature; the **fill** option is thus shorthand for `(d) => d.properties.unemployment`. The [geo mark](https://observablehq.com/plot/marks/geo) now also supports the **tip** option (via an implicit [centroid transform](https://observablehq.com/plot/transforms/centroid)), making it easier to use Plot’s [interactive tooltips](https://observablehq.com/plot/interactions/pointer). |
| 23 | + |
| 24 | +[<img src="./img/geo-tip.png" width="708" alt="a choropleth map of unemployment by U.S. county">](https://observablehq.com/plot/marks/geo) |
| 25 | + |
| 26 | +```js |
| 27 | +Plot.plot({ |
| 28 | + projection: "albers-usa", |
| 29 | + color: { |
| 30 | + type: "quantile", |
| 31 | + n: 9, |
| 32 | + scheme: "blues", |
| 33 | + label: "Unemployment (%)", |
| 34 | + legend: true |
| 35 | + }, |
| 36 | + marks: [ |
| 37 | + Plot.geo(counties, { |
| 38 | + fill: "unemployment", |
| 39 | + title: (d) => `${d.properties.name} ${d.properties.unemployment}%`, |
| 40 | + tip: true |
| 41 | + }) |
| 42 | + ] |
| 43 | +}) |
| 44 | +``` |
| 45 | + |
| 46 | +All marks now also support column name channel shorthand when using Apache Arrow tables as data, and we’ve added detection of Arrow date-type columns. (Arrow represents temporal data using BigInt rather than Date.) |
| 47 | + |
| 48 | +```js |
| 49 | +Plot.dot(gistemp, {x: "Date", y: "Anomaly"}).plot() // gistemp is an Arrow Table! |
| 50 | +``` |
| 51 | + |
| 52 | +The rect-like marks ([rect](https://observablehq.com/plot/marks/rect), [bar](https://observablehq.com/plot/marks/bar), [cell](https://observablehq.com/plot/marks/cell), and [frame](https://observablehq.com/plot/marks/frame)) now support individual rounding options for each side (**rx1**, **ry1**, *etc.*) and corner (**rx1y1**, **rx2y1**, *etc.*). This allows you to round just the top side of rects. You can even use a negative corner radius on the bottom side for seamless stacking, as in the histogram of Olympic athletes below. |
| 53 | + |
| 54 | +[<img src="./img/rect-rounded.png" width="708" alt="a histogram of Olympic athletes by weight">](https://observablehq.com/plot/marks/rect) |
| 55 | + |
| 56 | +```js |
| 57 | +Plot.plot({ |
| 58 | + color: {legend: true}, |
| 59 | + marks: [ |
| 60 | + Plot.rectY(olympians, Plot.binX({y: "count"}, {x: "weight", fill: "sex", ry2: 4, ry1: -4, clip: "frame"})), |
| 61 | + Plot.ruleY([0]) |
| 62 | + ] |
| 63 | +}) |
| 64 | +``` |
| 65 | + |
| 66 | +Plot now respects the projection **domain** when determining the default plot height. Previously, the map below would use a default square aspect ratio for the *conic-conformal* projection regardless of the specified **domain**, but now the map is perfectly sized to fit North Carolina. (Plot also now chooses a smarter default plot height when the ordinal *y* scale domain is empty.) |
| 67 | + |
| 68 | +<img src="./img/geo-nc.png" width="659" alt="an unlabeled map showing the outline and counties of North Carolina"> |
| 69 | + |
| 70 | +```js |
| 71 | +Plot.plot({ |
| 72 | + projection: {. |
| 73 | + type: "conic-conformal", |
| 74 | + parallels: [34 + 20 / 60, 36 + 10 / 60], |
| 75 | + rotate: [79, 0], |
| 76 | + domain: state |
| 77 | + }, |
| 78 | + marks: [ |
| 79 | + Plot.geo(counties, {strokeOpacity: 0.2}), |
| 80 | + Plot.geo(state) |
| 81 | + ] |
| 82 | +}) |
| 83 | +``` |
| 84 | + |
| 85 | +The [marker options](https://observablehq.com/plot/features/markers) now render as intended on marks with varying aesthetics, such as the spiraling arrows of varying thickness and color below. |
| 86 | + |
| 87 | +<img src="./img/group-marker.png" width="659" alt="several spiraling lines emanate from the center of the image, with rainbow color and increasing thickness, each capped with a pointed arrow at the end"> |
| 88 | + |
| 89 | +```js |
| 90 | +Plot.plot({ |
| 91 | + inset: 40, |
| 92 | + axis: null, |
| 93 | + marks: [ |
| 94 | + Plot.line(d3.range(400), { |
| 95 | + x: (i) => i * Math.sin(i / 100 + ((i % 5) * 2 * Math.PI) / 5), |
| 96 | + y: (i) => i * Math.cos(i / 100 + ((i % 5) * 2 * Math.PI) / 5), |
| 97 | + z: (i) => i % 5, |
| 98 | + stroke: (i) => -i, |
| 99 | + strokeWidth: (i) => i ** 1.1 / 100, |
| 100 | + markerEnd: "arrow" |
| 101 | + }) |
| 102 | + ] |
| 103 | +}) |
| 104 | +``` |
| 105 | + |
| 106 | +This release includes a few more new features, bug fixes, and improvements: |
| 107 | + |
| 108 | +The new **className** [mark option](https://observablehq.com/plot/features/marks#mark-options) specifies an optional `class` attribute for rendered marks, allowing styling of marks via external stylesheets or easier selection via JavaScript; thanks, @RLesser! Plot now reuses `clipPath` elements, when possible, when the **clip** mark option is set to *frame* or *projection*. |
| 109 | + |
| 110 | +The [difference mark](https://observablehq.com/plot/marks/difference) now supports a horizontal orientation via [differenceX](https://observablehq.com/plot/marks/difference#differenceX), and the [shift transform](https://observablehq.com/plot/transforms/shift) now likewise supports [shiftY](https://observablehq.com/plot/transforms/shift#shiftY). The [Voronoi mark](https://observablehq.com/plot/marks/delaunay) is now compatible with the pointer transform: only the pointed Voronoi cell is rendered; the Voronoi mark now also renders as intended with non-exclusive facets (as when using the *exclude* facet mode). The [tip mark](https://observablehq.com/plot/marks/tip) no longer displays channels containing literal color values by default. |
| 111 | + |
5 | 112 | ## 0.6.15
|
6 | 113 |
|
7 | 114 | [Released June 11, 2024.](https://github.com/observablehq/plot/releases/tag/v0.6.15)
|
|
0 commit comments