Reference · The globe as an SVG string
globefunction
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 it
import { globe } from "@johnmorrisdotca/chikyu-earth";
Definition
function globe(options?: GlobeOptions): string
Parameters
| Name | Type | Description |
|---|---|---|
options (optional) | GlobeOptions | Size, turn, look and graticule; every one has a default, so |
Returns
string
One <svg> element as text, with the country outlines as paths.
Examples
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
trueWhat it prints (run when this page was built)