本文へ移動

Wakusei Planets惑星

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

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

目次

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

LineupEmbed型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The size line-up to put in a page: which stars, the planets, how they stand, where the camera starts, and how wide it is.

インポート

import type { LineupEmbed } from "@johnmorrisdotca/wakusei-planets";

定義

interface LineupEmbed {
    stars?: LineupSet | readonly string[];
    planets?: boolean;
    layout?: LineupLayout;
    at?: string;
    zoom?: number;
    turn?: boolean;
    look?: "realistic" | "painted";
    lang?: "en" | "ja";
    width?: number;
}

メンバー

名前型説明
stars (省略可)readonly string[] | "all" | "bright" | "largest" | undefined

all (the default), bright or largest, or a list of ids from LINEUP_STARS.

planets (省略可)boolean | undefined

Add the Earth and Jupiter.

layout (省略可)"row" | "stack" | undefined

row (the default) or stack.

at (省略可)string | undefined

The id of the body the camera starts on; the Sun when left out.

zoom (省略可)number | undefined

Where the camera starts, 0 to 1 (over at).

turn (省略可)boolean | undefined

False stops the bodies turning by themselves.

look (省略可)"realistic" | "painted" | undefined

The planets' look: realistic (the default) or painted.

lang (省略可)"en" | "ja" | undefined

The words: en (the default) or ja.

width (省略可)number | undefined

Pixels across; default 720.

例

import { lineupCode, type LineupEmbed } from "@johnmorrisdotca/wakusei-planets";

const options: LineupEmbed = { stars: "bright", planets: true, at: "betelgeuse", width: 720 };
console.log(lineupCode(options, "html"));
<script type="module" src="https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.29.0/lineup/+esm"></script>

<wakusei-lineup stars="bright" planets at="betelgeuse"></wakusei-lineup>

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

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

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