Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fusionmaps

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fusionmaps

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

  • 4.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

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();

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

AngularJS (1.x and above)Github RepoDocumentation
Angular (2.x and above)Github RepoDocumentation
jQueryGithub RepoDocumentation
ReactGithub RepoDocumentation
Vue.jsGithub RepoDocumentation

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

ASP.NET (C#)Github RepoDocumentation
ASP.NET (VB)Github RepoDocumentation
Java (JSP)Github RepoDocumentation
DjangoGithub RepoDocumentation
PHPGithub RepoDocumentation
Ruby on RailsGithub RepoDocumentation

Contact Support

Fill this form or drop an email to [support@fusioncharts.com](mailto: support@fusioncharts.com)

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

Keywords

FAQs

Package last updated on 12 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc