リファレンス
数字の盤のSVG
import { … } from "@johnmorrisdotca/kazu/draw";
最小化と gzip 圧縮をしたサイズは 12.7 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Kazu's drawing: a puzzle as SVG text, with the style that gives it its look, and where everything sits
in it (so a page can tell which cell a finger is over). A separate entry
(@johnmorrisdotca/kazu/draw), so a server that only checks an answer never loads any of it.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
drawKazu | 関数 | A PUZZLE AS SVG TEXT: the grid with its printed numbers, whatever has been written in it, pencil marks, and everything the kind of puzzle prints: the heavier rules round the boxes or a Jigsaw's regions, the shaded diagonals, a cage's dashed outline with its sum, the more-than marks between cells, and the tower clues round the edge. |
drawShikaku | 関数 | SVG text with only the public clues and the player's rectangles. |
KAZU_CELL | 定数 | The units of a cell, and the margin round the drawing. |
KAZU_NAMES | 定数 | Bilingual puzzle names, aliases, rules, origins and introductory copy by native kind. |
KAZU_SIZE_NAMES | 定数 | What each side is for, under its size on a chooser: the quick one, the usual one, the long one. |
KAZU_STRINGS | 定数 | Native English and Japanese labels, announcements and interpolation templates for the number grid. |
KAZU_STYLE | 定数 | THE STYLE a Kazu drawing wears: the colours of its board as custom properties, and the one rule that matters for a puzzle played with fingers: nothing in the drawing can be selected, dragged or double-tapped. |
kazuCellName | 関数 | A cell as a screen reader names it: "row 3, column 5". |
KazuDrawOptions | 型 | What a drawing shows beyond the puzzle itself. |
kazuGeometry | 関数 | Where everything is in the drawing of a puzzle of this kind and side. |
KazuGeometry | 型 | WHERE EVERYTHING IS IN A DRAWING, so a page of your own can play it: the drawing is a square of side units, every cell cell units across, and a Towers square sits inside a ring one cell deep that holds its clues. |
KazuLanguage | 型 | THE WORDS A KAZU BOARD SAYS, in English and Japanese: what a screen reader hears of the drawing, the buttons and lines under a playable board, and what a hint says. |
kazuLanguageOf | 関数 | The language a piece of text is in: Japanese for anything starting ja, English for everything else. |
KazuName | 型 | WHAT EACH PUZZLE IS CALLED, and what it is, in English and Japanese: the name a player searches for, its Japanese name, a line saying how it is played, and a few lines of rules. |
kazuNameOf | 関数 | What a puzzle is called in a language, as a screen reader says it. |
kazuSay | 関数 | A line in a language, with its values filled in; the line itself if there is none by that name. |
kazuWhere | 関数 | The words for the groups a number is ruled out by, for a hint's line: "its row, column and box". |
ShikakuDrawOptions | 型 | Current Shikaku marks or entries, selection, errors and native SVG appearance choices. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。