PageSourceSearch

https://consumerenergyalliance.org/cms/wp-content/cache/autoptimiz…8340648b96940b4cb7de11e004bddb.js?ver=1.0.0

js consumerenergyalliance.org collected 2026-10-02 06:48:47 UTC 4,806 bytes, 3 lines download raw bytes

1(function(){let energyData=null;let previousYearData=null;window.dataService={initialize:function(){return $.Deferred(function(defer){if(window.mapController&&typeof window.mapController.getEnergyData==='function'){const interval=setInterval(function(){const data=window.mapController.getEnergyData();if(data){clearInterval(interval);energyData=data;generatePreviousYearData();defer.resolve(energyData);}},100);setTimeout(function(){clearInterval(interval);if(!energyData){const energyDataUrl=typeof ceaCalculator!=='undefined'&&ceaCalculator.energyDataUrl?ceaCalculator.energyDataUrl:'./js/energy-data~.json';$.getJSON(energyDataUrl).done(function(data){energyData=data;generatePreviousYearData();defer.resolve(energyData);}).fail(function(error){console.error("Error loading energy data:",error);defer.reject(error);});}},5000);}else{const energyDataUrl=typeof ceaCalculator!=='undefined'&&ceaCalculator.energyDataUrl?ceaCalculator.energyDataUrl:'./js/energy-data.json';$.getJSON(energyDataUrl).done(function(data){energyData=data;generatePreviousYearData();defer.resolve(energyData);}).fail(function(error){console.error("Error loading energy data:",error);defer.reject(error);});}}).promise();},getEnergyData:function(){return energyData;},getPreviousYearData:function(){return previousYearData;},getStateEnergyData:function(stateId){if(!energyData||!energyData.states)return null;const stateIndex=energyData.states.findIndex(s=>s.stateAbbr.toUpperCase()===stateId.toUpperCase());if(stateIndex!==-1){return energyData.states[stateIndex];}
2return null;},getPreviousYearValue:function(stateId,metric){if(!previousYearData||!previousYearData.states)return null;const stateIndex=previousYearData.states.findIndex(s=>s.stateAbbr.toUpperCase()===stateId.toUpperCase());if(stateIndex!==-1){return previousYearData.states[stateIndex][metric];}
3return null;},formatMetricName:function(metric){switch(metric){case'totalEnergyExpenditure':return'Total Energy ($)';case'electricityExpenditure':return'Electricity ($)';case'gasExpenditure':return'Gasoline ($)';case'naturalGasExpenditure':return'Natural Gas ($)';case'electricityPrice':return'Electricity ($/kWh)';case'gasolinePrice':return'Gasoline ($/gal)';case'naturalGasPrice':return'Natural Gas ($/therm)';case'electricityUse':return'Electricity Use (kWh)';case'gasolineUse':return'Gasoline Use (gal)';case'naturalGasUse':return'Natural Gas Use (therm)';default:return metric;}},formatMetricValue:function(metric,value){if(metric.includes('Price')){return`$${value.toFixed(3)}`;}else if(metric.includes('Expenditure')){return`$${value.toFixed(2)}`;}else{return value.toLocaleString();}},prepareChartData:function(selectedStates,selectedMetrics,compareWithPreviousYear){const data=[];selectedStates.forEach(function(state){const stateInfo=this.getStateEnergyData(state.id);if(!stateInfo)return;const stateData={stateId:state.id,stateName:state.name,metrics:{}};selectedMetrics.forEach(function(metric){stateData.metrics[metric]={current:stateInfo[metric],previous:compareWithPreviousYear?this.getPreviousYearValue(state.id,metric):null,formatted:this.formatMetricValue(metric,stateInfo[metric]),formattedName:this.formatMetricName(metric)};}.bind(this));data.push(stateData);}.bind(this));return{states:data,metrics:selectedMetrics};},getChangeIndicator:function(percentChange){if(percentChange>0.5){return{symbol:'▲',class:'increase'};}else if(percentChange<-0.5){return{symbol:'▼',class:'decrease'};}else{return{symbol:'◆',class:'same'};}}};function generatePreviousYearData(){if(!energyData||!energyData.states)return;previousYearData={states:energyData.states.map(function(state){const stateDataCopy={...state};const modifyValue=function(value){const changePercent=(Math.random()*0.2)-0.1;return value*(1+changePercent);};stateDataCopy.totalEnergyExpenditure=modifyValue(state.totalEnergyExpenditure);stateDataCopy.electricityExpenditure=modifyValue(state.electricityExpenditure);stateDataCopy.gasExpenditure=modifyValue(state.gasExpenditure);stateDataCopy.naturalGasExpenditure=modifyValue(state.naturalGasExpenditure);stateDataCopy.totalEnergyPercentage=modifyValue(state.totalEnergyPercentage);stateDataCopy.electricityPercentage=modifyValue(state.electricityPercentage);stateDataCopy.gasPercentage=modifyValue(state.gasPercentage);stateDataCopy.naturalGasPercentage=modifyValue(state.naturalGasPercentage);stateDataCopy.electricityPrice=modifyValue(state.electricityPrice);
3stateDataCopy.gasolinePrice=modifyValue(state.gasolinePrice);stateDataCopy.naturalGasPrice=modifyValue(state.naturalGasPrice);stateDataCopy.electricityUse=Math.round(modifyValue(state.electricityUse));stateDataCopy.gasolineUse=Math.round(modifyValue(state.gasolineUse));stateDataCopy.naturalGasUse=Math.round(modifyValue(state.naturalGasUse));return stateDataCopy;})};}})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.