From 9bc8563251e4226a6ef757c587876e46a42116e7 Mon Sep 17 00:00:00 2001 From: Andrew Aquino Date: Thu, 25 Apr 2024 06:42:29 -0700 Subject: [PATCH] docs: fix typo in polygonCentroid example (#3844) The example under the `polygonCentroid` heading was calling `polygonArea`. --- docs/d3-polygon.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/d3-polygon.md b/docs/d3-polygon.md index 21bce6edd0812..3c79042fd65a3 100644 --- a/docs/d3-polygon.md +++ b/docs/d3-polygon.md @@ -24,7 +24,7 @@ d3.polygonArea([[1, 1], [1.5, 0], [2, 1]]) // -0.5 ## polygonCentroid(*polygon*) {#polygonCentroid} ```js -d3.polygonArea([[1, 1], [1.5, 0], [2, 1]]) // [1.5, 0.6666666666666666] +d3.polygonCentroid([[1, 1], [1.5, 0], [2, 1]]) // [1.5, 0.6666666666666666] ``` [Source](https://github.com/d3/d3-polygon/blob/main/src/centroid.js) ยท Returns the [centroid](https://en.wikipedia.org/wiki/Centroid) of the specified *polygon*.