Reference · Stroke order from KanjiVG: draw it, and find a kanji by drawing it
loadStrokesfunction
The strokes of the kanji in a text, fetched: one piece of about 20 kB gzipped for each place they are in. Anything that is not a kanji the table has is left out of the answer.
Import it
import { loadStrokes } from "@johnmorrisdotca/jisho/strokes";
Definition
function loadStrokes(text: string): Promise<PackedStrokes>
Parameters
| Name | Type | Description |
|---|---|---|
text | string | A kanji, or a text with some. |
Returns
Promise<PackedStrokes>
A table to give strokesOf, strokeOrderSvg and findByDrawing, with those kanji in it.
Examples
import { loadStrokes, strokesOf } from "@johnmorrisdotca/jisho/strokes";
console.log(strokesOf(await loadStrokes("日本"), "日").length); // 44What it prints (run when this page was built)