From be647d0882a0a5f15959269097dbedceef2fa3b9 Mon Sep 17 00:00:00 2001 From: Jared Knowles Date: Mon, 10 Aug 2026 16:32:40 -0400 Subject: [PATCH] Fix: remove draws fetch (API endpoint not available for browser) The /estimates/{leaid}/draws endpoint doesn't exist - only bulk Parquet shard access is available. Falls back to interval-based rendering. --- src/components/ChartPanel.jsx | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/src/components/ChartPanel.jsx b/src/components/ChartPanel.jsx index b20ce95..7da518d 100644 --- a/src/components/ChartPanel.jsx +++ b/src/components/ChartPanel.jsx @@ -43,26 +43,9 @@ export default function ChartPanel({ district, state }) { try { quadData[model] = await api.fetchDistrictEstimates(district.leaid, { model, year: '21-22' }) } catch(e) {} })) - // Fetch raw posterior draws for Chart 4 (ModelDrawsComparison) - const modelDraws = {} - await Promise.all(quadrants.map(async (model) => { - try { - const result = await api.fetchDistrictDraws(district.leaid, { model, year: '21-22' }) - // API returns draws array grouped by race/sex - process into usable format - if (result?.data) { - // Group draws by model for easier access - const drawsByGroup = {} - result.data.forEach(d => { - const key = `${d.race}_${d.sex}` - if (!drawsByGroup[key]) drawsByGroup[key] = [] - drawsByGroup[key].push(d.pred) - }) - modelDraws[model] = drawsByGroup - } - } catch(e) { - console.error('Failed to fetch draws for', model, e) - } - })) + // Raw posterior draws are not available via browser API (only bulk Parquet shards) + // Falls back to interval-based rendering in charts + const modelDraws = null setData({ waveData, quadData, modelDraws }) } catch (err) {