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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mapwhizz

v2.0.3

Published

A reusable and customizable SVG world map React component

Downloads

142

Readme

MapWhizz

MapWhizz is a reusable, responsive, and customizable SVG world map React component for visualizing geographical data. It allows you to display a choropleth map where countries are colored based on their respective values.

Features

  • React Ready: Seamlessly integrates into your React applications as a functional component.
  • Choropleth Colors: Automatically interpolates colors for countries based on provided data values.
  • Interactivity: Includes built-in tooltips on hover and a click handler for countries.
  • Responsive: Adjusts automatically to the width and height of its parent container.

Installation

Install via npm:

npm install mapwhizz

Or via yarn:

yarn add mapwhizz

Usage

Here is a basic example of how to use MapWhizz in your React application:

import React from "react";
import MapWhizz from "mapwhizz";

const App = () => {
  const mapData = [
    { country: "Egypt", value: 30 },
    { country: "Bahamas", value: 10 },
    { country: "Azerbaijan", value: 50 },
    { country: "United States", value: 100 },
    { country: "Canada", value: 75 },
  ];

  const handleCountryClick = (countryName, countryData) => {
    console.log(`Clicked on ${countryName}:`, countryData);
  };

  return (
    <div style={{ width: "100%", height: "500px" }}>
      <MapWhizz
        data={mapData}
        onCountryClick={handleCountryClick}
        className="my-custom-map-class"
        style={{ border: "1px solid #ddd", borderRadius: "8px" }}
      />
    </div>
  );
};

export default App;

Props

| Prop | Type | Default | Description | | ---------------- | ---------- | ----------- | ----------------------------------------------------------------------------------------------------------------------- | | data | Array | [] | Array of objects representing the data to visualize. Each object must have a country (string) and a value (number). | | onCountryClick | Function | undefined | Callback fired when a country is clicked. Receives (countryName, countryData) as arguments. | | className | String | "" | Additional CSS class for the wrapper container. | | style | Object | {} | Additional inline styles for the wrapper container. |

Data Format

The data prop should be an array of objects. The country field must directly map to country names exactly as specified in the internal map:

[
  { "country": "Egypt", "value": 30 },
  { "country": "Bahamas", "value": 10 },
  { "country": "Azerbaijan", "value": 50 }
]

Available Countries

The SVG map supports the following countries. Please ensure your country values match these names exactly:

  • Andorra
  • United Arab Emirates
  • Afghanistan
  • Antigua and Barbuda
  • Anguilla
  • Albania
  • Armenia
  • Angola
  • Argentina
  • American Samoa
  • Austria
  • Australia
  • Aruba
  • Aland Islands
  • Azerbaijan
  • Bosnia and Herzegovina
  • Barbados
  • Bangladesh
  • Belgium
  • Burkina Faso
  • Bulgaria
  • Bahrain
  • Burundi
  • Benin
  • Saint Barthelemy
  • Brunei Darussalam
  • Bolivia
  • Bermuda
  • Bonaire, Saint Eustachius and Saba
  • Brazil
  • Bahamas
  • Bhutan
  • Bouvet Island
  • Botswana
  • Belarus
  • Belize
  • Canada
  • Cocos (Keeling) Islands
  • Democratic Republic of Congo
  • Central African Republic
  • Republic of Congo
  • Switzerland
  • Côte d'Ivoire
  • Cook Islands
  • Chile
  • Cameroon
  • China
  • Colombia
  • Costa Rica
  • Cuba
  • Cape Verde
  • Curaçao
  • Christmas Island
  • Cyprus
  • Czech Republic
  • Germany
  • Djibouti
  • Denmark
  • Dominica
  • Dominican Republic
  • Algeria
  • Ecuador
  • Egypt
  • Estonia
  • Western Sahara
  • Eritrea
  • Spain
  • Ethiopia
  • Finland
  • Fiji
  • Falkland Islands
  • Federated States of Micronesia
  • Faroe Islands
  • France
  • Gabon
  • United Kingdom
  • Georgia
  • Grenada
  • French Guiana
  • Guernsey
  • Ghana
  • Gibraltar
  • Greenland
  • Gambia
  • Guinea
  • Glorioso Islands
  • Guadeloupe
  • Equatorial Guinea
  • Greece
  • South Georgia and South Sandwich Islands
  • Guatemala
  • Guam
  • Guinea-Bissau
  • Guyana
  • Hong Kong
  • Heard Island and McDonald Islands
  • Honduras
  • Croatia
  • Haiti
  • Hungary
  • Indonesia
  • Ireland
  • Palestine
  • Isle of Man
  • India
  • British Indian Ocean Territory
  • Iraq
  • Iran
  • Iceland
  • Italy
  • Jersey
  • Jamaica
  • Jordan
  • Japan
  • Juan De Nova Island
  • Kenya
  • Kyrgyzstan
  • Cambodia
  • Kiribati
  • Comoros
  • Saint Kitts and Nevis
  • North Korea
  • South Korea
  • Kosovo
  • Kuwait
  • Cayman Islands
  • Kazakhstan
  • Lao People's Democratic Republic
  • Lebanon
  • Saint Lucia
  • Liechtenstein
  • Sri Lanka
  • Liberia
  • Lesotho
  • Lithuania
  • Luxembourg
  • Latvia
  • Libya
  • Morocco
  • Monaco
  • Moldova
  • Madagascar
  • Montenegro
  • Saint Martin
  • Marshall Islands
  • Macedonia
  • Mali
  • Macau
  • Myanmar
  • Mongolia
  • Northern Mariana Islands
  • Martinique
  • Mauritania
  • Montserrat
  • Malta
  • Mauritius
  • Maldives
  • Malawi
  • Mexico
  • Malaysia
  • Mozambique
  • Namibia
  • New Caledonia
  • Niger
  • Norfolk Island
  • Nigeria
  • Nicaragua
  • Netherlands
  • Norway
  • Nepal
  • Nauru
  • Niue
  • New Zealand
  • Oman
  • Panama
  • Peru
  • French Polynesia
  • Papua New Guinea
  • Philippines
  • Pakistan
  • Poland
  • Saint Pierre and Miquelon
  • Pitcairn Islands
  • Puerto Rico
  • Palestinian Territories
  • Portugal
  • Palau
  • Paraguay
  • Qatar
  • Reunion
  • Romania
  • Serbia
  • Russia
  • Rwanda
  • Saudi Arabia
  • Solomon Islands
  • Seychelles
  • Sudan
  • Sweden
  • Singapore
  • Saint Helena
  • Slovenia
  • Svalbard and Jan Mayen
  • Slovakia
  • Sierra Leone
  • San Marino
  • Senegal
  • Somalia
  • Suriname
  • South Sudan
  • Sao Tome and Principe
  • El Salvador
  • Saint Martin
  • Syria
  • Swaziland
  • Turks and Caicos Islands
  • Chad
  • French Southern and Antarctic Lands
  • Togo
  • Thailand
  • Tajikistan
  • Tokelau
  • Timor-Leste
  • Turkmenistan
  • Tunisia
  • Tonga
  • Turkey
  • Trinidad and Tobago
  • Tuvalu
  • Taiwan
  • Tanzania
  • Ukraine
  • Uganda
  • Jarvis Island
  • Baker Island
  • Howland Island
  • Johnston Atoll
  • Midway Islands
  • Wake Island
  • United States
  • Uruguay
  • Uzbekistan
  • Vatican City
  • Saint Vincent and the Grenadines
  • Venezuela
  • British Virgin Islands
  • US Virgin Islands
  • Vietnam
  • Vanuatu
  • Wallis and Futuna
  • Samoa
  • Yemen
  • Mayotte
  • South Africa
  • Zambia
  • Zimbabwe

License

ISC License