xxxxxxxxxx
28
// Example using getString() to access cells of the table object
let table, rows, cols;
function preload() {
table = loadTable("https://corgis-edu.github.io/corgis/datasets/csv/cancer/cancer.csv", "csv", "header");
}
function setup() {
createCanvas(400, 400);
rows = table.getRowCount();
cols = table.getColumnCount();
}
function draw() {
background("white");
noStroke();
for (let r = 0; r < rows; r++) {
for (let c = 0; c < cols; c++) {
let cell = table.get(r, c);
let x = map(r, 0, rows, 0, width);
let y = map(c, 0, cols, 0, height);
fill(x, y, random(255), 127);
ellipse(x, y, cell.length, cell % 100);
}
}
}