Skip to content

case study

A keyboard and screen-reader accessible data explorer

My role: I built this in 2026 as a demonstration of an accessible data explorer. It runs on invented data, uses no client or employer material, and the source is public.

Scope and constraints

Ownership
A solo demonstration on invented weather-station readings. Not employer or client material.
Scale
One HTML file, one stylesheet, plain ES modules, 60 invented readings from 12 invented stations in four regions, and a test suite.
Constraints
Everything has to work from the keyboard, the table and chart have to make sense without sight, and there are no runtime dependencies and no build step.
Judgment calls
Use a real table before reaching for ARIA roles, keep one tab stop in the table body, announce counts after a pause, and compute contrast instead of eyeballing it.

What was delivered and checked

  • 60 tests run with the Node test runner: 29 on the filter, sort and wording functions, 20 on the page loaded into jsdom, and 11 on contrast.
  • axe-core reports no violations in the initial, filtered, sorted and empty-result states, with its color-contrast and target-size rules off because jsdom has no layout.
  • A script computes contrast from the stylesheet for both palettes: text pairs at 4.5:1 or more, and the focus outline, chart marks and control borders at 3:1 or more.
  • No test uses a real screen reader or a browser.

What it is

A small page that lets you sort and filter a table of weather-station readings and read the same data as a chart. The readings are invented and generated from a fixed seed, so every run shows the same rows. It is written to be used with a keyboard and a screen reader, and to show what I checked and what I did not.

How it behaves

The column headers are buttons, so Enter and Space sort. In the table body only one cell is in the tab order, and the arrow keys move between cells.

keyboard mapsample data
KeysWhereResult
EnterSpaceColumn header buttonSorts by that column. A second press reverses the order.
Arrow UpArrow DownTable cellPrevious or next row, same column.
Arrow LeftArrow RightTable cellPrevious or next column, same row.
HomeEndTable cellFirst or last column in the row.
Page UpPage DownTable cell10 rows up or down, stopping at the first or last row.

Arrow keys stop at the edges and do not wrap. Keys pressed with Ctrl, Alt or Meta are left to the browser.

Illustration with invented sample data. The moves between cells are checked by tests. Enter and Space on a button are the browser's own behavior.

When the rows or the sort change, a polite status region says how many rows are shown and how they are sorted.

Illustration with invented sample data. The messages use the wording the tests check.

Decisions

  • A real table, with aria-sort on the header cell

    The data is a <table> with a caption, column headers with a scope, and a row header on each row. The one sorted column carries aria-sort on its th, and each header holds a real button, so sorting works with Enter and Space. A test checks that aria-sort is on exactly one header and never on a button. The cost is more markup than a grid of divs with roles.

  • One tab stop in the table body (roving tabindex)

    Only one body cell is in the tab order, and the arrow keys, Home, End, Page Up and Page Down move between cells. Tab then leaves the table instead of stepping through every cell. The tab stop stays on the same cell when the table is sorted and returns to the first cell when a filter changes. The cost is a small key handler that has to be kept right, and tests cover it.

  • A live region that announces counts, after a pause

    A polite status region says how many rows are shown and how they are sorted. The message is written 400 milliseconds after the last change, so typing in a filter does not announce every letter. The cost is that the announcement is not instant. The app takes a timer option and returns a flush function, so tests run without real timers.

  • The chart has a text alternative that is a real table

    The chart is an inline SVG with a title and a description, and a visually hidden data table follows it with one row for each plotted reading. Regions differ by mark shape as well as colour, and the legend names the shapes. The cost is a second copy of the data in the page.

  • Contrast is computed from the palette and tested

    A small script reads the colour custom properties in the stylesheet, for the default palette and the dark palette, and the tests compute contrast ratios as WCAG defines them. Text pairs must reach 4.5:1, and the focus outline, chart marks and control borders 3:1. The cost is that only colours set through those properties are covered.

  • Reduced motion and forced colors are handled in the CSS

    Transitions and smooth scrolling are off when the user asks for reduced motion, and in forced-colors mode the focus rings, marks and axes switch to system colors. Sort direction is shown by a glyph and by aria-sort, not by colour alone. The cost is that these rules are checked as text in the stylesheet, not observed in a browser.

  • No framework, no build step, no runtime dependencies

    The app is one HTML file, one stylesheet and plain ES modules. Tests check that the page has no inline event handlers, no external requests and no pixel units in the CSS. The cost is writing the table and chart code by hand with DOM calls.

Scope and limits

  • No assistive-technology testing

    I did not run this with a screen reader, a screen magnifier, voice control or a switch device. How the announcements and the table are spoken in a given screen reader is not measured.

  • axe cannot judge everything

    axe-core checks the rules a machine can test. It does not judge whether the labels, the wording or the reading order make sense. It runs in jsdom with its color-contrast and target-size rules turned off, because jsdom has no layout.

  • Contrast comes from CSS variables, not pixels

    Contrast is computed from the custom properties, so a colour set outside them, or an anti-aliased edge, is not covered. The dark palette is checked as values, not in a browser set to dark mode.

  • No browser testing

    Focus order, the forced-colors rendering and the reduced-motion behavior are asserted in the CSS text or in jsdom, not observed in a browser.

  • Not a conformance claim

    This page lists what was checked and how. It does not say the explorer conforms to a standard.

Source and tests

The source, the invented data and the tests are in the accessible-data-explorer repository, under the MIT licence. npm test runs the tests.

Stack

  • JavaScript
  • HTML
  • CSS
  • Node test runner
  • axe-core
  • jsdom

More case studies

    Engineering notes: the decisions behind the work