Reference · Markers on the globe
Clustertype
Several points gathered into one on the screen: where it is drawn and which points are in it.
Import it
import type { Cluster } from "@johnmorrisdotca/chikyu-earth/markers";
Definition
interface Cluster {
x: number;
y: number;
members: number[];
}
Members
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
members | number[] | Indices of the points in it. |
Examples
import { clusterPoints, type Cluster } from "@johnmorrisdotca/chikyu-earth/markers";
const clusters: Cluster[] = clusterPoints([0, 1], 2, [10, 12], [10, 11], 28);
console.log(clusters[0]?.members);[ 0, 1 ]What it prints (run when this page was built)