onomastics-ng: fix title and color alpha

This commit is contained in:
2022-10-07 02:40:52 +02:00
parent 23ff9fd7e6
commit da23296f0e
2 changed files with 7 additions and 3 deletions

View File

@@ -3,7 +3,6 @@
module Main where module Main where
import Data.Maybe (fromMaybe)
import Data.Text (Text) import Data.Text (Text)
import qualified Data.Text.IO as Text import qualified Data.Text.IO as Text
import Network.HTTP.Client.TLS (newTlsManager) import Network.HTTP.Client.TLS (newTlsManager)

View File

@@ -39,7 +39,13 @@ drawMap settings colorPalette areas statistics =
, ": " , ": "
, Text.intercalate , 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 then 0
else else
count count
/ fromIntegral (length statistics)
/ ( case scaleToMaximum settings of / ( case scaleToMaximum settings of
Global -> globalMaximum Global -> globalMaximum
Local -> theMaximum Local -> theMaximum