All Projects → zcreativelabs → React Simple Maps

zcreativelabs / React Simple Maps

Licence: mit
Beautiful React SVG maps with d3-geo and topojson using a declarative api.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Simple Maps

Svg World Map
🗺 A JavaScript library to easily integrate one or more SVG world maps with all nations (countries) and second-level political subdivisions (countries, provinces, states).
Stars: ✭ 38 (-98.39%)
Mutual labels:  mapping, svg
D3
This is the repository for my course, Learning Data Visualization with D3.js on LinkedIn Learning and Lynda.com.
Stars: ✭ 64 (-97.29%)
Mutual labels:  svg, d3v4
D3tutorial
📊📈 A D3 v6 tutorial - interactive bar chart and multiple coordinated views (MCV)
Stars: ✭ 163 (-93.09%)
Mutual labels:  svg, d3v4
Svgs
svgs is a compatiblity layer between svg and react-native-svg
Stars: ✭ 182 (-92.29%)
Mutual labels:  svg
Fiesta
Fast Incremental Euclidean Distance Fields for Online Motion Planning of Aerial Robots
Stars: ✭ 182 (-92.29%)
Mutual labels:  mapping
Svg Sprite Module
Optimize SVG files and combine them into sprite
Stars: ✭ 187 (-92.08%)
Mutual labels:  svg
Free Gophers Pack
✨ This pack of 100+ gopher pictures and elements will help you to build own design of almost anything related to Go Programming Language: presentations, posts in blogs or social media, courses, videos and many, many more.
Stars: ✭ 2,343 (-0.72%)
Mutual labels:  svg
Feathericon
simply generic vector icon collection - including sketch file, svg files, and font files.
Stars: ✭ 178 (-92.46%)
Mutual labels:  svg
Richpath
💪 Rich Android Path. 🤡 Draw as you want. 🎉 Animate much as you can.
Stars: ✭ 2,259 (-4.28%)
Mutual labels:  svg
Supertinyicons
Under 1KB each! Super Tiny Icons are miniscule SVG versions of your favourite website and app logos
Stars: ✭ 13,177 (+458.35%)
Mutual labels:  svg
Chartist Js
Simple responsive charts
Stars: ✭ 12,731 (+439.45%)
Mutual labels:  svg
Akar Icons
A perfectly rounded icon library made for designers, developers, and pretty much everyone.
Stars: ✭ 184 (-92.2%)
Mutual labels:  svg
V Chart Plugin
Easily bind a chart to the data stored in your Vue.js components.
Stars: ✭ 188 (-92.03%)
Mutual labels:  d3v4
Jfreesvg
A fast, lightweight Java library for creating Scalable Vector Graphics (SVG) output.
Stars: ✭ 182 (-92.29%)
Mutual labels:  svg
Opentileserver
This script is for building a basic tile server with OpenStreetMap data
Stars: ✭ 190 (-91.95%)
Mutual labels:  mapping
Oshmi
SCADA HMI for substations and automation applications.
Stars: ✭ 180 (-92.37%)
Mutual labels:  svg
Vue Eva Icons
Is a pack of more than 480 beautiful open source Eva icons as Vue components
Stars: ✭ 189 (-91.99%)
Mutual labels:  svg
Weather Underground Icons
Weather Underground Icons ( PNG & SVG )
Stars: ✭ 186 (-92.12%)
Mutual labels:  svg
Polymorph
Get Your SVG into Shape!
Stars: ✭ 185 (-92.16%)
Mutual labels:  svg
Visx
🐯 visx | visualization components
Stars: ✭ 14,544 (+516.27%)
Mutual labels:  svg

react-simple-maps

Create beautiful SVG maps in react with d3-geo and topojson using a declarative api.

Read the docs, or check out the examples.

Why

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 and topojson-client instead of relying on the entire d3 library.

Since react-simple-maps leaves DOM work to react, it can also easily be used with other libraries, such as react-spring and react-annotation.

Install

To install react-simple-maps

$ npm install --save react-simple-maps

...or if you use yarn:

$ yarn add react-simple-maps

Usage

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 in the topojson-maps folder or on topojson world-atlas. 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" on medium.

import React from "react"
import ReactDOM from "react-dom"
import {
  ComposableMap,
  Geographies,
  Geography,
} from "react-simple-maps"

// url to a valid topojson file
const geoUrl =
  "https://raw.githubusercontent.com/zcreativelabs/react-simple-maps/master/topojson-maps/world-110m.json"

const App = () => {
  return (
    <div>
      <ComposableMap>
        <Geographies geography={geoUrl}>
          {({geographies}) => geographies.map(geo =>
            <Geography key={geo.rsmKey} geography={geo} />
          )}
        </Geographies>
      </ComposableMap>
    </div>
  )
}

document.addEventListener("DOMContentLoaded", () => {
  ReactDOM.render(<App />, document.getElementById("app"))
})

Check out the live example

The above will render a world map using the equal earth projection. You can read more about this projection on Shaded Relief and on Wikipedia.

For other examples and components, check out the documentation.

License

MIT licensed. Copyright (c) Richard Zimerman 2017. See LICENSE.md for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].