リファレンス · 数値から描いた星のSVGの絵と、太陽との大きさくらべ
PortraitOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
How a portrait or a comparison is drawn.
インポート
import type { PortraitOptions } from "@johnmorrisdotca/hoshi-stars/portrait";
定義
interface PortraitOptions {
size?: number;
lang?: "en" | "ja";
name?: string;
background?: "space" | "none";
captions?: boolean;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
size (省略可) | 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 (省略可) | "en" | "ja" | undefined | The language of the words in the picture: |
name (省略可) | string | undefined | The star's name, used in the picture's title and, in the comparison, as the star's label. |
background (省略可) | "none" | "space" | undefined | Draw the dark sky behind ( |
captions (省略可) | 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. |
例
import type { PortraitOptions } from "@johnmorrisdotca/hoshi-stars/portrait";
const options: PortraitOptions = { size: 320, lang: "ja", name: "ベテルギウス" };
console.log(options.size);320出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。