From ed9299b0a6f15d9c82489463a6946a49bcd4dece Mon Sep 17 00:00:00 2001 From: hudaif747 Date: Mon, 11 Nov 2024 17:27:50 +0100 Subject: [PATCH] Updated namespace with keyInfo item; added 'anyOption' to records --- frontend/src/types/pandemos.ts | 76 ++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 32 deletions(-) diff --git a/frontend/src/types/pandemos.ts b/frontend/src/types/pandemos.ts index a6928337..3b70e1cf 100644 --- a/frontend/src/types/pandemos.ts +++ b/frontend/src/types/pandemos.ts @@ -3,31 +3,37 @@ /** Display names for the diffent enums of the pandemos data */ export namespace KeyInfo { + export const anyOption: KeyInfoItem = { + icon: '🤷', + fullName: "Any/Don't Care", + }; /** Locations */ - export const location_type: Record = { - /** Home */ 0: '🏡', - /** School */ 1: '🏫', - /** Work */ 2: '🏭/🏢', - /** Social Event */ 3: '🏟', - /** Shopping */ 4: '🏪', - /** Hospital */ 5: '🏥❗', - /** ICU */ 6: '🏥‼', - /** Car */ 7: '🚘', - /** Public */ 8: '⛲', - /** Transport */ 9: '🚍', - /** Cemetery */ 10: '⚰', + export const location_type: Record = { + /** Any */ 0: anyOption, + /** Home */ 1: {icon: '🏡', fullName: 'Home'}, + /** School */ 2: {icon: '🏫', fullName: 'School'}, + /** Work */ 3: {icon: '🏭/🏢', fullName: 'Workplace'}, + /** Social Event */ 4: {icon: '🏟', fullName: 'Social Event'}, + /** Shopping */ 5: {icon: '🏪', fullName: 'Shopping'}, + /** Hospital */ 6: {icon: '🏥❗', fullName: 'Hospital'}, + /** ICU */ 7: {icon: '🏥‼', fullName: 'Intensive Care Unit'}, + /** Car */ 8: {icon: '🚘', fullName: 'Car'}, + /** Public */ 9: {icon: '⛲', fullName: 'Public Space'}, + /** Transport */ 10: {icon: '🚍', fullName: 'Public Transport'}, + /** Cemetery */ 11: {icon: '⚰', fullName: 'Cemetery'}, }; - export const transport_mode: Record = { - /** Bike */ 0: '🚴‍♀️', - /** Car (Driver) */ 1: '🚘👤', - /** Car (Passenger) */ 2: '🚘👥', - /** Bus */ 3: '🚍', - /** Walking */ 4: '🚶‍♀️', - /** Other */ 5: '🛸', - /** Unknown */ 6: '❓', + export const transport_mode: Record = { + /** Any */ 0: anyOption, + /** Bike */ 1: {icon: '🚴‍♀️', fullName: 'Bicycle'}, + /** Car (Driver) */ 2: {icon: '🚘👤', fullName: 'Car as Driver'}, + /** Car (Passenger) */ 3: {icon: '🚘👥', fullName: 'Car as Passenger'}, + /** Bus */ 4: {icon: '🚍', fullName: 'Bus'}, + /** Walking */ 5: {icon: '🚶‍♀️', fullName: 'Walking'}, + /** Other */ 6: {icon: '🛸', fullName: 'Other Mode'}, + /** Unknown */ 7: {icon: '❓', fullName: 'Unknown Mode'}, }; - + export const activity: Record = { /** Workplace */ 0: 'Workplace', /** Education */ 1: 'Education', @@ -38,16 +44,17 @@ export namespace KeyInfo { /** Going Home */ 6: 'Going Home', /** Unknown */ 7: 'Unknown', }; - export const infection_state: Record = { - /** Susceptible */ 0: '🙂', - /** Infected with no symptoms */ 1: '🤔', - /** Infected with symptoms */ 2: '🤧', - /** Infected with severe symptoms */ 3: '🤒', - /** Infected with critical symptoms */ 4: '🤮', - /** Recovered */ 5: '😀', - /** Dead */ 6: '💀', - /** Unknown */ 7: '❓', - }; + export const infection_state: Record = { + /** Any */ 0: anyOption, + /** Susceptible */ 1: {icon: '🙂', fullName: 'Susceptible to Infection'}, + /** Infected with no symptoms */ 2: {icon: '🤔', fullName: 'Asymptomatic Infection'}, + /** Infected with symptoms */ 3: {icon: '🤧', fullName: 'Symptomatic Infection'}, + /** Infected with severe symptoms */ 4: {icon: '🤒', fullName: 'Severely Symptomatic'}, + /** Infected with critical symptoms */ 5: {icon: '🤮', fullName: 'Critically Symptomatic'}, + /** Recovered */ 6: {icon: '😀', fullName: 'Recovered from Infection'}, + /** Dead */ 7: {icon: '💀', fullName: 'Deceased'}, + /** Unknown */ 8: {icon: '❓', fullName: 'Unknown State'}, + }; } export interface Agent { @@ -103,4 +110,9 @@ export interface TripChain { chain_id: number; agent_id: number; trips: Array; -} \ No newline at end of file +} + +export interface KeyInfoItem { + icon: string; + fullName: string; +}