drawGuidePiecefunction
A piece of the guide (SUIDO_PIECE_GUIDE) as SVG text: its tiny board drawn by drawSuido, with the water in it where the guide says
the picture has some, and the piece's name as its description for a screen reader. style puts the board's style inside the drawing, so it
stands alone as an image.
Import it
import { drawGuidePiece } from "@johnmorrisdotca/suido/draw";
Definition
function drawGuidePiece(piece: GuidePiece, options?: { style?: boolean; label?: string; }): string
Parameters
| Name | Type | Description |
|---|---|---|
piece | GuidePiece | A guide piece with its example layout and caption. |
options (optional) | { style?: boolean; label?: string; } | Drawing, mounting or generator choices specified by the signature. |
Returns
string
A piece of the guide (SUIDO_PIECE_GUIDE) as SVG text: its tiny board drawn by drawSuido, with the water in it where the guide says the picture has some, and the piece's name as its description for a screen reader. style puts the board's style inside the drawing, so it stands alone as an image.
Examples
import { drawGuidePiece } from "@johnmorrisdotca/suido/draw";
import { SUIDO_PIECE_GUIDE } from "@johnmorrisdotca/suido";
console.log(drawGuidePiece(SUIDO_PIECE_GUIDE[0]).startsWith("<svg"));trueWhat it prints (run when this page was built)