{"version":3,"file":"mrc.tables.min.js","names":["stateToAcronym","stateName","Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","\"New Hampshire\"","\"New Jersey\"","\"New Mexico\"","\"New York\"","\"North Carolina\"","\"North Dakota\"","Ohio","Oklahoma","Oregon","Pennsylvania","\"Rhode Island\"","\"South Carolina\"","\"South Dakota\"","Tennessee","Texas","Utah","Vermont","Virginia","Washington","\"West Virginia\"","Wisconsin","Wyoming","geoData","top100","usaMap","chart","resp","fetch","then","response","json","tmpGeoData","sort","a","b","Rank","slice","tmpData","tableElementBody","document","querySelector","sortTableOrdered","querySelectorAll","forEach","th","addEventListener","e","sortType","target","id","sortOrder","getAttribute","setAttribute","classList","remove","add","updateChartFlag","usaRow","find","item","dataToSort","filter","dataSorted","comparison","localeCompare","parseFloat","replace","unshift","innerHTML","generateRows","map","d","i","length","join","toggleShow","action","getElementById","contains","tr","toggle"],"sources":["_dev/mrc.tables.js"],"sourcesContent":["/*\n// Required Libs in whatever twigs this goes in.\n\n\n\n\n*/\n\n//\tRegister the data label plugin\n\n//Chart.register(ChartDataLabels);\n\nfunction stateToAcronym(stateName) {\n const stateAcronyms = {\n 'Alabama': 'AL',\n 'Alaska': 'AK',\n 'Arizona': 'AZ',\n 'Arkansas': 'AR',\n 'California': 'CA',\n 'Colorado': 'CO',\n 'Connecticut': 'CT',\n 'Delaware': 'DE',\n 'Florida': 'FL',\n 'Georgia': 'GA',\n 'Hawaii': 'HI',\n 'Idaho': 'ID',\n 'Illinois': 'IL',\n 'Indiana': 'IN',\n 'Iowa': 'IA',\n 'Kansas': 'KS',\n 'Kentucky': 'KY',\n 'Louisiana': 'LA',\n 'Maine': 'ME',\n 'Maryland': 'MD',\n 'Massachusetts': 'MA',\n 'Michigan': 'MI',\n 'Minnesota': 'MN',\n 'Mississippi': 'MS',\n 'Missouri': 'MO',\n 'Montana': 'MT',\n 'Nebraska': 'NE',\n 'Nevada': 'NV',\n 'New Hampshire': 'NH',\n 'New Jersey': 'NJ',\n 'New Mexico': 'NM',\n 'New York': 'NY',\n 'North Carolina': 'NC',\n 'North Dakota': 'ND',\n 'Ohio': 'OH',\n 'Oklahoma': 'OK',\n 'Oregon': 'OR',\n 'Pennsylvania': 'PA',\n 'Rhode Island': 'RI',\n 'South Carolina': 'SC',\n 'South Dakota': 'SD',\n 'Tennessee': 'TN',\n 'Texas': 'TX',\n 'Utah': 'UT',\n 'Vermont': 'VT',\n 'Virginia': 'VA',\n 'Washington': 'WA',\n 'West Virginia': 'WV',\n 'Wisconsin': 'WI',\n 'Wyoming': 'WY'\n };\n\n return stateAcronyms[stateName] || 'Unknown';\n}\n\nlet geoData;\nlet top100;\nlet usaMap;\nlet chart;\n\n// const resp = fetch('/assets/json/cities-best-serving-black-homebuyers-table.json')\n// const resp = fetch('/assets/json/best-cities-article-data.json')\n// const resp = fetch('/assets/json/100_cities_table_v2.json')\n// const resp = fetch('/assets/json/100_cities_black_homebuyers_v3.json')\nconst resp = fetch('/assets/json/100_cities_black_homebuyers_v4.json')\n.then(response => response.json())\n.then(tmpGeoData => {\ngeoData = tmpGeoData;\n\ntop100 = geoData.sort((a, b) => a.Rank - b.Rank).slice(0, 100);\n\n// const colorScale = chroma.scale(['#CEE4FF','#005AF7']).domain([1, 100]);\n\nfetch('/assets/js/usaMapStates.geo.json')\n\t.then(response => response.json())\n\t.then(tmpData => {\n\t\t// Data for outline\n\t\tusaMap = tmpData;\n\t\t\n\n\t\t// chart = new Chart(document.getElementById(\"bubbleMapCanvas\").getContext(\"2d\"), {\n\t\t// \ttype: 'bubbleMap', \n\t\t// \tdefaults: {\n\t\t// \t\tplugins: {\n\t\t// \t\t\tlegend: false,\n\t\t// \t\t}\n\t\t// \t},\n\t\t// \tdata: {\n\t\t// \t\tlabels: top100.map((d) => d.MSA_x),\n\t\t// \t\tdatasets: [{\n\t\t// \t\t\ttype: 'bubbleMap',\n\t\t// \t\t\toutline: usaMap,\n\t\t// \t\t\tshowOutline: true,\n\t\t// \t\t\tbackgroundColor: context => {\n\t\t// \t\t\t\tconst value = context.dataset.data[context.index].value;\n\t\t// \t\t\t\treturn colorScale(value).hex();\n\t\t// \t\t\t},\n\t\t// \t\t\tborderColor: '#001941',\t//\tCircle border color\n\t\t// \t\t\thoverRadius: 10,\n\t\t// \t\t\tdata: top100.map((d) => Object.assign(d, {\n\t\t// \t\t\t\t//value: parseFloat(d.Average_INDEX).toFixed(2) * 1,\n\t\t// \t\t\t\tvalue : d. MSA_score_with_single_state_var_Rank * 1,\n\t\t// \t\t\t})),\n\t\t// \t\t\tradius: context => {\n\t\t// \t\t\t\tlet radius = 5;\n\t\t// \t\t\t\treturn radius;\n\t\t// \t\t\t},\n\t\t// \t\t},\n\t\t// \t\t{\n\t\t// \t\t\tlabel: 'Choropleth Layer',\n\t\t// \t\t\ttype: 'choropleth',\n\t\t// \t\t\toutline: usaMap,\n\t\t// \t\t\tshowOutline: false,\n\t\t// \t\t\toutlineBackgroundColor: context => {\n\t\t// \t\t\t\tconst value = parseFloat(context.dataset.data[context.index].value);\n\t\t// \t\t\t\treturn colorScale(value).hex();\n\t\t// \t\t\t},\n\t\t// \t\t\tdata: top100.map(d => ({\n\t\t// \t\t\t\tfeature: d, // Assuming the feature information is correctly structured\n\t\t// \t\t\t\tvalue: d. MSA_score_with_single_state_var_Rank * 1\n\t\t// \t\t\t})),\n\t\t// \t\t}],\n\t\t// \t},\n\t\t// \toptions: {\n\t\t// \t\tplugins: {\n\t\t// \t\t\tlegend: {\n\t\t// \t\t\t\tdisplay: false,\n\t\t// \t\t\t},\n\t\t// \t\t\tdatalabels: {\n\t\t// \t\t\t\tdisplay: false,\n\t\t// \t\t\t\tcolor: '#36A2EB',\n\t\t// \t\t\t\talign: 'end',\n\t\t// \t\t\t\tanchor: 'end',\n\t\t// \t\t\t\tformatter: function(value, context) {\n\t\t// \t\t\t\t\treturn value.just_city;\n\t\t// \t\t\t\t}\n\t\t// \t\t\t},\n\t\t// \t\t\ttooltip: {\n // backgroundColor: 'rgba(246, 247, 247, 1)',\n // borderColor: 'rgba(27, 56, 80, 0.95)',\n // borderWidth: 1,\n // titleColor: 'rgba(0, 0, 0, 1)',\n // bodyColor: 'rgba(0, 0, 0, 1)',\n // footerColor: 'rgba(0, 0, 0, 1)',\n // padding: 15,\n // boxPadding: 7,\n // boxWidth: 10,\n // boxHeight: 10,\n // borderColor: 'rgb(0,0,0)',\n // borderWidth: 1,\n // caretSize: 12,\n // displayColors: false,\n // mode: 'index',\n // titleFont: {\n // size: 16,\n\t\t// \t\t\t\t\tweight: 'bold',\n // },\n // bodyFont: {\n // size: 14\n // },\n // footerFont: {\n // size: 14\n // },\n // callbacks: {\n // label: function(context) {\n // let labelsToShow = {\n // 'MSA_score_with_single_state_var_Rank': 'Rank',\n // 'Financial_Well-being_Rank': 'Financial Well-being',\n // 'Community_Support_Rank': 'Community Support',\n // 'Healthcare_and_Facilities_Rank': 'Healthcare and Facilities',\n // 'Infrastructure,_Accessibility,_Quality_of_Life_Rank': 'Quality of Life',\n // }\n\n // // TODO: Find some way to keep the currently filtered value as the top entry?\n\n // // dataSetIndex 0 is the bubblemapping data, 1 is the choropleth data.\n\t\t// \t\t\t\t\t\tif ( context.datasetIndex === 0 ) {\n\t\t// \t\t\t\t\t\t\tlet label = context.raw.just_city + \", \" + context.raw.state_x || '';\n\t\t// \t\t\t\t\t\t\t// if (label) {\n\t\t// \t\t\t\t\t\t\t// \tlabel += ': ';\n\t\t// \t\t\t\t\t\t\t// }\n\t\t// \t\t\t\t\t\t\t// if (context.parsed.r !== null) {\n\t\t// \t\t\t\t\t\t\t// \t// r in this case is the data on the r access, ie the dataset data value for bubble maps.\n\t\t// \t\t\t\t\t\t\t// \tlabel += context.parsed.r;\n\t\t// \t\t\t\t\t\t\t// }\n // Object.entries(labelsToShow).forEach(([key, value]) => {\n // if (key in context.raw) {\n // label += `~ ${value}: ${context.raw[key]}`;\n // }\n // });\n\t\t// \t\t\t\t\t\t\treturn label.split('~');\n\t\t// \t\t\t\t\t\t}\n\t\t// \t\t\t\t\t\treturn false;\n // },\n // // afterLabel: function(context) {\n // // console.log(\"after\", context);\n // // // Set afterLabel to the value of the data in the format prop : value for the properties msa_score_with_single_state_var_rank, financial_well-being_rank, community_support_rank, healthcare_and_facilities_rank, infrastructure,_accessibility,_quality_of_life_rank\n // // const afterLabel = `Rank: ${context.raw.MSA_score_with_single_state_var_Rank}, Financial Well-being: ${context.raw['Financial_Well-being_Rank']}, Community Support: ${context.raw.Community_Support_Rank}, Healthcare and Facilities: ${context.raw.Healthcare_and_Facilities_Rank}, Quality of Life: ${context.raw['Infrastructure,_Accessibility,_Quality_of_Life_Rank']}`;\n // // return afterLabel;\n // // },\n // },\n // },\n\t\t// \t\t},\n\t\t// \t\tscales: {\n\t\t// \t\t\tprojection: {\n\t\t// \t\t\t\taxis: 'x',\n\t\t// \t\t\t\tprojection: 'albersUsa', \n\t\t// \t\t\t},\n\t\t// \t\t\tsize: {\n\t\t// \t\t\t\tdisplay: false,\n\t\t// \t\t\t\taxis: 'r',\n\t\t// \t\t\t\tlegend : {\n\t\t// \t\t\t\t\t// This is the bubblemap legend that we don't want to show.\n\t\t// \t\t\t\t\tposition: 'bottom-left',\n\t\t// \t\t\t\t}\n\t\t// \t\t\t\t// range : [85, 95],\n\t\t// \t\t\t\t// size: [85, 100], // Think this is the wrong prop\n\t\t// \t\t\t},\n\t\t// \t\t\tcolor: {\n\t\t// \t\t\t\tdisplay: false,\n\t\t// \t\t\t\taxis: 'r',\n\t\t// \t\t\t\ttitle: {\n\t\t// \t\t\t\t\tdisplay: true,\n\t\t// \t\t\t\t\ttext: 'Average Index',\n\t\t// \t\t\t\t\tpadding: 0,\n\t\t// \t\t\t\t},\n\t\t// \t\t\t\tquantize: 100,\n\t\t// \t\t\t\tinterpolate: (context) => {\n\t\t// \t\t\t\t\treturn colorScale(context * 100).hex();\n\t\t// \t\t\t\t},\n\t\t// \t\t\t\tlegend: {\n\t\t// \t\t\t\t\tposition: 'bottom-left',\n\t\t// \t\t\t\t\talign: 'bottom',\n\t\t// \t\t\t\t},\n\t\t// \t\t\t}\n\n\t\t// \t\t}\n\t\t// \t}\n\t\t// });\n\n\t\t// Load the initial sorted table in.\n\t\tconst sortType = 'rankSort';\n\t\tconst tableElementBody = document.querySelector('#top100Table tbody');\n\t\tconst sortOrder = 'asc';\n\t\tsortTableOrdered(sortType, tableElementBody, sortOrder, false);\n\t});\n\n});\n\n\ndocument.querySelectorAll('th.sort').forEach((th) => {\n\tth.addEventListener('click', (e) => {\n\t\tconst sortType = e.target.id;\n\t\tconst tableElementBody = document.querySelector('#top100Table tbody');\n\t\tconst sortOrder = e.target.getAttribute('data-order') === 'asc' ? 'desc' : 'asc';\n\t\tdocument.querySelectorAll('th.sort').forEach((th) => {\n\t\t\tth.setAttribute('data-order', 'desc');\n\t\t});\n\t\te.target.setAttribute('data-order', sortOrder);\n\t\t// Remove active class from all th elements\n\t\tdocument.querySelectorAll('th.sort').forEach((th) => {\n\t\t\tth.classList.remove('active');\n\t\t});\n\t\te.target.classList.add('active');\n\t\tsortTableOrdered(sortType, tableElementBody, sortOrder);\n\t});\n});\n\nconst sortTableOrdered = (sortType, tableElementBody, sortOrder = 'asc', updateChartFlag = true) => {\n // Find and remove the United States row\n let usaRow = geoData.find(item => item['Metropolitan Area'] === 'United States');\n let dataToSort = geoData.filter(item => item['Metropolitan Area'] !== 'United States');\n\n let dataSorted = dataToSort.sort((a, b) => {\n let comparison = 0;\n switch (sortType) {\n case 'rankSort':\n comparison = a['Rank'] - b['Rank'];\n break;\n case 'alphaSort':\n comparison = a['Metropolitan Area'].localeCompare(b['Metropolitan Area']);\n break;\n case 'inclusivitySort':\n comparison = parseFloat(a['Inclusivity Score*'].replace(',', '')) - parseFloat(b['Inclusivity Score*'].replace(',', ''));\n break;\n case 'buyerSort':\n comparison = parseFloat(a['Black Homebuyers'].replace(',', '')) - parseFloat(b['Black Homebuyers'].replace(',', ''));\n break;\n case 'applicantSort':\n comparison = parseFloat(a['Black Applicants'].replace(',', '')) - parseFloat(b['Black Applicants'].replace(',', ''));\n break;\n case 'approvalSort':\n comparison = a['Black Approval Rate'].replace('%', '') - b['Black Approval Rate'].replace('%', '');\n break;\n case 'bvwSort':\n comparison = a['Black vs White Approval Rate Gap'].replace('%', '') - b['Black vs White Approval Rate Gap'].replace('%', '');\n break;\n default:\n }\n\n return sortOrder === 'desc' ? -comparison : comparison;\n }).slice(0, 100); // Get the 100 other results\n\n // Add United States row back at the beginning\n if (usaRow) {\n dataSorted.unshift(usaRow);\n }\n\n // Overwrite tableElementBody innerHTML with new sorted geoData\n tableElementBody.innerHTML = generateRows(dataSorted);\n};\n\nconst generateRows = (dataSorted) => {\n\t// Generate the rows for the table\n\treturn dataSorted.map((d, i) => {\n return `\n \n\t\t\t\t${d['Rank']}\n\t\t\t\t${d['Metropolitan Area']}\n ${d['Inclusivity Score*']}\n ${d['Black Homebuyers']}\n ${d['Black Applicants']}\n ${d['Black Approval Rate']}\n ${d['Black vs White Approval Rate Gap']}\n \n\t\t\t${i === dataSorted.length - 1 ? 'Expand' : ''}\n `;\n }).join('');\n}\n\nfunction toggleShow() {\n\tlet action = document.getElementById('toggleShow').classList.contains('expand') ? 'Collapse' : 'Expand';\n\tdocument.getElementById('toggleShow').innerHTML = action;\n\tif (action == 'Collapse') {\n\t\tdocument.getElementById('toggleShow').classList.remove('expand');\n\t\tdocument.getElementById('toggleShow').classList.add('collapse');\n\t} else {\n\t\tdocument.getElementById('toggleShow').classList.remove('collapse');\n\t\tdocument.getElementById('toggleShow').classList.add('expand');\n\t}\n\tdocument.querySelectorAll('tr.additional').forEach((tr) => {\n\t\ttr.classList.toggle('hidden');\n\t});\n}"],"mappings":"AAYA,QAAS,CAAAA,cAAcA,CAACC,CAAS,CAAE,CAsD/B,MArDsB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