{"id":13468279,"url":"https://github.com/zcreativelabs/react-simple-maps","last_synced_at":"2025-10-04T19:34:15.923Z","repository":{"id":38107661,"uuid":"83827894","full_name":"zcreativelabs/react-simple-maps","owner":"zcreativelabs","description":"Beautiful React SVG maps with d3-geo and topojson using a declarative api.","archived":false,"fork":false,"pushed_at":"2024-08-08T15:53:29.000Z","size":3372,"stargazers_count":3208,"open_issues_count":185,"forks_count":449,"subscribers_count":24,"default_branch":"main","last_synced_at":"2025-09-10T11:50:04.369Z","etag":null,"topics":["d3v4","mapping","nodejs","react","svg","visualization"],"latest_commit_sha":null,"homepage":"https://www.react-simple-maps.io/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zcreativelabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-03T18:17:19.000Z","updated_at":"2025-09-09T05:34:28.000Z","dependencies_parsed_at":"2022-07-08T01:40:37.437Z","dependency_job_id":"4c5ee8d9-f996-4eb0-ad65-463539c68129","html_url":"https://github.com/zcreativelabs/react-simple-maps","commit_stats":{"total_commits":269,"total_committers":30,"mean_commits":8.966666666666667,"dds":"0.39033457249070636","last_synced_commit":"b322da59a76fa789de1de77165bbef6df9beb0ef"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/zcreativelabs/react-simple-maps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcreativelabs%2Freact-simple-maps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcreativelabs%2Freact-simple-maps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcreativelabs%2Freact-simple-maps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcreativelabs%2Freact-simple-maps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zcreativelabs","download_url":"https://codeload.github.com/zcreativelabs/react-simple-maps/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcreativelabs%2Freact-simple-maps/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278366581,"owners_count":25975091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["d3v4","mapping","nodejs","react","svg","visualization"],"created_at":"2024-07-31T15:01:08.118Z","updated_at":"2025-10-04T19:34:15.892Z","avatar_url":"https://github.com/zcreativelabs.png","language":"JavaScript","readme":"\u003cimg src=\"https://img.shields.io/bundlephobia/minzip/react-simple-maps?color=%2328cb95\u0026label=gzip\" /\u003e\n\n# react-simple-maps\n\nCreate beautiful SVG maps in react with d3-geo and topojson using a declarative api.\n\nRead the [docs](https://www.react-simple-maps.io/docs/getting-started/), or check out the [examples](https://www.react-simple-maps.io/examples/).\n\n### Why\n\n`React-simple-maps` aims to make working with svg maps in react easier. It handles tasks such as panning, zooming and simple rendering optimization, and takes advantage of parts of [d3-geo](https://github.com/d3/d3-geo) and topojson-client instead of relying on the entire d3 library.\n\nSince `react-simple-maps` leaves DOM work to react, it can also easily be used with other libraries, such as [react-spring](https://github.com/react-spring/react-spring) and [react-annotation](https://github.com/susielu/react-annotation/).\n\n### Install\n\nTo install `react-simple-maps`\n\n```bash\n$ npm install react-simple-maps\n```\n\n...or if you use yarn:\n\n```bash\n$ yarn add react-simple-maps\n```\n\n### Usage\n\n`React-simple-maps` exposes a set of components that can be combined to create svg maps with markers and annotations. In order to render a map you have to provide a reference to a valid topojson file. You can find example topojson files on [here](https://github.com/topojson/world-atlas) or [here](https://github.com/deldersveld/topojson). To learn how to make your own topojson maps from shapefiles, please read [\"How to convert and prepare TopoJSON files for interactive mapping with d3\"](https://hackernoon.com/how-to-convert-and-prepare-topojson-files-for-interactive-mapping-with-d3-499cf0ced5f) on medium.\n\n```jsx\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { ComposableMap, Geographies, Geography } from \"react-simple-maps\";\n\n// url to a valid topojson file\nconst geoUrl =\n  \"https://raw.githubusercontent.com/deldersveld/topojson/master/world-countries.json\";\n\nconst App = () =\u003e {\n  return (\n    \u003cdiv\u003e\n      \u003cComposableMap\u003e\n        \u003cGeographies geography={geoUrl}\u003e\n          {({ geographies }) =\u003e\n            geographies.map((geo) =\u003e (\n              \u003cGeography key={geo.rsmKey} geography={geo} /\u003e\n            ))\n          }\n        \u003c/Geographies\u003e\n      \u003c/ComposableMap\u003e\n    \u003c/div\u003e\n  );\n};\n\ndocument.addEventListener(\"DOMContentLoaded\", () =\u003e {\n  ReactDOM.render(\u003cApp /\u003e, document.getElementById(\"app\"));\n});\n```\n\nCheck out the [live example](https://codesandbox.io/s/basic-map-wvlol)\n\nThe above will render a world map using the [equal earth projection](https://observablehq.com/@d3/equal-earth). You can read more about this projection on [Shaded Relief](http://shadedrelief.com/ee_proj/) and on [Wikipedia](https://en.wikipedia.org/wiki/Equal_Earth_projection).\n\nFor other examples and components, check out the [documentation](https://www.react-simple-maps.io/docs/getting-started).\n\n### Map files\n\nReact-simple-maps does not restrict you to one specific map and relies on custom map files that you can modify in any way necessary for the project. This means that you can visualise countries, regions, and continents in various resolutions, as long as they can be represented using geojson/topojson.\n\nIn order for this to work properly, you will however need to provide these valid map files to react-simple-maps yourself. Luckily, there are decent sources for map files on github and elsewhere. Here are some you can check out:\n\n* [Natural Earth](https://github.com/nvkelso/natural-earth-vector)\n* [Topojson maps by @deldersveld](https://github.com/deldersveld/topojson)\n* [Topojson world atlas](https://github.com/topojson/world-atlas)\n\n### License\n\nMIT licensed. Copyright (c) Richard Zimerman 2017. See [LICENSE.md](https://github.com/zcreativelabs/react-simple-maps/blob/master/LICENSE) for more details.\n","funding_links":[],"categories":["JavaScript","👨‍💻 JavaScript Libraries","Maps","Charts and Maps","nodejs"],"sub_categories":["Mapping"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzcreativelabs%2Freact-simple-maps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzcreativelabs%2Freact-simple-maps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzcreativelabs%2Freact-simple-maps/lists"}