starSkyfunction
The faint stars of a page, from any number of tile sources: the door's view of the sky. Each source is checked when it is added; tiles load only when the view asks (load), under one byte budget, at most six at a time per source, and
nothing is sent at rest; a source switched off or removed has its loads aborted and its tiles freed; a tile that fails, is not a faint tile or holds a number that is not finite is counted and never drawn; and credits() names the sources
that drew something in the last stars call.
Import it
import { starSky } from "@johnmorrisdotca/hoshi-stars/door";
Definition
function starSky(options?: StarSkyOptions): StarSky
Parameters
| Name | Type | Description |
|---|---|---|
options (optional) | StarSkyOptions | The sources to start with, the budget, and the two callbacks. |
Returns
StarSky
The sky.
Examples
import { starSky, ucac4Source } from "@johnmorrisdotca/hoshi-stars/door";
const sky = starSky({ sources: [ucac4Source()], onChange: () => console.log("draw again") });
await sky.load({ rightAscension: 299, declination: 40, radius: 2 }, 12);
console.log(sky.stars({ rightAscension: 299, declination: 40, radius: 2 }, 12, 500).stars.length);