npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-geo-charts

v1.0.7

Published

A simple react worldmap and countrymaps component svg base

Readme

react-geo-charts

GitHub license

You're looking for an SVG-based React map that supports:

  • World-level view with countries
  • Drill-down to states/provinces (geo-regions)
  • Interactive selection and custom metadata
  • Custom styling (color, CSS, tooltip, etc.) etc...

Install

npm i react-geo-charts

Usage

import React from 'react';
import WorldSVGMap, { dataSet } from "react-geo-charts"
import "./App.css"

const type = {
  "Continent": "Continent",
  "1": "1"
}

function App() {
  const [regioncode, setregioncode] = React.useState("US")
  const [code, setcode] = React.useState([])

  const customizeFuncation = () => {
    let customizeData = {}, data = dataSet.US; // find in dataset as regioncode
    for (let key in data) {
      customizeData[key] = {
        fill: code.includes(key) ? "blue" : "#fff",
        stroke: code.includes(key) ? "red" : "#222",
        identifierdata: data[key] + "100%",
        regiontooltipdisable: key == "AK", // Alaska
        disable: key == "AK", // Alaska
        onClick: (ISOIdentifier) => {
          setcode(code.includes(ISOIdentifier) ? code.filter(e => e != ISOIdentifier) : [...code, ISOIdentifier])
        }
      }
    }
    return customizeData
  }

  return (
    <div className="App">
      <WorldSVGMap
        regioncode={regioncode}
        containerClass=""
        width="100%"
        height="100%"
        filldefault="#ccc"
        strokedefault="#222"
        customize={customizeFuncation()}
        figure={type[1]} // for continent use like type.Continent
        tooltipdisable={true}
      />
    </div>
  );
}

export default App;

ReactDOM.render(<App/>, document.body)

list of props

| Prop | Description | Type | Default | | ----------------- | -------------------------------------------------------------- | ------------------ | ----------------- | | regioncode | options for regioncode: countries:[US, IN, AU, CA] with variant US1, IN1 'worldmap',continent:[AF,AS,EU,NA,OC,SA] | String | "" | | width | width option for svg tag | String | 100% | | height | height option for svg tag | String | 100% | | filldefault | region fill default color | String | #fff | | strokedefault | region stroke(border) default color | String | #222 | | viewBox | set to svg tag viewBox attribute | String | according to map | | figure | use for variant and continent type map as you can see in example | String | "" | | tooltipdisable | use for all regions with tooltips disabled. | Bool | false | | customize | customize option | Object | '{}' |
| identifierdata | customize the option in the set ‘identifierdata’ as a tooltip. | String | 'worldmap' and 'continentmap' in country or 'countrymap' in state,provinces | | regiontooltipdisable | customize the option in the set ‘regiontooltipdisable’ as tooltip disable for a specific region. you can see in the example. | Bool | false | | disable | Customize the option in the set 'disable' to a specific region. you can see in example | Bool | false |

Maps

alt text alt text alt text alt text alt text

License

MIT.

Copyright (c) 2025 Jeel Chheta