ChizuDrawOptionstype
What a drawing shows beyond the map itself. Every part is optional: a map alone is its land on its sea.
Import it
import type { ChizuDrawOptions } from "@johnmorrisdotca/chizu/draw";
Definition
type ChizuDrawOptions = {
box?: MapBox;
language?: ChizuLanguage;
tones?: Readonly<Record<string, string>>;
colors?: Readonly<Record<string, string>>;
callouts?: readonly string[] | Omit<CalloutRequest, "box">;
labels?: boolean | readonly string[];
insetFrames?: boolean;
interactive?: boolean;
label?: string;
style?: boolean;
features?: readonly ChizuFeatureChoice[];
featureLayer?: ChizuFeatureLayer | null;
featureLabels?: boolean;
};
Members
| Name | Type | Description |
|---|---|---|
box (optional) | MapBox | undefined | The window to show: a part of the map, as |
language (optional) | ChizuLanguage | undefined | The language of the names a screen reader hears, and of the labels. Default |
tones (optional) | Readonly<Record<string, string>> | undefined | A tone for each region, by code: |
colors (optional) | Readonly<Record<string, string>> | undefined | A colour for each region, by code: |
callouts (optional) | readonly string[] | Omit<CalloutRequest, "box"> | undefined | Numbered circles in open water with leader lines to these regions ( |
labels (optional) | boolean | readonly string[] | undefined | Print the names on the land: all the regions that are big enough to hold theirs, or just these. |
insetFrames (optional) | boolean | undefined | Draw a dashed frame round each inset. Default true. |
interactive (optional) | boolean | undefined | Give every region its |
label (optional) | string | undefined | What a screen reader hears of the drawing, instead of "Map of the world". |
style (optional) | boolean | undefined | Put |
features (optional) | readonly ChizuFeatureChoice[] | undefined | Which named features to draw from |
featureLayer (optional) | ChizuFeatureLayer | null | undefined | The map's named features: |
featureLabels (optional) | boolean | undefined | Print the features' names. Default true. |
Examples
import WORLD from "@johnmorrisdotca/chizu/world";
import { drawChizu, type ChizuDrawOptions } from "@johnmorrisdotca/chizu/draw";
const options: ChizuDrawOptions = { language: "ja", tones: { JP: "selected" }, style: true };
console.log(drawChizu(WORLD, options).includes('data-tone="selected"'));
// truetrueWhat it prints (run when this page was built)