Skip to content
Snippets Groups Projects
Commit f815b04d authored by Lucas Philippe's avatar Lucas Philippe
Browse files

ajout readme et clean

parent 61d3b9fb
No related branches found
No related tags found
No related merge requests found
......@@ -9,3 +9,5 @@ Le dossier `TP1` comprend le TP1 et le TP2 (expérience contrôlée).
Le dossier `TP3` comprend l'analyse des résultats.
Le dossier `TP4` comprend le TP "Technique d'entrée de texte".
Le dossier `TP5` comprend le TP "Visualisation".
\ No newline at end of file
# Visualisation processing
## TP1
## Première paartie
**Enoncé du tp : http://malacria.com/teachings/RVA/visualisation/tpvisu1.html**
## TP2
## Deuxième partie
**Enoncé du tp : http://malacria.com/teachings/RVA/visualisation/tpvisu2.html**
### Définir les marques
Nous choisisons les attributs "population" et "altiteude" pour encoder visuellement les villes. Voici comment nous pourrions associer une variable rétinienne à chaque attribut :
Nous choisisons les attributs "population" et "altitude" pour encoder visuellement les villes. Voici comment nous pourrions associer une variable rétinienne à chaque attribut :
- Population : la variable rétinienne associée à la population sera la taille du marqueur. Ainsi, une ville avec une population plus élevée aurait une marque plus grande qu'une ville avec une population plus faible.
......@@ -17,3 +17,8 @@ Nous choisisons les attributs "population" et "altiteude" pour encoder visuellem
On met en place aussi un histogramme des valeurs de population, c'est-à-dire le nombre de valeurs appartenant à chaque intervalle de l'axe afin d'améliorer la visualisation des données.
## Troisième partie
**Enoncé du tp : http://malacria.com/teachings/RVA/visualisation/tpvisu3.html**
Je me suis arrêté juste avant la 10eme partie.
\ No newline at end of file
......@@ -10,7 +10,6 @@ class City {
boolean isHighlighted=false;
boolean isClicked=false;
// put a drawing function in here and call from main drawing loop }
public City(String postalcode, String name, float x, float y, float population, float surface, float altitude) {
this.postalcode = Integer.parseInt(postalcode);
this.name = name;
......@@ -22,14 +21,9 @@ class City {
}
void draw() {
//map the altitude to the color in porcentage
float porcentageAlt = map(this.altitude, minAltitude, maxAltitude, 0, 100);
float hue = getColorForAltitude(porcentageAlt);
// Set marker size based on populationxxxx
radius=map(this.population, minPopulation, maxPopulation, 3, 100);
// Draw marker
float alpha = 80;
if(isHighlighted){
alpha=255;
......@@ -37,7 +31,6 @@ class City {
fill(hue, 100, 100, alpha);
ellipse(x, y, radius, radius);
// Draw city name
if (isHighlighted) {
textSize(16);
textAlign(LEFT, CENTER);
......
......@@ -32,7 +32,6 @@ void drawAltitudeLegend(float minVal, float maxVal, float x, float y, float w, f
}
void drawDistributionPopulationLegend(int minPopulation, int maxPopulation, float x, float y, float width, float height, int numberOfDiv, float[] populationValues) {
// Calcul de l'histogramme
int[] histogram = new int[numberOfDiv];
for (int i = 0; i < populationValues.length; i++) {
int val = (int) map(populationValues[i], minPopulation, maxPopulation, 0, numberOfDiv);
......@@ -62,8 +61,6 @@ void drawDistributionPopulationLegend(int minPopulation, int maxPopulation, floa
rect(currentX, y - barHeight, binWidth, barHeight);
}
// Dessin de la légende
// Draw title
fill(0);
textAlign(CENTER, CENTER);
......
//globally
//declare the min and max variables that you need in parseInfo
float minX, maxX;
float minY, maxY;
int totalCount; // total number of places
int totalCount;
int minPopulation, maxPopulation;
int minSurface, maxSurface;
int minAltitude, maxAltitude;
//declare the variables corresponding to the column ids for x and y
int x = 1;
int y = 2;
......@@ -50,7 +48,6 @@ void draw() {
drawSlider();
// Vérifiez que l'indice est valide
for (int i = 0; i < Math.min(totalCount, cities.length); ++i) {
cities[i].draw();
}
......@@ -122,7 +119,6 @@ void drawLegend() {
float distributionY = height - legendsHeight;
float distributionWidth = width - 100;
float distributionHeight = 50;
// get list of population values from the cities
float[] populationValues = new float[cities.length];
for (int i = 0; i < cities.length - 2; i++) {
populationValues[i] = cities[i].population;
......@@ -205,15 +201,15 @@ void mouseDragged() {
}
}
if (updateData) {
readData(); // Modifier pour ne lire les données que si nécessaire
redraw(); // Limitez le redessin aux moments nécessaires
readData();
redraw();
}
}
}
void mouseReleased() {
draggingSlider = false;
redraw(); // Assurez-vous de redessiner une dernière fois à la fin du déplacement
redraw();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment