diff --git a/src/lib/world-map/StatsPanel.svelte b/src/lib/world-map/StatsPanel.svelte index aa9050a..f336326 100644 --- a/src/lib/world-map/StatsPanel.svelte +++ b/src/lib/world-map/StatsPanel.svelte @@ -2,6 +2,8 @@ import { CONTINENTS, getContinent, continentTotals } from './continents.js'; import { getSelected, getTotalCount } from '../layout/selection.svelte.js'; + let collapsed = $state(false); + const continentColors = { 'Europe': '#3b82f6', 'Asia': '#ef4444', @@ -30,7 +32,7 @@ const segs = []; let deg = 0; for (const cont of CONTINENTS) { - const angle = counts[cont] / total * 360; + const angle = Math.min(counts[cont] / total * 360, 359.99); if (angle > 0) { const startDeg = deg; const endDeg = deg + angle; @@ -59,51 +61,59 @@ }); -
-

your statistics

+
+ - visited countries -
-
-
+ {#if !collapsed} +
+

your statistics

+ + visited countries +
+
+
+
+ {total} / {grandTotal} +
+ +
+ + by continent + {#each CONTINENTS as continent} + {@const contTotal = continentTotals[continent]} +
+ + {continent} + {counts[continent]}/{contTotal} +
+ {/each} + +
+ {#if segments.length > 0} + + {#each segments as seg} + + + {seg.cont} + + {/each} + + + {:else} + + + + + {/if} +
+ +
+ +
Contains all UN countries, Kosovo, Hong Kong and Taiwan
- {total} / {grandTotal} -
- -
- - by continent - {#each CONTINENTS as continent} - {@const contTotal = continentTotals[continent]} -
- - {continent} - {counts[continent]}/{contTotal} -
- {/each} - -
- {#if segments.length > 0} - - {#each segments as seg} - - - {seg.cont} - - {/each} - - - {:else} - - - - - {/if} -
- -
- -
Contains all UN countries, Kosovo, Hong Kong and Taiwan
+ {/if}