VEuPathDB / EdaNewIssues

0 stars 0 forks source link

MAP: bubble marker response not following API docs when overlay data missing for a marker #673

Open bobular opened 11 months ago

bobular commented 11 months ago

Best explained with SCORE S. mansoni CRT (of course!)

Binary variables work great now in general, e.g. Schistosoma mansoni, by microscopy

However, the other binary assay results were not performed in all countries.

So Hookworm, by microscopy for example, has no data in Tanzania - as shown in donut marker mode image

In bubble mode, the response for that geohash ("kx") is missing the OverlayValue (not surprising because it can't be calculated!)

{
    "mapElements": [
        {
            "geoAggregateValue": "kx",
            "entityCount": 89924,
            "avgLat": -2.5239190046989326,
            "avgLon": 32.62888518082249,
            "minLat": -2.83761621,
            "minLon": 31.83110476,
            "maxLat": -2.2782033,
            "maxLon": 33.71772766
        },
        {
            "geoAggregateValue": "kz",
            "entityCount": 106579,
            "overlayValue": 0.0019279128248114,
            "avgLat": -0.2840606135634784,
            "avgLon": 34.45740643068976,
            "minLat": -2.29191542,
            "minLon": 33.7546134,
            "maxLat": -0.039578,
            "maxLon": 35.574142
        }
    ]
}

This is violating the client side type checking Error: Unexpected backend type(s) encountered: Invalid valueundefinedsupplied to overlayValue (type: number) of 1. This was developed from the API docs for StandaloneMapBubblesPostResponse.

Should we update the docs to make overlayValue optional/null and then do something suitable on the client. Plain white circles (similar in style to the donut markers) - and add something in the legend?

bobular commented 9 months ago

I've re-opened this - still seeing an issue. Looked into it more and it seems to be when the denominator is zero.

Commented on the PR here: https://github.com/VEuPathDB/EdaDataService/pull/305/files#r1322905925

bobular commented 9 months ago

Oh, I pressed the wrong button. Reopening now.