-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub_league_commits_graph.pde
More file actions
54 lines (44 loc) · 1.54 KB
/
github_league_commits_graph.pde
File metadata and controls
54 lines (44 loc) · 1.54 KB
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
Table table; // making table variable
float dataMax = MAX_FLOAT; //establishing min and max values from data
float dataMin = MIN_FLOAT;
int rowCount; //establishing length of data
void setup() {
size(550, 550);
background(255);
table = loadTable("fabpot.csv", "header"); //importing csv data
//int val1 = table.getInt(2, 1);
//print(val1);
rowCount = table.getRowCount();
//print(dataMin); //testing
//print(rowCount);
displayBlocks(); //calling display blocks function to display final blocks, colored according to data
}
void draw() {
}
//void displayBlocks() {
// noStroke();
// for (int i = 0; i < rowCount; i++) {
// float containerVal = table.getFloat(i, 0); // getting values for first column of each row
// //println(containerVal);
// float valMappedToColor = map(containerVal, dataMin, dataMax, 0, 255); //mapping max and min data values to color range
// println(valMappedToColor);
// for (int y = 0; y < height; y+=40) {
// for (int x = 0; x < width; x +=40) {
// fill(valMappedToColor);
// rect(x, y, 40, 40);
// }
// }
// }
//}
void displayBlocks() {
noStroke();
for (int i = 0; i < rowCount; i++) {
float containerVal = table.getFloat(i, 0); // getting values for first column of each row
//println(containerVal);
// put them in array?
float valMappedToColor = map(containerVal, dataMin, dataMax, 0, 255); //mapping max and min data values to color range
println(valMappedToColor);
//fill(valMappedToColor);
//rect(100, 100, 40, 40);
}
}