Reference · Facts, line drawings and positions
lineupZoomOffunction
The zoom at which a body fills the picture: where the camera frames its radius. 0 for a lone body.
Import it
import { lineupZoomOf } from "@johnmorrisdotca/wakusei-planets";
Definition
function lineupZoomOf(places: readonly LineupPlace[], id: string): number | undefined
Parameters
| Name | Type | Description |
|---|---|---|
places | readonly LineupPlace[] | The places, smallest first. |
id | string | A body's id. |
Returns
number | undefined
The zoom from 0 to 1, or undefined when the id is not in the line-up.
Examples
import { lineupBodies, lineupZoomOf, placeLineup } from "@johnmorrisdotca/wakusei-planets";
const places = placeLineup(lineupBodies(), "row");
console.log(lineupZoomOf(places, "antares")?.toFixed(3));0.850What it prints (run when this page was built)