lukeslp commited on
Commit
d8980c4
·
verified ·
1 Parent(s): 8b1ac9d

add accessibility_atlas_demo.ipynb

Browse files
Files changed (1) hide show
  1. accessibility_atlas_demo.ipynb +675 -0
accessibility_atlas_demo.ipynb ADDED
@@ -0,0 +1,675 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "# Accessibility Atlas: A Data-Driven Portrait of Disability\n",
8
+ "\n",
9
+ "**Author**: Luke Steuber \n",
10
+ "**Date**: February 2026 \n",
11
+ "**Data Sources**: US Census Bureau, Bureau of Labor Statistics, WebAIM, Eurostat, NCES/IDEA, and more \n",
12
+ "\n",
13
+ "This notebook explores disability prevalence, employment outcomes, web accessibility compliance, assistive technology usage, and special education trends across 25+ datasets.\n",
14
+ "\n",
15
+ "---"
16
+ ]
17
+ },
18
+ {
19
+ "cell_type": "code",
20
+ "execution_count": null,
21
+ "metadata": {},
22
+ "outputs": [],
23
+ "source": "import json\nimport csv\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as mticker\nfrom pathlib import Path\nimport warnings\nwarnings.filterwarnings('ignore')\n\n# Style setup\nplt.rcParams['figure.figsize'] = (12, 6)\nplt.rcParams['figure.dpi'] = 100\nplt.rcParams['axes.titlesize'] = 14\nplt.rcParams['axes.labelsize'] = 12\nplt.rcParams['axes.grid'] = True\nplt.rcParams['grid.alpha'] = 0.3\nplt.rcParams['font.family'] = 'sans-serif'\n\nDATA_DIR = Path('.')\njson_files = list(DATA_DIR.glob('*.json'))\ncsv_files = list(DATA_DIR.glob('*.csv'))\nprint(f'Data directory: {DATA_DIR.resolve()}')\nprint(f'Files: {len(json_files)} JSON + {len(csv_files)} CSV = {len(json_files) + len(csv_files)} datasets')\n\ndef read_csv_as_dicts(path):\n \"\"\"Read CSV into list of dicts (no pandas needed).\"\"\"\n with open(path, newline='', encoding='utf-8') as f:\n return list(csv.DictReader(f))"
24
+ },
25
+ {
26
+ "cell_type": "markdown",
27
+ "metadata": {},
28
+ "source": [
29
+ "## 1. US Disability Prevalence — National Trends (2010-2023)\n",
30
+ "\n",
31
+ "Census Bureau ACS 1-year estimates from Table S1810. 13 years of data (2020 excluded due to COVID survey disruptions)."
32
+ ]
33
+ },
34
+ {
35
+ "cell_type": "code",
36
+ "execution_count": null,
37
+ "metadata": {},
38
+ "outputs": [],
39
+ "source": "# Load the full 13-year Census trend dataset\nwith open(DATA_DIR / 'census_disability_trends_2010_2023.json') as f:\n census_raw = json.load(f)\n\n# Parse S1810 into numpy arrays\n# Note: S1810 age-group variables changed meaning around 2015.\n# Pre-2015 values (0.4-0.8%) are NOT disability rates — skip those.\nt_years, t_pop, t_dis, t_pct = [], [], [], []\nt_u18, t_1864, t_65 = [], [], []\n\nfor year in sorted(census_raw['s1810_data'].keys()):\n d = census_raw['s1810_data'][year]['data']\n header, values = list(d[0]), list(d[1])\n row = dict(zip(header, values))\n yr = int(year)\n \n t_years.append(yr)\n t_pop.append(float(row.get('S1810_C01_001E', 0) or 0))\n t_dis.append(float(row.get('S1810_C02_001E', 0) or 0))\n t_pct.append(float(row.get('S1810_C03_001E', 0) or 0))\n \n # Pre-2015 age-group data uses different variable definitions\n if yr < 2015:\n t_u18.append(np.nan)\n t_1864.append(np.nan)\n t_65.append(np.nan)\n else:\n t_u18.append(float(row.get('S1810_C03_002E', 0) or 0))\n t_1864.append(float(row.get('S1810_C03_003E', 0) or 0))\n t_65.append(float(row.get('S1810_C03_004E', 0) or 0))\n\n# Convert to numpy\nt_years = np.array(t_years)\nt_pop = np.array(t_pop)\nt_dis = np.array(t_dis)\nt_pct = np.array(t_pct)\nt_u18 = np.array(t_u18)\nt_1864 = np.array(t_1864)\nt_65 = np.array(t_65)\n\nprint(f'Census disability trends: {len(t_years)} years ({t_years[0]}-{t_years[-1]})')\nprint(f'Disability rate: {t_pct[0]:.1f}% ({t_years[0]}) → {t_pct[-1]:.1f}% ({t_years[-1]})')\nprint(f'Population with disability: {t_dis[-1]:,.0f} in {t_years[-1]}')"
40
+ },
41
+ {
42
+ "cell_type": "code",
43
+ "execution_count": null,
44
+ "metadata": {},
45
+ "outputs": [],
46
+ "source": "fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 6))\n\n# Left: Overall disability rate\nax1.plot(t_years, t_pct, 'o-', color='#2c3e50', linewidth=2.5, markersize=8)\nax1.fill_between(t_years, t_pct, alpha=0.1, color='#2c3e50')\nax1.set_title('US Disability Prevalence Rate', fontweight='bold')\nax1.set_ylabel('% of Population')\nax1.set_xlabel('Year')\nax1.axvspan(2019.5, 2020.5, alpha=0.15, color='red', label='2020 gap (COVID)')\nax1.legend()\nax1.yaxis.set_major_formatter(mticker.FormatStrFormatter('%.1f%%'))\n\n# Right: By age group (2015+ only, where data is valid)\nmask = ~np.isnan(t_u18)\nax2.plot(t_years[mask], t_u18[mask], 'o-', color='#3498db', label='Under 18', linewidth=2, markersize=6)\nax2.plot(t_years[mask], t_1864[mask], 'o-', color='#e67e22', label='18-64', linewidth=2, markersize=6)\nax2.plot(t_years[mask], t_65[mask], 'o-', color='#e74c3c', label='65+', linewidth=2, markersize=6)\n\nax2.set_title('Disability Rate by Age Group', fontweight='bold')\nax2.set_ylabel('% of Age Group')\nax2.set_xlabel('Year')\nax2.legend()\nax2.yaxis.set_major_formatter(mticker.FormatStrFormatter('%.1f%%'))\n\nplt.tight_layout()\nplt.show()\n\nprint(f'\\nKey finding: Disability rate rose from {t_pct[0]:.1f}% ({t_years[0]}) to {t_pct[-1]:.1f}% ({t_years[-1]})')\nprint(f'Total with disability in {t_years[-1]}: {t_dis[-1]:,.0f}')"
47
+ },
48
+ {
49
+ "cell_type": "markdown",
50
+ "metadata": {},
51
+ "source": [
52
+ "## 2. Disability by Age and Sex (2022 Snapshot)\n",
53
+ "\n",
54
+ "Detailed breakdown from Census Table B18101 showing how disability rates vary dramatically by age and sex."
55
+ ]
56
+ },
57
+ {
58
+ "cell_type": "code",
59
+ "execution_count": null,
60
+ "metadata": {},
61
+ "outputs": [],
62
+ "source": [
63
+ "with open(DATA_DIR / 'census_disability_by_age_sex_2022.json') as f:\n",
64
+ " age_sex = json.load(f)\n",
65
+ "\n",
66
+ "# Build comparison DataFrame\n",
67
+ "age_groups = ['under_5', '5_to_17', '18_to_34', '35_to_64', '65_to_74', '75_plus']\n",
68
+ "age_labels = ['Under 5', '5-17', '18-34', '35-64', '65-74', '75+']\n",
69
+ "\n",
70
+ "male_rates = [age_sex['male']['by_age'][ag]['rate_pct'] for ag in age_groups]\n",
71
+ "female_rates = [age_sex['female']['by_age'][ag]['rate_pct'] for ag in age_groups]\n",
72
+ "\n",
73
+ "x = np.arange(len(age_labels))\n",
74
+ "width = 0.35\n",
75
+ "\n",
76
+ "fig, ax = plt.subplots(figsize=(12, 6))\n",
77
+ "bars1 = ax.bar(x - width/2, male_rates, width, label='Male', color='#3498db', alpha=0.85)\n",
78
+ "bars2 = ax.bar(x + width/2, female_rates, width, label='Female', color='#e74c3c', alpha=0.85)\n",
79
+ "\n",
80
+ "ax.set_ylabel('Disability Rate (%)')\n",
81
+ "ax.set_title('Disability Rate by Age Group and Sex (2022)', fontweight='bold')\n",
82
+ "ax.set_xticks(x)\n",
83
+ "ax.set_xticklabels(age_labels)\n",
84
+ "ax.legend()\n",
85
+ "ax.bar_label(bars1, fmt='%.1f%%', padding=3, fontsize=9)\n",
86
+ "ax.bar_label(bars2, fmt='%.1f%%', padding=3, fontsize=9)\n",
87
+ "\n",
88
+ "plt.tight_layout()\n",
89
+ "plt.show()\n",
90
+ "\n",
91
+ "print(f'Overall: Male {age_sex[\"male\"][\"rate_pct\"]:.1f}% vs Female {age_sex[\"female\"][\"rate_pct\"]:.1f}%')\n",
92
+ "print(f'Steepest climb: 35-64 → 65-74 (male: {male_rates[3]:.1f}% → {male_rates[4]:.1f}%, female: {female_rates[3]:.1f}% → {female_rates[4]:.1f}%)')"
93
+ ]
94
+ },
95
+ {
96
+ "cell_type": "markdown",
97
+ "metadata": {},
98
+ "source": [
99
+ "## 3. Disability Employment Gap\n",
100
+ "\n",
101
+ "Bureau of Labor Statistics data showing employment outcomes for people with and without disabilities."
102
+ ]
103
+ },
104
+ {
105
+ "cell_type": "code",
106
+ "execution_count": null,
107
+ "metadata": {},
108
+ "outputs": [],
109
+ "source": [
110
+ "with open(DATA_DIR / 'bls_disability_employment_2024.json') as f:\n",
111
+ " bls = json.load(f)\n",
112
+ "\n",
113
+ "# Extract historical employment-population ratio\n",
114
+ "emp_data = bls['historical_trends']['employment_population_ratio']['data']\n",
115
+ "years_emp = sorted(emp_data.keys())\n",
116
+ "with_dis = [emp_data[y]['with_disability'] for y in years_emp]\n",
117
+ "without_dis = [emp_data[y].get('without_disability') for y in years_emp]\n",
118
+ "\n",
119
+ "fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 6))\n",
120
+ "\n",
121
+ "# Left: Employment-population ratio trend\n",
122
+ "ax1.plot([int(y) for y in years_emp], with_dis, 'o-', color='#e74c3c', linewidth=2, label='With disability')\n",
123
+ "# Plot without_disability where available\n",
124
+ "valid_wo = [(int(y), v) for y, v in zip(years_emp, without_dis) if v is not None]\n",
125
+ "if valid_wo:\n",
126
+ " ax1.plot([x[0] for x in valid_wo], [x[1] for x in valid_wo], 's--', color='#2ecc71', linewidth=2, label='Without disability')\n",
127
+ "ax1.set_title('Employment-Population Ratio (2009-2024)', fontweight='bold')\n",
128
+ "ax1.set_ylabel('% Employed')\n",
129
+ "ax1.set_xlabel('Year')\n",
130
+ "ax1.legend()\n",
131
+ "ax1.axvspan(2019.5, 2020.5, alpha=0.1, color='gray')\n",
132
+ "\n",
133
+ "# Right: 2024 comparison dashboard\n",
134
+ "stats = bls['overall_statistics']\n",
135
+ "metrics = ['employment_population_ratio', 'unemployment_rate', 'part_time_workers_percent', 'self_employed_percent']\n",
136
+ "metric_labels = ['Employment Ratio', 'Unemployment Rate', 'Part-Time Workers', 'Self-Employed']\n",
137
+ "dis_vals = [stats['with_disability'][m] for m in metrics]\n",
138
+ "nodis_vals = [stats['without_disability'][m] if stats['without_disability'][m] is not None else 0 for m in metrics]\n",
139
+ "\n",
140
+ "x = np.arange(len(metric_labels))\n",
141
+ "ax2.barh(x - 0.2, dis_vals, 0.35, label='With Disability', color='#e74c3c', alpha=0.85)\n",
142
+ "ax2.barh(x + 0.2, nodis_vals, 0.35, label='Without Disability', color='#2ecc71', alpha=0.85)\n",
143
+ "ax2.set_yticks(x)\n",
144
+ "ax2.set_yticklabels(metric_labels)\n",
145
+ "ax2.set_xlabel('Percentage (%)')\n",
146
+ "ax2.set_title('Employment Metrics (2024)', fontweight='bold')\n",
147
+ "ax2.legend()\n",
148
+ "\n",
149
+ "plt.tight_layout()\n",
150
+ "plt.show()\n",
151
+ "\n",
152
+ "print(f'Employment gap: {stats[\"without_disability\"][\"employment_population_ratio\"] - stats[\"with_disability\"][\"employment_population_ratio\"]:.1f} percentage points')\n",
153
+ "print(f'People with disabilities employed: {bls[\"population_overview\"][\"total_employed_with_disability_thousands\"]}K')"
154
+ ]
155
+ },
156
+ {
157
+ "cell_type": "code",
158
+ "execution_count": null,
159
+ "metadata": {},
160
+ "outputs": [],
161
+ "source": [
162
+ "# Employment by race/ethnicity\n",
163
+ "race_data = bls['by_race_ethnicity']\n",
164
+ "races = list(race_data['disability_prevalence'].keys())\n",
165
+ "races = [r for r in races if r != 'note']\n",
166
+ "\n",
167
+ "race_labels = [r.replace('_', ' ').title() for r in races]\n",
168
+ "prevalence = [race_data['disability_prevalence'][r] for r in races]\n",
169
+ "unemp_dis = [race_data['unemployment_rate_with_disability'][r] for r in races]\n",
170
+ "\n",
171
+ "fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 5))\n",
172
+ "\n",
173
+ "bars = ax1.barh(race_labels, prevalence, color=['#3498db', '#e74c3c', '#2ecc71', '#f39c12'])\n",
174
+ "ax1.set_xlabel('Prevalence (%)')\n",
175
+ "ax1.set_title('Disability Prevalence by Race/Ethnicity', fontweight='bold')\n",
176
+ "ax1.bar_label(bars, fmt='%.1f%%', padding=5)\n",
177
+ "\n",
178
+ "bars2 = ax2.barh(race_labels, unemp_dis, color=['#3498db', '#e74c3c', '#2ecc71', '#f39c12'])\n",
179
+ "ax2.set_xlabel('Unemployment Rate (%)')\n",
180
+ "ax2.set_title('Unemployment Rate (With Disability)', fontweight='bold')\n",
181
+ "ax2.bar_label(bars2, fmt='%.1f%%', padding=5)\n",
182
+ "\n",
183
+ "plt.tight_layout()\n",
184
+ "plt.show()"
185
+ ]
186
+ },
187
+ {
188
+ "cell_type": "code",
189
+ "source": "with open(DATA_DIR / 'fred_disability_employment.json') as f:\n fred = json.load(f)\n\nfred_years = sorted(fred['annual_data'].keys())\nfred_yr_int = [int(y) for y in fred_years]\nfred_emp_dis = [fred['annual_data'][y].get('disability_employment_ratio') for y in fred_years]\nfred_emp_all = [fred['annual_data'][y].get('total_employment_ratio') for y in fred_years]\nfred_gap = [fred['annual_data'][y].get('employment_gap_pp') for y in fred_years]\n\nfig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 6))\n\n# Left: Employment-population ratio comparison\nax1.plot(fred_yr_int, fred_emp_all, 's-', color='#2ecc71', linewidth=2.5, markersize=7, label='Total civilian')\nvalid_dis = [(y, v) for y, v in zip(fred_yr_int, fred_emp_dis) if v is not None]\nax1.plot([x[0] for x in valid_dis], [x[1] for x in valid_dis], 'o-', color='#e74c3c', linewidth=2.5, markersize=7, label='With disability')\nax1.fill_between([x[0] for x in valid_dis], [x[1] for x in valid_dis], \n [fred_emp_all[fred_yr_int.index(x[0])] for x in valid_dis], alpha=0.15, color='#e74c3c')\nax1.set_title('Employment-Population Ratio (FRED)', fontweight='bold')\nax1.set_ylabel('% Employed')\nax1.set_xlabel('Year')\nax1.legend()\nax1.axvspan(2019.5, 2020.5, alpha=0.1, color='gray', label='COVID')\n\n# Right: Gap over time\nvalid_gap = [(y, g) for y, g in zip(fred_yr_int, fred_gap) if g is not None]\nax2.bar([x[0] for x in valid_gap], [x[1] for x in valid_gap], color='#e67e22', alpha=0.7)\nax2.set_title('Employment Gap (pp)', fontweight='bold')\nax2.set_ylabel('Percentage Point Gap')\nax2.set_xlabel('Year')\nax2.axhline(y=np.mean([x[1] for x in valid_gap]), color='gray', linestyle='--', label=f'Average: {np.mean([x[1] for x in valid_gap]):.1f}pp')\nax2.legend()\n\nplt.tight_layout()\nplt.show()\n\ns = fred['summary']\nprint(f'FRED data: {s[\"years_of_data\"]} years (2009-{s[\"latest_year\"]})')\nprint(f'Employment gap ({s[\"latest_year\"]}): {s[\"employment_gap\"]} pp ({s[\"total_employment_ratio\"]}% total vs {s[\"disability_employment_ratio\"]}% disability)')\nprint(f'Disability LFPR: {s[\"disability_lfpr\"]}%')\nprint(f'{s[\"trend\"]}')",
190
+ "metadata": {},
191
+ "execution_count": null,
192
+ "outputs": []
193
+ },
194
+ {
195
+ "cell_type": "markdown",
196
+ "source": "### FRED: Disability Employment Gap Over Time\n\nComplete FRED series (2008-2024) showing the employment-population ratio for people with and without disabilities side by side.",
197
+ "metadata": {}
198
+ },
199
+ {
200
+ "cell_type": "markdown",
201
+ "metadata": {},
202
+ "source": [
203
+ "## 4. Web Accessibility — WebAIM Million Report\n",
204
+ "\n",
205
+ "WAVE automated analysis of 1,000,000 website home pages. The annual state-of-the-web for accessibility."
206
+ ]
207
+ },
208
+ {
209
+ "cell_type": "code",
210
+ "execution_count": null,
211
+ "metadata": {},
212
+ "outputs": [],
213
+ "source": [
214
+ "with open(DATA_DIR / 'webaim_million_2025.json') as f:\n",
215
+ " webaim = json.load(f)\n",
216
+ "\n",
217
+ "trends = webaim['yearly_trends']\n",
218
+ "years = trends['years']\n",
219
+ "\n",
220
+ "fig, axes = plt.subplots(2, 2, figsize=(16, 12))\n",
221
+ "\n",
222
+ "# Top-left: Failure rate trend\n",
223
+ "ax = axes[0, 0]\n",
224
+ "ax.plot(years, trends['pages_with_failures_pct'], 'o-', color='#e74c3c', linewidth=2.5)\n",
225
+ "ax.fill_between(years, trends['pages_with_failures_pct'], 90, alpha=0.1, color='#e74c3c')\n",
226
+ "ax.set_title('Pages with WCAG Failures (%)', fontweight='bold')\n",
227
+ "ax.set_ylim(90, 100)\n",
228
+ "ax.yaxis.set_major_formatter(mticker.FormatStrFormatter('%.1f%%'))\n",
229
+ "ax.annotate(f'{trends[\"pages_with_failures_pct\"][-1]}%', xy=(years[-1], trends['pages_with_failures_pct'][-1]),\n",
230
+ " fontsize=14, fontweight='bold', color='#e74c3c', ha='center', va='bottom',\n",
231
+ " xytext=(0, 10), textcoords='offset points')\n",
232
+ "\n",
233
+ "# Top-right: Error types breakdown\n",
234
+ "ax = axes[0, 1]\n",
235
+ "error_types = ['low_contrast_pct', 'missing_alt_text_pct', 'empty_links_pct', \n",
236
+ " 'missing_form_labels_pct', 'empty_buttons_pct', 'missing_language_pct']\n",
237
+ "error_labels = ['Low Contrast', 'Missing Alt Text', 'Empty Links', \n",
238
+ " 'Missing Labels', 'Empty Buttons', 'Missing Lang']\n",
239
+ "colors_err = ['#e74c3c', '#3498db', '#f39c12', '#9b59b6', '#2ecc71', '#1abc9c']\n",
240
+ "for et, label, color in zip(error_types, error_labels, colors_err):\n",
241
+ " ax.plot(years, trends[et], 'o-', label=label, color=color, linewidth=1.5)\n",
242
+ "ax.set_title('WCAG Failure Types Over Time', fontweight='bold')\n",
243
+ "ax.set_ylabel('% of Pages Affected')\n",
244
+ "ax.legend(fontsize=9, loc='upper right')\n",
245
+ "\n",
246
+ "# Bottom-left: CMS performance\n",
247
+ "ax = axes[1, 0]\n",
248
+ "cms_data = webaim['cms_performance']\n",
249
+ "cms_names = [c['cms'] for c in cms_data]\n",
250
+ "cms_errors = [c['avg_errors'] for c in cms_data]\n",
251
+ "bar_colors = ['#2ecc71' if e < 51 else '#f39c12' if e < 65 else '#e74c3c' for e in cms_errors]\n",
252
+ "bars = ax.barh(cms_names, cms_errors, color=bar_colors)\n",
253
+ "ax.axvline(x=51, color='gray', linestyle='--', alpha=0.5, label='Baseline (51 avg)')\n",
254
+ "ax.set_xlabel('Average Errors per Page')\n",
255
+ "ax.set_title('CMS Accessibility Performance', fontweight='bold')\n",
256
+ "ax.bar_label(bars, fmt='%.0f', padding=5)\n",
257
+ "ax.legend()\n",
258
+ "\n",
259
+ "# Bottom-right: TLD performance\n",
260
+ "ax = axes[1, 1]\n",
261
+ "tld_data = webaim['tld_performance']\n",
262
+ "tld_names = [t['tld'] for t in tld_data]\n",
263
+ "tld_errors = [t['avg_errors'] for t in tld_data]\n",
264
+ "bar_colors = ['#2ecc71' if e < 40 else '#3498db' if e < 55 else '#f39c12' if e < 70 else '#e74c3c' for e in tld_errors]\n",
265
+ "bars = ax.barh(tld_names, tld_errors, color=bar_colors)\n",
266
+ "ax.set_xlabel('Average Errors per Page')\n",
267
+ "ax.set_title('Accessibility by TLD', fontweight='bold')\n",
268
+ "ax.bar_label(bars, fmt='%.0f', padding=5)\n",
269
+ "\n",
270
+ "plt.tight_layout()\n",
271
+ "plt.show()\n",
272
+ "\n",
273
+ "print(f'Bottom line: {webaim[\"summary\"][\"pages_with_wcag_failures_pct\"]}% of top 1M sites have WCAG failures')\n",
274
+ "print(f'Total errors detected: {webaim[\"summary\"][\"total_errors_detected\"]:,}')\n",
275
+ "print(f'Best TLD: .gov ({tld_data[0][\"avg_errors\"]} errors) Worst: .ua ({tld_data[-1][\"avg_errors\"]} errors)')"
276
+ ]
277
+ },
278
+ {
279
+ "cell_type": "markdown",
280
+ "metadata": {},
281
+ "source": [
282
+ "## 5. Screen Reader Usage — WebAIM Survey\n",
283
+ "\n",
284
+ "Survey of 1,539 screen reader users revealing technology preferences and accessibility pain points."
285
+ ]
286
+ },
287
+ {
288
+ "cell_type": "code",
289
+ "execution_count": null,
290
+ "metadata": {},
291
+ "outputs": [],
292
+ "source": [
293
+ "with open(DATA_DIR / 'webaim_screen_reader_survey_2024.json') as f:\n",
294
+ " sr = json.load(f)\n",
295
+ "\n",
296
+ "fig, axes = plt.subplots(2, 2, figsize=(16, 12))\n",
297
+ "\n",
298
+ "# Top-left: Primary screen reader\n",
299
+ "ax = axes[0, 0]\n",
300
+ "sr_names = [s['name'] for s in sr['primary_screen_reader']]\n",
301
+ "sr_pcts = [s['pct'] for s in sr['primary_screen_reader']]\n",
302
+ "colors_sr = plt.cm.Set2(np.linspace(0, 1, len(sr_names)))\n",
303
+ "wedges, texts, autotexts = ax.pie(sr_pcts, labels=sr_names, autopct='%1.1f%%', \n",
304
+ " colors=colors_sr, startangle=90)\n",
305
+ "ax.set_title('Primary Screen Reader (2024)', fontweight='bold')\n",
306
+ "\n",
307
+ "# Top-right: Most problematic items\n",
308
+ "ax = axes[0, 1]\n",
309
+ "problems = sr['problematic_items_ranked'][:8]\n",
310
+ "prob_names = [p['item'][:30] + '...' if len(p['item']) > 30 else p['item'] for p in problems]\n",
311
+ "prob_points = [p['points'] for p in problems]\n",
312
+ "bars = ax.barh(prob_names[::-1], prob_points[::-1], color=plt.cm.Reds(np.linspace(0.3, 0.9, len(problems))))\n",
313
+ "ax.set_xlabel('Severity Points')\n",
314
+ "ax.set_title('Most Problematic Web Elements', fontweight='bold')\n",
315
+ "\n",
316
+ "# Bottom-left: Disability types\n",
317
+ "ax = axes[1, 0]\n",
318
+ "dis_types = sr['demographics']['disability_types']\n",
319
+ "dt_names = [d['type'] for d in dis_types]\n",
320
+ "dt_pcts = [d['pct'] for d in dis_types]\n",
321
+ "bars = ax.barh(dt_names[::-1], dt_pcts[::-1], color='#3498db', alpha=0.8)\n",
322
+ "ax.set_xlabel('% of Respondents')\n",
323
+ "ax.set_title('Disability Types of Screen Reader Users', fontweight='bold')\n",
324
+ "ax.bar_label(bars, fmt='%.1f%%', padding=5)\n",
325
+ "\n",
326
+ "# Bottom-right: Mobile platform preference\n",
327
+ "ax = axes[1, 1]\n",
328
+ "mobile = sr['mobile']['primary_platform']\n",
329
+ "mob_names = [m['name'] for m in mobile]\n",
330
+ "mob_pcts = [m['pct'] for m in mobile]\n",
331
+ "ax.pie(mob_pcts, labels=mob_names, autopct='%1.1f%%', \n",
332
+ " colors=['#636363', '#2ecc71', '#3498db', '#95a5a6'], startangle=90)\n",
333
+ "ax.set_title('Mobile Platform (Screen Reader Users)', fontweight='bold')\n",
334
+ "\n",
335
+ "plt.tight_layout()\n",
336
+ "plt.show()\n",
337
+ "\n",
338
+ "print(f'Survey: {sr[\"respondents\"]} respondents')\n",
339
+ "print(f'#1 problem: {sr[\"problematic_items_ranked\"][0][\"item\"]} ({sr[\"problematic_items_ranked\"][0][\"points\"]} severity points)')\n",
340
+ "print(f'Web getting better? {sr[\"web_accessibility_progress\"][\"more_accessible_pct\"]}% say yes, {sr[\"web_accessibility_progress\"][\"less_accessible_pct\"]}% say worse')"
341
+ ]
342
+ },
343
+ {
344
+ "cell_type": "markdown",
345
+ "metadata": {},
346
+ "source": [
347
+ "## 6. ADA Digital Accessibility Lawsuits\n",
348
+ "\n",
349
+ "Tracking the explosion of ADA web accessibility lawsuits from 2017-2024."
350
+ ]
351
+ },
352
+ {
353
+ "cell_type": "code",
354
+ "execution_count": null,
355
+ "metadata": {},
356
+ "outputs": [],
357
+ "source": [
358
+ "with open(DATA_DIR / 'ada_digital_lawsuits.json') as f:\n",
359
+ " ada = json.load(f)\n",
360
+ "\n",
361
+ "fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 5))\n",
362
+ "\n",
363
+ "# Left: Lawsuit volume trend\n",
364
+ "ax1.bar(ada['years'], ada['total_lawsuits'], color='#e74c3c', alpha=0.85, edgecolor='#c0392b')\n",
365
+ "ax1.plot(ada['years'], ada['total_lawsuits'], 'o-', color='#2c3e50', linewidth=2)\n",
366
+ "ax1.set_title('ADA Digital Accessibility Lawsuits', fontweight='bold')\n",
367
+ "ax1.set_ylabel('Number of Lawsuits')\n",
368
+ "ax1.set_xlabel('Year')\n",
369
+ "for i, (yr, val) in enumerate(zip(ada['years'], ada['total_lawsuits'])):\n",
370
+ " ax1.annotate(f'{val:,}', xy=(yr, val), ha='center', va='bottom', fontsize=9, fontweight='bold')\n",
371
+ "\n",
372
+ "# Right: 2024 breakdown\n",
373
+ "bd = ada['breakdown_2024']\n",
374
+ "labels = ['Federal\\nCourt', 'State\\nCourt']\n",
375
+ "values = [bd['federal_court'], bd['state_court']]\n",
376
+ "ax2.pie(values, labels=labels, autopct='%1.0f%%', colors=['#3498db', '#e67e22'],\n",
377
+ " startangle=90, textprops={'fontsize': 12})\n",
378
+ "ax2.set_title(f'2024 Lawsuit Breakdown (n={bd[\"total\"]:,})', fontweight='bold')\n",
379
+ "\n",
380
+ "plt.tight_layout()\n",
381
+ "plt.show()\n",
382
+ "\n",
383
+ "print(f'Total growth: {ada[\"total_lawsuits\"][0]:,} ({ada[\"years\"][0]}) → {ada[\"total_lawsuits\"][-1]:,} ({ada[\"years\"][-1]}) = {(ada[\"total_lawsuits\"][-1]/ada[\"total_lawsuits\"][0]-1)*100:.0f}% increase')\n",
384
+ "print(f'E-commerce accounts for {bd[\"ecommerce_pct\"]}% of cases')\n",
385
+ "print(f'NY and CA combined: {bd[\"ny_ca_combined_pct\"]}% of all lawsuits')"
386
+ ]
387
+ },
388
+ {
389
+ "cell_type": "markdown",
390
+ "metadata": {},
391
+ "source": [
392
+ "## 7. European Disability Data — Eurostat GALI\n",
393
+ "\n",
394
+ "EU-wide disability data using the Global Activity Limitation Indicator from the EU Statistics on Income and Living Conditions survey."
395
+ ]
396
+ },
397
+ {
398
+ "cell_type": "code",
399
+ "execution_count": null,
400
+ "metadata": {},
401
+ "outputs": [],
402
+ "source": [
403
+ "with open(DATA_DIR / 'eurostat_disability_eu.json') as f:\n",
404
+ " eu = json.load(f)\n",
405
+ "\n",
406
+ "# Extract country-level data\n",
407
+ "countries = [c for c in eu['countries'] if c['country_code'] not in ['EU27_2020', 'EA20']]\n",
408
+ "countries_with_data = [c for c in countries if c.get('gali_indicator', {}).get('some_or_severe_limitation') is not None]\n",
409
+ "\n",
410
+ "# Sort by disability rate\n",
411
+ "countries_sorted = sorted(countries_with_data, \n",
412
+ " key=lambda c: c['gali_indicator']['some_or_severe_limitation'],\n",
413
+ " reverse=True)\n",
414
+ "\n",
415
+ "top_20 = countries_sorted[:20]\n",
416
+ "names = [c['country_name'][:20] for c in top_20]\n",
417
+ "rates = [c['gali_indicator']['some_or_severe_limitation'] for c in top_20]\n",
418
+ "severe = [c['gali_indicator'].get('severe_limitation', 0) for c in top_20]\n",
419
+ "\n",
420
+ "fig, ax = plt.subplots(figsize=(14, 8))\n",
421
+ "ax.barh(names[::-1], rates[::-1], color='#3498db', alpha=0.7, label='Some + Severe')\n",
422
+ "ax.barh(names[::-1], severe[::-1], color='#e74c3c', alpha=0.9, label='Severe only')\n",
423
+ "ax.axvline(x=eu['eu27_summary_2023']['total_disability_rate_pct'], color='gray', linestyle='--', \n",
424
+ " label=f'EU27 avg ({eu[\"eu27_summary_2023\"][\"total_disability_rate_pct\"]}%)')\n",
425
+ "ax.set_xlabel('Activity Limitation Rate (%)')\n",
426
+ "ax.set_title('Disability Prevalence Across Europe (GALI, 2023)', fontweight='bold')\n",
427
+ "ax.legend()\n",
428
+ "\n",
429
+ "plt.tight_layout()\n",
430
+ "plt.show()\n",
431
+ "\n",
432
+ "print(f'EU27 average: {eu[\"eu27_summary_2023\"][\"total_disability_rate_pct\"]}% activity limitation')\n",
433
+ "print(f'EU employment gap: {eu[\"eu27_summary_2023\"][\"employment_gap_pp\"]} percentage points')\n",
434
+ "print(f'Severe limitation employment gap: {eu[\"eu27_summary_2023\"][\"severe_employment_gap_pp\"]} pp')"
435
+ ]
436
+ },
437
+ {
438
+ "cell_type": "markdown",
439
+ "metadata": {},
440
+ "source": [
441
+ "## 8. IDEA Special Education Trends (1976-2023)\n",
442
+ "\n",
443
+ "Individuals with Disabilities Education Act data showing 47 years of special education enrollment across 13 disability categories."
444
+ ]
445
+ },
446
+ {
447
+ "cell_type": "code",
448
+ "execution_count": null,
449
+ "metadata": {},
450
+ "outputs": [],
451
+ "source": "with open(DATA_DIR / 'idea_special_education_enriched.json') as f:\n idea = json.load(f)\n\n# Historical trends — stored as dict of year->count\nhist_served = idea['historical_trends_1976_2023']['total_served_by_year']\nhist_years = sorted(hist_served.keys())\nhist_total = [hist_served[y] for y in hist_years]\n\n# Clean year labels for plotting (e.g., \"1976-77\" -> 1976)\nhist_year_nums = [int(y.split('-')[0]) for y in hist_years]\n\nfig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 6))\n\n# Left: Total students over time\nax1.fill_between(hist_year_nums, [t/1e6 for t in hist_total], alpha=0.2, color='#3498db')\nax1.plot(hist_year_nums, [t/1e6 for t in hist_total], 'o-', color='#3498db', linewidth=2, markersize=4)\nax1.set_title('Students Served Under IDEA (1976-2023)', fontweight='bold')\nax1.set_ylabel('Students (Millions)')\nax1.set_xlabel('Year')\n\n# Right: Category breakdown (latest year)\ncategories = idea['disability_categories_2022_23']\ncat_sorted = sorted(categories, key=lambda c: c.get('count', 0), reverse=True)\ntop_cats = cat_sorted[:10]\ncat_names = [c['category'][:25] for c in top_cats]\ncat_counts = [c.get('count', 0) / 1e6 for c in top_cats]\n\nbars = ax2.barh(cat_names[::-1], cat_counts[::-1], \n color=plt.cm.viridis(np.linspace(0.2, 0.9, len(top_cats))))\nax2.set_xlabel('Students (Millions)')\nax2.set_title('Students by Disability Category (2022-23)', fontweight='bold')\n\nplt.tight_layout()\nplt.show()\n\nns = idea['national_summary_2022_23']\nprint(f'Total students served (2022-23): {ns[\"total_students_served\"]:,}')\nprint(f'Percent of enrollment: {ns[\"percent_of_public_school_enrollment\"]}%')\nprint(f'Disability categories: {len(categories)}')"
452
+ },
453
+ {
454
+ "cell_type": "markdown",
455
+ "metadata": {},
456
+ "source": [
457
+ "## 9. County-Level Disability Map (3,200+ Counties)\n",
458
+ "\n",
459
+ "Census ACS disability rates at the county level, showing geographic variation across the US."
460
+ ]
461
+ },
462
+ {
463
+ "cell_type": "code",
464
+ "execution_count": null,
465
+ "metadata": {},
466
+ "outputs": [],
467
+ "source": "county_rows = read_csv_as_dicts(DATA_DIR / 'census_disability_by_county_2022.csv')\ncounty_rates = [float(r['disability_rate']) for r in county_rows if r.get('disability_rate')]\nprint(f'County data: {len(county_rows):,} counties')\nprint(f'Columns: {list(county_rows[0].keys())}')\nprint(f'\\nDisability rate range: {min(county_rates):.1f}% - {max(county_rates):.1f}%')\ncounty_median = sorted(county_rates)[len(county_rates)//2]\ncounty_mean = sum(county_rates) / len(county_rates)\nprint(f'Median: {county_median:.1f}%')\nprint(f'Mean: {county_mean:.1f}%')\n\nfig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 5))\n\n# Distribution\nax1.hist(county_rates, bins=50, color='#3498db', alpha=0.7, edgecolor='white')\nax1.axvline(county_median, color='#e74c3c', linestyle='--', label=f'Median: {county_median:.1f}%')\nax1.set_title('Distribution of County Disability Rates', fontweight='bold')\nax1.set_xlabel('Disability Rate (%)')\nax1.set_ylabel('Number of Counties')\nax1.legend()\n\n# Top/bottom states by average county disability rate\nstate_col = 'state_name' if 'state_name' in county_rows[0] else 'state'\nstate_sums = {}\nstate_counts = {}\nfor r in county_rows:\n st = r.get(state_col, '')\n rate = r.get('disability_rate')\n if st and rate:\n state_sums[st] = state_sums.get(st, 0) + float(rate)\n state_counts[st] = state_counts.get(st, 0) + 1\n\nstate_avgs = {s: state_sums[s]/state_counts[s] for s in state_sums}\nsorted_states = sorted(state_avgs.items(), key=lambda x: x[1], reverse=True)\ntop_10 = sorted_states[:10]\nbottom_5 = sorted_states[-5:]\ncombined = top_10 + bottom_5\nnames = [s[0] for s in combined][::-1]\nvals = [s[1] for s in combined][::-1]\ncolors_tb = ['#2ecc71']*5 + ['#e74c3c']*10\nax2.barh(names, vals, color=colors_tb)\nax2.set_xlabel('Average County Disability Rate (%)')\nax2.set_title('States: Highest & Lowest Disability Rates', fontweight='bold')\n\nplt.tight_layout()\nplt.show()"
468
+ },
469
+ {
470
+ "cell_type": "markdown",
471
+ "metadata": {},
472
+ "source": [
473
+ "## 10. WHO Healthy Life Expectancy (HALE)\n",
474
+ "\n",
475
+ "World Health Organization data on healthy life expectancy — the years lived in good health versus total life expectancy."
476
+ ]
477
+ },
478
+ {
479
+ "cell_type": "code",
480
+ "execution_count": null,
481
+ "metadata": {},
482
+ "outputs": [],
483
+ "source": "hale_rows = read_csv_as_dicts(DATA_DIR / 'who_healthy_life_expectancy.csv')\nprint(f'WHO HALE data: {len(hale_rows):,} records')\nprint(f'Columns: {list(hale_rows[0].keys())}')\nprint(f'\\nFirst 5 rows:')\nfor r in hale_rows[:5]:\n print(f' {r}')"
484
+ },
485
+ {
486
+ "cell_type": "code",
487
+ "execution_count": null,
488
+ "metadata": {},
489
+ "outputs": [],
490
+ "source": "# Explore the HALE data structure\nprint('Column types and unique value counts:')\nfor col in hale_rows[0].keys():\n unique = set(r[col] for r in hale_rows if r.get(col))\n if len(unique) < 20:\n print(f' {col}: {len(unique)} unique - {sorted(list(unique))[:10]}')\n else:\n print(f' {col}: {len(unique)} unique')"
491
+ },
492
+ {
493
+ "cell_type": "markdown",
494
+ "metadata": {},
495
+ "source": [
496
+ "## 11. Section 508 Federal Compliance\n",
497
+ "\n",
498
+ "GSA assessment of federal government website accessibility — a sobering look at how the government's own sites measure up."
499
+ ]
500
+ },
501
+ {
502
+ "cell_type": "code",
503
+ "execution_count": null,
504
+ "metadata": {},
505
+ "outputs": [],
506
+ "source": [
507
+ "with open(DATA_DIR / 'section_508_compliance_2024.json') as f:\n",
508
+ " s508 = json.load(f)\n",
509
+ "\n",
510
+ "fig, ax = plt.subplots(figsize=(8, 5))\n",
511
+ "\n",
512
+ "kf = s508['key_findings']\n",
513
+ "labels = ['Public Websites\\nConforming', 'Intranet Pages\\nConforming']\n",
514
+ "values = [kf['public_websites_conforming_pct'], kf['intranet_pages_conforming_pct']]\n",
515
+ "remainder = [100 - v for v in values]\n",
516
+ "\n",
517
+ "x = np.arange(len(labels))\n",
518
+ "bars1 = ax.bar(x, values, 0.5, label='Conforming', color='#2ecc71')\n",
519
+ "bars2 = ax.bar(x, remainder, 0.5, bottom=values, label='Non-conforming', color='#e74c3c', alpha=0.7)\n",
520
+ "ax.set_ylabel('Percentage (%)')\n",
521
+ "ax.set_title(f'Federal Section 508 Compliance ({s508[\"year\"]})', fontweight='bold')\n",
522
+ "ax.set_xticks(x)\n",
523
+ "ax.set_xticklabels(labels)\n",
524
+ "ax.legend()\n",
525
+ "ax.bar_label(bars1, fmt='%d%%', label_type='center', fontsize=14, fontweight='bold', color='white')\n",
526
+ "\n",
527
+ "plt.tight_layout()\n",
528
+ "plt.show()\n",
529
+ "\n",
530
+ "print(f'Only {kf[\"public_websites_conforming_pct\"]}% of federal public websites conform to Section 508')\n",
531
+ "print(f'{s508[\"reporting_entities\"]} federal entities assessed across {s508[\"assessment_criteria\"]} criteria')\n",
532
+ "print(f'Trend: {kf[\"conformance_trend\"]}')"
533
+ ]
534
+ },
535
+ {
536
+ "cell_type": "markdown",
537
+ "metadata": {},
538
+ "source": [
539
+ "## 12. Disability by Race/Ethnicity and Characteristics\n",
540
+ "\n",
541
+ "Census data on disability types and racial/ethnic disparities."
542
+ ]
543
+ },
544
+ {
545
+ "cell_type": "code",
546
+ "execution_count": null,
547
+ "metadata": {},
548
+ "outputs": [],
549
+ "source": [
550
+ "with open(DATA_DIR / 'census_disability_by_race_2022.json') as f:\n",
551
+ " race = json.load(f)\n",
552
+ "\n",
553
+ "with open(DATA_DIR / 'census_disability_characteristics_2022.json') as f:\n",
554
+ " chars = json.load(f)\n",
555
+ "\n",
556
+ "print('Race/ethnicity data:')\n",
557
+ "print(json.dumps(race, indent=2)[:1000])\n",
558
+ "print('\\nCharacteristics data:')\n",
559
+ "print(json.dumps(chars, indent=2)[:1000])"
560
+ ]
561
+ },
562
+ {
563
+ "cell_type": "markdown",
564
+ "metadata": {},
565
+ "source": [
566
+ "## 13. Sign Language & AAC Datasets\n",
567
+ "\n",
568
+ "Assistive technology datasets: WLASL (sign language video index) and AAC vocabulary data."
569
+ ]
570
+ },
571
+ {
572
+ "cell_type": "code",
573
+ "execution_count": null,
574
+ "metadata": {},
575
+ "outputs": [],
576
+ "source": "# WLASL - Word-Level American Sign Language\nwlasl_rows = read_csv_as_dicts(DATA_DIR / 'wlasl_index.csv')\nprint(f'WLASL dataset: {len(wlasl_rows):,} sign entries')\nprint(f'Columns: {list(wlasl_rows[0].keys())}')\nprint(f'\\nFirst 5 entries:')\nfor r in wlasl_rows[:5]:\n print(f' {r}')"
577
+ },
578
+ {
579
+ "cell_type": "code",
580
+ "execution_count": null,
581
+ "metadata": {},
582
+ "outputs": [],
583
+ "source": [
584
+ "# AAC Vocabulary Data\n",
585
+ "with open(DATA_DIR / 'aac_vocabulary_data.json') as f:\n",
586
+ " aac = json.load(f)\n",
587
+ "\n",
588
+ "print(f'AAC dataset keys: {list(aac.keys()) if isinstance(aac, dict) else \"list of \" + str(len(aac))}')\n",
589
+ "if isinstance(aac, dict):\n",
590
+ " for k, v in aac.items():\n",
591
+ " if isinstance(v, list):\n",
592
+ " print(f' {k}: {len(v)} items')\n",
593
+ " elif isinstance(v, dict):\n",
594
+ " print(f' {k}: {len(v)} keys')\n",
595
+ " else:\n",
596
+ " print(f' {k}: {v}')"
597
+ ]
598
+ },
599
+ {
600
+ "cell_type": "code",
601
+ "execution_count": null,
602
+ "metadata": {},
603
+ "outputs": [],
604
+ "source": "# VizWiz - Visual Question Answering for Blind Users\nvizwiz_rows = read_csv_as_dicts(DATA_DIR / 'vizwiz_val_annotations.csv')\nprint(f'VizWiz dataset: {len(vizwiz_rows):,} image annotations')\nprint(f'Columns: {list(vizwiz_rows[0].keys())}')\nprint(f'\\nFirst 5 entries:')\nfor r in vizwiz_rows[:5]:\n print(f' {r}')"
605
+ },
606
+ {
607
+ "cell_type": "markdown",
608
+ "metadata": {},
609
+ "source": "## 14. Dataset Inventory\n\nAll accessibility datasets in this collection."
610
+ },
611
+ {
612
+ "cell_type": "code",
613
+ "execution_count": null,
614
+ "metadata": {},
615
+ "outputs": [],
616
+ "source": "from pathlib import Path\n\n# Catalog all data files\ncatalog = []\nfor f in sorted(DATA_DIR.glob('*')):\n if f.is_file() and not f.name.startswith('.') and f.suffix in ['.json', '.csv', '.xlsx']:\n size = f.stat().st_size\n if f.suffix == '.json':\n try:\n with open(f) as fh:\n data = json.load(fh)\n if isinstance(data, list):\n records = len(data)\n elif isinstance(data, dict):\n records = sum(len(v) if isinstance(v, (list, dict)) else 1 for v in data.values())\n else:\n records = 1\n except:\n records = '?'\n elif f.suffix == '.csv':\n try:\n records = sum(1 for _ in open(f)) - 1\n except:\n records = '?'\n else:\n records = '?'\n catalog.append({\n 'file': f.name,\n 'format': f.suffix[1:].upper(),\n 'size_kb': round(size / 1024, 1),\n 'records': records\n })\n\ntotal_kb = sum(c['size_kb'] for c in catalog)\nprint(f'Total datasets: {len(catalog)}')\nprint(f'Total size: {total_kb:.0f} KB ({total_kb/1024:.1f} MB)\\n')\n\n# Print as formatted table\nprint(f'{\"File\":<55} {\"Format\":<6} {\"Size (KB)\":<10} {\"Records\"}')\nprint('-' * 85)\nfor c in sorted(catalog, key=lambda x: x['size_kb'], reverse=True):\n print(f'{c[\"file\"]:<55} {c[\"format\"]:<6} {c[\"size_kb\"]:<10} {c[\"records\"]}')"
617
+ },
618
+ {
619
+ "cell_type": "markdown",
620
+ "metadata": {},
621
+ "source": [
622
+ "## 15. Cross-Dataset Analysis: The Disability Landscape\n",
623
+ "\n",
624
+ "Pulling threads across all datasets to paint a unified picture."
625
+ ]
626
+ },
627
+ {
628
+ "cell_type": "code",
629
+ "execution_count": null,
630
+ "metadata": {},
631
+ "outputs": [],
632
+ "source": "fig, axes = plt.subplots(2, 2, figsize=(16, 12))\n\n# 1. US vs EU disability rate comparison\nax = axes[0, 0]\nus_rate = t_pct[-1]\neu_rate = eu['eu27_summary_2023']['total_disability_rate_pct']\nax.bar(['United States\\n(Census ACS)', 'European Union\\n(GALI/EU-SILC)'], \n [us_rate, eu_rate], color=['#3498db', '#f39c12'], width=0.5)\nax.set_ylabel('Disability Prevalence (%)')\nax.set_title('US vs EU Disability Rates', fontweight='bold')\nax.annotate('Different methodologies — not directly comparable', \n xy=(0.5, 0.02), xycoords='axes fraction', ha='center', fontsize=9, style='italic', color='gray')\nfor i, v in enumerate([us_rate, eu_rate]):\n ax.text(i, v + 0.3, f'{v}%', ha='center', fontweight='bold', fontsize=14)\n\n# 2. Employment gap comparison\nax = axes[0, 1]\nbls_stats = bls['overall_statistics']\nus_emp_gap = bls_stats['without_disability']['employment_population_ratio'] - bls_stats['with_disability']['employment_population_ratio']\neu_emp_gap = eu['eu27_summary_2023']['employment_gap_pp']\nax.bar(['US Employment\\nGap', 'EU Employment\\nGap'], [us_emp_gap, eu_emp_gap], \n color=['#e74c3c', '#e67e22'], width=0.5)\nax.set_ylabel('Gap (Percentage Points)')\nax.set_title('Disability Employment Gap: US vs EU', fontweight='bold')\nfor i, v in enumerate([us_emp_gap, eu_emp_gap]):\n ax.text(i, v + 0.3, f'{v:.1f}pp', ha='center', fontweight='bold', fontsize=14)\n\n# 3. Web accessibility vs lawsuits (dual axis)\nax = axes[1, 0]\ncommon_years = [y for y in ada['years'] if y in trends['years']]\nada_idx = [ada['years'].index(y) for y in common_years]\nwebaim_idx = [trends['years'].index(y) for y in common_years]\nax.bar(common_years, [ada['total_lawsuits'][i] for i in ada_idx], color='#e74c3c', alpha=0.6, label='Lawsuits')\nax2_twin = ax.twinx()\nax2_twin.plot(common_years, [trends['pages_with_failures_pct'][i] for i in webaim_idx], \n 'o-', color='#3498db', linewidth=2, label='% Sites Failing')\nax.set_ylabel('Lawsuits Filed', color='#e74c3c')\nax2_twin.set_ylabel('Sites with Failures (%)', color='#3498db')\nax.set_title('Lawsuits vs Web Compliance', fontweight='bold')\nax.legend(loc='upper left')\nax2_twin.legend(loc='upper right')\n\n# 4. Key stats dashboard\nax = axes[1, 1]\nax.axis('off')\nidea_ns = idea['national_summary_2022_23']\nstats_text = [\n f'US disability prevalence: {us_rate}%',\n f'Americans with disabilities: {t_dis[-1]:,.0f}',\n f'IDEA students served: {idea_ns[\"total_students_served\"]:,}',\n f'Employment rate (w/disability): {bls_stats[\"with_disability\"][\"employment_population_ratio\"]}%',\n f'Web pages with WCAG failures: {webaim[\"summary\"][\"pages_with_wcag_failures_pct\"]}%',\n f'Federal sites conforming: {s508[\"key_findings\"][\"public_websites_conforming_pct\"]}%',\n f'ADA lawsuits (2024): {ada[\"total_lawsuits\"][-1]:,}',\n f'Screen reader users surveyed: {sr[\"respondents\"]:,}',\n f'#1 web problem: {sr[\"problematic_items_ranked\"][0][\"item\"]}',\n]\nax.set_title('Key Stats at a Glance', fontweight='bold', fontsize=14, pad=20)\nfor i, line in enumerate(stats_text):\n ax.text(0.05, 0.9 - i*0.1, line, fontsize=11, transform=ax.transAxes, \n fontfamily='monospace')\n\nplt.tight_layout()\nplt.show()"
633
+ },
634
+ {
635
+ "cell_type": "markdown",
636
+ "metadata": {},
637
+ "source": [
638
+ "---\n",
639
+ "\n",
640
+ "## Data Sources & Credits\n",
641
+ "\n",
642
+ "| Dataset | Source | Coverage |\n",
643
+ "|---------|--------|----------|\n",
644
+ "| Census ACS S1810/B18101 | US Census Bureau | 2010-2023 national trends |\n",
645
+ "| Census County Disability | US Census Bureau ACS 5-year | 3,200+ counties (2022) |\n",
646
+ "| BLS Employment | Bureau of Labor Statistics CPS | 2009-2024 annual |\n",
647
+ "| WebAIM Million | WebAIM.org | 2019-2025 (1M sites/year) |\n",
648
+ "| Screen Reader Survey | WebAIM Survey #10 | 1,539 respondents (2024) |\n",
649
+ "| ADA Lawsuits | UsableNet, EcomBack | 2017-2024 |\n",
650
+ "| Section 508 | GSA FY24 Assessment | 245 federal entities |\n",
651
+ "| Eurostat GALI | EU-SILC | 30+ EU/EEA countries (2023) |\n",
652
+ "| IDEA | NCES Digest of Education | 1976-2023, 13 categories |\n",
653
+ "| WHO HALE | World Health Organization | Global life expectancy |\n",
654
+ "| WLASL | Li et al. (2020) | 2,001 ASL signs |\n",
655
+ "| VizWiz | VizWiz Challenge | 4,320 image annotations |\n",
656
+ "| AAC Vocabulary | Research compilation | Communication patterns |\n",
657
+ "\n",
658
+ "**Author**: Luke Steuber | **License**: CC-BY-4.0 | **Repository**: github.com/lukeslp/accessibility-atlas"
659
+ ]
660
+ }
661
+ ],
662
+ "metadata": {
663
+ "kernelspec": {
664
+ "display_name": "Python 3",
665
+ "language": "python",
666
+ "name": "python3"
667
+ },
668
+ "language_info": {
669
+ "name": "python",
670
+ "version": "3.10.0"
671
+ }
672
+ },
673
+ "nbformat": 4,
674
+ "nbformat_minor": 4
675
+ }