Skip to content

Commit

Permalink
Updated namespace with keyInfo item; added 'anyOption' to records
Browse files Browse the repository at this point in the history
  • Loading branch information
hudaif747 committed Nov 11, 2024
1 parent de002a0 commit ed9299b
Showing 1 changed file with 44 additions and 32 deletions.
76 changes: 44 additions & 32 deletions frontend/src/types/pandemos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<number, string> = {
/** 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<number, KeyInfoItem> = {
/** 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<number, string> = {
/** Bike */ 0: '🚴‍♀️',
/** Car (Driver) */ 1: '🚘👤',
/** Car (Passenger) */ 2: '🚘👥',
/** Bus */ 3: '🚍',
/** Walking */ 4: '🚶‍♀️',
/** Other */ 5: '🛸',
/** Unknown */ 6: '❓',
export const transport_mode: Record<number, KeyInfoItem> = {
/** 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<number, string> = {
/** Workplace */ 0: 'Workplace',
/** Education */ 1: 'Education',
Expand All @@ -38,16 +44,17 @@ export namespace KeyInfo {
/** Going Home */ 6: 'Going Home',
/** Unknown */ 7: 'Unknown',
};
export const infection_state: Record<number, string> = {
/** 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<number, KeyInfoItem> = {
/** 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 {
Expand Down Expand Up @@ -103,4 +110,9 @@ export interface TripChain {
chain_id: number;
agent_id: number;
trips: Array<Trip>;
}
}

export interface KeyInfoItem {
icon: string;
fullName: string;
}

0 comments on commit ed9299b

Please sign in to comment.