drawSuidofunction
A board as SVG text. The pieces face as options.masks say, with the water
in them as it runs from the pumps through every opening that meets another.
The drawing is class="suido"; its colours and its flowing are SUIDO_STYLE.
Import it
import { drawSuido } from "@johnmorrisdotca/suido/draw";
Definition
function drawSuido(layout: Layout, options?: DrawOptions): string
Parameters
| Name | Type | Description |
|---|---|---|
layout | Layout | The decoded board with its dimensions, pipe masks and rule settings. |
options (optional) | DrawOptions | Drawing, mounting or generator choices specified by the signature. |
Returns
string
A board as SVG text. The pieces face as options.masks say, with the water in them as it runs from the pumps through every opening that meets another. The drawing is class="suido"; its colours and its flowing are SUIDO_STYLE.
Examples
import { SUIDO_5X5 } from "@johnmorrisdotca/suido/levels-5x5";
import { decodeLayout } from "@johnmorrisdotca/suido";
import { drawSuido } from "@johnmorrisdotca/suido/draw";
const row = SUIDO_5X5[0];
const code = row[0];
const layout = decodeLayout(code)!;
console.log(drawSuido(layout,{label:"Sample board"}).startsWith("<svg"));trueWhat it prints (run when this page was built)