-
Notifications
You must be signed in to change notification settings - Fork 0
/
sketch.js
57 lines (43 loc) · 997 Bytes
/
sketch.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
let data;
let url = 'https://source.unsplash.com/1600x900/?';
let img;
let img2;
let boxes;
let w;
let h;
function preload(){
data = loadTable('https://raw.githubusercontent.com/computational-mama/nadika-sangam/main/nadika-sangam.csv','csv')
img = loadImage(url)
}
// function searchloaded(){
// if (data.loaded == true){
// return true
// }
// }
function setup() {
createCanvas(900, 700);
noLoop()
}
function draw() {
background(220);
// if(url != ""){
image(img, 600,300,160,90)
// }
for (let r = 0; r < data.getRowCount(); r++)
for (let c = 0; c < data.getColumnCount(); c++) {
// console.log(data.getString(r, c));
noStroke()
w = 80
h = 20
rect(c*100,r*30+60, w,h)
text(data.getString(r, c),c*100,r*30+60, 100,70)
}
text(url+data.get(2,4),100,670)
// image(img2,100,670,160,90)
}
function mousePressed(){
}
function clickSquare(){
let d = dist(mouseX, mouseY, w, h)
if(d)
}