# All files / src/components/Graphs types.ts

0% Statements 0/2
100% Branches 0/0
100% Functions 0/0
0% Lines 0/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103

     // https://www.nationsonline.org/oneworld/country_code_list.htm
    export type Countries = 'ITA' | 'GBR' | 'USA' | 'SWE' | 'SCO' | 'TUR' | 'IND';

    export type CountryData = {
      longName: string;
      color: string;
      population: number;
    };

    export type CountriesData = {
      [key in Countries]: CountryData;
    };

    export type DayStatistics = {
      confirmed: number;
      deaths: number;
      recovered: number;
      date: string;
    };

    export type CountryStats = {
      result: DayStatistics[];
    };

    export type Stats = {
      [country in Countries]: CountryStats;
    };

    export type DayData = {
      delta: number;
      x: number | string;
      y: number;
      index: number;
      country: CountryData;
      deltaDeaths: number;
      population: number;
      deaths: number;
    };

    export type CountryResult = { color: string; name: string; data: DayData[] };

    export type CountriesResult = Record<Countries, CountryResult>;

    export const countryData: CountriesData = {
      // DEU: {
      //   longName: 'Germany',
      //   color: '#038D44',
      //   population: 83000000,
      // },
      TUR: {
        longName: 'Turkey',
        color: '#038D44',
        population: 82000000,
      },
      // FRA: {
      //   longName: 'France',
      //   color: 'pink',
      //   population: 67000000,
      // },
      ITA: {
        longName: 'Italy',
        color: '#99ccff',
        population: 60000000,
      },
      // BRA: {
      //   longName: 'Brazil',
      //   color: '#FEDF00',
      //   population: 210000000,
      // },
      IND: {
        longName: 'India',
        color: '#964B00',
        population: 1366000000,
      },
      USA: {
        longName: 'USA',
        color: '#BF0A30',
        population: 383000000,
      },
      SWE: {
        longName: 'Sweden',
        color: '#FEDF00',
        population: 11000000,
      },
      SCO: {
        longName: 'Scotland',
        color: '#2C67B7',
        population: 5550000,
      },
      // ESP: {
      //   longName: 'Spain',
      //   color: '#00FF00',
      //   population: 47000000,
      // },
      GBR: {
        longName: 'UK',
        color: '#fff',
        population: 67000000,
      },
    };

    export const AxisColor = '#fff';