Skip to content

Commit

Permalink
Merge branch 'master' of github.com:com-480-data-visualization/com-48…
Browse files Browse the repository at this point in the history
…0-project-statiswiss
  • Loading branch information
fabnemEPFL committed May 31, 2024
2 parents ddb5f73 + 4dbf34a commit a3aa202
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 24 deletions.
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,23 @@ Luckily for you, Statiswiss is easily accessible by clicking on the following li
No problem! All you need to do is :
1. Clone our repository
2. Go to the website folder
3. Start a ``HTTP`` server

├───convex Semantic search
├───create_JSON JSON generation
├───data-preprocessing Data preprocessing
├───previous_Milestones Previous Milestones
├───sketchbook Sketchbook
└───website Files for website
├───data Data
└───ressources Ressources
├───compsims Data for theoretical vs real results
├───Names Partynames
├───party_logos Party logos
└───sims Data for theoretical results
└───topo Topology of Switzerland

3. Start a HTTP server

```
├─── convex Semantic search
├─── create_JSON JSON generation
├─── data-preprocessing Data preprocessing
├─── previous_Milestones Previous Milestones
├─── sketchbook Sketchbook
└─── website Files for website
├─── data Data
├─── topo Topology of Switzerland
└─── ressources Ressources
├─── compsims Data for theoretical vs real results
├─── Names Partynames
├─── party_logos Party logos
└─── sims Data for theoretical results
```


## 📊 Where does the data come from?
Expand Down
3 changes: 0 additions & 3 deletions website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@
<span class="absolute inset-y-0 left-0 flex items-center pl-3">
<img class="h-7 w-7" src="resources/magnifying_glass.svg" alt="Magnifying glass" />
</span>
<span class="absolute inset-y-0 right-0 flex items-center pr-3">
<img class="h-7 w-7" src="resources/sparkles.svg" alt="I'm feeling lucky" />
</span>
<input class="js-search placeholder:text-slate-400 h-12 text-xl block bg-white font-semibold w-full border-4 border-black rounded-full py-2 pl-12 pr-3 shadow-sm focus:outline-none focus:border-sky-500 focus:ring-sky-500 focus:ring-1 sm:text-xl" type="text" name="search"/>
</label>

Expand Down
1 change: 1 addition & 0 deletions website/resources/map.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
left: 0;
pointer-events: none;
opacity: 0;
width: 200px;
}

.map-title {
Expand Down
10 changes: 5 additions & 5 deletions website/resources/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ function createMap(refId, refForm, simResult = false, lang = "en", callBackCanto
const turnoutAffi = (!simResult) ? `<br/>${turnout}: ${results[cantonAbbrs[id-1]]["par"].toFixed(2)}% / ${results[cantonAbbrs[id-1]]["cas"]}` : "";

const tooltipHtml = `
<div class="border-2 border-black rounded-2xl p-2">
<h2 class="text-2xl">${cantonNames.get(id)} (${abbr.toUpperCase()})</h2>
<div class="">
<h2 class="font-semibold text-lg">${cantonNames.get(id)} (${abbr.toUpperCase()})</h2>
${yes}: ${results[cantonAbbrs[id-1]]["per"].toFixed(2)}%
<br/>
${no}: ${(100-results[cantonAbbrs[id-1]]["per"]).toFixed(2)}%
Expand Down Expand Up @@ -318,11 +318,11 @@ function createMap(refId, refForm, simResult = false, lang = "en", callBackCanto
<br/>
${no}: ${(100-results[id]["per"]).toFixed(2)}%
<br/>
${turnout}: ${results[id]["par"].toFixed(2)}% / ${results[id]["cas"]}` : '<em>No data</em>';
${turnout}: ${results[id]["par"].toFixed(2)}% / ${results[id]["cas"]}` : {"en": "No data", "fr": "Pas de données", "de": "Keine Daten"}[lang];

const tooltipHtml = `
<div class="border-2 border-black rounded-2xl p-2">
<h2 class="text-2xl">${municipalitiesNames.get(id)}</h2>
<div class="">
<h2 class="font-semibold text-lg">${municipalitiesNames.get(id)}</h2>
${voteInfo}
</div>`;
tooltip.html(tooltipHtml);
Expand Down
5 changes: 5 additions & 0 deletions website/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@
<div class="block border-2 border-black w-72 mx-auto" id="party-recommendations">
</div>

<p class="text-center leading-tight pt-4">
<script>
document.write({"en": "Simulate results based on party recommendations", "fr": "Résultat simulé basé sur les recommandations de partis", "de": "Simulierte Ergebnis basierend auf den Empfehlungen der Partei"}[lang]);
</script>
</p>
<div class="border-4 border-black w-14 h-8 mx-auto relative" id="toggle-sim" title="Résultat simulé">
<script>
document.write(`<a href="results.html?refId=${refId}&lang=${lang}&simulated=${(simResult) ? 0 : 1}">`);
Expand Down

0 comments on commit a3aa202

Please sign in to comment.