Proportional Symbol Map
Maps in CanvasXpress allow users to create interactive and customizable visualizations for geographical data. You can integrate various map types, such as choropleths or point maps, and layer your data to highlight trends, distributions, or relationships across regions. With its flexibility, Maps in CanvasXpress support detailed analysis and presentation of spatial data for a wide range of applications.
<html>
<head>
<!-- Include the CanvasXpress library in your HTML file -->
<link rel="stylesheet" href="https://www.canvasxpress.org/dist/canvasXpress.css" type="text/css"/>
<script src="https://www.canvasxpress.org/dist/canvasXpress.min.js"></script>
</head>
<body>
<!-- Create a canvas element for the chart with the desired dimensions -->
<div>
<canvas id="canvasId" width="600" height="600"></canvas>
</div>
<!-- Create a script to initialize the chart -->
<script>
// Use a data frame (2D-array) for the graph
var data =
// Create the configuration for the graph
var config = {
"graphType": "Map",
"topoJSON": "https://www.canvasxpress.org/data/maps/WORLD.json",
"mapId": "medalsBubbles",
"sizeBy": "Total",
"mapColor": "#e5e7eb",
"mapOutlineColor": "#ffffff",
"mapBubbleColor": "rgba(8,81,156,0.6)",
"legendPosition": "bottom",
"title": "Olympic medals, Paris 2024 (bubbles)",
"source": "IOC",
"legendColumns": 4
}
// Event used to create graph (optional)
var events = false
// Call the CanvasXpress function to create the graph
var cX = new CanvasXpress("canvasId", data, config, events);
</script>
</body>
</html>
<html>
<head>
<!-- Include the CanvasXpress library in your HTML file -->
<link rel="stylesheet" href="https://www.canvasxpress.org/dist/canvasXpress.css" type="text/css"/>
<script src="https://www.canvasxpress.org/dist/canvasXpress.min.js"></script>
</head>
<body>
<!-- Create a canvas element for the chart with the desired dimensions -->
<div>
<canvas id="canvasId" width="600" height="600"></canvas>
</div>
<!-- Create a script to initialize the chart -->
<script>
// Create the data for the graph
var data = {
"y" : {
"data" : [
[
0,
0,
2,
2
],
[
1,
1,
1,
3
],
[
0,
3,
1,
4
],
[
18,
19,
16,
53
],
[
2,
0,
3,
5
],
[
2,
2,
3,
7
],
[
3,
1,
6,
10
],
[
3,
1,
3,
7
],
[
2,
1,
1,
4
],
[
3,
7,
10,
20
],
[
1,
1,
0,
2
],
[
9,
7,
11,
27
],
[
1,
2,
5,
8
],
[
1,
1,
0,
2
],
[
40,
27,
24,
91
],
[
0,
0,
1,
1
],
[
0,
3,
1,
4
],
[
0,
0,
1,
1
],
[
2,
1,
6,
9
],
[
0,
1,
0,
1
],
[
3,
0,
2,
5
],
[
12,
13,
8,
33
],
[
1,
0,
0,
1
],
[
2,
2,
5,
9
],
[
1,
0,
2,
3
],
[
2,
0,
1,
3
],
[
1,
2,
2,
5
],
[
1,
1,
1,
3
],
[
0,
0,
1,
1
],
[
5,
4,
9,
18
],
[
1,
3,
0,
4
],
[
0,
1,
0,
1
],
[
16,
26,
22,
64
],
[
14,
22,
29,
65
],
[
3,
3,
1,
7
],
[
1,
1,
6,
8
],
[
0,
0,
2,
2
],
[
1,
0,
1,
2
],
[
2,
0,
2,
4
],
[
2,
2,
3,
7
],
[
6,
7,
6,
19
],
[
2,
0,
0,
2
],
[
0,
1,
5,
6
],
[
4,
0,
3,
7
],
[
3,
6,
3,
12
],
[
1,
5,
1,
7
],
[
12,
13,
15,
40
],
[
1,
3,
2,
6
],
[
0,
1,
0,
1
],
[
20,
12,
13,
45
],
[
1,
3,
3,
7
],
[
4,
2,
5,
11
],
[
0,
2,
4,
6
],
[
13,
9,
10,
32
],
[
0,
1,
1,
2
],
[
1,
1,
0,
2
],
[
0,
2,
2,
4
],
[
1,
0,
1,
2
],
[
0,
1,
3,
4
],
[
0,
3,
2,
5
],
[
0,
1,
0,
1
],
[
0,
0,
2,
2
],
[
15,
7,
12,
34
],
[
4,
1,
3,
8
],
[
10,
7,
3,
20
],
[
1,
0,
0,
1
],
[
0,
1,
0,
1
],
[
0,
0,
1,
1
],
[
2,
0,
2,
4
],
[
1,
4,
5,
10
],
[
0,
0,
2,
2
],
[
0,
2,
4,
6
],
[
1,
2,
1,
4
],
[
0,
0,
1,
1
],
[
3,
4,
2,
9
],
[
1,
3,
1,
5
],
[
0,
0,
1,
1
],
[
3,
1,
1,
5
],
[
0,
0,
1,
1
],
[
2,
1,
0,
3
],
[
4,
4,
3,
11
],
[
1,
3,
2,
6
],
[
0,
0,
3,
3
],
[
2,
0,
5,
7
],
[
1,
1,
1,
3
],
[
0,
3,
5,
8
],
[
1,
1,
0,
2
],
[
3,
5,
4,
12
],
[
40,
44,
42,
126
],
[
8,
2,
3,
13
],
[
1,
3,
2,
6
],
[
0,
0,
1,
1
]
],
"smps" : [
"Gold",
"Silver",
"Bronze",
"Total"
],
"vars" : [
"ALB",
"ARG",
"ARM",
"AUS",
"AUT",
"AZE",
"BEL",
"BGR",
"BHR",
"BRA",
"BWA",
"CAN",
"CHE",
"CHL",
"CHN",
"CIV",
"COL",
"CPV",
"CUB",
"CYP",
"CZE",
"DEU",
"DMA",
"DNK",
"DOM",
"DZA",
"ECU",
"EGY",
"-99",
"ESP",
"ETH",
"FJI",
"FRA",
"GBR",
"GEO",
"GRC",
"GRD",
"GTM",
"HKG",
"HRV",
"HUN",
"IDN",
"IND",
"IRL",
"IRN",
"ISR",
"ITA",
"JAM",
"JOR",
"JPN",
"KAZ",
"KEN",
"KGZ",
"KOR",
"KSV",
"LCA",
"LTU",
"MAR",
"MDA",
"MEX",
"MNG",
"MYS",
"NLD",
"NOR",
"NZL",
"PAK",
"PAN",
"PER",
"PHL",
"POL",
"PRI",
"PRK",
"PRT",
"QAT",
"ROU",
"RUS",
"SGP",
"SRB",
"SVK",
"SVN",
"SWE",
"THA",
"TJK",
"TWN",
"TUN",
"TUR",
"UGA",
"UKR",
"USA",
"UZB",
"ZAF",
"ZMB"
]
}
}
// Create the configuration for the graph
var config = {
"graphType": "Map",
"topoJSON": "https://www.canvasxpress.org/data/maps/WORLD.json",
"mapId": "medalsBubbles",
"sizeBy": "Total",
"mapColor": "#e5e7eb",
"mapOutlineColor": "#ffffff",
"mapBubbleColor": "rgba(8,81,156,0.6)",
"legendPosition": "bottom",
"title": "Olympic medals, Paris 2024 (bubbles)",
"source": "IOC",
"legendColumns": 4
}
// Event used to create graph (optional)
var events = false
// Call the CanvasXpress function to create the graph
var cX = new CanvasXpress("canvasId", data, config, events);
</script>
</body>
</html>
library(canvasXpress)
y=read.table("https://www.canvasxpress.org/data/r/cX-map20-dat.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE)
canvasXpress(
data=y,
graphType="Map",
legendColumns=4,
legendPosition="bottom",
mapBubbleColor="rgba(8,81,156,0.6)",
mapColor="#e5e7eb",
mapId="medalsBubbles",
mapOutlineColor="#ffffff",
sizeBy="Total",
source="IOC",
title="Olympic medals, Paris 2024 (bubbles)",
topoJSON="https://www.canvasxpress.org/data/maps/WORLD.json"
)
from canvasxpress.canvas import CanvasXpress
from canvasxpress.plot import show_in_browser
if __name__ == "__main__":
# Define the chart with its data and configuration
chart: CanvasXpress = CanvasXpress(
render_to = "map19",
data = {
"y": {
"data": [
[0, 0, 2, 2],
[1, 1, 1, 3],
[0, 3, 1, 4],
[18, 19, 16, 53],
[2, 0, 3, 5],
[2, 2, 3, 7],
[3, 1, 6, 10],
[3, 1, 3, 7],
[2, 1, 1, 4],
[3, 7, 10, 20],
[1, 1, 0, 2],
[9, 7, 11, 27],
[1, 2, 5, 8],
[1, 1, 0, 2],
[40, 27, 24, 91],
[0, 0, 1, 1],
[0, 3, 1, 4],
[0, 0, 1, 1],
[2, 1, 6, 9],
[0, 1, 0, 1],
[3, 0, 2, 5],
[12, 13, 8, 33],
[1, 0, 0, 1],
[2, 2, 5, 9],
[1, 0, 2, 3],
[2, 0, 1, 3],
[1, 2, 2, 5],
[1, 1, 1, 3],
[0, 0, 1, 1],
[5, 4, 9, 18],
[1, 3, 0, 4],
[0, 1, 0, 1],
[16, 26, 22, 64],
[14, 22, 29, 65],
[3, 3, 1, 7],
[1, 1, 6, 8],
[0, 0, 2, 2],
[1, 0, 1, 2],
[2, 0, 2, 4],
[2, 2, 3, 7],
[6, 7, 6, 19],
[2, 0, 0, 2],
[0, 1, 5, 6],
[4, 0, 3, 7],
[3, 6, 3, 12],
[1, 5, 1, 7],
[12, 13, 15, 40],
[1, 3, 2, 6],
[0, 1, 0, 1],
[20, 12, 13, 45],
[1, 3, 3, 7],
[4, 2, 5, 11],
[0, 2, 4, 6],
[13, 9, 10, 32],
[0, 1, 1, 2],
[1, 1, 0, 2],
[0, 2, 2, 4],
[1, 0, 1, 2],
[0, 1, 3, 4],
[0, 3, 2, 5],
[0, 1, 0, 1],
[0, 0, 2, 2],
[15, 7, 12, 34],
[4, 1, 3, 8],
[10, 7, 3, 20],
[1, 0, 0, 1],
[0, 1, 0, 1],
[0, 0, 1, 1],
[2, 0, 2, 4],
[1, 4, 5, 10],
[0, 0, 2, 2],
[0, 2, 4, 6],
[1, 2, 1, 4],
[0, 0, 1, 1],
[3, 4, 2, 9],
[1, 3, 1, 5],
[0, 0, 1, 1],
[3, 1, 1, 5],
[0, 0, 1, 1],
[2, 1, 0, 3],
[4, 4, 3, 11],
[1, 3, 2, 6],
[0, 0, 3, 3],
[2, 0, 5, 7],
[1, 1, 1, 3],
[0, 3, 5, 8],
[1, 1, 0, 2],
[3, 5, 4, 12],
[40, 44, 42, 126],
[8, 2, 3, 13],
[1, 3, 2, 6],
[0, 0, 1, 1]
],
"smps": ["Gold", "Silver", "Bronze", "Total"],
"vars": ["ALB", "ARG", "ARM", "AUS", "AUT", "AZE", "BEL", "BGR", "BHR", "BRA", "BWA", "CAN", "CHE", "CHL", "CHN", "CIV", "COL", "CPV", "CUB", "CYP", "CZE", "DEU", "DMA", "DNK", "DOM", "DZA", "ECU", "EGY", "-99", "ESP", "ETH", "FJI", "FRA", "GBR", "GEO", "GRC", "GRD", "GTM", "HKG", "HRV", "HUN", "IDN", "IND", "IRL", "IRN", "ISR", "ITA", "JAM", "JOR", "JPN", "KAZ", "KEN", "KGZ", "KOR", "KSV", "LCA", "LTU", "MAR", "MDA", "MEX", "MNG", "MYS", "NLD", "NOR", "NZL", "PAK", "PAN", "PER", "PHL", "POL", "PRI", "PRK", "PRT", "QAT", "ROU", "RUS", "SGP", "SRB", "SVK", "SVN", "SWE", "THA", "TJK", "TWN", "TUN", "TUR", "UGA", "UKR", "USA", "UZB", "ZAF", "ZMB"]
}
},
config = {
"graphType": "Map",
"topoJSON": "https://www.canvasxpress.org/data/maps/WORLD.json",
"mapId": "medalsBubbles",
"sizeBy": "Total",
"mapColor": "#e5e7eb",
"mapOutlineColor": "#ffffff",
"mapBubbleColor": "rgba(8,81,156,0.6)",
"legendPosition": "bottom",
"title": "Olympic medals, Paris 2024 (bubbles)",
"source": "IOC",
"legendColumns": 4
},
width = 600,
height = 600
)
# Display the chart in its own Web page
show_in_browser(chart)
from canvasxpress.canvas import CanvasXpress
from canvasxpress.plot import graph
graph(
CanvasXpress(
render_to = "map19",
data = {
"y": {
"data": [
[0, 0, 2, 2],
[1, 1, 1, 3],
[0, 3, 1, 4],
[18, 19, 16, 53],
[2, 0, 3, 5],
[2, 2, 3, 7],
[3, 1, 6, 10],
[3, 1, 3, 7],
[2, 1, 1, 4],
[3, 7, 10, 20],
[1, 1, 0, 2],
[9, 7, 11, 27],
[1, 2, 5, 8],
[1, 1, 0, 2],
[40, 27, 24, 91],
[0, 0, 1, 1],
[0, 3, 1, 4],
[0, 0, 1, 1],
[2, 1, 6, 9],
[0, 1, 0, 1],
[3, 0, 2, 5],
[12, 13, 8, 33],
[1, 0, 0, 1],
[2, 2, 5, 9],
[1, 0, 2, 3],
[2, 0, 1, 3],
[1, 2, 2, 5],
[1, 1, 1, 3],
[0, 0, 1, 1],
[5, 4, 9, 18],
[1, 3, 0, 4],
[0, 1, 0, 1],
[16, 26, 22, 64],
[14, 22, 29, 65],
[3, 3, 1, 7],
[1, 1, 6, 8],
[0, 0, 2, 2],
[1, 0, 1, 2],
[2, 0, 2, 4],
[2, 2, 3, 7],
[6, 7, 6, 19],
[2, 0, 0, 2],
[0, 1, 5, 6],
[4, 0, 3, 7],
[3, 6, 3, 12],
[1, 5, 1, 7],
[12, 13, 15, 40],
[1, 3, 2, 6],
[0, 1, 0, 1],
[20, 12, 13, 45],
[1, 3, 3, 7],
[4, 2, 5, 11],
[0, 2, 4, 6],
[13, 9, 10, 32],
[0, 1, 1, 2],
[1, 1, 0, 2],
[0, 2, 2, 4],
[1, 0, 1, 2],
[0, 1, 3, 4],
[0, 3, 2, 5],
[0, 1, 0, 1],
[0, 0, 2, 2],
[15, 7, 12, 34],
[4, 1, 3, 8],
[10, 7, 3, 20],
[1, 0, 0, 1],
[0, 1, 0, 1],
[0, 0, 1, 1],
[2, 0, 2, 4],
[1, 4, 5, 10],
[0, 0, 2, 2],
[0, 2, 4, 6],
[1, 2, 1, 4],
[0, 0, 1, 1],
[3, 4, 2, 9],
[1, 3, 1, 5],
[0, 0, 1, 1],
[3, 1, 1, 5],
[0, 0, 1, 1],
[2, 1, 0, 3],
[4, 4, 3, 11],
[1, 3, 2, 6],
[0, 0, 3, 3],
[2, 0, 5, 7],
[1, 1, 1, 3],
[0, 3, 5, 8],
[1, 1, 0, 2],
[3, 5, 4, 12],
[40, 44, 42, 126],
[8, 2, 3, 13],
[1, 3, 2, 6],
[0, 0, 1, 1]
],
"smps": ["Gold", "Silver", "Bronze", "Total"],
"vars": ["ALB", "ARG", "ARM", "AUS", "AUT", "AZE", "BEL", "BGR", "BHR", "BRA", "BWA", "CAN", "CHE", "CHL", "CHN", "CIV", "COL", "CPV", "CUB", "CYP", "CZE", "DEU", "DMA", "DNK", "DOM", "DZA", "ECU", "EGY", "-99", "ESP", "ETH", "FJI", "FRA", "GBR", "GEO", "GRC", "GRD", "GTM", "HKG", "HRV", "HUN", "IDN", "IND", "IRL", "IRN", "ISR", "ITA", "JAM", "JOR", "JPN", "KAZ", "KEN", "KGZ", "KOR", "KSV", "LCA", "LTU", "MAR", "MDA", "MEX", "MNG", "MYS", "NLD", "NOR", "NZL", "PAK", "PAN", "PER", "PHL", "POL", "PRI", "PRK", "PRT", "QAT", "ROU", "RUS", "SGP", "SRB", "SVK", "SVN", "SWE", "THA", "TJK", "TWN", "TUN", "TUR", "UGA", "UKR", "USA", "UZB", "ZAF", "ZMB"]
}
},
config = {
"graphType": "Map",
"topoJSON": "https://www.canvasxpress.org/data/maps/WORLD.json",
"mapId": "medalsBubbles",
"sizeBy": "Total",
"mapColor": "#e5e7eb",
"mapOutlineColor": "#ffffff",
"mapBubbleColor": "rgba(8,81,156,0.6)",
"legendPosition": "bottom",
"title": "Olympic medals, Paris 2024 (bubbles)",
"source": "IOC",
"legendColumns": 4
},
width = 600,
height = 600
)
)
using CanvasXpress
canvasxpress(Dict(
"y" => Dict(
"data" => [
[0, 0, 2, 2],
[1, 1, 1, 3],
[0, 3, 1, 4],
[18, 19, 16, 53],
[2, 0, 3, 5],
[2, 2, 3, 7],
[3, 1, 6, 10],
[3, 1, 3, 7],
[2, 1, 1, 4],
[3, 7, 10, 20],
[1, 1, 0, 2],
[9, 7, 11, 27],
[1, 2, 5, 8],
[1, 1, 0, 2],
[40, 27, 24, 91],
[0, 0, 1, 1],
[0, 3, 1, 4],
[0, 0, 1, 1],
[2, 1, 6, 9],
[0, 1, 0, 1],
[3, 0, 2, 5],
[12, 13, 8, 33],
[1, 0, 0, 1],
[2, 2, 5, 9],
[1, 0, 2, 3],
[2, 0, 1, 3],
[1, 2, 2, 5],
[1, 1, 1, 3],
[0, 0, 1, 1],
[5, 4, 9, 18],
[1, 3, 0, 4],
[0, 1, 0, 1],
[16, 26, 22, 64],
[14, 22, 29, 65],
[3, 3, 1, 7],
[1, 1, 6, 8],
[0, 0, 2, 2],
[1, 0, 1, 2],
[2, 0, 2, 4],
[2, 2, 3, 7],
[6, 7, 6, 19],
[2, 0, 0, 2],
[0, 1, 5, 6],
[4, 0, 3, 7],
[3, 6, 3, 12],
[1, 5, 1, 7],
[12, 13, 15, 40],
[1, 3, 2, 6],
[0, 1, 0, 1],
[20, 12, 13, 45],
[1, 3, 3, 7],
[4, 2, 5, 11],
[0, 2, 4, 6],
[13, 9, 10, 32],
[0, 1, 1, 2],
[1, 1, 0, 2],
[0, 2, 2, 4],
[1, 0, 1, 2],
[0, 1, 3, 4],
[0, 3, 2, 5],
[0, 1, 0, 1],
[0, 0, 2, 2],
[15, 7, 12, 34],
[4, 1, 3, 8],
[10, 7, 3, 20],
[1, 0, 0, 1],
[0, 1, 0, 1],
[0, 0, 1, 1],
[2, 0, 2, 4],
[1, 4, 5, 10],
[0, 0, 2, 2],
[0, 2, 4, 6],
[1, 2, 1, 4],
[0, 0, 1, 1],
[3, 4, 2, 9],
[1, 3, 1, 5],
[0, 0, 1, 1],
[3, 1, 1, 5],
[0, 0, 1, 1],
[2, 1, 0, 3],
[4, 4, 3, 11],
[1, 3, 2, 6],
[0, 0, 3, 3],
[2, 0, 5, 7],
[1, 1, 1, 3],
[0, 3, 5, 8],
[1, 1, 0, 2],
[3, 5, 4, 12],
[40, 44, 42, 126],
[8, 2, 3, 13],
[1, 3, 2, 6],
[0, 0, 1, 1]
],
"smps" => ["Gold", "Silver", "Bronze", "Total"],
"vars" => ["ALB", "ARG", "ARM", "AUS", "AUT", "AZE", "BEL", "BGR", "BHR", "BRA", "BWA", "CAN", "CHE", "CHL", "CHN", "CIV", "COL", "CPV", "CUB", "CYP", "CZE", "DEU", "DMA", "DNK", "DOM", "DZA", "ECU", "EGY", "-99", "ESP", "ETH", "FJI", "FRA", "GBR", "GEO", "GRC", "GRD", "GTM", "HKG", "HRV", "HUN", "IDN", "IND", "IRL", "IRN", "ISR", "ITA", "JAM", "JOR", "JPN", "KAZ", "KEN", "KGZ", "KOR", "KSV", "LCA", "LTU", "MAR", "MDA", "MEX", "MNG", "MYS", "NLD", "NOR", "NZL", "PAK", "PAN", "PER", "PHL", "POL", "PRI", "PRK", "PRT", "QAT", "ROU", "RUS", "SGP", "SRB", "SVK", "SVN", "SWE", "THA", "TJK", "TWN", "TUN", "TUR", "UGA", "UKR", "USA", "UZB", "ZAF", "ZMB"]
)
);
graphType = "Map",
topoJSON = "https://www.canvasxpress.org/data/maps/WORLD.json",
mapId = "medalsBubbles",
sizeBy = "Total",
mapColor = "#e5e7eb",
mapOutlineColor = "#ffffff",
mapBubbleColor = "rgba(8,81,156,0.6)",
legendPosition = "bottom",
title = "Olympic medals, Paris 2024 (bubbles)",
source = "IOC",
legendColumns = 4
)


















