“Final Project' / R.A” by Data Flaw
https://openprocessing.org/sketch/1027317
License CreativeCommons Attribution ShareAlike
https://creativecommons.org/licenses/by-sa/3.0
{{filePath}}
{{width}} x {{height}}
Report Sketch
Oh, that naughty sketch! Please let us know what the issue is below.
Apply Template
Applying this template will reset your sketch and remove all your changes. Are you sure you would like to continue?
Report Sketch
Report Comment
Please confirm that you would like to report the comment below.
We will review your submission and take any actions necessary per our Community Guidelines. In addition to reporting this comment, you can also block the user to prevent any future interactions.
Please report comments only when necessary. Unnecessary or abusive use of this tool may result in your own account being suspended.
Are you sure you want to delete your sketch?
Any files uploaded will be deleted as well.
Delete Comment?
This will also delete all the replies to this comment.
Delete this tab? Any code in it will be deleted as well.
Select a collection to submit your sketch
We Need Your Support
Since 2008, OpenProcessing has provided tools for creative coders to learn, create, and share over a million open source projects in a friendly environment.
Niche websites like ours need your continued support for future development and maintenance, while keeping it an ad-free platform that respects your data and privacy!
Please consider subscribing below to show your support with a "Plus" badge on your profile and get access to many other features!
A fork of Final Project' by Clément
CC Attribution ShareAlike
Final Project' / R.A
Flaw
xxxxxxxxxx
let img
var ScreentimeTable
var x= 0;
var y= 0;
var r= 0;
var country = "";
var hours = "";
function preload (){
ScreentimeTable=loadTable('ScreentimeTable5.csv','csv','header')
}
function setup() {
createCanvas(1200,650);
img= loadImage('World Map Project .png')
textAlign(CENTER); // Pour centre le texte
}
function draw() {
image(img,0,0)
// Algo lecture CSV
for(var i=0; i< ScreentimeTable.getRowCount(); i++)
{
var row = ScreentimeTable.getRow(i);
country= row.get("Country")
hours= row.get("ScreenTime")
x= row.get("X")
y= row.get("Y")
r= row.get("R")
fill(255);
ellipse(x,y,r,r)
console.log("Country : "+country+"; average screen time : "+hours+"; X : "+x+"; Y : "+y+"; R : "+r);
var d = dist(mouseX,mouseY,x,y)
//fill(255,0,0);
//ellipse(500,500,30,30);
if (d <= r)
{
textSize(30)
fill(0)
textFont('Georgia')
text(hours,x,y)
}
}
// -----
/*
for(var i=0; i< ScreentimeTable.getRowCount(); i++){
ellipse(posX[i],posY[i], r, r)
}
fill(9,82,40)
ellipse(1032,195,08,8)// Japon
fill(52, 201, 36)
ellipse(534,152,15,15)// France
fill(0,255,0)
ellipse(523,125,08,08)// Royaume-Uni
ellipse(575,095,10,10)// Suède
ellipse(930,220,35,35)// Chine
ellipse(1030,470,35,35)// Australie
ellipse(1150,538,17,17)// Nouvelle-Zélande
fill(255,255,0)
ellipse(160,190,35,35)// USA
ellipse(593,128,12,12)// Pologne
ellipse(690,250,25,25)// Arabie Saoudite
ellipse(800,090,35,35)// Russie
fill(252,210,28)
ellipse(632,237,22,22)// Égypte
ellipse(650,185,14,14)// Turquie
fill(237,127,16)
ellipse(133,250,23,23)// Mexique
ellipse(285,515,27,27)// Argentine
ellipse(610,490,22,22)// Afrique du Sud
ellipse(990,363,10,10)// Indonésie
fill(244,102,27)
ellipse(320,405,35,35)// Brésil
ellipse(912,288,12,12)// Thaïlande
fill(255,73,1)
ellipse(1000,300,12,12)// Philippines
*/
}
See More Shortcuts