Fix national_rates.json deployment — copy to public/ directory
Deploy to git-pages / deploy (push) Successful in 19s
Deploy to git-pages / deploy (push) Successful in 19s
- Add missing data/national_rates.json fixture (was only in src/data/, not served by Vite) - LoadingAnimation.jsx: Use import.meta.env.BASE_URL for national rates path - Ensures file is available at /crdc-demo/data/national_rates.json on git-pages
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"metadata": {
|
||||
"source": "CRDC School Arrest Rate API / Knowles & Miller 2025, White Paper §3 Data",
|
||||
"year": "21-22",
|
||||
"description": "National arrest rates per 1,000 students for each race×sex group in the 2021-22 CRDC. Generated from crdc_2122 with RACE != TOTAL and SEX != TOTAL: sum(ARRESTS) / (sum(stu_enroll)/1000).",
|
||||
"note": "These are observed national rates, used for comparison in Charts 3 & 6."
|
||||
},
|
||||
"rates_per_1000": {
|
||||
"WH_F": 0.34,
|
||||
"WH_M": 0.67,
|
||||
"BL_F": 1.25,
|
||||
"BL_M": 1.98,
|
||||
"HI_F": 0.42,
|
||||
"HI_M": 0.88,
|
||||
"AM_F": 0.91,
|
||||
"AM_M": 1.40
|
||||
},
|
||||
"observed_arrests": {
|
||||
"WH_F": 3653,
|
||||
"WH_M": 7606,
|
||||
"BL_F": 4420,
|
||||
"BL_M": 7246,
|
||||
"HI_F": 2876,
|
||||
"HI_M": 6270,
|
||||
"AM_F": 202,
|
||||
"AM_M": 327
|
||||
},
|
||||
"enrollment": {
|
||||
"WH_F": 10624313,
|
||||
"WH_M": 11322741,
|
||||
"BL_F": 3530162,
|
||||
"BL_M": 3667523,
|
||||
"HI_F": 6805008,
|
||||
"HI_M": 7109091,
|
||||
"AM_F": 222963,
|
||||
"AM_M": 233442
|
||||
},
|
||||
"totals": {
|
||||
"arrests": 34846,
|
||||
"enrollment": 48596489,
|
||||
"rate_per_1000": 0.72,
|
||||
"districts_reporting_arrests_pct": 11.6
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ export default function LoadingAnimation({ district, state }) {
|
||||
)
|
||||
|
||||
// ——— National rates (from static fixture, instant) ———
|
||||
const nationalPromise = fetch('/data/national_rates.json')
|
||||
const nationalPromise = fetch(import.meta.env.BASE_URL + 'data/national_rates.json')
|
||||
.then(r => r.json())
|
||||
.then(data => { /* cache for ChartPanel */ window.__NATIONAL_RATES__ = data })
|
||||
.catch(() => {})
|
||||
|
||||
Reference in New Issue
Block a user