Reference · Build a mesh and a drawing
lineupSvgfunction
The whole picture as SVG text. Unknown items are left out.
Import it
import { lineupSvg } from "@johnmorrisdotca/uchusen-rockets/build";
Definition
function lineupSvg(options: LineupOptions): { svg: string; items: LineupItem[]; real: LineupItem[]; width: number; height: number; unit: number; }
Parameters
| Name | Type | Description |
|---|---|---|
options | LineupOptions | The items and how they are drawn. |
Returns
{ 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).
Examples
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 trueWhat it prints (run when this page was built)