リファレンス
SVGで地図を描く
import { … } from "@johnmorrisdotca/chizu/draw";
最小化と gzip 圧縮をしたサイズは 16.2 kB(読み込むものをすべて含み、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.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
CHIZU_LOCAL_STYLE | 定数 | 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 | 定数 | 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 | 型 | What a drawing shows beyond the map itself. |
ChizuLocalDrawOptions | 型 | What a drawing of a local map shows beyond the shapes. |
ChizuLocalStyle | 型 | 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 | 関数 | 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 | 関数 | 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 | 関数 | Whether colour is one drawChizu's colors will draw. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。