We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, i'm trying to do a data visualization about immigration. I have the countries represented as ellipses and i'm trying to put small ellipses inside the "country" ones to represent citizens. My first question is: how do I set the boundaries and make them (the citizens ellipse) not overlap each other.
Second question is (i've imported my data in the format ("year","origin","destination","gender","","value") "how do I 'connect' it to the citizens ellipses and make them move from country to country?
Thank you for you time and forgive my lack of knowledge!
Answers
show your entire code please
do you know objects / classes / oop?
draw the countries at ellipses (circle)
set the position of the people via random inside the circle
like this
2.
a)
Let's make a class Citizen as blue print for all citizens.
Make an ArrayList to hold all citizens. Call it citizens.
now read your list and fill in all citizens with
"year","origin","destination","gender"
(in setup())
b)
also have a class Country and an ArrayList countries that you fill during a)
each country has a name and a screen pos
from the countries screen pos give all citizen a screen pos around there origin country and around the destination country (see
1.
)(in setup())
c)
display all countries and all citizens
draw lines from origin country to the destination country pos for all citizens
(in draw())
d)
now we want to animate the travel of citizens in draw().
have a single var
year
and let's say a varday
you increase day (
day++;
) until 365 and then set day to 0 andyear++;
during that check the year of each citizen
when the year match, set a marker in the class Citizen for this person, use
lerp()
with day to travel from origin to destiny pos while days increasedone.
come back when you have questions.
Best, Chrisir ;-)
my code so far:
go hback, edit your post please
empty line before and after the code
highlight entire Code
hit ctrl-o
done!
thanks
I just wait until you followed my steps.
;-)
we have no idea what is in these files
the image is just a reference of the european map to place the 'countries'. the csv is a spreadsheet that contains ("year","origin","destination","gender","","value") and its values
I think it's no use to draw the values for the countries in this way... better store them to a csv and use them in a ArrayLIst / class as described above
It's fairly complex, so I recommend to read the tutorial about objects first and use this concept as described above
I had time to work a little on it.
it's a mock-up since it uses no csv and no real countries
but here you go
Keywords:
https://forum.processing.org/two/discussion/14280/boundaries-and-particules#latest
boundaries and particles
boundary and particle
Country countries
Migration
Refugees refugee
Citizens Citizen