本文へ移動

Chizu地図

SVGの地図を描き、地域を表示範囲に収め、番号付きの注記や地理クイズを英語と日本語の名前で作れます。

「地図」は、土地や場所を図で表したものです。 名前について(英語)

目次

リファレンス

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.

ソースを見るGitHub で編集@johnmorrisdotca/chizu 1.5.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。