EmbedOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What the reader chose: the body, how it is drawn, and whether it is a portrait or the sky at a date.
インポート
import type { EmbedOptions } from "@johnmorrisdotca/wakusei-planets";
定義
interface EmbedOptions {
body: BodyId;
look?: Look;
time?: string;
moons?: boolean;
turn?: number;
size?: number;
zoom?: number;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
body | BodyId | |
look (省略可) | Look | undefined | |
time (省略可) | string | undefined | The date and time as an ISO string, or |
moons (省略可) | boolean | undefined | A planet with its moons on their orbits (needs |
turn (省略可) | number | undefined | Degrees a second it turns by itself; left out or 0, it is still. |
size (省略可) | number | undefined | Pixels across. |
zoom (省略可) | number | undefined | How far in the embed page starts, as its |
例
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>出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。