Reference
Register map elements
import { … } from "@johnmorrisdotca/chizu/element/define";
6247.2 kB minified and gzipped, with everything it imports (measured with esbuild)
Register the map, locator and quiz elements. Import for its browser-only effect; safe on a server.
Exports
| Name | Kind | What it is |
|---|---|---|
CHIZU_ELEMENT_OPTION_KEYS | constant | Real host option keys, kept complete by TypeScript and checked by the builder's coverage gate. |
ChizuElementOptions | type | Options that require host code rather than an HTML attribute. |
ChizuLocator | class | <chizu-locator>: locate a feature's id or a latitude,longitude pair, without contacting a geocoding service. |
ChizuMapElement | class | <chizu-map>: a map with highlights, labels, five-shade figures and keyboard selection. |
ChizuQuiz | class | <chizu-quiz>: repeatable questions from a seed, native answer events and no persisted score. |
defineLocator | function | Register <chizu-locator> or a host's own tag; an existing definition is preserved. |
defineMap | function | Register <chizu-map> or a host's own tag; an existing definition is preserved. |
defineQuiz | function | Register <chizu-quiz> or a host's own tag; an existing definition is preserved. |
loadElementMap | function | Load a built-in map by world, country-<ISO> or divisions-<ISO>. |
readMapColors | function | Parse region colours, including native CSS colours with commas inside rgb()/hsl(). |
readMapData | function | Parse finite choropleth figures; invalid JSON and nested or non-numeric values are rejected. |