react-map-chart
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

react-map-chart


Simple component to display SVG based World Map. Uses react-spring to make stuff nicer.

World geometry data was extracted from osme-geometry, and has origins in openstreetmap.

 <Chart
    className="outerClassName"
    
    // styler make things looks as YOU want
    styler={
      (x, isoCode, feature) => ({
          className: 'paths-classname',
          style: {
            fill: feature.code === 'CN' ? '#F00' : '#44F',
            opacity: x
          },
          onClick: () => onClick(code),
          // "code" is available in dataset
          onMouseOver: event => over(event.target.dataset.code)
      })
    }
 
    // provide data for interpolation
    data={{
      CN: 1,
      US: 1,
      AU: 0.5
    }}
 
  />)

Licence

MIT

/react-map-chart/

    Package Sidebar

    Install

    npm i react-map-chart

    Weekly Downloads

    17

    Version

    2.1.0

    License

    MIT

    Unpacked Size

    473 kB

    Total Files

    13

    Last publish

    Collaborators

    • kashey