Skip to content

Commit b7014db

Browse files
committed
Update CHANGELOG
1 parent d7d283f commit b7014db

File tree

6 files changed

+25
-29
lines changed

6 files changed

+25
-29
lines changed

CHANGELOG.md

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
The new [geo mark](https://observablehq.com/@observablehq/plot-geo)
88

9+
[<img src="./img/choropleth.png" width="640" alt="A choropleth of unemployment rate by U.S. county">](https://observablehq.com/@observablehq/plot-geo)
10+
911
```js
1012
Plot.geo(counties, {fill: (d) => d.properties.unemployment}).plot({
1113
projection: "albers-usa",
@@ -21,19 +23,18 @@ Plot.geo(counties, {fill: (d) => d.properties.unemployment}).plot({
2123

2224
Faceting.
2325

26+
[<img src="./img/faceted-map.png" width="930" alt="A dot map of Walmart store openings faceted by decade">](https://observablehq.com/@observablehq/plot-geo)
27+
2428
```js
2529
Plot.plot({
26-
width: 960,
27-
height: 150,
28-
marginLeft: 0,
29-
marginRight: 0,
30+
width: 975,
3031
projection: "albers",
31-
fx: { tickFormat: (d) => `${d}’s`, padding: 0 },
32-
facet: { data: walmarts, x: (d) => Math.floor(d.date.getUTCFullYear() / 10) * 10 },
32+
fx: {tickFormat: (d) => `${d}’s`},
33+
facet: {data: walmarts, x: (d) => Math.floor(d.date.getUTCFullYear() / 10) * 10},
3334
marks: [
34-
Plot.geo(statemesh, { clip: "frame", strokeOpacity: 0.1 }),
35-
Plot.dot(walmarts, { x: "longitude", y: "latitude", r: 1, fill: "currentColor" }),
36-
Plot.geo(nation, { clip: "frame" })
35+
Plot.geo(statemesh, {strokeOpacity: 0.1}),
36+
Plot.dot(walmarts, {x: "longitude", y: "latitude", r: 1, fill: "currentColor"}),
37+
Plot.geo(nation)
3738
]
3839
})
3940
```
@@ -42,66 +43,61 @@ Plot.plot({
4243

4344
Projected vector.
4445

46+
[<img src="./img/vector-map.png" width="640" alt="An arrow map showing the county-level vote margins in the 2020 U.S. presidential election; a margin for Biden is shown as a blue left-pointing arrow, and a margin for Trump is shown as a red right-pointing arrow">](https://observablehq.com/@observablehq/plot-projections)
47+
4548
```js
4649
Plot.plot({
47-
projection: "albers-usa",
4850
width: 975,
51+
projection: "albers-usa",
4952
marks: [
50-
Plot.geo(statemesh, {strokeWidth: 0.75}),
53+
Plot.geo(statemesh, {strokeOpacity: 0.25}),
5154
Plot.geo(nation),
5255
Plot.vector(elections, {
5356
filter: (d) => d.votes > 0,
5457
anchor: "start",
5558
x: (d) => centroids.get(d.fips)?.[0],
5659
y: (d) => centroids.get(d.fips)?.[1],
57-
sort: (d) => Math.abs(+d.results_trumpd - +d.results_bidenj),
58-
stroke: (d) => (+d.results_trumpd > +d.results_bidenj ? "red" : "blue"),
59-
length: (d) => Math.sqrt(Math.abs(+d.margin2020 * +d.votes)),
60-
rotate: (d) => (+d.results_bidenj < +d.results_trumpd ? 60 : -60)
60+
sort: (d) => Math.abs(d.results_trumpd - d.results_bidenj),
61+
stroke: (d) => (d.results_trumpd > d.results_bidenj ? "red" : "blue"),
62+
length: (d) => Math.sqrt(Math.abs(d.margin2020 * d.votes)),
63+
rotate: (d) => (d.results_bidenj < d.results_trumpd ? 60 : -60)
6164
})
6265
]
6366
})
6467
```
6568

6669
Projected line.
6770

71+
[<img src="./img/beagle.png" width="640" alt="A map of the route of the HMS Beagle, 1831–1836; color indicates direction, with the ship initially departing London and heading southwest before circumnavigating the globe">](https://observablehq.com/@observablehq/plot-projections)
72+
6873
```js
6974
Plot.plot({
7075
projection: "equal-earth",
7176
marks: [
7277
Plot.geo(land, {fill: "currentColor"}),
7378
Plot.graticule(),
74-
Plot.line(beagle.coordinates, {stroke: (d, i) => i, z: null, strokeWidth: 2}),
75-
Plot.geo(london, {fill: "red", r: 5}),
79+
Plot.line(beagle, {stroke: (d, i) => i, z: null, strokeWidth: 2}),
7680
Plot.sphere()
7781
]
7882
})
7983
```
8084

8185
Projected transforms (hexbin aggregation).
8286

87+
[<img src="./img/hexbin-map.png" width="640" alt="A bivariate hexbin map of Walmart store openings; within each hexagonal area, size indicates the number of Walmart store openings, and color indicates the year of the first opening">](https://observablehq.com/@observablehq/plot-projections)
88+
8389
```js
8490
Plot.plot({
85-
width: 975,
8691
projection: "albers",
87-
r: {
88-
range: [0, 20]
89-
},
9092
color: {
9193
legend: true,
9294
label: "First year opened",
9395
scheme: "spectral"
9496
},
9597
marks: [
96-
Plot.geo(statemesh, { strokeOpacity: 0.25 }),
98+
Plot.geo(statemesh, {strokeOpacity: 0.25}),
9799
Plot.geo(nation),
98-
Plot.dot(
99-
walmarts,
100-
Plot.hexbin(
101-
{ r: "count", fill: "min" },
102-
{ x: "longitude", y: "latitude", fill: "date" }
103-
)
104-
)
100+
Plot.dot(walmarts, Plot.hexbin({r: "count", fill: "min"}, {x: "longitude", y: "latitude", fill: "date"}))
105101
]
106102
})
107103
```

img/beagle.png

201 KB
Loading

img/choropleth.png

180 KB
Loading

img/faceted-map.png

72.3 KB
Loading

img/hexbin-map.png

118 KB
Loading

img/vector-map.png

143 KB
Loading

0 commit comments

Comments
 (0)