Reference
Number-grid SVG
import { … } from "@johnmorrisdotca/kazu/draw";
12.7 kB minified and gzipped, with everything it imports (measured with 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.
Exports
| Name | Kind | What it is |
|---|---|---|
drawKazu | function | 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 | function | SVG text with only the public clues and the player's rectangles. |
KAZU_CELL | constant | The units of a cell, and the margin round the drawing. |
KAZU_NAMES | constant | Bilingual puzzle names, aliases, rules, origins and introductory copy by native kind. |
KAZU_SIZE_NAMES | constant | What each side is for, under its size on a chooser: the quick one, the usual one, the long one. |
KAZU_STRINGS | constant | Native English and Japanese labels, announcements and interpolation templates for the number grid. |
KAZU_STYLE | constant | 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 | function | A cell as a screen reader names it: "row 3, column 5". |
KazuDrawOptions | type | What a drawing shows beyond the puzzle itself. |
kazuGeometry | function | Where everything is in the drawing of a puzzle of this kind and side. |
KazuGeometry | type | 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 | type | 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 | function | The language a piece of text is in: Japanese for anything starting ja, English for everything else. |
KazuName | type | 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 | function | What a puzzle is called in a language, as a screen reader says it. |
kazuSay | function | A line in a language, with its values filled in; the line itself if there is none by that name. |
kazuWhere | function | The words for the groups a number is ruled out by, for a hint's line: "its row, column and box". |
ShikakuDrawOptions | type | Current Shikaku marks or entries, selection, errors and native SVG appearance choices. |