-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathline_graph_vis.pde
49 lines (39 loc) · 980 Bytes
/
line_graph_vis.pde
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
int dimX = 1280;
int dimY = 720;
void settings() {
size(dimX, dimY);
}
String inputData = "covid-19-malaysia.csv";
//String inputData = "apims-final.csv";
Graph g;
int steps = 60;
int transition = 30;
PVector centre = new PVector(dimX*.05, dimY*.92);
PVector maxG = new PVector(dimX*.85, dimY*.1);
void setup() {
frameRate(60);
println("Loading table...");
Table csv = loadTable(inputData, "header");
println("Table loaded");
g = new Graph(centre,maxG,transition,csv);
}
void draw() {
String c = "000000";
background(unhex(c));
if (frameCount % steps == 0 && !g.finished) {
g.nextStep();
}
if (!g.finished) g.update();
pushStyle();
textSize(16);
text(frameCount, dimX*.95, dimY*.1);
text(frameRate, dimX*.95, dimY*.8);
popStyle();
//saveFrame("frames/frame-####.png");
if (g.finished) {
println(frameCount);
exit();
} else if (frameCount % 60 == 0) {
println(frameCount/60 + "/88 seconds procesed");
}
}