Reference · Facts, line drawings and positions
LineOptionstype
Options for lineSvg: the size, a pose (tilt, pitch, phase, spin, a time or a pose), moons, range, fill, the language and the colours.
Import it
import type { LineOptions } from "@johnmorrisdotca/wakusei-planets";
Definition
interface LineOptions extends PortraitOptions {
size?: number;
time?: number;
fill?: number;
pose?: Pose;
zoom?: number;
panX?: number;
panY?: number;
moons?: boolean;
moonsAt?: readonly {
id: MoonId;
x: number;
y: number;
z: number;
distance: number;
}[];
orbits?: ReadonlyMap<string, Float32Array>;
range?: number;
labels?: boolean;
lang?: "en" | "ja";
stroke?: string;
paper?: string;
}
Members
| Name | Type | Description |
|---|---|---|
size (optional) | number | undefined | The width and height of the square drawing, in pixels. Default 320. |
time (optional) | number | undefined | A moment in milliseconds since 1970: the body is drawn as the Earth sees it then (its real pose, phase and rings). Without it the body is a portrait. |
fill (optional) | number | undefined | The radius of the body as a fraction of half the drawing's width, to draw bodies to scale side by side. Default: as large as fits, with its rings. |
pose (optional) | Pose | undefined | A pose to draw instead of the portrait or the date's (the viewer's frame; see |
zoom (optional) | number | undefined | Zoom, and the pan as a fraction of half the picture, for a view a shared control moves. |
panX (optional) | number | undefined | |
panY (optional) | number | undefined | |
moons (optional) | boolean | undefined | Draw the planet's moons on their orbits as the Earth sees them at |
moonsAt (optional) | readonly { id: MoonId; x: number; y: number; z: number; distance: number; }[] | undefined | Moons already placed (planet radii, the viewer's frame), for a picture that moves them itself; used with |
orbits (optional) | ReadonlyMap<string, Float32Array<ArrayBufferLike>> | undefined | Orbit paths already worked out (x, y, z in planet radii, by moon), to draw instead of working them out. |
range (optional) | number | undefined | How far the picture reaches from the planet's centre, in planet radii, when |
labels (optional) | boolean | undefined | Write the names of the moons. Default true. |
lang (optional) | "en" | "ja" | undefined | The language of the names and the description. Default |
stroke (optional) | string | undefined | The colour of the lines. Default: a pale tint of the body's colour. |
paper (optional) | string | undefined | The colour of the disc. Default: a dark tint of the body's colour. |
tilt (optional) | number | undefined | The axial tilt on the page: how far the north pole leans to the right of straight up. Default: the body's own tilt (turned to 120 or less). |
pitch (optional) | number | undefined | How far the viewer looks over the north pole: 0 sees the equator edge-on, 90 looks straight down at the pole. Default 12, or 22 for a body with rings. |
phase (optional) | number | undefined | The Sun–body–viewer angle: 0 is full, 90 half, 180 new. Default 38. |
spin (optional) | number | undefined | The longitude at the middle of the disc, degrees east. Default: the longitude of the body's best-known side. |
Examples
import { lineSvg, type LineOptions } from "@johnmorrisdotca/wakusei-planets";
const options: LineOptions = { size: 200, tilt: 15, lang: "ja" };
console.log(lineSvg("mars", options).includes("火星"));trueWhat it prints (run when this page was built)