本文へ移動

Wakusei Planets惑星

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

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

目次

リファレンス · 子ども向けのぬりえ: 太陽・惑星・大きな衛星を太い線の絵にして、本当の色と3つのことがらをつけます。すべての惑星を同じ縮尺で一列にならべた絵も。英語と日本語

kidsSvg関数

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

One sheet as an SVG string measured in millimetres: the picture of the body, the colours to colour it with and three facts, in English or Japanese; or the lineup of all the planets at one scale. widthMm and heightMm are the room it is drawn for (kidsRoom), and the viewBox is that room, so a millimetre is a millimetre on paper.

インポート

import { kidsSvg } from "@johnmorrisdotca/wakusei-planets/sheets";

定義

function kidsSvg(id: KidsSheet, options: { widthMm: number; heightMm: number; lang?: Lang; }): string

引数

名前型説明
id"sun" | "mercury" | "venus" | "earth" | "mars" | "jupiter" | "saturn" | "uranus" | "neptune" | "pluto" | "moon" | "io" | "europa" | "ganymede" | "callisto" | "titan" | "triton" | "charon" | "lineup"

A body with a sheet, or lineup.

options{ widthMm: number; heightMm: number; lang?: Lang; }

The room, and the language.

戻り値

string

The <svg> markup.

例

import { kidsRoom, kidsSvg } from "@johnmorrisdotca/wakusei-planets/sheets";

const room = kidsRoom("a4");
console.log(kidsSvg("saturn", { ...room, lang: "en" }).includes("Colour me!"));
true

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

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

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