Coder Social home page Coder Social logo

coronavirus's People

Contributors

kennygrant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

coronavirus's Issues

3 day averages should exclude most recent day

It looks like the 3 day averages is skewed by including the most recent day, which is often missing data. I really like this visualization otherwise, mainly because it feels so light and fast. Thank you for making it.

Invalid values for "alltimeDeaths", with repitition

the latest feed:

{
    "version"   : 1.0,
    "country"   : "",
    "province"  : "",
    "alltimeDeaths": 24.1k,
    "alltimeDeaths": 534.2k,
    "dates"     : ["Feb 1", "Feb 2", "Feb 3", "Feb 4", "Feb 5", "Feb 6", "Feb 7", "Feb 8", "Feb 9", "Feb 10", "Feb 11", "Feb 12", "Feb 13", "Feb 14", "Feb 15", "Feb 16", "Feb 17", "Feb 18", "Feb 19", "Feb 20", "Feb 21", "Feb 22", "Feb 23", "Feb 24", "Feb 25", "Feb 26", "Feb 27", "Feb 28", "Feb 29", "Mar 1", "Mar 2", "Mar 3", "Mar 4", "Mar 5", "Mar 6", "Mar 7", "Mar 8", "Mar 9", "Mar 10", "Mar 11", "Mar 12", "Mar 13", "Mar 14", "Mar 15", "Mar 16", "Mar 17", "Mar 18", "Mar 19", "Mar 20", "Mar 21", "Mar 22", "Mar 23", "Mar 24", "Mar 25", "Mar 26", "Mar 27"],
    "deaths"    : [259, 362, 426, 492, 564, 634, 719, 806, 906, 1013, 1113, 1118, 1371, 1523, 1666, 1770, 1868, 2007, 2122, 2247, 2251, 2458, 2469, 2629, 2708, 2770, 2814, 2872, 2941, 2996, 3085, 3160, 3254, 3348, 3460, 3558, 3802, 3988, 4262, 4615, 4720, 5404, 5819, 6440, 7126, 7905, 8733, 9867, 11299, 12973, 14651, 16505, 18625, 21181, 23970, 24087],
    "confirmed" : [12038, 16787, 19881, 23892, 27635, 30794, 34391, 37120, 40150, 42762, 44802, 45221, 60368, 66885, 69030, 71224, 73258, 75136, 75639, 76197, 76819, 78572, 78958, 79561, 80406, 81388, 82746, 84112, 86011, 88369, 90306, 92840, 95120, 97886, 101801, 105847, 109821, 113590, 118620, 125875, 128352, 145205, 156101, 167454, 181574, 197102, 214821, 242500, 272035, 304396, 336953, 378235, 418045, 467653, 529591, 534161]
}

is not valid, (for example the jq tool shows the error

curl --silent https://coronavirus.projectpage.app/.json?period=0 | jq .
parse error: Invalid numeric literal at line 5, column 27

either use:

"alltimeDeaths": "24.1k",

or

"alltimeDeaths": 24100,

also, the key alltimeDeaths is repeated with two different values.

Broken JSON feed

$ curl --silent https://coronavirus.projectpage.app/.json?period=0
{
"version" : 1.0,
"country" : "",
"province" : "",
"dates" : ["Jan 22", "Jan 23", "Jan 24", "Jan 25", "Jan 26", "Jan 27", "Jan 28", "Jan 29", "Jan 30", "Jan 31", "Feb 1", "Feb 2", "Feb 3", "Feb 4", "Feb 5", "Feb 6", "Feb 7", "Feb 8", "Feb 9", "Feb 10", "Feb 11", "Feb 12", "Feb 13", "Feb 14", "Feb 15", "Feb 16", "Feb 17", "Feb 18", "Feb 19", "Feb 20", "Feb 21", "Feb 22", "Feb 23", "Feb 24", "Feb 25", "Feb 26", "Feb 27", "Feb 28", "Feb 29", "Mar 1", "Mar 2", "Mar 3", "Mar 4", "Mar 5", "Mar 6", "Mar 7", "Mar 8", "Mar 9", "Mar 10", "Mar 11", "Mar 12", "Mar 13", "Mar 14", "Mar 15", "Mar 16", "Mar 17", "Mar 18", "Mar 19", "Mar 20", "Mar 21", "Mar 22", "Mar 23", "Mar 24"],
"deaths" : [17, 18, 26, 42, 56, 82, 131, 133, 171, 213, 259, 362, 426, 492, 564, 634, 719, 806, 906, 1013, 1113, 1118, 1371, 1523, 1666, 1770, 1868, 2007, 2122, 2247, 2251, 2458, 2469, 2629, 2708, 2770, 2814, 2872, 2941, 2996, 3085, 3160, 3254, 3348, 3460, 3558, 3802, 3988, 4262, 4615, 4720, 5404, 5819, 6440, 7126, 7905, 8733, 9867, 11299, 12973, 14651, 16505, 17149],
"confirmed" : [555, 654, 941, 1434, 2118, 2927, 5578, 6166, 8234, 9927, 12038, 16787, 19881, 23892, 27635, 30794, 34391, 37120, 40150, 42762, 44802, 45221, 60368, 66885, 69030, 71224, 73258, 75136, 75639, 76197, 76819, 78572, 78958, 79561, 80406, 81388, 82746, 84112, 86011, 88369, 90306, 92840, 95120, 97882, 101794, 105831, 109805, 113571, 118602, 125875, 128353, 145209, 156104, 167454, 181573, 197150, 214909, 242706, 272164, 304519, 337089, 378547, 392124],
"recovered" : template: index.json.got:8:29: executing "index.json.got" at <.series.Recovered>: can't evaluate field Recovered in type interface {}

Can you add an option to show a projection based on current trends?

I think that this would be even more effective at convincing people what’s happening if you show even a projection based on the current rate of progression and the average delay of testing to results lag because the data is at least 6 days out of sync apparently. Or at least mention the estimated delay and that the data may be significantly different.

Consider a csv feed

currently I'm using this program (j2csv.go)

package main

import (
	"encoding/json"
	"fmt"
	"os"
)

// C19 is the json data returned by https://coronavirus.projectpage.app/.json?period=0
type C19 struct {
	Dates     []string `json:"dates"`
	Deaths    []int    `json:"deaths"`
	Confirmed []int    `json:"confirmed"`
	//Recovered []int    `json:"recovered"`
}

func main() {
	var data C19
	if err := json.NewDecoder(os.Stdin).Decode(&data); err != nil {
		fmt.Fprintf(os.Stderr, "%v\n", err)
	}
	fmt.Println("date,deaths,confirmed")
	for i := 0; i < len(data.Dates); i++ {
		fmt.Printf("\"%s\",%d,%d\n", data.Dates[i], data.Deaths[i], data.Confirmed[i])
	}
}

to convert your JSON feed to csv. My processing pipeline is:

curl --silent https://coronavirus.projectpage.app/.json?period=0 | ./j2csv > c19.csv && decksh c19.dsh|pdf

to produce

Screenshot from 2020-03-27 04-29-21

Perhaps you can add a URL that delivers the CSV files

Number of recovered

Would be great if the API served the number of recovered patients as well.

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.