リファレンス
KanjiVG由来の筆順:描く、描いた漢字から探す
import { … } from "@johnmorrisdotca/jisho/strokes";
最小化と gzip 圧縮をしたサイズは 1083.8 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The stroke order of a kanji: the strokes in the order they are written, each as the SVG path KanjiVG draws it with in a square of
109 by 109, drawn as an SVG that writes itself stroke by stroke, and a search by drawing a kanji that compares the strokes as they were
drawn with these. The strokes are made from KanjiVG (CC BY-SA 3.0) and are in pieces of about 20 kB gzipped, each holding some kanji, which
loadStrokes fetches for the kanji it is asked about and loadAllStrokes for all of them, as a search by drawing needs.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
DrawingMatch | 型 | What findByDrawing gives for a kanji: the kanji, and how far its strokes are from the drawn ones (0 is the same, and about 0.1 a careful hand). |
findByDrawing | 関数 | The kanji whose strokes are nearest to what was drawn, nearest first. |
loadAllStrokes | 関数 | The strokes of every kanji the table has, about 1.1 MB gzipped in 57 pieces, as a search by drawing needs them. |
loadStrokes | 関数 | The strokes of the kanji in a text, fetched: one piece of about 20 kB gzipped for each place they are in. |
PackedStrokes | 型 | The table of the strokes as the data file holds it: where it was made from, the release, and for each kanji its paths, apart by "|". |
pathPoints | 関数 | Points along a path: its curves cut into steps straight pieces each. |
Point | 型 | A point of a drawing or of a stroke: x then y, in the units of whoever drew it. |
STROKE_BOX | 定数 | The side of the square KanjiVG draws in. |
StrokeOrderOptions | 型 | How a drawing of the strokes looks and moves. |
strokeOrderSvg | 関数 | The strokes as an SVG, text a page can put in an element or a server can send: each stroke is a path, and with animate each is written in its turn with CSS that the SVG carries, so that it needs no script and works where an <img> does not. |
strokesOf | 関数 | The strokes of a kanji in the order they are written, each as an SVG path. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。