|
@@ -650,22 +650,40 @@ viewKeyedCard model wasChosen { name, frontImage, backImage } =
|
|
|
stats =
|
|
stats =
|
|
|
Database.get name model.database
|
|
Database.get name model.database
|
|
|
|
|
|
|
|
|
|
+ focusStat : Maybe ( String, Float )
|
|
|
focusStat =
|
|
focusStat =
|
|
|
case model.focusStat of
|
|
case model.focusStat of
|
|
|
FocusALSA ->
|
|
FocusALSA ->
|
|
|
- Maybe.map (Round.round 2) (Maybe.andThen Card.alsa stats)
|
|
|
|
|
|
|
+ Maybe.map (\x -> ( Round.round 2 x, negate <| zscore x model.performanceDistributions.alsa ))
|
|
|
|
|
+ (Maybe.andThen Card.alsa stats)
|
|
|
|
|
|
|
|
FocusALPA ->
|
|
FocusALPA ->
|
|
|
- Maybe.map (Round.round 2) (Maybe.andThen Card.alpa stats)
|
|
|
|
|
|
|
+ Maybe.map (\x -> ( Round.round 2 x, negate <| zscore x model.performanceDistributions.alpa ))
|
|
|
|
|
+ (Maybe.andThen Card.alpa stats)
|
|
|
|
|
|
|
|
FocusGIHWR ->
|
|
FocusGIHWR ->
|
|
|
- Maybe.map formatPercentage (Maybe.andThen Card.gihwr stats)
|
|
|
|
|
|
|
+ Maybe.map (\x -> ( formatPercentage x, zscore x model.performanceDistributions.gihwr ))
|
|
|
|
|
+ (Maybe.andThen Card.gihwr stats)
|
|
|
|
|
|
|
|
FocusPickRate ->
|
|
FocusPickRate ->
|
|
|
- Maybe.map (formatPercentage << Card.pickRate) stats
|
|
|
|
|
|
|
+ Maybe.map
|
|
|
|
|
+ (\x ->
|
|
|
|
|
+ ( formatPercentage x, zscore x model.performanceDistributions.pickRate )
|
|
|
|
|
+ )
|
|
|
|
|
+ (Maybe.map Card.pickRate stats)
|
|
|
|
|
|
|
|
FocusIWD ->
|
|
FocusIWD ->
|
|
|
- Maybe.map (Round.round 2) (Maybe.andThen Card.iwd stats)
|
|
|
|
|
|
|
+ Maybe.map (\x -> ( Round.round 2 x, zscore x model.performanceDistributions.iwd ))
|
|
|
|
|
+ (Maybe.andThen Card.iwd stats)
|
|
|
|
|
+
|
|
|
|
|
+ viewFocusStat : Maybe ( String, Float ) -> Html Msg
|
|
|
|
|
+ viewFocusStat stat =
|
|
|
|
|
+ case stat of
|
|
|
|
|
+ Just ( value, zscore ) ->
|
|
|
|
|
+ span [ class <| "absolute top-0 left-0 px-1 py-1 shadow bg-" ++ characteriseZScore zscore ++ "-100" ] [ text value ]
|
|
|
|
|
+
|
|
|
|
|
+ Nothing ->
|
|
|
|
|
+ span [ class "absolute top-0 left-0 bg-gray-100 px-2 shadow" ] [ text "?" ]
|
|
|
in
|
|
in
|
|
|
( name
|
|
( name
|
|
|
, div
|
|
, div
|
|
@@ -677,6 +695,6 @@ viewKeyedCard model wasChosen { name, frontImage, backImage } =
|
|
|
, Events.onMouseEnter (Highlight name)
|
|
, Events.onMouseEnter (Highlight name)
|
|
|
]
|
|
]
|
|
|
[ img [ src frontImage, alt name ] []
|
|
[ img [ src frontImage, alt name ] []
|
|
|
- , span [ class "absolute top-0 left-0 bg-green-100" ] [ text <| Maybe.withDefault "?" focusStat ]
|
|
|
|
|
|
|
+ , viewFocusStat focusStat
|
|
|
]
|
|
]
|
|
|
)
|
|
)
|