Giter Club home page Giter Club logo

covid-19-data's Introduction

covid-19-data

The timeseries datasets from https://github.com/CSSEGISandData/COVID-19 converted into a JSON representation, and a JS file able to be included in other pages easily.

Direct sources for some countries

This repo collates multiple datasets into a single dataset used by covid.graphics. These specific datasets are:

Usage

Please use these URLs to reference files here, since it's CDN fronted:

<script src="https://theojulienne.github.io/covid-19-data/dataset.js"></script>
<script src="https://theojulienne.github.io/covid-19-data/populations.js"></script>
<script src="https://theojulienne.github.io/covid-19-data/countries.js"></script>

The country data is also available on a single country basis:

<script src="https://theojulienne.github.io/covid-19-data/by_country/AUS.js"></script>

The data is available raw for downloading/polling (not too often!) from this CDN fronted URLs:

https://theojulienne.github.io/covid-19-data/dataset.json
https://theojulienne.github.io/covid-19-data/populations.json
https://theojulienne.github.io/covid-19-data/countries.json

Using the JS option, the full dataset will be available in the covid19_dataset variable. Either way, the JSON or variable looks like the following:

{
  "timeseries_dates": ["2020-01-22", "2020-01-23", ..., today's date],
  "total": {
    "confirmed": [1, 2, 3, 4, ...],
    "deaths": [1, 2, 3, 4, ...],
    "recovered": [1, 2, 3, 4, ...],
  },
  "subseries": {
    "AUS": {
      "population": 24127159, # approximate, and only for some countries right now
      "total": {
        "confirmed": [1, 2, 3, 4, ...],
        "deaths": [1, 2, 3, 4, ...],
        "recovered": [1, 2, 3, 4, ...],
      },
      "subseries": {
        "New South Wales": {
          "total": {
            "confirmed": [1, 2, 3, 4, ...],
            "deaths": [1, 2, 3, 4, ...],
            "recovered": [1, 2, 3, 4, ...],
          },
        },
        ... more states ...
      },
    },
    ... more countries ...
  },
}

The populations.js(on) files contain the populations of countries by code. The variable in the .js version is covid19_dataset_populations and it maps a country code to a population.

The countries.js(on) files contain the names of countries by code, all codes are ISO 3166-1 alpha-3 where available. The variable in the .js version is covid19_dataset_country_names and it maps a country code to a country name.

For any of the covid19 timeseries .js files including by_country/<COUNTRY_CODE>.js files, if a function called covid19_dataset_callback exists, it will be called as follows to facilitate dynamic loading:

if (covid19_dataset_callback) covid19_dataset_callback('covid19_dataset_country_aus', covid19_dataset_country_aus, {"country_iso": "AUS"});

You can get a simple set of X/Y data for graphing software, with an X axis of covid19_dataset['timeseries_dates'], and Y axis of:

  • The world: covid19_dataset['totals']['confirmed']
  • A country: covid19_dataset['subseries'][COUNTRY_CODE]['totals']['confirmed']
  • A state/province: covid19_dataset['subseries'][COUNTRY_CODE]['subseries'][STATE_NAME]['totals']['confirmed']

covid-19-data's People

Contributors

theojulienne avatar actions-user avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.