Reference
Radical intersection and display forms
import { … } from "@johnmorrisdotca/bushu";
0.9 kB minified and gzipped, with everything it imports (measured with esbuild)
Bushu 部首, the radical lookup: find a kanji by the parts it is made of, with no page and no data needed.
kanjiForRadicalsandusableRadicals: the kanji that hold every chosen part, and the parts that can still narrow them (the dimming of a picker).radicalGroups,orderChosenandradicalsInKanji: the grid by stroke count, the choice in the grid's order, and the parts of one kanji.radicalFormandwithCorrectedStrokes: RADKFILE's stand-ins (汁 for 氵) turned back into the shapes people see, and its two wrong stroke counts put right.
The data is in /radkfile (the radicals), /names (さんずい, にんべん, くさかんむり) and /strokes (the strokes of a kanji), and the picker to put in a page in /picker.
Exports
| Name | Kind | What it is |
|---|---|---|
isRadicalStandIn | function | True when the key is a stand-in, so that the form, not the key, is the thing to draw and to name. |
kanjiForRadicals | function | The kanji that hold every one of the chosen radicals, in the order of the first radical's list (the dictionary's own). |
orderChosen | function | The chosen radicals in the grid's own order, not the order they were clicked, so the choice reads as a row of the grid. |
Radical | type | A radical, or a common element of kanji, as RADKFILE lists it. |
RADICAL_FORMS | constant | WHAT A RADKFILE RADICAL LOOKS LIKE, AS OPPOSED TO WHAT IT IS KEYED BY. |
radicalForm | function | The shape to draw for a RADKFILE key: the stand-in's own shape (汁 gives 氵), or the key itself where it already is the shape. |
RadicalGroup | type | The radicals that share a stroke count, as the grid of a picker draws them. |
radicalGroups | function | The grid: the radicals in stroke-count order, grouped by the count, in the order they were given within a count. |
radicalsInKanji | function | The radicals a character is written with, fewest strokes first. |
radicalStrokes | function | The stroke count to file a RADKFILE radical under: its own, except for the two it miscounts. |
RADKFILE_STROKE_CORRECTIONS | constant | THE TWO STROKE COUNTS RADKFILE GETS WRONG. |
usableRadicals | function | The radicals that can still narrow what is left: every one that appears in at least one of the kanji that match now. |
VERSION | constant | The package's version. |
withCorrectedStrokes | function | The radicals with the two miscounts put right, as new entries in the same order. |