lineupSvg関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The whole picture as SVG text. Unknown items are left out.
インポート
import { lineupSvg } from "@johnmorrisdotca/uchusen-rockets/build";
定義
function lineupSvg(options: LineupOptions): { svg: string; items: LineupItem[]; real: LineupItem[]; width: number; height: number; unit: number; }
引数
| 名前 | 型 | 説明 |
|---|---|---|
options | LineupOptions | The items and how they are drawn. |
戻り値
{ svg: string; items: LineupItem[]; real: LineupItem[]; width: number; height: number; unit: number; }
The picture as SVG text, the items it holds, the real craft lying beside the fleet (real, with their lengths), its width and height and the scale it was drawn at (pixels a metre: less than unit when fit shrank it).
例
import { lineupSvg } from "@johnmorrisdotca/uchusen-rockets/build";
const picture = lineupSvg({ items: ["falcon-9:block-5", "falcon-heavy:falcon-heavy", "person"], unit: 4, ruler: true });
console.log(picture.items.length, picture.svg.startsWith("<svg"));3 true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。