DistanceLayerstype
What layersByDistance gives back.
Import it
import type { DistanceLayers } from "@johnmorrisdotca/hoshi-stars/distance";
Definition
interface DistanceLayers {
limit: number;
things: LayeredThing[];
counts: number[];
uncertain: number;
unknown: number;
}
Members
| Name | Type | Description |
|---|---|---|
limit | number | The limit the layers were made for, in light-years; |
things | LayeredThing[] | The things within the limit, nearest first: the certain ones by their best distance, the uncertain ones by the nearest their error allows. |
counts | number[] | How many certain things are in each of the six bands. |
uncertain | number | How many things are in the |
unknown | number | How many things were given with no distance at all. They are never drawn once a limit is set. |
Examples
import type { DistanceLayers } from "@johnmorrisdotca/hoshi-stars/distance";
const total = (layers: DistanceLayers): number => layers.counts.reduce((sum, n) => sum + n, 0) + layers.uncertain;
console.log(typeof total);functionWhat it prints (run when this page was built)