SvgOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What a drawing is asked for: the look, the view, what to show and whether the engines are lit. Anything left out takes its default.
インポート
import type { SvgOptions } from "@johnmorrisdotca/uchusen-rockets/build";
定義
interface SvgOptions {
look?: LookName;
view?: ViewName | Angle;
show?: string;
engines?: boolean | Readonly<Record<string, number>>;
moves?: Readonly<Record<string, Readonly<Record<string, number>>>>;
only?: readonly string[];
frame?: Bounds;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
look (省略可) | "line" | "thick" | "painted" | undefined | |
view (省略可) | "three-quarter" | "front" | "back" | "side" | "below" | Angle | undefined | |
show (省略可) | string | undefined | |
engines (省略可) | boolean | Readonly<Record<string, number>> | undefined | A flame at each engine that is showing, or as many as a count names for each part. The length is a picture, not a measured flame. Left out, the drawing is unchanged. |
moves (省略可) | Readonly<Record<string, Readonly<Record<string, number>>>> | undefined | Degrees each moving group of each part is turned from where it is drawn at rest, by slot and then by name: |
only (省略可) | readonly string[] | undefined | Only these slots, closed up into one stack, centred in |
frame (省略可) | Bounds | undefined | The bounds the picture is fitted to, from another build's |
例
import { build, type SvgOptions } from "@johnmorrisdotca/uchusen-rockets/build";
const options: SvgOptions = { look: "thick", view: "below", show: "booster" };
console.log(build({ rocket: "starship", variant: "v3" }).svg(options).startsWith("<svg"));true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。