Skip to content

Commit 13f6e54

Browse files
committed
Update CHANGELOG
1 parent 4aea0a3 commit 13f6e54

File tree

4 files changed

+77
-10
lines changed

4 files changed

+77
-10
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44

55
*Not yet released. These are forthcoming changes in the main branch.*
66

7-
The new [tree](./README.md#tree) mark and transforms can generate hierarchical node-link diagrams using D3’s “tidy” tree layout.
7+
The new [tree](./README.md#tree) mark and transforms can generate hierarchical node-link diagrams using D3’s [“tidy” tree](https://observablehq.com/@d3/tree) or [cluster (dendrogram)](https://observablehq.com/@d3/cluster) layout. The tree transform uses [d3.stratify](https://observablehq.com/@d3/d3-stratify) to convert tabular data into a hierarchy by parsing a slash-separated **path** for each row.
8+
9+
<img src="./img/tree.png" width="640" alt="a node-link tree diagram representing a software hierarchy">
10+
11+
```js
12+
Plot.plot({
13+
axis: null,
14+
inset: 10,
15+
insetRight: 120,
16+
height: 500,
17+
marks: Plot.tree(plotsrc, {markerEnd: "arrow"})
18+
})
19+
```
820

921
The [line](./README.md#line) and [area](./README.md#area) marks (specifically lineX, lineY, areaX, and areaY) now support an implicit [bin transform](./README.md#bin) with the **interval** option. This can be used to “regularize” time series data, say to show gaps or default to zero when data is missing, rather than interpolating across missing data. This is also useful for stacking time series data that is sampled at irregular intervals or with missing samples.
1022

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,7 @@ Equivalent to [Plot.stackX](#plotstackxstack-options), except that the **x2** ch
20142014
20152015
### Tree
20162016
2017-
[<img src="./img/tree.png" width="320" height="198" alt="a node-link tree representing a software hierarchy">](https://observablehq.com/@observablehq/plot-tree)
2017+
[<img src="./img/tree.png" width="320" height="250" alt="a node-link tree diagram representing a software hierarchy">](https://observablehq.com/@observablehq/plot-tree)
20182018
20192019
[Source](./src/transforms/tree.js) · [Examples](https://observablehq.com/@observablehq/plot-tree) · Transforms a tabular dataset into a hierarchy according to the given **path** input channel, which is typically a slash-separated string; then executes a tree layout algorithm to compute **x** and **y** output channels; these channels can then be fed to other marks to construct a node-link diagram.
20202020

img/tree.png

179 KB
Loading

test/plots/flare-tree.js

Lines changed: 63 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,67 @@ import * as Plot from "@observablehq/plot";
22
import * as d3 from "d3";
33

44
export default async function() {
5-
const flare = await d3.csv("data/flare.csv", d3.autoType);
6-
return Plot.plot({
7-
axis: null,
8-
inset: 10,
9-
insetRight: 120,
10-
height: 1800,
11-
marks: Plot.tree(flare, {markerEnd: "arrow", path: "name", delimiter: "."})
12-
});
5+
const plotsrc = `
6+
src/channel.js
7+
src/scales.js
8+
src/warnings.js
9+
src/format.js
10+
src/marks/line.js
11+
src/marks/cell.js
12+
src/marks/rect.js
13+
src/marks/arrow.js
14+
src/marks/box.js
15+
src/marks/tree.js
16+
src/marks/link.js
17+
src/marks/vector.js
18+
src/marks/dot.js
19+
src/marks/image.js
20+
src/marks/area.js
21+
src/marks/rule.js
22+
src/marks/marker.js
23+
src/marks/bar.js
24+
src/marks/tick.js
25+
src/marks/text.js
26+
src/marks/frame.js
27+
src/legends/swatches.js
28+
src/legends/ramp.js
29+
src/legends.js
30+
src/axis.js
31+
src/memoize.js
32+
src/options.js
33+
src/dimensions.js
34+
src/index.js
35+
src/style.js
36+
src/plot.js
37+
src/scales/quantitative.js
38+
src/scales/diverging.js
39+
src/scales/temporal.js
40+
src/scales/index.js
41+
src/scales/ordinal.js
42+
src/scales/schemes.js
43+
src/transforms/normalize.js
44+
src/transforms/inset.js
45+
src/transforms/bin.js
46+
src/transforms/tree.js
47+
src/transforms/interval.js
48+
src/transforms/window.js
49+
src/transforms/select.js
50+
src/transforms/identity.js
51+
src/transforms/basic.js
52+
src/transforms/map.js
53+
src/transforms/group.js
54+
src/transforms/stack.js
55+
src/defined.js
56+
src/math.js
57+
src/axes.js
58+
src/curve.js
59+
`.trim().split("\n").sort();
60+
return Plot.plot({
61+
style: "padding: 1px; border: solid;",
62+
axis: null,
63+
inset: 10,
64+
insetRight: 120,
65+
height: 500,
66+
marks: Plot.tree(plotsrc, {markerEnd: "arrow"})
67+
});
1368
}

0 commit comments

Comments
 (0)