Reference · Facts, line drawings and positions
lineupViewfunction
The camera at a zoom from 0 to 1: the size it frames grows from the smallest body's radius to the largest's on a logarithmic scale, and its centre glides from one body to the next, easing in and out, so it rests on each body as the framed size reaches that body's radius. A tall, narrow picture (aspect under 1) is zoomed out so the framed body still fits across.
Import it
import { lineupView } from "@johnmorrisdotca/wakusei-planets";
Definition
function lineupView(places: readonly LineupPlace[], zoom: number, aspect?: number): LineupView
Parameters
| Name | Type | Description |
|---|---|---|
places | readonly LineupPlace[] | The places, smallest first. |
zoom | number | 0 (the smallest body fills the picture) to 1 (the largest does). Held to that range. |
aspect (optional) | number | The picture's width over its height, 1.78 by default. |
Returns
LineupView
The camera.
Examples
import { lineupBodies, lineupView, placeLineup } from "@johnmorrisdotca/wakusei-planets";
const places = placeLineup(lineupBodies(), "row");
console.log(lineupView(places, 0).h, lineupView(places, 1).h);1.45 3117.499999999999What it prints (run when this page was built)