dayNightSvgfunction
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 it
import { dayNightSvg } from "@johnmorrisdotca/chikyu-earth/sheets";
Definition
function dayNightSvg(ms: number, options: SheetOptions): string
Parameters
| Name | Type | Description |
|---|---|---|
ms | number | The moment, in milliseconds since the Unix epoch. |
options | SheetOptions | The room, the language and the type. |
Returns
string
The <svg> markup, carrying the place of the Sun as data-sun.
Examples
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 trueWhat it prints (run when this page was built)