Skip to content

Commit

Permalink
Update config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
nofurtherinformation committed May 10, 2024
1 parent a14b627 commit 2834aef
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions utils/data/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)`,
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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<typeof columnsDict> = {
"Market Concentration": {
Expand Down Expand Up @@ -268,7 +277,11 @@ export const columnGroups: ColumnGroups<typeof columnsDict> = {
},
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

Expand Down

0 comments on commit 2834aef

Please sign in to comment.