xxxxxxxxxx
// //inspired by https://openprocessing.org/sketch/1152792
// var baseurl = 'https://data.cityofnewyork.us/resource/xywu-7bv9.json';
// var elementValue = '_1950_boro_share_of_nyc_total'
// // var elementName = "borough"
// // var useData = []
// function easeOutQuart(x){
// return 1 - pow(1 - x, 4);
// }
// function preload() {
// var url = baseurl //why do we have to re-name the variable?
// data = loadJSON( url );
// }
// function setup() {
// data = Object.values(data);
// // for(let d of data){
// // if(d){
// // useData.push(d)
// // }
// // }
// createCanvas(windowWidth, windowHeight);
// background("#182066");
// console.log(data)
// }
// function draw() {
// let animationProgress = easeOutQuart(map(frameCount, 0, 300, 0, 1, true))
// for(var i = 0; i <data.length; i++){
// translate(50,0);
// push()
// stroke(255);
// fill(235, 131, 154, 255);
// let d = data[i]
// rect(i*50, 0, 50, d.elementValue*1*animationProgress);
// translate(i*50, 0);
// rotate(radians(90));
// noStroke();
// fill("#FFF")
// // text(d.elementName,10,-20)
// // text(d.elementValue,175,-20)
// pop()
// }
// }