@@ -199,8 +199,8 @@ <h3>Census Data Manager</h3>
199199 // --- DATA URLS ---
200200 const csvUrl = 'https://gist.githubusercontent.com/jstart/5957b92d8d1f60480de2d15654c555ca/raw/c66ae13821921707b79a0665b6acb02d7734ae85/torrance_precincts.csv' ;
201201 const geojsonUrl = 'https://gist.githubusercontent.com/jstart/0ba13db4475880d226b4e222a09bdfc8/raw/2e72a76fe9ac3cf6ae036c1977d5803cb9693a6e/test.geojson' ;
202- const fullDataUrl = 'Precinct_ACS_FullOverlay.csv' ; // Local comprehensive data file
203- const variableLabelsUrl = 'acs_variable_labels.csv' ; // Variable name mappings
202+ const fullDataUrl = 'https://raw.githubusercontent.com/jstart/jstart.github.io/main/ Precinct_ACS_FullOverlay.csv' ; // Hosted comprehensive data file
203+ const variableLabelsUrl = 'https://raw.githubusercontent.com/jstart/jstart.github.io/main/ acs_variable_labels.csv' ; // Hosted variable name mappings
204204
205205 // --- CENSUS DATA CHUNKS DEFINITION (EXPANDED & HUMAN-READABLE) ---
206206 const censusDataChunks = {
@@ -1044,7 +1044,12 @@ <h3>Census Data Manager</h3>
10441044 console . log ( 'Loading variable labels...' ) ;
10451045 try {
10461046 const response = await fetch ( variableLabelsUrl ) ;
1047- if ( ! response . ok ) throw new Error ( `Failed to load variable labels: ${ response . status } ` ) ;
1047+ if ( ! response . ok ) {
1048+ if ( response . status === 404 ) {
1049+ throw new Error ( `Variable labels file not found. Please upload acs_variable_labels.csv to your GitHub repository.` ) ;
1050+ }
1051+ throw new Error ( `Failed to load variable labels: ${ response . status } ` ) ;
1052+ }
10481053
10491054 const csvText = await response . text ( ) ;
10501055 const parsed = Papa . parse ( csvText , { header : true , skipEmptyLines : true } ) ;
@@ -1067,7 +1072,12 @@ <h3>Census Data Manager</h3>
10671072 console . log ( 'Loading full precinct data from:' , fullDataUrl ) ;
10681073 try {
10691074 const response = await fetch ( fullDataUrl ) ;
1070- if ( ! response . ok ) throw new Error ( `Failed to load full data: ${ response . status } ${ response . statusText } ` ) ;
1075+ if ( ! response . ok ) {
1076+ if ( response . status === 404 ) {
1077+ throw new Error ( `Full data file not found. Please upload Precinct_ACS_FullOverlay.csv to your GitHub repository.` ) ;
1078+ }
1079+ throw new Error ( `Failed to load full data: ${ response . status } ${ response . statusText } ` ) ;
1080+ }
10711081
10721082 console . log ( 'Full data file response received, parsing CSV...' ) ;
10731083 const csvText = await response . text ( ) ;
0 commit comments