{"_id":"@affino/world-map-core","name":"@affino/world-map-core","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@affino/world-map-core","version":"0.1.0","author":{"name":"Anton Pavlov","email":"a.pavlov@affino.dev"},"type":"module","description":"Headless world map core types and utilities for Affino map features","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"main":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/affinio/affinio.git","directory":"packages/world-map-core"},"homepage":"https://github.com/affinio/affinio/tree/main/packages/world-map-core#readme","license":"MIT","keywords":["affino","world-map","map","headless","core"],"devDependencies":{"vitest":"^4.0.18"},"bugs":{"url":"https://github.com/affinio/affinio/issues"},"module":"dist/index.js","scripts":{"build":"tsc -p tsconfig.json","type-check":"tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit","test":"vitest run --config ./vitest.config.ts"},"_id":"@affino/world-map-core@0.1.0","_integrity":"sha512-a3S2uwlLPpw/y/+ZMRXKdKN5Vdt4lMJ6l1OcSi3zYpYvTEZIpoZrskNrU8Uk4crSCs+nxYYTXPQ8J6U6Tr9acg==","_resolved":"/tmp/989919f312e1b8ecef028d6e2ea0aaa0/affino-world-map-core-0.1.0.tgz","_from":"file:affino-world-map-core-0.1.0.tgz","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-a3S2uwlLPpw/y/+ZMRXKdKN5Vdt4lMJ6l1OcSi3zYpYvTEZIpoZrskNrU8Uk4crSCs+nxYYTXPQ8J6U6Tr9acg==","shasum":"2f8077b9447f2a3db964a583d46350f80af32371","tarball":"https://registry.npmjs.org/@affino/world-map-core/-/world-map-core-0.1.0.tgz","fileCount":15,"unpackedSize":15363,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCkkXBficOhXSGflHlUml5I/6UugOFECskQN7grOG8nIwIgVsQ01Q3iFXmMBngfmNQCIpssddbaU/FgtHuO1yC1ugw="}]},"_npmUser":{"name":"affino","email":"anton.pavlov.personal@gmail.com"},"directories":{},"maintainers":[{"name":"affino","email":"anton.pavlov.personal@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/world-map-core_0.1.0_1779187133135_0.2009790294353746"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T10:38:53.023Z","0.1.0":"2026-05-19T10:38:53.331Z","modified":"2026-05-19T10:38:53.540Z"},"maintainers":[{"name":"affino","email":"anton.pavlov.personal@gmail.com"}],"description":"Headless world map core types and utilities for Affino map features","homepage":"https://github.com/affinio/affinio/tree/main/packages/world-map-core#readme","keywords":["affino","world-map","map","headless","core"],"repository":{"type":"git","url":"git+https://github.com/affinio/affinio.git","directory":"packages/world-map-core"},"author":{"name":"Anton Pavlov","email":"a.pavlov@affino.dev"},"bugs":{"url":"https://github.com/affinio/affinio/issues"},"license":"MIT","readme":"# @affino/world-map-core\n\nHeadless world map core types and utilities for reusable Affino world map features.\n\nThis package has no UI, renderer, Vue, React, DOM, SVG, Canvas, WebGL, MapLibre, D3, topojson, or chart dependencies.\n\n## Core\n\n```ts\nimport { createWorldMapCore } from \"@affino/world-map-core\"\n\nconst core = createWorldMapCore()\n// { version: \"0.1.0\" }\n```\n\n## Country Features\n\n```ts\nimport type { WorldMapCountryFeature } from \"@affino/world-map-core\"\n\nconst feature: WorldMapCountryFeature = {\n  id: \"US\",\n  name: \"United States\",\n  iso2: \"US\",\n  iso3: \"USA\",\n  geometry: {\n    type: \"Polygon\",\n    coordinates: [[\n      { lon: -124.7844, lat: 24.7433 },\n      { lon: -66.9514, lat: 24.7433 },\n      { lon: -66.9514, lat: 49.3458 },\n    ]],\n  },\n}\n```\n\n## Projection\n\n```ts\nimport { projectWorldMapPosition } from \"@affino/world-map-core\"\n\nconst point = projectWorldMapPosition(\n  { lon: 0, lat: 0 },\n  { viewport: { width: 360, height: 180 } },\n)\n\n// { x: 180, y: 90 }\n```\n\nThe default projection is `equirectangular`.\n\n## Path Data\n\n```ts\nimport { createWorldMapPath } from \"@affino/world-map-core\"\n\nconst pathFeature = createWorldMapPath(feature, {\n  viewport: { width: 360, height: 180 },\n  precision: 2,\n  antimeridianStrategy: \"break-lines\",\n})\n\n// { id, name, iso2, iso3, path, properties }\n```\n\n`Polygon` and `MultiPolygon` rings are projected with the selected projection and emitted as SVG path data. Empty rings are skipped.\n\nBy default, paths use `antimeridianStrategy: \"break-lines\"` to unwrap rings that cross the antimeridian. Compact edge-crossing rings may emit shifted copies at the map edges to preserve local closure, while larger mainland rings keep the primary visible copy to avoid duplicating whole countries outside the viewport. Use `antimeridianStrategy: \"none\"` to preserve direct line commands across the antimeridian.\n\n## Non-Goals For v0.1\n\n- No renderer components.\n- No DOM, SVG, Canvas, or WebGL integration.\n- No MapLibre, D3, topojson, or chart dependencies.\n- No Mercator projection yet.\n- No fit-to-bounds, zoom, pan, or topology processing yet.\n","readmeFilename":"README.md","_rev":"1-5dc97890eed170db88e114c109b37b43"}