Skip to content

Commit ac5b227

Browse files
Filmbostock
andauthored
gods tree & barycentric fix (#1729)
* gods * fix barycentric * Update CHANGELOG --------- Co-authored-by: Mike Bostock <[email protected]>
1 parent 0579f2e commit ac5b227

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

CHANGELOG.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,34 @@ Plot.plot({
3030
})
3131
```
3232

33-
The [tree mark](https://observablehq.com/plot/marks/tree) now supports a **textLayout** option, which defaults to *mirrored*, alternating 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).
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.
3434

35-
[TK Example of mirrored labels in a tree diagram.]
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.">
3636

37-
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.
38-
39-
Fix [barycentric interpolation](https://observablehq.com/plot/marks/raster#interpolatorbarycentric-options) outside the convex hull of samples.
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+
```
4049

41-
[TK Before and after comparison of barycentric interpolation.]
50+
The [barycentric interpolator](https://observablehq.com/plot/marks/raster#interpolatorbarycentric-options) 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.
4251

43-
TK Fix invisible rects with the [auto mark](https://observablehq.com/plot/marks/auto) when both dimensions are ordinal and the **mark** option is set to *bar*.
52+
<img src="./img/barycentric-before-after.png" width="632" 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.">
4453

45-
TK Fix pointer transform on non-faceted marks in faceted plots.
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.
4655

47-
TK Fix a regression with the [window transform](https://observablehq.com/plot/transforms/window) when using the *median*, *deviation*, *variance*, or percentile reducer.
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.
4857

49-
Fix the **clip** option when the [rule mark](https://observablehq.com/plot/marks/rule) is used with a custom **document**. Fix the **tip** option with the [tree mark](https://observablehq.com/plot/marks/tree) to not produce duplicate tips.
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.
5059

51-
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.
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.
5261

5362
## 0.6.8
5463

docs/marks/tree.md

Lines changed: 1 addition & 1 deletion
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

24.3 KB
Loading

img/tree-gods.png

7.29 KB
Loading

0 commit comments

Comments
 (0)