Reference
The data door: hand the package your own stars or objects as a source with its own licence and credit, and see whose data is on the screen
import { … } from "@johnmorrisdotca/hoshi-stars/door";
7.0 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
BitmapLike | type | What a picture needs of its bitmap: an ImageBitmap fits. |
createTileStore | function | A tile store for a view: loads the tiles of every source by key and keeps them under one budget of bytes (default 48 MB, all sources together). |
Credit | type | One source's part in the last drawn frame. |
creditLine | function | The credit line for what a view drew: each source's credit with its licence name, and "non-commercial" or "share-alike" whenever the source says so, so a page cannot hide the terms of the data it uses. |
DataSource | type | Either kind of source. |
ImageTile | type | A map tile: its size in pixels and its picture. |
Licence | type | A licence: its name and a link are always shown beside the credit. |
loadRecords | function | Reads a record source once, when it is added: the list is frozen, a record with a non-finite number (a NaN or an infinity in any number finite names) is skipped and counted, and a list over MAX_RECORDS is refused whole (bigger data must be tiles). |
MapPlace | type | A piece of a map, in degrees: longitude and latitude (right ascension and declination for the sky). |
MAX_IN_FLIGHT | constant | The most loads in flight at once for one source. |
MAX_RECORDS | constant | The most records a record source may hold. |
ObjectSource | type | A source of deep-sky objects: a list that fits in memory (at most 200,000 records), read once. |
ObjectsRead | type | What withObjects found. |
OWN_SOURCES | constant | The package's own data, as sources, written from the rows of NOTICE.md: the Yale Bright Star Catalogue, UCAC4 and the deep-sky list from Wikidata. |
ownCredit | function | The credit of one of the package's own sources, for the part of a page the door does not draw: the bright stars of the Yale catalogue are drawn from the main entry, so a page puts ownCredit("yale-bsc", count) first in its credit line. |
RecordSource | type | A list that fits in memory (at most MAX_RECORDS records; bigger data must be tiles). |
RecordsRead | type | What loadRecords found. |
SkyPictureSource | type | A source of a picture of the sky in tiles (a survey, an all-sky photograph): a map source, which uses the family's one map shape. |
SourceInfo | type | What a source says about itself. |
starSky | function | The faint stars of a page, from any number of tile sources: the door's view of the sky. |
StarSky | type | The faint stars of a page from any number of sources: loads the tiles a patch needs from each and answers from the ones it has. |
StarSkyOptions | type | What starSky takes. |
StarSource | type | A source of stars in tiles: the place is a round patch of sky (FaintField), the detail is the faintest magnitude wanted, and a tile is the decoded FaintTile (parallel arrays of right ascension, declination, magnitude and B-V). |
TILE_BUDGET_BYTES | constant | The default budget for decoded tiles in a view, all sources together: 48 MB (a picture counts with its mipmaps, 4/3 of its bytes). |
TileFetch | type | A fetch as the loaders use it: the address and, for a stop, a signal. |
TileLoader | type | The part of a tile source the store uses. |
TileSource | type | Data cut by place and by detail. |
TileStats | type | What a tile store has done. |
TileStore | type | A tile store: tiles by source and key, under one byte budget. |
TileStoreOptions | type | Options for createTileStore. |
Ucac4Options | type | What ucac4Source takes. |
ucac4Source | function | The package's own faint stars, UCAC4 to magnitude 12 in sky tiles, as a source: what faintSky has always loaded, through the door. |
validateSource | function | Refuses a source that cannot be shown honestly: it throws a TypeError at once, when a source is added, not at the first draw. |
withObjects | function | Adds the deep-sky objects of outside sources to the page's own. |