Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: blprnt/dataart2016b
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: gauini/dataart2016b
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Sep 26, 2016

  1. added homework

    Renata Gaui authored and Renata Gaui committed Sep 26, 2016
    Copy the full SHA
    1040f1f View commit details
Binary file added section1/.DS_Store
Binary file not shown.
Binary file added section1/homework/RenataGaui/.DS_Store
Binary file not shown.
51 changes: 51 additions & 0 deletions section1/homework/RenataGaui/data/ligue180.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{"Ligue-180":[
46423,
204514,
271212,
401729,
732878,
667076,
732468,
532711,
485105,
634862,
555634,
],
"inicioViolencia": [
1368,
3045,
3045,
3045,
3045,
1770,
1770,
1770,
1770,
3817,
],
"violenciaFisica": [
10000,
13000,
14500,
21000,
63000,
47000,
50000,
36000,
28000,
32000,
],
"violenciaPsicologica" : [
2000,
5000,
8000,
13500,
29000,
19000,
25500,
20000,
18000,
19500,
]

}
79 changes: 79 additions & 0 deletions section1/homework/RenataGaui/ligue180_v10.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
float i = 0;
float m = 0;
float nConvert;
float Stroke = 3;
float Space = 60;
float PhisColor;
float PsicColor;
float transparency;
float n;


void setup() {
size(800, 600, P3D);
smooth(4);
loadData("ligue180.json");
}

void draw() {
}

void loadData(String dataset) {
JSONObject YearStats = loadJSONObject(dataset);

JSONArray TotalCalls = YearStats.getJSONArray("Ligue-180");
JSONArray PhisViolence = YearStats.getJSONArray("violenciaFisica");
JSONArray PsicViolence = YearStats.getJSONArray("violenciaPsicologica");
//JSONArray ViolenceStart = YearStats.getJSONArray("inicioViolencia");

translate(width/2, 0);

background(255);

for (int j = 0; j < PhisViolence.size(); j++) {
for (int k = 0; k < PsicViolence.size(); k++) {
float o = PhisViolence.getInt(j);
float p = PsicViolence.getInt(k);
m = j*Space;
float PhisColor = (map(o, 10000, 32000, 0, 255))/5;
float PsicColor = (map(p, 2000, 18500, 0, 255))/5;
float transparency = (PhisColor + PsicColor)/2;
stroke(PhisColor, 0, PsicColor, transparency);
//stroke(transparency);
strokeWeight(60);
line(0, m+30, width, m+30);
line(-width, m+30, 0, m+30);
}
}

beginShape();
noFill();
for (int i =0; i < TotalCalls.size(); i++) {

float n = TotalCalls.getInt(i);
float m = i*60;
float nConvert = n/20000;

strokeWeight(Stroke);
stroke(255);

vertex(nConvert, m);
}
endShape();

beginShape();
noFill();
for (int i =0; i < TotalCalls.size(); i++) {

float n = TotalCalls.getInt(i);
float m = i*60;
float nConvert = n/20000;

strokeWeight(Stroke);
stroke(255);

vertex(-nConvert, m);
}
endShape();
fill(255);
}