Giter Site home page Giter Site logo

bruceallday / coronavirus-covid-19--tracker Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 29.01 MB

COVID-19 data by country with interactive heat and choropleth map. React, Mapbox, various API's

Home Page: https://www.trackcoronavirus.info/

JavaScript 98.56% HTML 1.44%

coronavirus-covid-19--tracker's Introduction

❗ Track Coronavirus(COVID-19) v1.5.0

Run locally

Clone project
Navigate into the project
run yarn in the project directory to install all dependancies
yarn start to spin up a local server
View at localhost:1234/

Stack

Endpoints:

Media Query Breakpoints

Device Width Height
Mobile 414 896
Tablet 768 1024
Desktop 1400 800

API Tutorial:

import React, { useState, useEffect } from 'react'

import { useStyles } from './totals.styles'

const Totals = () => {
    const classes = useStyles()
    const [data, setData] = useState([])
    const [isLoading, setLoading] = useState(false)

    useEffect(() => {
        getData()
    }, [])

    const getData = async () => {
        setLoading(true)

        const result = await fetch(`
            https://corona.lmao.ninja/all
        `)

        const data = await result.json()

        if (data.error) {
            console.log("error", data.error)
        } else {
            setData(data)
        }
        setLoading(false)
    }

    return (
        <div className={classes.root}>
            {!isLoading && (
                data.map((item, index) => {
                    <h3>{item.countryByGeo}</h3>
                    <p>{item.cases}</p>
                })
            )}
        </div>
    )
}

export default Totals

Features

πŸ” Dynamic search engine

Making use of the React useState() hook to make an event based search engine.

πŸ—ΊοΈ Data Driven Styling

Using my endpoint data, I create dynamic data driven styling to associated parameters, in my mapbox.com / Geo-Json / NovelCOVID/API) merged data to dynammically create a real-time data visualisation of COVID-19 cases around the world.

   const getData = async () => {
        setLoading(true)
        const result = await fetch(
            `https://bpouncey.github.io/geo-json-world/custom.geo.json`
        )
        const data = await result.json()

        if (data.error) {
            console.log(data.error)

        } else {
            data.features.map(country => {
                covidData.map(countryData => {
                    if (country.properties.iso_a3 === countryData.countryInfo.iso3) {

                        country.properties = {
                            ...countryData,
                            ...country.properties
                        }
                    }
                })
                if (!country.properties.cases) {
                    country.properties.cases = 0
                }
            })
            setState({ data: data })
        }
        setLoading(false)
    }

πŸ“ˆ Totals display

πŸ”₯ Heatmap

View a heatmap visual based on cases per region

❗ About

Due to the panic and fear in society I created this accesible application to provide correct infomation, on every countryByGeo where data has been recorded. Please also know, the data shown is recorded infomation, unrecorded infomation will not be shown.
Track Coronavirus(COVID-19) is an independently developed, free to use web application βœ”οΈ

Environment

  • macOS catalina: 10.15.3
  • VS Code: 1.39.1

Authors

  • Bruce Pouncey - Initial work - BPouncey

License

(MIT)

Acknowledgments

@NovelCOVID

coronavirus-covid-19--tracker's People

Contributors

bruceallday avatar dependabot[bot] avatar

Stargazers

Roman avatar Luke Brown avatar Jiarui Ruan avatar

Watchers

James Cloos avatar  avatar

Forkers

nkhs

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.