From 2834aef49289af75bb593e6fb6950795ce070d69 Mon Sep 17 00:00:00 2001 From: nofurtherinformation Date: Fri, 10 May 2024 15:36:25 -0500 Subject: [PATCH] Update config.ts --- utils/data/config.ts | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/utils/data/config.ts b/utils/data/config.ts index 1e1f798..78b816d 100644 --- a/utils/data/config.ts +++ b/utils/data/config.ts @@ -2,7 +2,6 @@ import { DataConfig, ColumnConfig, ColumnGroups, Columns } from "./config.types" const years = [2000, 2010, 2020] - const generateHhiConfig = (year: number) => ({ name: `Concentration Index ${year} (No Dollar Stores)`, @@ -133,14 +132,25 @@ export const columnsDict = { description: "Bivariate", colorScheme: "RdBu", }, + "Economic Advantage & Market Concentration - Bivariate 2020": { + name: "ADI & Food Access - 2020", + bivariate: true, + reversed: [true, false], + column: ["ADI_NATRANK", "2020"], + columnLabels: ["Economic Disadvantage", "Market Concentration"], + idColumns: ["FIPS", "GEOID"], + tables: ["data/adi/2021_tracts.parquet", "data/concentration_metrics_wide.parquet"], + description: "Bivariate", + colorScheme: "PuOr", + }, "Economic Advantage Index": { name: "Economic Advantage Index", column: "ADI_NATRANK", description: "ADI", table: "data/adi/2021_tracts.parquet", idColumn: "FIPS", - bivariate: false - } + bivariate: false, + }, } as const export const dataConfig: DataConfig = { @@ -202,29 +212,28 @@ export const dataConfig: DataConfig = { }, } as const - export const timeSeriesConfig = { hhi: { table: "data/concentration_metrics_wide.parquet", - columns: new Array(2021-1997).fill(null).map((_, i) => i + 1997), - idColumn: "GEOID" + columns: new Array(2021 - 1997).fill(null).map((_, i) => i + 1997), + idColumn: "GEOID", }, hhiDs: { table: "data/concentration_metrics_wide_ds.parquet", - columns: new Array(2021-1997).fill(null).map((_, i) => i + 1997), - idColumn: "GEOID" + columns: new Array(2021 - 1997).fill(null).map((_, i) => i + 1997), + idColumn: "GEOID", }, gravity: { table: "data/gravity_no_dollar_pivoted.parquet", - columns: [2000, ...(new Array(2021-2010).fill(null).map((_, i) => i + 2010))], - idColumn: "GEOID" + columns: [2000, ...new Array(2021 - 2010).fill(null).map((_, i) => i + 2010)], + idColumn: "GEOID", }, gravityDs: { table: "data/gravity_dollar_pivoted.parquet", - columns: [2000, ...(new Array(2021-2010).fill(null).map((_, i) => i + 2010))], - idColumn: "GEOID" - } -} as const + columns: [2000, ...new Array(2021 - 2010).fill(null).map((_, i) => i + 2010)], + idColumn: "GEOID", + }, +} as const export const columnGroups: ColumnGroups = { "Market Concentration": { @@ -268,7 +277,11 @@ export const columnGroups: ColumnGroups = { }, Bivariate: { description: "Bivariate", - columns: ["Concentration & Food Access - Bivariate 2020", "Economic Advantage & Food Access - Bivariate 2020"], + columns: [ + "Concentration & Food Access - Bivariate 2020", + "Economic Advantage & Food Access - Bivariate 2020", + "Economic Advantage & Market Concentration - Bivariate 2020", + ], }, } as const