nprapps / elections24-primaries

2024 primary/caucus election results
https://apps.npr.org/primary-election-results-2024/
Other
5 stars 1 forks source link

House results: Is there a way to filter out or label special elections when we're showing a long list of House results? #158

Open alykat opened 6 months ago

alykat commented 6 months ago

Getting this for Ohio District 6. Two of these are Special Primaries, according to the API response.

image

From the API response for one of the specials:

            "eventID": "20240319",
            "stateID": "36",
            "test": false,
            "resultsType": "live",
            "raceID": "82157",
            "raceType": "Special Primary",
            "raceTypeID": "J",
            "tabulationStatus": "Active Tabulation",
            "raceCallStatus": "Called",
            "officeID": "H",
            "officeName": "U.S. House",
            "party": "Dem",
            "eevp": 82.87,
            "national": true,
            "seatName": "District 6 Unexpired Term",
            "seatNum": "6",

API response for one of the primaries:

            "eventID": "20240319",
            "stateID": "36",
            "test": false,
            "resultsType": "live",
            "raceID": "36578",
            "raceType": "Primary",
            "raceTypeID": "D",
            "tabulationStatus": "Active Tabulation",
            "raceCallStatus": "Called",
            "officeID": "H",
            "officeName": "U.S. House",
            "party": "Dem",
            "eevp": 88.5,
            "national": true,
            "seatName": "District 6",
            "seatNum": "6",

One way to disambiguate would be manually-added footnotes (#157). Automatic labeling would be helpful, too, and avoid the need for manual intervention / someone having to notice the need for it. Yay, edge cases.

alykat commented 3 months ago

Ran into this for the 6/25 primaries in Colorado, where there were both Dem/GOP primaries and a special election for district 4.

https://apps.npr.org/primary-election-results-2024/states/CO.html#date=6/25/2024&office=H

I ended up setting the config like this:

image