Reference · A star drawn from its numbers as SVG, and next to the Sun
PortraitOptionstype
How a portrait or a comparison is drawn.
Import it
import type { PortraitOptions } from "@johnmorrisdotca/hoshi-stars/portrait";
Definition
interface PortraitOptions {
size?: number;
lang?: "en" | "ja";
name?: string;
background?: "space" | "none";
captions?: boolean;
}
Members
| Name | Type | Description |
|---|---|---|
size (optional) | number | undefined | The width in pixels (the picture scales, so this only sets its default size). Default 240 for a portrait and 360 for a comparison. |
lang (optional) | "en" | "ja" | undefined | The language of the words in the picture: |
name (optional) | string | undefined | The star's name, used in the picture's title and, in the comparison, as the star's label. |
background (optional) | "none" | "space" | undefined | Draw the dark sky behind ( |
captions (optional) | boolean | undefined | Print the lines "drawn from its numbers, not a photo" and "a generic look, not this star's surface" under the portrait. Default true. |
Examples
import type { PortraitOptions } from "@johnmorrisdotca/hoshi-stars/portrait";
const options: PortraitOptions = { size: 320, lang: "ja", name: "ベテルギウス" };
console.log(options.size);320What it prints (run when this page was built)