diff --git a/components/Stats.vue b/components/Stats.vue index 9cd59411..bbec840e 100644 --- a/components/Stats.vue +++ b/components/Stats.vue @@ -122,23 +122,86 @@ :url="'https://coronadatascraper.com'" /> + + +
+ +
+
+ + {{ countyName.name }} + +
+
+
+ + + + + + + + diff --git a/static/data/countyColor.json b/static/data/countyColor.json new file mode 100644 index 00000000..8f12cb6f --- /dev/null +++ b/static/data/countyColor.json @@ -0,0 +1,11 @@ +{ + "Solano County": "#999900", + "Alameda County": "#009900", + "Santa Clara County": "#ff0000", + "San Francisco County": "#7f00ff", + "Contra Costa County": "#ff8800", + "San Mateo County": "#0080ff", + "Sonoma County": "#ff00ff", + "Napa County": "#808080", + "Marin County": "#0000ff" +} \ No newline at end of file diff --git a/utils/formatCountyData.ts b/utils/formatCountyData.ts index b28c5f38..b2d74ac0 100644 --- a/utils/formatCountyData.ts +++ b/utils/formatCountyData.ts @@ -22,6 +22,7 @@ type GraphDataType = { type CountyDataFormattedType = { name: string + population: number graph: Array lastUpdatedAt: Date } @@ -47,9 +48,10 @@ export default (data: Array, countyFilter?: Array) => { for (const countyName in data) { if (countyFilter && !includedCounties[countyName]) continue - const { name, cases } = data[countyName] + const { name, population, cases } = data[countyName] const county: CountyDataFormattedType = { name, + population, graph: formatGraph(cases), lastUpdatedAt: cases.slice(-1)[0].date }