Reference
Draw maps as SVG
import { … } from "@johnmorrisdotca/chizu/draw";
16.2 kB minified and gzipped, with everything it imports (measured with esbuild)
Chizu's drawing: a map as SVG text (drawChizu) and a city or a venue as SVG text (drawLocal), with the style that gives it its look. A separate entry
(@johnmorrisdotca/chizu/draw), so a page that only needs to know which country is nearest never loads any of it.
Exports
| Name | Kind | What it is |
|---|---|---|
CHIZU_LOCAL_STYLE | constant | THE LOOK OF A LOCAL MAP (drawLocal), as CSS that goes beside CHIZU_STYLE: the ground, and the shapes a caller's GeoJSON draws, in the same custom properties and the same light and dark. |
CHIZU_STYLE | constant | THE STYLE a chizu drawing wears: the colours of its land and sea as custom properties, and the one rule that matters for a map pressed with fingers: nothing in the drawing can be selected, dragged or double-tapped. |
ChizuDrawOptions | type | What a drawing shows beyond the map itself. |
ChizuLocalDrawOptions | type | What a drawing of a local map shows beyond the shapes. |
ChizuLocalStyle | type | How one shape of a local map looks, over the look of its kind: colours as drawChizu's colors takes them (hex, a CSS name, rgb(), hsl() or var(--name), anything else ignored), with a second for the dark look, and the classes and custom properties of your own. |
drawChizu | function | A map as SVG text: the sea, every region's land with its tone, the frames of its insets, and optionally the names and the numbered callouts. |
drawLocal | function | A local map as SVG text: the ground, the caller's shapes in the order given (areas, lines, points), the pictures at their places, true size and bearing, and optionally names, numbered callouts, a scale bar in metres and the credit lines. |
isChizuColour | function | Whether colour is one drawChizu's colors will draw. |