Maps
ts
import { createChart } from 'nervure';
import { loadMap } from 'nervure/maps';
const geo = await loadMap('countries/tn');
createChart(host, { type: 'map', geo, values: { 'TN-11': 1056, 'TN-61': 955 }, legend: true, zoom: true });Files
| Path | Holds |
|---|---|
world, continents | every country; every continent |
continents/africa … | the countries of a continent |
countries/tn … | the regions of a country, by its two-letter code |
france/departements, france/departements-outre-mer | French departments |
france/communes/75 … | the municipalities of a department |
They are fetched from this site and kept in memory. To serve them yourself, copy the maps folder and give its address: loadMap('world', '/maps'). Look at all of them.
Your own map
Any GeoJSON or TopoJSON works: pass it as geo, with key for the property that identifies a place and nameKey for its name.
Projections
mercator (default), equirectangular, naturalEarth for the world, conic for a country far from the equator, orthographic for a globe that can be turned.
Language
Maps hold name, name_fr and name_ar: nameKey: 'name_ar' shows Arabic names.