本文へ移動

Suido水道

管を回してポンプと排水口をつなぎます。収録された問題やシード付きの問題で遊べます。

「水道」は、水を届ける設備を表す言葉です。 名前について(英語)

目次

リファレンス · SVGの盤

drawGuidePiece関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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 { drawGuidePiece } from "@johnmorrisdotca/suido/draw";

定義

function drawGuidePiece(piece: GuidePiece, options?: { style?: boolean; label?: string; }): string

引数

名前型説明
pieceGuidePiece

A guide piece with its example layout and caption.

options (省略可){ style?: boolean; label?: string; }

Drawing, mounting or generator choices specified by the signature.

戻り値

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.

例

import { drawGuidePiece } from "@johnmorrisdotca/suido/draw";
import { SUIDO_PIECE_GUIDE } from "@johnmorrisdotca/suido";

console.log(drawGuidePiece(SUIDO_PIECE_GUIDE[0]).startsWith("<svg"));
true

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/suido 1.7.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。