Skip to content

Commit 74e8423

Browse files
committed
geoCentroid test
1 parent 5f9c77e commit 74e8423

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/plots/tip.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ export async function tipGeoCentroid() {
9696
.json<any>("data/us-counties-10m.json")
9797
.then((us) => [feature(us, us.objects.counties), mesh(us, us.objects.counties)])
9898
]);
99-
// Alternatively, using geoCentroid:
100-
// const {x, y} = Plot.geoCentroid();
101-
// const pointer = Plot.pointer({px: x, py: y, x, y});
102-
const pointer = Plot.pointer(Plot.centroid());
99+
// Alternatively, using centroid (slower):
100+
// const pointer = Plot.pointer(Plot.centroid());
101+
const {x, y} = Plot.geoCentroid();
102+
const pointer = Plot.pointer({px: x, py: y, x, y});
103103
return Plot.plot({
104104
width: 960,
105105
height: 600,

0 commit comments

Comments
 (0)