本文へ移動

Wakusei Planets惑星

太陽・惑星・衛星を、線画、陰影つきの絵、表面の地図で描きます。実際の大きさ・傾き・自転つきで、任意の日時の衛星の位置も分かります。

「惑星」(わくせい) は、太陽のまわりを回る大きな星のことです。 名前について(英語)

目次

リファレンス · データ・線画・位置

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;
}

メンバー

名前型説明
bodyBodyId
look (省略可)Look | undefined
time (省略可)string | undefined

The date and time as an ISO string, or now: the body as the Earth sees it then. Left out, a portrait.

moons (省略可)boolean | undefined

A planet with its moons on their orbits (needs time).

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 zoom address key has it (1 is the whole body). Left out or 1, the page starts at Fit. Only the iframe way carries it: the element's own start is Fit.

例

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>

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/wakusei-planets 0.24.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。