DataMaps
Interactive maps for data visualizations. Bundled into a single Javascript file.
Download datamaps-usa.js Download datamaps-world.jsInteractive maps for data visualizations. Bundled into a single Javascript file.
Download datamaps-usa.js Download datamaps-world.jsbubbles for data bubbles
$("#map_bombs").datamap({
scope: 'world',
/*bubble data*/
bubbles: [{
name: 'Gerboise Bleue',
radius: 20.4,
yeild: 70,
country: 'France',
significance: 'First fission weapon test by France',
date: '1960-02-13',
fillKey: 'FRA',
latitude: -0.325,
longitude: 26.1840
}, {
name: 'Canopus',
radius: 10.23
/*...snipped, see source link under map */
],
/*bubble config*/
bubble_config: {
popupTemplate: _.template([
'<div class="hoverinfo"><stro...'
},
geography_config: {
popupOnHover: false,
highlightOnHover: false
},
data for Choropleths
$('#map_election').datamap({
scope: 'usa',
popupTemplate: _.template('<div>...</div>'),
fills: {
'REP': '#CC4731',
'DEM': '#306596',
'HEAVY_DEM': '#667FAF',
/*... snipped */
defaultFill: '#EDDC4E'
},
data:{
"AZ": {
"fillKey": "REP",
"electoralVotes": 5
},
"CO": {
"fillKey": "LIGHT_DEM",
"electoralVotes": 5
} /* ... snipped */
})
World map
USA specific
$("#map_world").datamap({scope: 'world'})
$("#map_usa").datamap({scope: 'usa'})
South America
Africa
$("#southamerica").datamap({scope: 'southamerica'})
$("#africa").datamap({scope: 'africa'})
Europe
Middle East
$("#europe").datamap({scope: 'europe'})
$("#middleeast").datamap({scope: 'middleeast'})
Southeast Asia
Asia
$("#southeastasia").datamap({scope: 'southeastasia'})
$("#asia").datamap({scope: 'asia'})
{
projection: 'equirectangular', // 'albersUsa'
scope: 'world', // usa, asia, southeastAsia, middleEast, africa, southAmerica, australia
/* geographical fills */
geography_config: {
borderWidth: 1,
borderColor: '#FFFFFF',
popupTemplate: _.template('<div class="hoverinfo"><%= geography.properties.name %></div>'),
popupOnHover: true,
highlightOnHover: true,
highlightBorderColor: '#FA0FA0',
highlightBorderWidth: 2
},
/* bubbles points */
bubble_config: {
borderWidth: 2,
borderColor: '#FFFFFF',
popupOnHover: true,
popupTemplate: _.template(''),
fillOpacity: 0.75,
animate: true,
highlightOnHover: true,
highlightBorderColor: '#667FAF',
highlightFillColor: '#667FAF',
highlightBorderWidth: 2,
highlightFillOpacity: 0.85
},
/* fill settings */
data: {},
bubbles: [],
fills: {
defaultFill: '#BADA55'
}
}