{"_id":"@anaybucket/travel-atlas","_rev":"2-645fe5a2139268e730a6abee2b1650ca","name":"@anaybucket/travel-atlas","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@anaybucket/travel-atlas","version":"0.1.0","_id":"@anaybucket/travel-atlas@0.1.0","maintainers":[{"name":"anaybucket","email":"anay.bhakat@gmail.com"}],"dist":{"shasum":"8a60ff038af2692d2efcef19d59ab0db9f76427c","tarball":"https://registry.npmjs.org/@anaybucket/travel-atlas/-/travel-atlas-0.1.0.tgz","fileCount":51,"integrity":"sha512-zE0537qSRuIM9k5s0VktgA1E0kMVKeq/3ppTBCmwcFksGbv9JZ0w+/gaSUp+jO+NqMq5jQrfoEVh02CUJlIG0g==","signatures":[{"sig":"MEQCIBU8Mgc+mvdz4iB/QJ0BC2k7SP7UyHyidWC+I54Q1vKXAiBhemkWOBsrfGiqkmOPuV1MRcsleVDFgfBX2LS/KGyj2g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":245948},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./db":{"types":"./dist/db/index.d.ts","import":"./dist/db/index.js"},"./globe":{"types":"./dist/globe/index.d.ts","import":"./dist/globe/index.js"},"./gazetteer":{"types":"./dist/gazetteer/index.d.ts","import":"./dist/gazetteer/index.js"},"./style.css":"./dist/style.css"},"gitHead":"15fa6308bcef2dae2a15d2c0668bf41c869e3df3","scripts":{"dev":"vite --host 127.0.0.1","test":"bun test","build":"vite build && tsc -p tsconfig.build.json","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anaybucket","email":"anay.bhakat@gmail.com"},"_npmVersion":"11.8.0","description":"A React travel atlas for visited countries, planned places, and trip routes.","directories":{},"sideEffects":["dist/style.css","src/styles.css"],"_nodeVersion":"22.17.1","dependencies":{"d3-geo":"^3.1.1","iso-3166-1":"^2.1.1","world-atlas":"^2.0.2","topojson-client":"^3.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.9","devDependencies":{"vite":"^7.2.4","react":"^19.2.0","react-dom":"^19.2.0","@types/bun":"^1.3.14","typescript":"^5.9.3","@types/react":"^19.2.5","@types/d3-geo":"^3.1.0","all-the-cities":"^3.1.0","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^5.1.1","@types/all-the-cities":"^3.1.3","@types/topojson-client":"^3.1.5"},"peerDependencies":{"react":"^18.3.0 || ^19.0.0","react-dom":"^18.3.0 || ^19.0.0","all-the-cities":"^3.1.0"},"peerDependenciesMeta":{"all-the-cities":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/travel-atlas_0.1.0_1780355646162_0.6270975935509384","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@anaybucket/travel-atlas","version":"0.1.2","description":"A React travel atlas for visited countries, planned places, and trip routes.","type":"module","publishConfig":{"access":"public"},"packageManager":"bun@1.3.9","sideEffects":["dist/style.css","src/styles.css"],"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./db":{"types":"./dist/db/index.d.ts","import":"./dist/db/index.js"},"./gazetteer":{"types":"./dist/gazetteer/index.d.ts","import":"./dist/gazetteer/index.js"},"./globe":{"types":"./dist/globe/index.d.ts","import":"./dist/globe/index.js"},"./style.css":"./dist/style.css"},"scripts":{"dev":"vite --host 127.0.0.1","build":"vite build && tsc -p tsconfig.build.json","typecheck":"tsc --noEmit","test":"bun test"},"peerDependencies":{"all-the-cities":"^3.1.0","react":"^18.3.0 || ^19.0.0","react-dom":"^18.3.0 || ^19.0.0"},"peerDependenciesMeta":{"all-the-cities":{"optional":true}},"dependencies":{"d3-geo":"^3.1.1","iso-3166-1":"^2.1.1","topojson-client":"^3.1.0","world-atlas":"^2.0.2"},"devDependencies":{"@types/all-the-cities":"^3.1.3","@types/bun":"^1.3.14","@types/d3-geo":"^3.1.0","@types/react":"^19.2.5","@types/react-dom":"^19.2.3","@types/topojson-client":"^3.1.5","@vitejs/plugin-react":"^5.1.1","all-the-cities":"^3.1.0","react":"^19.2.0","react-dom":"^19.2.0","typescript":"^5.9.3","vite":"^7.2.4"},"gitHead":"2fbbd669049f9dcc4213680de9e78f505c529238","_id":"@anaybucket/travel-atlas@0.1.2","_nodeVersion":"22.17.1","_npmVersion":"11.8.0","dist":{"integrity":"sha512-0/NEJow2KzLis+a40Dep7ck0QUiwfDd6t6zfpX4KNNYBDUy5NDTsOmXH7DM2Mr7pl8nQIfZ+rFEd8dVzpXB1kA==","shasum":"2d1265fb77680fd92f50ab731e1a697886b8920d","tarball":"https://registry.npmjs.org/@anaybucket/travel-atlas/-/travel-atlas-0.1.2.tgz","fileCount":56,"unpackedSize":261705,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBP6t5+RcqVJW4V1IgOp3enI6RA+GQpgU4sFb24xjHAsAiB3eB/7q+k4QdDkbSAOCsjUVcL6U+AVkuyJ45k/CxAZoA=="}]},"_npmUser":{"name":"anaybucket","email":"anay.bhakat@gmail.com"},"directories":{},"maintainers":[{"name":"anaybucket","email":"anay.bhakat@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/travel-atlas_0.1.2_1780360790135_0.06000358370439618"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-01T23:14:05.954Z","modified":"2026-06-02T00:39:50.398Z","0.1.0":"2026-06-01T23:14:06.302Z","0.1.2":"2026-06-02T00:39:50.291Z"},"description":"A React travel atlas for visited countries, planned places, and trip routes.","maintainers":[{"name":"anaybucket","email":"anay.bhakat@gmail.com"}],"readme":"# Travel Atlas\n\nA React + TypeScript atlas component for visited countries, want-to-visit countries, city markers, and trip routes.\n\nThis package is intentionally data-first: your app owns the travel content, and the atlas renders it.\n\n## Features\n\n- Bundled Natural Earth world map via `world-atlas`.\n- ISO alpha-3 country authoring with internal numeric map-id lookup.\n- Zoomable/pannable SVG atlas up to `1000%`.\n- Optional orthographic globe renderer with drag rotation and projected routes.\n- Clickable country and city layers with nested label toggles.\n- City visibility is a superset of country visibility: turning cities on always shows countries too.\n- Country and city clicks select the country and refocus the map viewport.\n- Visited, lived, and want-to-visit country states.\n- Completed and planned trip routes.\n- Completed and planned trip layer toggles.\n- One-trip or all-trips route display modes.\n- Inverse-scaled markers that stay crisp while zooming.\n- Pure TypeScript helpers for route generation and data validation.\n- Country lookup helpers for name, alpha-2, alpha-3, and numeric ids.\n- Optional city gazetteer lookup through `@anaybucket/travel-atlas/gazetteer`.\n- Optional Bun SQLite adapter through `@anaybucket/travel-atlas/db`.\n\n## Install\n\n```bash\nbun add @anaybucket/travel-atlas\n```\n\n## Usage\n\n```tsx\nimport { TravelAtlas, type TravelCountry, type TravelTrip } from '@anaybucket/travel-atlas'\nimport '@anaybucket/travel-atlas/style.css'\n\nconst countries = [\n  {\n    code: 'JPN',\n    name: 'Japan',\n    coordinates: [138.2529, 36.2048],\n    status: 'visited',\n    cities: [\n      { id: 'tokyo', name: 'Tokyo', coordinates: [139.6917, 35.6895] },\n      { id: 'kyoto', name: 'Kyoto', coordinates: [135.7681, 35.0116] },\n    ],\n  },\n] satisfies TravelCountry[]\n\nconst trips = [\n  {\n    id: 'japan-2024',\n    name: 'Japan 2024',\n    status: 'completed',\n    stops: [\n      { countryCode: 'JPN', cityId: 'tokyo' },\n      { countryCode: 'JPN', cityId: 'kyoto' },\n    ],\n  },\n] satisfies TravelTrip[]\n\nexport function App() {\n  return <TravelAtlas countries={countries} trips={trips} enableZoom />\n}\n```\n\nCoordinates are always `[longitude, latitude]`.\n\nTrip routes default to showing one selected trip at a time. Set\n`defaultTripDisplayMode=\"all\"` when you want the atlas to initially show every\nvisible trip route while the selected trip still owns the detail panel and stop\nmarkers.\n\nTo render the same data as a simulated 3D globe, switch the renderer:\n\n```tsx\nexport function App() {\n  return <TravelAtlas countries={countries} trips={trips} renderer=\"globe\" />\n}\n```\n\nThe globe can also be imported directly from the optional subpath:\n\n```tsx\nimport { TravelGlobe } from '@anaybucket/travel-atlas/globe'\n```\n\n## Place Helpers\n\nCountries can be resolved from a name or code:\n\n```ts\nimport { createTravelCountry, createTravelCity } from '@anaybucket/travel-atlas'\n\nconst japan = createTravelCountry({\n  country: 'Japan',\n  status: 'visited',\n  cities: [\n    createTravelCity({\n      name: 'Osaka',\n      coordinates: [135.5023, 34.6937],\n    }),\n  ],\n})\n```\n\nCity coordinates still need to come from your data or a geocoder, but the helper\nkeeps ids and country metadata consistent.\n\n## Optional City Gazetteer\n\nFor admin scripts, install the optional city dataset:\n\n```bash\nbun add -D all-the-cities\n```\n\nThen use the package subpath:\n\n```ts\nimport {\n  createCityInputFromGazetteer,\n  findCity,\n} from '@anaybucket/travel-atlas/gazetteer'\nimport { upsertCity } from '@anaybucket/travel-atlas/db'\n\nconst tokyo = await findCity('Tokyo', { country: 'Japan' })\n\nif (tokyo) {\n  upsertCity(db, createCityInputFromGazetteer(tokyo))\n}\n```\n\nThis subpath is meant for Bun scripts, build steps, or admin tooling. It should\nnot be imported into the browser-rendered React app.\n\n## Optional SQLite Adapter\n\nThe React package works with plain data. If you want a tiny local database as\nthe source of truth, import the optional Bun-only adapter:\n\n```ts\nimport {\n  exportTravelAtlasData,\n  openTravelAtlasDatabase,\n  seedCountryCatalog,\n} from '@anaybucket/travel-atlas/db'\n\nconst db = openTravelAtlasDatabase('travel-atlas.sqlite')\n\nseedCountryCatalog(db)\n\nconst { countries, trips } = exportTravelAtlasData(db)\n```\n\nUse the `./db` entry in a Bun script, server route, or static build step, then\npass the exported `countries` and `trips` into `TravelAtlas`. The browser entry\npoint does not import `bun:sqlite`.\n\nThe adapter creates only the default atlas tables for countries, city nodes,\nwant-to-visit/visited/lived state, trips, and ordered trip stops. Custom website\ndata can live in your own SQLite tables beside those defaults and join through\n`country_code`, `(country_code, city_id)`, or `trip_id`.\n\n## Scripts\n\n```bash\nbun install\nbun test\nbun run typecheck\nbun run build\nbun run dev\n```\n\nThe demo app runs at the Vite URL printed by `bun run dev`.\n\n## Project Notes\n\n- [Architecture](docs/architecture.md)\n- [Optional database adapter](docs/database.md)\n- [Optional gazetteer](docs/gazetteer.md)\n- [Rendering direction](docs/rendering-direction.md)\n- [UI inspiration](docs/ui-inspiration.md)\n","readmeFilename":"README.md"}