Skip to content

Commit 7b92d54

Browse files
mbostockFil
andauthored
0.6.9 (#1727)
* Update CHANGELOG * Update CHANGELOG.md * Update CHANGELOG.md * gods tree & barycentric fix (#1729) * gods * fix barycentric * Update CHANGELOG --------- Co-authored-by: Mike Bostock <[email protected]> * Update CHANGELOG * leaner barycentric before/after image * Update CHANGELOG * Update CHANGELOG --------- Co-authored-by: Philippe Rivière <[email protected]>
1 parent eb4b7c4 commit 7b92d54

8 files changed

+59
-2
lines changed

CHANGELOG.md

+57
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,63 @@
22

33
Year: **Current (2023)** · [2022](./CHANGELOG-2022.md) · [2021](./CHANGELOG-2021.md)
44

5+
## 0.6.9
6+
7+
[Released June 27, 2023.](https://github.com/observablehq/plot/releases/tag/v0.6.9)
8+
9+
Time [axes](https://observablehq.com/plot/marks/axis) now default to multi-line ticks, greatly improving readability. When a tick has the same second field value as the previous tick (*e.g.*, “19 Jan” after “17 Jan”), only the first field (“19”) is shown for brevity. The tick format is now based on the tick interval and hence is always consistent, whereas the prior “multi-scale” format varied based on the date, such as “Jan 29” (for Sunday, January 29) and “Tue 31” (for Tuesday, January 31). The new ticks are similar to [Datawrapper](https://blog.datawrapper.de/new-axis-ticks/).
10+
11+
Before:<br>
12+
<img src="./img/time-axis-before.png" width="640" alt="A horizontal time axis showing dates “Wed 25”, “Fri 27”, “Jan 29”, “Tue 31”, and so on.">
13+
14+
After:<br>
15+
<img src="./img/time-axis-after.png" width="640" alt="A horizontal time axis showing dates “17 Jan”, “19”, “21”, through “2 Feb”, “4”, and so on. When the month name is shown, it is on a second line below the date.">
16+
17+
It is now easier to construct a “piecewise” [continuous scale](https://observablehq.com/plot/features/scales#continuous-scales) with more than two elements in the **domain** or **range**. This is most often used for a custom color scheme interpolating through fixed colors, such as this pleasing rainbow (sometimes used by artist [Dave Whyte](https://beesandbombs.com/), *a.k.a.* beesandbombs).
18+
19+
<img src="./img/piecewise-rainbow.png" width="640" alt="A one-dimensional cell plot of the numbers 0 through 39, laid out horizontally, with color varying smoothly through red, yellow, green-blue, and purple.">
20+
21+
```js
22+
Plot.plot({
23+
color: {
24+
type: "linear",
25+
range: ["#d70441", "#f4e904", "#009978", "#5e3688"]
26+
},
27+
marks: [
28+
Plot.cellX(d3.range(40), {fill: Plot.identity})
29+
]
30+
})
31+
```
32+
33+
The [tree mark](https://observablehq.com/plot/marks/tree) now supports a **textLayout** option, which defaults to *mirrored* to alternate the orientation of labels for internal (non-leaf) *vs.* external (leaf) nodes. The treeNode and treeLink marks now also support a new **treeFilter** option, allowing these marks to be filtered without affecting the tree layout.
34+
35+
<img src="./img/tree-gods.png" width="640" alt="A small family tree diagram of Greek gods. Chaos beget Eros, Erebus, Tartarus, and Gaia; Gaia beget Mountains, Pontus, and Uranus.">
36+
37+
```js
38+
Plot.plot({
39+
axis: null,
40+
height: 100,
41+
margin: 10,
42+
marginLeft: 40,
43+
marginRight: 120,
44+
marks: [
45+
Plot.tree(gods, {textStroke: "white"})
46+
]
47+
})
48+
```
49+
50+
The [barycentric interpolator](https://observablehq.com/plot/marks/raster#interpolatorbarycentric-options) used by the [raster](https://observablehq.com/plot/marks/raster) and [contour](https://observablehq.com/plot/marks/contour) marks now behaves correctly outside the convex hull of samples. The new algorithm (below right) radiates outwards from the hull, ensuring a continuous image; the old algorithm (below left) radiated inwards from values imputed on the frame’s edges, producing discontinuities.
51+
52+
<img src="./img/barycentric-before-after.png" width="640" alt="A before-and-after comparison of the barycentric interpolator applied to three sample points; in the new algorithm, lines radiate outward perpendicular from the triangle’s sides, producing a more coherent and understandable image.">
53+
54+
The [tip mark](https://observablehq.com/plot/marks/tip) now automatically sets the pointer-events attribute to *none* when associated with the [pointer transform](https://observablehq.com/plot/interactions/pointer) when the the pointer is not sticky, as when hovering a chart without clicking to lock the pointer. This prevents the tip mark from interfering with interaction on other marks, such as clickable links.
55+
56+
The [auto mark](https://observablehq.com/plot/marks/auto) now renders as a cell, instead of a degenerate invisible rect, when **x** and **y** are both ordinal and the **mark** option is set to *bar*. The [tree mark](https://observablehq.com/plot/marks/tree) no longer produces duplicate tips with the **tip** option. The [rule mark](https://observablehq.com/plot/marks/rule) now respects the top-level **document** option, if any, when using the **clip** option. The [axis mark](https://observablehq.com/plot/marks/axis) now correctly handles the **sort**, **filter**, **reverse**, and **initializer** options.
57+
58+
The **title**, **ariaLabel**, and **href** channels no longer filter by default; these channels may now be sparsely defined and the associated mark instance will still render.
59+
60+
The [pointer transform](https://observablehq.com/plot/interactions/pointer) now handles non-faceted marks in faceted plots. The [window transform](https://observablehq.com/plot/transforms/window)’s *median*, *deviation*, *variance*, and percentile reducers have been fixed.
61+
562
## 0.6.8
663

764
[Released June 2, 2023.](https://github.com/observablehq/plot/releases/tag/v0.6.8)

docs/marks/tree.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Plot.plot({
4242
axis: null,
4343
height: 100,
4444
margin: 10,
45-
marginLeft: 35,
45+
marginLeft: 40,
4646
marginRight: 120,
4747
marks: [
4848
Plot.tree(gods, {textStroke: "var(--vp-c-bg)"})

img/barycentric-before-after.png

18.9 KB
Loading

img/piecewise-rainbow.png

10.2 KB
Loading

img/time-axis-after.png

3.48 KB
Loading

img/time-axis-before.png

6.15 KB
Loading

img/tree-gods.png

7.29 KB
Loading

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@observablehq/plot",
33
"description": "A JavaScript library for exploratory data visualization.",
4-
"version": "0.6.8",
4+
"version": "0.6.9",
55
"author": {
66
"name": "Observable, Inc.",
77
"url": "https://observablehq.com"

0 commit comments

Comments
 (0)