Reference · Radical intersection and display forms
orderChosenfunction
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. A radical the grid does not have is dropped.
Import it
import { orderChosen } from "@johnmorrisdotca/bushu";
Definition
function orderChosen(radicals: readonly Radical[], chosen: readonly string[]): string[]
Parameters
| Name | Type | Description |
|---|---|---|
radicals | readonly Radical[] | The native radical entries; these inputs are read without mutation. |
chosen | readonly string[] | Chosen RADKFILE keys, interpreted as an intersection of all chosen parts. |
Returns
string[]
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. A radical the grid does not have is dropped.
Examples
import { RADKFILE } from "@johnmorrisdotca/bushu/radkfile";
import { orderChosen } from "@johnmorrisdotca/bushu";
const radicals = RADKFILE.radicals;
console.log(orderChosen(radicals,["田","汁"]));[ '汁', '田' ]What it prints (run when this page was built)