Skip to content

zcreativelabs/react-simple-maps-canvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Mapchart

!WIP: The aim of this react component library is to render mapcharts to canvas using a simple declarative api similar to react-simple-maps.

import { CanvasMap, Geographies, Geography } from "react-mapchart"

const MyMap = () => {
  return (
    <CanvasMap width={800} height={600}>
      <Geographies geography="https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json">
        {({geographies, highlighted}) =>
          geographies.map(geo =>
            <Geography
              key={geo.rsmKey}
              geography={geo}
              fill={highlighted === geo.rsmKey ? "#F53" : "#EEE"}
            />
          )
        }
      </Geographies>
    </CanvasMap>
  )
}

About

Declarative canvas mapcharts for react.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published