Mark small countries on the map, fit latest catches table, show missing host
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6e2ff3f7ee
commit
31cef44bf3
15 files changed
+475
-27
No files matched your search
@@ -6,7 +6,15 @@
|
||||
@foreach (var country in Map.Countries)
|
||||
{
|
||||
var count = Count(country.Code);
|
||||
<path d="@country.Path" class="@($"level-{Level(count)}")"><title>@country.Name: @count.ToString("N0") @(count == 1 ? "Fang" : "Fänge")</title></path>
|
||||
<path d="@country.Path" class="@($"level-{Level(count)}")"><title>@Title(country.Name, count)</title></path>
|
||||
}
|
||||
@foreach (var marker in Map.Markers)
|
||||
{
|
||||
var count = Count(marker.Code);
|
||||
if (count > 0)
|
||||
{
|
||||
<circle cx="@marker.X.ToString(CultureInfo.InvariantCulture)" cy="@marker.Y.ToString(CultureInfo.InvariantCulture)" r="5" class="@($"marker level-{Level(count)}")"><title>@Title(marker.Name, count)</title></circle>
|
||||
}
|
||||
}
|
||||
</svg>
|
||||
<div class="map-legend">
|
||||
@@ -31,6 +39,8 @@
|
||||
|
||||
private int Count(string? code) => code is not null && CatchesByCountry.TryGetValue(code, out var count) ? count : 0;
|
||||
|
||||
private static string Title(string name, int count) => $"{name}: {count:N0} {(count == 1 ? "Fang" : "Fänge")}";
|
||||
|
||||
private int Level(int count) =>
|
||||
count == 0 || _max == 0 ? 0 : Math.Max(1, (int)Math.Ceiling(Math.Log(count + 1) / Math.Log(_max + 1) * Levels));
|
||||
}
|
||||
Reference in new issue
Block a user