Loading map
Docs · Visuals
Map JSON format.
Countries or US states coloured by a value, from the lowest to the highest, with the name and the number on hover.
Try it
Edit the example and the visual redraws. Mistakes show the same messages the API returns.
Change any number or label. The chart follows.
Fields
| Field | Type | Rule |
|---|---|---|
regionRequired | string | world or us-states. The world map has every country with an ISO code and a shape; the US map has the 50 states and DC. |
idKeyRequired | string | The key in each row that holds the region's code. Up to 80 characters. |
valueKeyRequired | string | The key in each row that holds the number. Up to 80 characters. Must differ from idKey. |
labelKeyOptional | string | The key in each row for a label the tooltip shows instead of the region's name. Up to 80 characters. |
formatOptional | string | number (the default), compact or percent. A percent value is a fraction: 0.25 shows as 25%. |
prefixOptional | string | Shown before the value in the tooltip and the legend, such as "$". Up to 80 characters. |
suffixOptional | string | Shown after the value, such as " h". Up to 80 characters. |
dataRequired | array | One row per region at most; may be empty. |
| Field | Type | Rule |
|---|---|---|
<idKey>Required | string | The region's code: an ISO 3166-1 alpha-2 code such as DE on the world map (alpha-3 is accepted too), a USPS code such as CA on the US map (the two-digit FIPS code is accepted too). Case does not matter. |
<valueKey>Required | number | The number the colour and the tooltip show. |
<labelKey>Optional | string | Required when labelKey is set. Up to 80 characters; may be empty. |
Good to know
- A code that appears twice is an error naming the repeat. A real code with no shape on the map (Puerto Rico and the territories on the US map; Guadeloupe, Gibraltar and other territories drawn as part of their country on the world map) is refused with the region's name: drop the row, or count it under the country it belongs to.
- The colour runs from the dashboard scheme's surface to its first series colour, lowest value to highest. A region with no row is drawn in a neutral tone and its tooltip says No data.
- A map is full width by default and 700 pixels tall, and the whole region always fits inside the tile; a third of the width is the narrowest it goes. Append merges rows by region, so a few changed regions can be sent without the rest.
Codes
What goes under idKey for each region, with the alternative that is also accepted and the name the tooltip shows.
World map (235 countries)
| Code | Also accepted | Name |
|---|---|---|
AD | AND | Andorra |
AE | ARE | United Arab Emirates |
AF | AFG | Afghanistan |
AG | ATG | Antigua and Barbuda |
AI | AIA | Anguilla |
AL | ALB | Albania |
AM | ARM | Armenia |
AO | AGO | Angola |
AR | ARG | Argentina |
AS | ASM | American Samoa |
AT | AUT | Austria |
AU | AUS | Australia |
AW | ABW | Aruba |
AX | ALA | Åland Islands |
AZ | AZE | Azerbaijan |
BA | BIH | Bosnia and Herzegovina |
BB | BRB | Barbados |
BD | BGD | Bangladesh |
BE | BEL | Belgium |
BF | BFA | Burkina Faso |
BG | BGR | Bulgaria |
BH | BHR | Bahrain |
BI | BDI | Burundi |
BJ | BEN | Benin |
BL | BLM | Saint Barthélemy |
BM | BMU | Bermuda |
BN | BRN | Brunei |
BO | BOL | Bolivia |
BR | BRA | Brazil |
BS | BHS | Bahamas |
BT | BTN | Bhutan |
BW | BWA | Botswana |
BY | BLR | Belarus |
BZ | BLZ | Belize |
CA | CAN | Canada |
CD | COD | DR Congo |
CF | CAF | Central African Republic |
CG | COG | Republic of the Congo |
CH | CHE | Switzerland |
CI | CIV | Ivory Coast |
CK | COK | Cook Islands |
CL | CHL | Chile |
CM | CMR | Cameroon |
CN | CHN | China |
CO | COL | Colombia |
CR | CRI | Costa Rica |
CU | CUB | Cuba |
CV | CPV | Cape Verde |
CW | CUW | Curaçao |
CY | CYP | Cyprus |
CZ | CZE | Czechia |
DE | DEU | Germany |
DJ | DJI | Djibouti |
DK | DNK | Denmark |
DM | DMA | Dominica |
DO | DOM | Dominican Republic |
DZ | DZA | Algeria |
EC | ECU | Ecuador |
EE | EST | Estonia |
EG | EGY | Egypt |
EH | ESH | Western Sahara |
ER | ERI | Eritrea |
ES | ESP | Spain |
ET | ETH | Ethiopia |
FI | FIN | Finland |
FJ | FJI | Fiji |
FK | FLK | Falkland Islands |
FM | FSM | Micronesia |
FO | FRO | Faroe Islands |
FR | FRA | France |
GA | GAB | Gabon |
GB | GBR | United Kingdom |
GD | GRD | Grenada |
GE | GEO | Georgia |
GG | GGY | Guernsey |
GH | GHA | Ghana |
GL | GRL | Greenland |
GM | GMB | Gambia |
GN | GIN | Guinea |
GQ | GNQ | Equatorial Guinea |
GR | GRC | Greece |
GS | SGS | South Georgia |
GT | GTM | Guatemala |
GU | GUM | Guam |
GW | GNB | Guinea-Bissau |
GY | GUY | Guyana |
HK | HKG | Hong Kong |
HM | HMD | Heard Island and McDonald Islands |
HN | HND | Honduras |
HR | HRV | Croatia |
HT | HTI | Haiti |
HU | HUN | Hungary |
ID | IDN | Indonesia |
IE | IRL | Ireland |
IL | ISR | Israel |
IM | IMN | Isle of Man |
IN | IND | India |
IO | IOT | British Indian Ocean Territory |
IQ | IRQ | Iraq |
IR | IRN | Iran |
IS | ISL | Iceland |
IT | ITA | Italy |
JE | JEY | Jersey |
JM | JAM | Jamaica |
JO | JOR | Jordan |
JP | JPN | Japan |
KE | KEN | Kenya |
KG | KGZ | Kyrgyzstan |
KH | KHM | Cambodia |
KI | KIR | Kiribati |
KM | COM | Comoros |
KN | KNA | Saint Kitts and Nevis |
KP | PRK | North Korea |
KR | KOR | South Korea |
KW | KWT | Kuwait |
KY | CYM | Cayman Islands |
KZ | KAZ | Kazakhstan |
LA | LAO | Laos |
LB | LBN | Lebanon |
LC | LCA | Saint Lucia |
LI | LIE | Liechtenstein |
LK | LKA | Sri Lanka |
LR | LBR | Liberia |
LS | LSO | Lesotho |
LT | LTU | Lithuania |
LU | LUX | Luxembourg |
LV | LVA | Latvia |
LY | LBY | Libya |
MA | MAR | Morocco |
MC | MCO | Monaco |
MD | MDA | Moldova |
ME | MNE | Montenegro |
MF | MAF | Saint Martin |
MG | MDG | Madagascar |
MH | MHL | Marshall Islands |
MK | MKD | North Macedonia |
ML | MLI | Mali |
MM | MMR | Myanmar |
MN | MNG | Mongolia |
MO | MAC | Macau |
MP | MNP | Northern Mariana Islands |
MR | MRT | Mauritania |
MS | MSR | Montserrat |
MT | MLT | Malta |
MU | MUS | Mauritius |
MV | MDV | Maldives |
MW | MWI | Malawi |
MX | MEX | Mexico |
MY | MYS | Malaysia |
MZ | MOZ | Mozambique |
NA | NAM | Namibia |
NC | NCL | New Caledonia |
NE | NER | Niger |
NF | NFK | Norfolk Island |
NG | NGA | Nigeria |
NI | NIC | Nicaragua |
NL | NLD | Netherlands |
NO | NOR | Norway |
NP | NPL | Nepal |
NR | NRU | Nauru |
NU | NIU | Niue |
NZ | NZL | New Zealand |
OM | OMN | Oman |
PA | PAN | Panama |
PE | PER | Peru |
PF | PYF | French Polynesia |
PG | PNG | Papua New Guinea |
PH | PHL | Philippines |
PK | PAK | Pakistan |
PL | POL | Poland |
PM | SPM | Saint Pierre and Miquelon |
PN | PCN | Pitcairn Islands |
PR | PRI | Puerto Rico |
PS | PSE | Palestine |
PT | PRT | Portugal |
PW | PLW | Palau |
PY | PRY | Paraguay |
QA | QAT | Qatar |
RO | ROU | Romania |
RS | SRB | Serbia |
RU | RUS | Russia |
RW | RWA | Rwanda |
SA | SAU | Saudi Arabia |
SB | SLB | Solomon Islands |
SC | SYC | Seychelles |
SD | SDN | Sudan |
SE | SWE | Sweden |
SG | SGP | Singapore |
SH | SHN | Saint Helena, Ascension and Tristan da Cunha |
SI | SVN | Slovenia |
SK | SVK | Slovakia |
SL | SLE | Sierra Leone |
SM | SMR | San Marino |
SN | SEN | Senegal |
SO | SOM | Somalia |
SR | SUR | Suriname |
SS | SSD | South Sudan |
ST | STP | São Tomé and Príncipe |
SV | SLV | El Salvador |
SX | SXM | Sint Maarten |
SY | SYR | Syria |
SZ | SWZ | Eswatini |
TC | TCA | Turks and Caicos Islands |
TD | TCD | Chad |
TF | ATF | French Southern and Antarctic Lands |
TG | TGO | Togo |
TH | THA | Thailand |
TJ | TJK | Tajikistan |
TL | TLS | Timor-Leste |
TM | TKM | Turkmenistan |
TN | TUN | Tunisia |
TO | TON | Tonga |
TR | TUR | Türkiye |
TT | TTO | Trinidad and Tobago |
TW | TWN | Taiwan |
TZ | TZA | Tanzania |
UA | UKR | Ukraine |
UG | UGA | Uganda |
US | USA | United States |
UY | URY | Uruguay |
UZ | UZB | Uzbekistan |
VA | VAT | Vatican City |
VC | VCT | Saint Vincent and the Grenadines |
VE | VEN | Venezuela |
VG | VGB | British Virgin Islands |
VI | VIR | United States Virgin Islands |
VN | VNM | Vietnam |
VU | VUT | Vanuatu |
WF | WLF | Wallis and Futuna |
WS | WSM | Samoa |
XK | UNK | Kosovo |
YE | YEM | Yemen |
ZA | ZAF | South Africa |
ZM | ZMB | Zambia |
ZW | ZWE | Zimbabwe |
Not on this map, refused by name: Antarctica (AQ), Caribbean Netherlands (BQ), Bouvet Island (BV), Cocos (Keeling) Islands (CC), Christmas Island (CX), French Guiana (GF), Gibraltar (GI), Guadeloupe (GP), Martinique (MQ), Réunion (RE), Svalbard and Jan Mayen (SJ), Tokelau (TK), Tuvalu (TV), United States Minor Outlying Islands (UM), Mayotte (YT).
US states map (51 states)
| Code | Also accepted | Name |
|---|---|---|
AK | 02 | Alaska |
AL | 01 | Alabama |
AR | 05 | Arkansas |
AZ | 04 | Arizona |
CA | 06 | California |
CO | 08 | Colorado |
CT | 09 | Connecticut |
DC | 11 | District of Columbia |
DE | 10 | Delaware |
FL | 12 | Florida |
GA | 13 | Georgia |
HI | 15 | Hawaii |
IA | 19 | Iowa |
ID | 16 | Idaho |
IL | 17 | Illinois |
IN | 18 | Indiana |
KS | 20 | Kansas |
KY | 21 | Kentucky |
LA | 22 | Louisiana |
MA | 25 | Massachusetts |
MD | 24 | Maryland |
ME | 23 | Maine |
MI | 26 | Michigan |
MN | 27 | Minnesota |
MO | 29 | Missouri |
MS | 28 | Mississippi |
MT | 30 | Montana |
NC | 37 | North Carolina |
ND | 38 | North Dakota |
NE | 31 | Nebraska |
NH | 33 | New Hampshire |
NJ | 34 | New Jersey |
NM | 35 | New Mexico |
NV | 32 | Nevada |
NY | 36 | New York |
OH | 39 | Ohio |
OK | 40 | Oklahoma |
OR | 41 | Oregon |
PA | 42 | Pennsylvania |
RI | 44 | Rhode Island |
SC | 45 | South Carolina |
SD | 46 | South Dakota |
TN | 47 | Tennessee |
TX | 48 | Texas |
UT | 49 | Utah |
VA | 51 | Virginia |
VT | 50 | Vermont |
WA | 53 | Washington |
WI | 55 | Wisconsin |
WV | 54 | West Virginia |
WY | 56 | Wyoming |
Not on this map, refused by name: American Samoa (AS), Guam (GU), Northern Mariana Islands (MP), Puerto Rico (PR), United States Virgin Islands (VI).
Example
{
"region": "world",
"idKey": "country",
"valueKey": "signups",
"format": "number",
"data": [
{ "country": "US", "signups": 412 },
{ "country": "GB", "signups": 138 },
{ "country": "DE", "signups": 96 },
{ "country": "IN", "signups": 87 },
{ "country": "CA", "signups": 64 },
{ "country": "BR", "signups": 41 },
{ "country": "AU", "signups": 33 },
{ "country": "JP", "signups": 19 }
]
}Send it from your code
Paste the document in the editor, or replace it with a PUT to the visual's push URL. The push API page has the details and examples.
Next: Bar chart JSON format