LineupOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What a lineup is asked for: the items by key, how many pixels make a metre, and optionally the look, the view, what to show, a ruler and labels.
インポート
import type { LineupOptions } from "@johnmorrisdotca/uchusen-rockets/build";
定義
interface LineupOptions {
items: readonly string[];
unit: number;
look?: LookName;
view?: ViewName;
show?: string;
ruler?: boolean;
labels?: boolean;
real?: boolean;
filter?: "all" | "rockets" | "fleet";
fit?: {
width?: number;
height?: number;
};
pose?: "stand";
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
items | readonly string[] | "starship:v1,starship:v3,person,building". |
unit | number | Pixels a metre. |
look (省略可) | "line" | "thick" | "painted" | undefined | |
view (省略可) | "three-quarter" | "front" | "back" | "side" | "below" | undefined | |
show (省略可) | string | undefined | |
ruler (省略可) | boolean | undefined | |
labels (省略可) | boolean | undefined | |
real (省略可) | boolean | undefined | Real craft for scale: Starship with Super Heavy, Saturn V, SLS and the ISS lie sideways in the fleet band, at the same scale as the fleet ships, nose right, each labelled with its name and length. Left out: not drawn. Only where the fleet band is. |
filter (省略可) | "all" | "rockets" | "fleet" | undefined |
|
fit (省略可) | { width?: number; height?: number; } | undefined | Shrinks the scale, never grows it, until the whole drawing fits this many pixels across and down (either may be left out). Without it the scale is |
pose (省略可) | "stand" | undefined |
|
例
import { lineupSvg, type LineupOptions } from "@johnmorrisdotca/uchusen-rockets/build";
const options: LineupOptions = { items: ["starship:v2", "starship:v3", "building"], unit: 3, ruler: true, labels: true };
console.log(lineupSvg(options).width);342出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。