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 🙏

© 2024 – Pkg Stats / Ryan Hefner

fusionmaps

v4.1.0

Published

Data-driven maps in JavaScript from FusionMaps (FusionCharts). Over 2,000+ maps of all countries, regions, counties etc.

Downloads

3,649

Readme

FusionMaps is a companion package meant to be used in conjunction with FusionCharts to render data-driven maps (over 2,000+ maps for different continents, countries, states & regions). This package contains choropleth maps that can render on both desktop & mobile, with extended functionality like city or location markers, annotations, events etc.

This package contains definition files for all the maps. Map definition files are the path files required by FusionMaps to plot a map for a particular region. Each map has its own path file.

By default, FusionCharts package only includes definition files for two maps - the World map and the USA map.


Table of Contents

Installing FusionMaps

There are multiple ways to install FusionMaps. For general instructions, refer to this developer docs page.

Direct Download You can download zipped version here.

Using CDN Instead of downloading, you can also use FusionCharts’s CDN to access map definition files directly. See below for details

<script src="https://cdn.fusioncharts.com/fusioncharts/latest/maps/<MAP_ALIAS>.js"></script>

MAP_ALIAS is the name of the map that you're plotting, used by FusionMaps. For each map, FusionMaps has a different JavaScript alias. e.g., World Map is world etc.

Install from NPM

npm install --save fusionmaps

You will also need FusionCharts package installed on your system to use maps. You can install the same using below command

npm install --save fusioncharts

See npm documentation to know more about npm usage.

Getting Started

Easiest way to render map is to include the FusionCharts JavaScript library files and map definition file in your webpage, create <div> container and chart instance, configure the data and render. Check this HTML snippet below:

<!doctype html>
<html>
<head>
    <script src="https://cdn.fusioncharts.com/fusioncharts/latest/fusioncharts.js"></script>
    <script src="https://cdn.fusioncharts.com/fusioncharts/latest/fusioncharts.maps.js"></script>
    <script src="https://cdn.fusioncharts.com/fusioncharts/latest/maps/fusioncharts.world.js"></script>
    <script src="https://cdn.fusioncharts.com/fusioncharts/latest/themes/fusioncharts.theme.fusion.js"></script>
</head>
<body>
  <div id="chart-container"></div>
  <script>
        FusionCharts.ready(function () {
            // chart instance
            var chart = new FusionCharts({
                type: "world",
                renderAt: "chart-container", // container where chart will render
                width: "600",
                height: "400",
                dataFormat: "json",
                dataSource: {
                    "chart": {
                      "caption": "Average Annual Population Growth",
                      "subcaption": " 1955-2015",
                      "numbersuffix": "%",
                      "includevalueinlabels": "1",
                      "labelsepchar": ": ",
                      "entityFillHoverColor": "#FFF9C4",
                      "theme": "fusion"
                    },
                    "data": [
                      { "id": "NA", "value": ".82", "showLabel": "1" },
                      { "id": "SA", "value": "2.04", "showLabel": "1" },
                      { "id": "AS", "value": "1.78", "showLabel": "1" },
                      { "id": "EU", "value": ".40", "showLabel": "1" },
                      { "id": "AF", "value": "2.58", "showLabel": "1" },
                      { "id": "AU", "value": "1.30", "showLabel": "1" }
                  ]
              }
            }).render();
        });
    </script>
</body>
</html>

As you can see in above example, each continent is referenced using an ID. Each map in FusionMaps has its own regions, each of which have its own ID and name. These are present in specification sheets for the map. You can find specification sheets for all maps here.

Learn more through resources below:

Using FusionMaps as an ES Module

FusionMaps can be loaded as an ES module via transpilers.

The following examples presumes you are using npm to install FusionCharts and FusionMaps, see Installing FusionMaps for more details.

import FusionCharts from 'fusioncharts/core';
import Maps from 'fusioncharts/maps';

// include map definition file from maps/es folder - import mapName from fusionmaps/maps/es/<MAP_ALIAS>
import World from fusionmaps/maps/es/world

// add chart as dependency - FusionCharts.addDep(ChartType);
FusionCharts.addDep(Maps);
FusionCharts.addDep(World);

// instantiate the chart.
var chart = new FusionCharts({
  type: "world",
  renderAt: "chart-container", // container where chart will render
  width: "600",
  height: "400",
  dataFormat: "json",
  dataSource: {
    "chart": {
      "caption": "Average Annual Population Growth",
      "subcaption": " 1955-2015",
      "numbersuffix": "%",
      "includevalueinlabels": "1",
      "labelsepchar": ": ",
      "entityFillHoverColor": "#FFF9C4"
    },
    "data": [
      { "id": "NA", "value": ".82", "showLabel": "1" },
      { "id": "SA", "value": "2.04", "showLabel": "1" },
      { "id": "AS", "value": "1.78", "showLabel": "1" },
      { "id": "EU", "value": ".40", "showLabel": "1" },
      { "id": "AF", "value": "2.58", "showLabel": "1" },
      { "id": "AU", "value": "1.30", "showLabel": "1" }
    ]
  }
});

// render the chart
chart.render();

Related Packages

Front-end Integrations to help you easily integrate FusionCharts Suite in your projects/apps

| | | | |:----------------|:---------------|:---------| |AngularJS (1.x and above)|Github Repo|Documentation| |Angular (2.x and above)|Github Repo|Documentation| |jQuery|Github Repo|Documentation| |React|Github Repo|Documentation| |Vue.js|Github Repo|Documentation|

Back-end Integrations to help you easily integrate FusionCharts Suite in your projects/apps

| | | | |:----------------|:---------------|:---------| |ASP.NET (C#)|Github Repo|Documentation| |ASP.NET (VB)|Github Repo|Documentation| |Java (JSP)|Github Repo|Documentation| |Django|Github Repo|Documentation| |PHP|Github Repo|Documentation| |Ruby on Rails|Github Repo|Documentation|

Contact Support

Fill this form or drop an email to [[email protected]](mailto: [email protected])

Folder Structure

fusionmaps/
└── maps/
    ├── es
    │   ├── fusioncharts.world.js
    │   ├── fusioncharts.usa.js
    │   ├── ...
    │   └── fusioncharts.<MAP_ALIAS>.js
    ├── fusioncharts.world.js
    ├── fusioncharts.usa.js
    ├── ...
    └── fusioncharts.<MAP_ALIAS>.js