globe関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The globe as an SVG string, turned to rotation and drawn in style, size pixels square. It is pure: the same options always give the same markup, so it runs on a server, in a test or in a build step with no DOM.
インポート
import { globe } from "@johnmorrisdotca/chikyu-earth";
定義
function globe(options?: GlobeOptions): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
options (省略可) | GlobeOptions | Size, turn, look and graticule; every one has a default, so |
戻り値
string
One <svg> element as text, with the country outlines as paths.
例
import { globe } from "@johnmorrisdotca/chikyu-earth";
const svg = globe({ size: 240, rotation: [-139.7, -35.7], style: "line" });
console.log(svg.slice(0, 60));
console.log(svg.length > 10_000);<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240
true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。