var table;

function preload() {
  table = loadTable("future_cities_data.csv","csv","header")
}
function setup() {
  createCanvas(1000,1000)
  noStroke()
  fill(0,0,255,100)

  background(255,255,255)

  let meanTemps = table.getColumn('Annual_Mean_Temperature');



  if(table.get){
    var rows = table.getRows()
    for (var i= 0; i < rows.length; i++) {

      var from_long = rows[i].getNum("Longitude")
      var from_lat = rows[i].getNum("Latitude")
      var meanTemp = rows[i].getNum("Annual_Mean_Temperature");
      
      var x = map(from_long, -180, 180, 0, width)
      var y = map(from_lat, -90, 90, height, 0)
      var diameter = map(meanTemp , min(meanTemps), max(meanTemps), 1,10);
      ellipse(x,y,diameter,diameter)
    }
  }
}

