リファレンス · 印刷できるシート: 色をぬる地球と世界地図、わたしの国、昼と夜、季節
dayNightSvg関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The day and night sheet: the Earth with the Sun's light coming from the right, the lit half left white (day) and the dark half hatched (night), the line between them thick, and three facts, for the date and time you give. The line is worked out from the package's own sun position.
インポート
import { dayNightSvg } from "@johnmorrisdotca/chikyu-earth/sheets";
定義
function dayNightSvg(ms: number, options: SheetOptions): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
ms | number | The moment, in milliseconds since the Unix epoch. |
options | SheetOptions | The room, the language and the type. |
戻り値
string
The <svg> markup, carrying the place of the Sun as data-sun.
例
import { dayNightSvg } from "@johnmorrisdotca/chikyu-earth/sheets";
const svg = dayNightSvg(Date.UTC(2026, 5, 21, 12), { widthMm: 184.6, heightMm: 180 });
console.log(svg.includes("data-sun="), svg.includes("Night"));true true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。