Reference · Facts, line drawings and positions
EmbedOptionstype
What the reader chose: the body, how it is drawn, and whether it is a portrait or the sky at a date.
Import it
import type { EmbedOptions } from "@johnmorrisdotca/wakusei-planets";
Definition
interface EmbedOptions {
body: BodyId;
look?: Look;
time?: string;
moons?: boolean;
turn?: number;
size?: number;
zoom?: number;
}
Members
| Name | Type | Description |
|---|---|---|
body | BodyId | |
look (optional) | Look | undefined | |
time (optional) | string | undefined | The date and time as an ISO string, or |
moons (optional) | boolean | undefined | A planet with its moons on their orbits (needs |
turn (optional) | number | undefined | Degrees a second it turns by itself; left out or 0, it is still. |
size (optional) | number | undefined | Pixels across. |
zoom (optional) | number | undefined | How far in the embed page starts, as its |
Examples
import { embedCode, type EmbedOptions } from "@johnmorrisdotca/wakusei-planets";
const options: EmbedOptions = { body: "saturn", look: "painted", size: 320, turn: 12 };
console.log(embedCode(options, "html"));<script type="module" src="https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.24.0/element/+esm"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.24.0/saturn/+esm"></script>
<wakusei-body body="saturn" look="painted" turn="12"></wakusei-body>What it prints (run when this page was built)