diff --git a/onomastics-ng/cli/Main.hs b/onomastics-ng/cli/Main.hs index 5d40ec1..5f36d12 100644 --- a/onomastics-ng/cli/Main.hs +++ b/onomastics-ng/cli/Main.hs @@ -3,7 +3,6 @@ module Main where -import Data.Maybe (fromMaybe) import Data.Text (Text) import qualified Data.Text.IO as Text import Network.HTTP.Client.TLS (newTlsManager) diff --git a/onomastics-ng/lib/Onomap/Svg.hs b/onomastics-ng/lib/Onomap/Svg.hs index 1c2e4da..80a5187 100644 --- a/onomastics-ng/lib/Onomap/Svg.hs +++ b/onomastics-ng/lib/Onomap/Svg.hs @@ -39,7 +39,13 @@ drawMap settings colorPalette areas statistics = , ": " , Text.intercalate ", " - (map (\(surname, statistic) -> localize (showRounded count) <> " (" <> Text.toTitle surname <> ")") statistics) + ( map + ( \(surname, statistic) -> + let count = fromMaybe 0 (Map.lookup (key area) (getByArea statistic)) + in localize (showRounded count) <> " (" <> Text.toTitle surname <> ")" + ) + statistics + ) ] ) ) @@ -52,7 +58,6 @@ drawMap settings colorPalette areas statistics = then 0 else count - / fromIntegral (length statistics) / ( case scaleToMaximum settings of Global -> globalMaximum Local -> theMaximum