Example 1: JSON Bubble Plot
Code
let data;
function preload() {
data = loadJSON('../assets/data/example.json');
}
function setup() {
createCanvas(400, 400);
}
function draw() {
background(252);
for (const c of data.cities) {
fill(255, 45, 140, 180);
noStroke();
circle(c.x, c.y, c.pop * 2.5);
fill(20);
text(c.name, c.x + 12, c.y);
}
}Try this: Map a different field to bubble size.