Skip to content

ElectionTracker component - #16574

Draft
JamieB-gu wants to merge 11 commits into
mainfrom
election-tracker-component
Draft

ElectionTracker component#16574
JamieB-gu wants to merge 11 commits into
mainfrom
election-tracker-component

Conversation

@JamieB-gu

Copy link
Copy Markdown
Contributor

Create a component designed to handle multiple different election tracker layouts.

Add support for "excluded" sections in the `StackedProgress` component.
This could be used for elections in which there are "holdovers", i.e.
seats that are not up for election this time. The US Senate is an
example of this, with roughly a third of seats up for election and two
thirds not.

In this scenario, the excluded sections are represented on the bar using
a different pattern (vertical stripes) to the included sections. They
are also excluded from calculations on the progress of the election.

This change also updates the corresponding stories file to use
Storybook's CSF Next factory functions, introduces an additional story
for the US Senate, and adds `play` functions to several stories to
verify some of the component's calculations.
When we display stories with horizontal or vertical splits there are
multiple instances of the component present. Therefore we need to check
each one in the tests.
Allow the `Versus` component to support more design variations by making
it optional to include an image or to have the text appear in the colour
for a group. Also updated the stories to use Storybook's CSF Next
factory functions.
A small component that can be used in election trackers. Represents
progress towards a total in text form. For example, "300/650 seats
declared" or "290/435 races called".
Handles a common design pattern, where components are placed above one
another at narrower breakpoints and side-by-side at wider ones.
An `OnwardLink` component for linking to a full results page from an
election tracker.
A component for displaying results from an election to the US Congress.
The `USHouse` and `USSenate` components could also be used to view
results separately. This change includes stories with example data from
2024.
This adds support for "Others" and independents in the `USHouse` and
`USSenate` components.
There are multiple links in split mode, because the story is rendered
multiple times.
Create a component designed to handle multiple different election
tracker layouts.
@JamieB-gu JamieB-gu self-assigned this Aug 19, 2026
@JamieB-gu JamieB-gu added feature Departmental tracking: work on a new feature run_chromatic Runs chromatic when label is applied labels Aug 19, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Aug 19, 2026
@JamieB-gu
JamieB-gu force-pushed the election-trackers-us-congress branch from 8e4579c to b1873fd Compare August 20, 2026 11:19
Base automatically changed from election-trackers-us-congress to main August 21, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant