File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1
1
import type { ChannelTransform , ChannelValue } from "../channel.js" ;
2
2
import type { Initialized } from "./basic.js" ;
3
3
4
+ /** Options for the centroid and geoCentroid transforms. */
4
5
export interface CentroidOptions {
6
+ /**
7
+ * A channel supplying GeoJSON geometry; defaults to the identity transform,
8
+ * assuming that the data is GeoJSON geometry.
9
+ */
5
10
geometry ?: ChannelValue ;
6
11
}
7
12
13
+ /**
14
+ * Given a **geometry** input channel of GeoJSON geometry, derives **x** and
15
+ * **y** output channels representing the planar (projected) centroids of the
16
+ * geometry. The centroids are computed in screen coordinates according to the
17
+ * plot’s associated **projection** (or *x* and *y* scales), if any.
18
+ *
19
+ * For centroids of spherical geometry, see Plot.geoCentroid.
20
+ */
8
21
export function centroid < T > ( options ?: T & CentroidOptions ) : Initialized < T > ;
9
22
23
+ /**
24
+ * Given a **geometry** input channel of spherical GeoJSON geometry, derives
25
+ * **x** and **y** output channels representing the spherical centroids of the
26
+ * geometry.
27
+ *
28
+ * For planar (projected) centroids, see Plot.centroid.
29
+ */
10
30
export function geoCentroid < T > ( options ?: T & CentroidOptions ) : T & { x : ChannelTransform ; y : ChannelTransform } ;
You can’t perform that action at this time.
0 commit comments