Implementation & Testing Guide
This guide explains how to implement ParaCharts in a practical way, how accessibility affordances are delivered, and how to test what users actually receive.
Architecture At A Glance
ParaCharts in this repository follows this pattern:
- Third-party data sources are fetched by update scripts.
- Scripts write validated manifests into
docs/data/manifests. - Documentation pages point to local cached manifest files.
- GitHub Actions refreshes cached data monthly.
- Users consume charts with visual, keyboard, screen-reader, and audio affordances.
Implementation Recipe
Recipe A: Add A Static Or Semi-Static Chart
- Create a manifest JSON file.
- Add a page in
docs/with apara-chartelement. - Point the element to your manifest path.
- Add a short scenario, source note, and interpretation prompts.
- Link the new page from Example Gallery.
Minimal page embed:
<para-chart manifest="data/manifests/your-manifest.json"></para-chart>
Recipe B: Add A Monthly Live Chart
- Add a builder function in
docs/scripts/update_live_data.py. - Keep transforms explicit and deterministic.
- Validate output manifest before writing.
- Add your new target to the
targetslist in the updater. - Run the updater locally.
- Create/update the docs page that points at your cached manifest.
- Confirm status appears in
docs/data/live-data-status.json.
Accessibility Affordances You Deliver
When implemented correctly, a chart should provide:
- Keyboard navigation for chart exploration.
- Queryable point-level descriptions.
- ARIA live announcement behavior for summaries/updates.
- Sonification mode (
s) for trend perception. - Self-voicing mode (
v) for spoken summaries.
Use Accessibility Features as the source of truth for expected behavior and acceptance criteria.
Testing Workflow
1. Data And Manifest Validation
Run the updater:
python3 docs/scripts/update_live_data.py
Expected:
Updatedcount increases for healthy sources.Failures without cachestays at0for production-ready changes.docs/data/live-data-status.jsonreflects source states.
2. Build And Regression Checks
Recommended commands:
npm run build
npm run test:unit
npm run test:browser
Use browser tests when interaction, keyboard, accessibility, or rendering behavior changes.
3. Manual Accessibility Test Pass
For each changed chart page:
- Focus chart and navigate with arrow keys.
- Trigger
qand verify meaningful point-level output. - Toggle
sand verify sonification output changes with datapoints. - Toggle
vand verify speech output behavior. - Confirm chart meaning is still understandable without color cues alone.
4. Documentation QA
- Confirm page links appear in Example Gallery.
- Confirm source and refresh policy text is present.
- Confirm chart title, units, and labels match actual data semantics.
Common Failure Modes
- Third-party API changed schema:
- Symptom: parser error in updater.
- Action: update parser and keep cache-retention behavior.
- Manifest shape drift:
- Symptom: chart renders controls but no data marks.
- Action: compare against existing known-good manifests.
- Keyboard shortcuts not responding:
- Symptom: key commands do nothing.
- Action: ensure chart has focus before testing.
Done Criteria For New Chart Pages
A page is complete when all are true:
- Manifest data is current and cached locally.
- Monthly updater regenerates it successfully.
- Accessibility smoke checks pass.
- Source attribution and refresh notes are documented.
- Example index links are updated.