{"_id":"@abez/uzb-map","_rev":"3-cbc7827131d38741883f335a33ec276f","name":"@abez/uzb-map","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@abez/uzb-map","version":"0.1.0","keywords":["react","svg","map","uzbekistan","choropleth","geo","topojson","shadcn"],"author":"","license":"MIT","_id":"@abez/uzb-map@0.1.0","maintainers":[{"name":"lastninja294","email":"lastninja294@gmail.com"}],"homepage":"https://github.com/lastninja294/uzb-map#readme","bugs":{"url":"https://github.com/lastninja294/uzb-map/issues"},"dist":{"shasum":"5fc93fea7a5ccd9dc2a421c0612d99fb0c43f3ca","tarball":"https://registry.npmjs.org/@abez/uzb-map/-/uzb-map-0.1.0.tgz","fileCount":65,"integrity":"sha512-C0nPr0c/KdXOGsdYyxZbXzt4lyGSSOEW2RZeHfK8k0cJL8IZJv8AhJmYRdKYs6/QWeszZQkihNSKovUlpKysbg==","signatures":[{"sig":"MEUCIQDyH98dbmBaPf9a7OByMPh7YyOpYa1mIakU0LIyPh0jGgIgdC52hkEXIEGQDSLVcO0la+QDQxb2sAeDqaM8SQ/4UMo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2696451},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"94d10c1d564e81698f24661db669b313bd53d053","scripts":{"dev":"tsup --watch","lint":"tsc --noEmit","test":"vitest run","build":"tsup","data:meta":"node scripts/build-metadata.mjs","typecheck":"tsc --noEmit","data:build":"node scripts/build-topology.mjs","data:fetch":"node scripts/fetch-geoboundaries.mjs","test:watch":"vitest","registry:build":"shadcn build"},"_npmUser":{"name":"lastninja294","email":"lastninja294@gmail.com"},"repository":{"url":"git+https://github.com/lastninja294/uzb-map.git","type":"git"},"_npmVersion":"10.9.4","description":"Customizable, accessible SVG map of Uzbekistan for React — 14 regions, 199 districts, built-in metadata, choropleth, tooltips, and drill-down. Zero runtime dependencies.","directories":{},"sideEffects":false,"_nodeVersion":"22.21.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","react":"^18.3.0","shadcn":"^2.9.0","vitest":"^2.1.0","mapshaper":"^0.6.55","typescript":"^5.6.0","@types/react":"^18.3.0","topojson-client":"^3.1.0","topojson-server":"^3.0.1","topojson-simplify":"^3.0.3"},"peerDependencies":{"react":">=17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/uzb-map_0.1.0_1787481236697_0.6663625933999429","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@abez/uzb-map","version":"0.2.0","keywords":["react","svg","map","uzbekistan","choropleth","geo","topojson","shadcn"],"author":"","license":"MIT","_id":"@abez/uzb-map@0.2.0","maintainers":[{"name":"lastninja294","email":"lastninja294@gmail.com"}],"homepage":"https://github.com/lastninja294/uzb-map#readme","bugs":{"url":"https://github.com/lastninja294/uzb-map/issues"},"dist":{"shasum":"0618e5f2cf22a82cd80e6bb4a2d474f22e414ac5","tarball":"https://registry.npmjs.org/@abez/uzb-map/-/uzb-map-0.2.0.tgz","fileCount":65,"integrity":"sha512-/kmnGOWeB2euA5rv3SZzjrutZ0ifsh7V6txUWqsohkfh8+b16+hC/10rXrsGkeNRiZm+W+ZfZ1tYk21+hzn9Jw==","signatures":[{"sig":"MEQCID40jyxezQDS967nYIJ6q9yGYfhcyfy3IPLsDD6u1OWcAiA2OfJ4O9zt74qLklMLp4jK9GlPezDwKvKN6jkOyLu4ww==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2488498},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"5dc8ccaf24b86a9e0f50773d368f2d79a4d23a3a","scripts":{"dev":"tsup --watch","lint":"tsc --noEmit","test":"vitest run","build":"tsup","data:meta":"node scripts/build-metadata.mjs","typecheck":"tsc --noEmit","data:build":"node scripts/build-topology.mjs","data:fetch":"node scripts/fetch-geoboundaries.mjs","test:watch":"vitest","registry:build":"shadcn build"},"_npmUser":{"name":"lastninja294","email":"lastninja294@gmail.com"},"repository":{"url":"git+https://github.com/lastninja294/uzb-map.git","type":"git"},"_npmVersion":"10.9.4","description":"Customizable, accessible SVG map of Uzbekistan for React — 14 regions, 199 districts, built-in metadata, choropleth, tooltips, and drill-down. Zero runtime dependencies.","directories":{},"sideEffects":false,"_nodeVersion":"22.21.1","dependencies":{"@abez/map-core":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","react":"^18.3.0","shadcn":"^2.9.0","vitest":"^2.1.0","mapshaper":"^0.6.55","typescript":"^5.6.0","@types/react":"^18.3.0","topojson-client":"^3.1.0","topojson-server":"^3.0.1","topojson-simplify":"^3.0.3"},"peerDependencies":{"react":">=17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/uzb-map_0.2.0_1787507325956_0.29585742555427297","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@abez/uzb-map","version":"0.2.1","description":"Customizable, accessible SVG map of Uzbekistan for React — 14 regions, 199 districts, built-in metadata, choropleth, tooltips, and drill-down. Zero runtime dependencies.","license":"MIT","author":"","repository":{"type":"git","url":"git+https://github.com/lastninja294/uzb-map.git"},"homepage":"https://abez-maps.vercel.app/uzbekistan","bugs":{"url":"https://github.com/lastninja294/uzb-map/issues"},"type":"module","sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"keywords":["react","svg","map","uzbekistan","choropleth","geo","topojson","shadcn"],"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","data:fetch":"node scripts/fetch-geoboundaries.mjs","data:build":"node scripts/build-topology.mjs","data:meta":"node scripts/build-metadata.mjs","registry:build":"shadcn build","lint":"tsc --noEmit"},"peerDependencies":{"react":">=17.0.0"},"dependencies":{"@abez/map-core":"^0.1.0"},"devDependencies":{"@types/react":"^18.3.0","mapshaper":"^0.6.55","react":"^18.3.0","shadcn":"^2.9.0","topojson-client":"^3.1.0","topojson-server":"^3.0.1","topojson-simplify":"^3.0.3","tsup":"^8.3.0","typescript":"^5.6.0","vitest":"^2.1.0"},"publishConfig":{"access":"public"},"_id":"@abez/uzb-map@0.2.1","gitHead":"5dc8ccaf24b86a9e0f50773d368f2d79a4d23a3a","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-sXQiIFf4IDFmqcw75gf83BT8k7QrYYId2k+GJ6MUBzD0IZbML0GF4vxCEj6S+nx0v2MPVF4paTWyOZPfYiPKPw==","shasum":"b74d6b747084332b1e20cd5a3c952901a9359fc6","tarball":"https://registry.npmjs.org/@abez/uzb-map/-/uzb-map-0.2.1.tgz","fileCount":65,"unpackedSize":2488553,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDjU39ttmgaS1xXFQlzd6SjpPvNUBMY1/uz+eDLQTzdkwIhAKRe5OYW/3hLGNpnvMA9LZVHzfb6fKoieRJQBQWMJtyf"}]},"_npmUser":{"name":"lastninja294","email":"lastninja294@gmail.com"},"directories":{},"maintainers":[{"name":"lastninja294","email":"lastninja294@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/uzb-map_0.2.1_1787569782278_0.9842558428978028"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-23T10:33:56.441Z","modified":"2026-08-24T11:09:42.645Z","0.1.0":"2026-08-23T10:33:56.838Z","0.2.0":"2026-08-23T17:48:46.116Z","0.2.1":"2026-08-24T11:09:42.458Z"},"bugs":{"url":"https://github.com/lastninja294/uzb-map/issues"},"license":"MIT","homepage":"https://abez-maps.vercel.app/uzbekistan","keywords":["react","svg","map","uzbekistan","choropleth","geo","topojson","shadcn"],"repository":{"type":"git","url":"git+https://github.com/lastninja294/uzb-map.git"},"description":"Customizable, accessible SVG map of Uzbekistan for React — 14 regions, 199 districts, built-in metadata, choropleth, tooltips, and drill-down. Zero runtime dependencies.","maintainers":[{"name":"lastninja294","email":"lastninja294@gmail.com"}],"readme":"# @abez/uzb-map\n\n**[Live demo →](https://abez-maps.vercel.app/uzbekistan)**\n\nA customizable, accessible SVG map of Uzbekistan for React — all 14 top-level\nadministrative units (12 viloyatlar, the Republic of Karakalpakstan, and\nTashkent city) and all 199 districts (tumanlar), with built-in metadata,\nchoropleth support, tooltips, and region drill-down.\n\nTypeScript-first. **Zero runtime dependencies.**\n\n## Install\n\n```bash\nnpm install @abez/uzb-map\n```\n\nReact 17+ is a peer dependency; nothing else is required at runtime.\n\n## Quick start\n\n```tsx\nimport { UzbekistanMap } from '@abez/uzb-map'\n\nexport function App() {\n  return <UzbekistanMap locale=\"en\" onRegionClick={(code) => console.log(code)} />\n}\n```\n\nThe map is pure `viewBox`-based SVG — give it a container width and it scales\nresponsively while keeping Uzbekistan's aspect ratio.\n\n## Choropleth\n\n```tsx\n<UzbekistanMap\n  data={{ 'UZ-FA': 42, 'UZ-TK': 98, 'UZ-QR': 12 }}\n  // colorScale defaults to a sequential blue scale; bring your own:\n  // colorScale={interpolateColors(['#f0fdf4', '#16a34a', '#14532d'])}\n/>\n```\n\nKeys are region codes (`\"UZ-FA\"`) or, in `view=\"districts\"`, district codes\n(`\"UZ-FA-ALTIARIK\"`). The color domain is the min/max of the values you pass.\n\n## Drill-down\n\n```tsx\nconst [focusRegion, setFocusRegion] = useState<string>()\n\n<UzbekistanMap\n  focusRegion={focusRegion}\n  onRegionClick={(code) => setFocusRegion(code)}\n  onDistrictClick={(code) => console.log('district', code)}\n/>\n```\n\nSetting `focusRegion` zooms into that region (animated, via a CSS transform —\nno data re-projection) and lazily loads and reveals its districts; the other\n13 regions stay visible, dimmed. Clear it (`setFocusRegion(undefined)`) to\nzoom back out. This is a controlled prop — the component never changes it\nitself, so you decide how \"back\" navigation works.\n\n## Districts view\n\n```tsx\n<UzbekistanMap view=\"districts\" />\n```\n\nDraws all 199 districts country-wide. District geometry is code-split into\none chunk per region (`import()`), so `view=\"districts\"` fetches all 14\nchunks and `focusRegion` fetches exactly one. Labels default to hidden in\nthis view (199 overlapping labels at that zoom is unreadable) — pass\n`showLabels` to override.\n\n## Styling\n\n```tsx\n<UzbekistanMap\n  theme={{ baseFill: '#f1f5f9', hoverFill: '#fbbf24', stroke: '#fff', dimOpacity: 0.3 }}\n  regionStyle={({ isHovered }) => (isHovered ? { strokeWidth: 1.5 } : {})}\n  districtStyle={{ strokeDasharray: '2 2' }}\n  renderLabel={({ name, centroid, scale }) =>\n    scale > 3 ? (\n      <text x={centroid[0]} y={centroid[1]} fontSize={8 / scale} textAnchor=\"middle\">\n        {name}\n      </text>\n    ) : null\n  }\n  renderTooltip={({ name, meta }) => (\n    <div style={{ background: '#000', color: '#fff', padding: 6 }}>\n      {name} — {meta.population?.toLocaleString()}\n    </div>\n  )}\n/>\n```\n\n`regionStyle` / `districtStyle` accept either a static SVG-props object or a\nfunction of `{ code, kind, value, isFocused, isHovered }`.\n\n## Custom markers\n\nChildren render inside the SVG, in the same panned/zoomed group as the map.\nUse `useProjectPoint()` to convert real coordinates. Since markers sit in\nthat same CSS-scaled group, a marker meant to stay a constant pixel size\n(rather than grow with the map) should divide by `useMapScale()`:\n\n```tsx\nimport { UzbekistanMap, useProjectPoint, useMapScale } from '@abez/uzb-map'\n\nfunction CapitalMarker() {\n  const project = useProjectPoint()\n  const scale = useMapScale() // 1 when zoomed out, larger during drill-down\n  const [x, y] = project([69.2401, 41.2995]) // Tashkent\n  return <circle cx={x} cy={y} r={4 / scale} fill=\"red\" />\n}\n\n<UzbekistanMap>\n  <CapitalMarker />\n</UzbekistanMap>\n```\n\n## Locales & metadata\n\nEvery region and district ships with names in four locales (`uz`, `uz-Cyrl`,\n`ru`, `en`), plus population/area estimates:\n\n```tsx\nimport { getRegionMeta, getDistrictMeta, getDistrictsByRegion, REGIONS_META } from '@abez/uzb-map'\n\ngetRegionMeta('UZ-FA') // { code, names, capital, population, populationYear, areaKm2, ... }\ngetDistrictsByRegion('UZ-FA') // all 19 districts of Fergana Region\n```\n\nDistrict-level `population`/`areaKm2` are best-effort: many of the 199\ndistricts don't have a reliably citable area figure publicly available.\nCheck `meta.verified` before treating a district's numbers as solid — see\n`DATA_SOURCES.md` for what's confirmed vs. estimated and where it came from.\n\nAccessibility: every clickable unit is a keyboard-focusable (`tabIndex`,\n`role=\"button\"`) `<path>` with a localized `aria-label`.\n\n## shadcn registry\n\nThis package is also published as a [shadcn registry](https://ui.shadcn.com/docs/registry) --\ndirectly from this GitHub repo, no separate hosting needed. Install a\nready-made demo component with:\n\n```bash\nnpx shadcn add lastninja294/uzb-map/uzbekistan-map\n```\n\nPin to a specific tag/branch/commit if you want reproducible installs:\n\n```bash\nnpx shadcn add lastninja294/uzb-map/uzbekistan-map#main\n```\n\nAvailable items: `uzbekistan-map` (basic), `uzbekistan-map-choropleth`,\n`uzbekistan-map-drilldown`. Each drops a small demo component into your repo\nand adds `@abez/uzb-map` as a dependency — the geometry/metadata stay in the\nnpm package, only the usage example is copied.\n\nYou can also install from the pre-built registry JSON directly (useful for\ntools that only accept a URL, not the `owner/repo/item` shorthand):\n\n```bash\nnpx shadcn add https://raw.githubusercontent.com/lastninja294/uzb-map/main/public/r/uzbekistan-map.json\n```\n\n## Data & attribution\n\nGeometry is derived from the [geoBoundaries](https://www.geoboundaries.org)\nUZB ADM1/ADM2 dataset (Runfola et al. 2020, CC BY 4.0 / ODbL). Region borders\nare a topological dissolve of the district geometry, so they nest exactly.\nSee `DATA_SOURCES.md` and `LICENSE` for full attribution and data-pipeline\nnotes.\n\n## Development\n\n```bash\nnpm install\nnpm run data:fetch   # download geoBoundaries source geojson\nnpm run data:build   # rebuild regions.topo.json + district chunks\nnpm run data:meta    # merge data-src/work/meta/*.json -> typed metadata modules\nnpm run build        # tsup -> dist/\nnpm run typecheck\n```\n","readmeFilename":"README.md"}