Skip to content

Commit

Permalink
Fix incorrect label on us_electoral_forecast (#2815)
Browse files Browse the repository at this point in the history
* Fix incorrect label on us_electoral_forecast

* lint
  • Loading branch information
jwoglom authored Oct 21, 2024
1 parent b13ee73 commit 50415c5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions apps/us_electoral_forecast/us_electoral_forecast.star
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ PARTY_COLORS = {
"REP_BG": "#f77272",
}

PARTY_LEADERS = {
"DEM": "HARRIS",
"REP": "TRUMP",
}

def main(config):
period = config.get(PERIOD, DEFAULT_PERIOD)
type = config.get(TYPE, DEFAULT_TYPE)
Expand Down Expand Up @@ -77,15 +82,15 @@ def main(config):
render.Column(
main_align = "start",
children = [
render.Text("HARRIS", font = FONT, color = PARTY_COLORS["DEM"]),
render.Text(PARTY_LEADERS["DEM"], font = FONT, color = PARTY_COLORS["DEM"]),
render.Text(print_num(latest_data["dem"]), font = FONT, color = PARTY_COLORS["DEM"]),
render.Text(print_num(latest_data["rep"]), font = FONT, color = PARTY_COLORS["REP"]),
render.Text("TRUMP", font = FONT, color = PARTY_COLORS["REP"]),
render.Text(PARTY_LEADERS["REP"], font = FONT, color = PARTY_COLORS["REP"]),
] if dem_leading_rep else [
render.Text("HARRIS", font = FONT, color = PARTY_COLORS["REP"]),
render.Text(PARTY_LEADERS["REP"], font = FONT, color = PARTY_COLORS["REP"]),
render.Text(print_num(latest_data["rep"]), font = FONT, color = PARTY_COLORS["REP"]),
render.Text(print_num(latest_data["dem"]), font = FONT, color = PARTY_COLORS["DEM"]),
render.Text("TRUMP", font = FONT, color = PARTY_COLORS["DEM"]),
render.Text(PARTY_LEADERS["DEM"], font = FONT, color = PARTY_COLORS["DEM"]),
],
),
),
Expand Down

0 comments on commit 50415c5

Please sign in to comment.