File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ import { Processor } from "./processors/processor"
125125import { mapConfigs } from " ./config/loader"
126126import type { MapConfig } from " ./config/types"
127127import { MapManager } from " ./mapManager"
128- import type { ValidFilterLookup } from " ./mapManager"
128+ import type { FilterLookup } from " ./mapManager"
129129
130130// UI toggles
131131const showInfo = ref (false )
@@ -140,7 +140,7 @@ const regionData = ref<RegionData[] | undefined>(undefined)
140140const selectedLegendColor = ref <string >(" " )
141141const config = ref <MapConfig | undefined >(undefined )
142142const configs = ref <MapConfig []>([])
143- const validFilterLookup = ref <ValidFilterLookup | undefined >(undefined )
143+ const validFilterLookup = ref <FilterLookup | undefined >(undefined )
144144
145145
146146// Filter state
Original file line number Diff line number Diff line change @@ -131,15 +131,15 @@ import Checkbox from './checkbox.vue'
131131import InputField from ' ./input-field.vue'
132132import { colorSchemes } from ' ../config/types.ts'
133133import type { MapConfig } from ' ../config/types.ts'
134- import type { ValidFilterLookup } from ' ../mapManager.ts'
134+ import type { FilterLookup } from ' ../mapManager.ts'
135135
136136const schemeNames: string [] = [... colorSchemes ]
137137
138138const props = defineProps <{
139139 availableFilterOptions? : Record <string , any >
140140 config? : MapConfig
141141 loading? : boolean
142- validFilterLookup? : ValidFilterLookup
142+ validFilterLookup? : FilterLookup
143143}>()
144144
145145const emit = defineEmits ([
Original file line number Diff line number Diff line change @@ -5,13 +5,17 @@ import { Processor } from "./processors/processor"
55import type { MapConfig } from "./config/types"
66import { fetchPublicFile } from "./helpers"
77
8- export interface LoadedMapState {
8+ export type FilterLookup = {
9+ lookup ( knownValues : Record < string , string > , targetKey : string ) : string [ ]
10+ }
11+
12+ export type LoadedMapState = {
913 geojsonData : GeoJSON
1014 dataProcessor : Processor
1115 regionData : RegionData [ ]
1216 availableFilterOptions : { [ key : string ] : string [ ] }
1317 selectedFilters : { [ key : string ] : string }
14- validFilterLookup : ValidFilterLookup
18+ validFilterLookup : FilterLookup
1519}
1620
1721type MapKey = string
Original file line number Diff line number Diff line change @@ -60,11 +60,11 @@ export async function getRegionData(
6060 datasetName : string
6161) : Promise < RegionData [ ] > {
6262
63- const filter_clause = Object . entries ( selectedCategoryValues )
64- . map ( ( [ category_col , value ] ) =>
63+ const filterClause = Object . entries ( selectedCategoryValues )
64+ . map ( ( [ categoryCol , value ] ) =>
6565 value === MISSING_LABEL
66- ? `${ category_col } IS NULL`
67- : `${ category_col } = '${ value } '`
66+ ? `${ categoryCol } IS NULL`
67+ : `${ categoryCol } = '${ value } '`
6868 )
6969 . join ( " AND " )
7070
@@ -75,7 +75,7 @@ export async function getRegionData(
7575 FROM
7676 ${ readFunction } ('${ datasetName } ')
7777 WHERE
78- ${ filter_clause }
78+ ${ filterClause }
7979 `
8080 const out = await executeQuery ( query ) as RegionData [ ]
8181 return out
Original file line number Diff line number Diff line change 1- export interface RegionData {
1+ export type RegionData = {
22 regionId : string
33 value : number
44}
You can’t perform that action at this time.
0 commit comments