# COVID-19 status by country

**URL:** <https://discourse.nodered.org/t/covid-19-status-by-country/28743>\
**Category:** Share Your Projects\
**Created:** [22 June 2020 18:00 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743 "2020-06-22T18:00:42Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [23 June 2020 23:28 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/21 "2020-06-23T23:28:52Z")

</div>

> [@janvda](#):
>
> Sorry Paul, not fully clear what you mean by one day change in RN. You mean the difference between column 4 and 5 ?

Exactly! Then you could see which way countries are going, getting better of worse and by how much.

One other question, is there a location where I could get the same data for the US states? I'd like to be able to compare the various states and see how they are doing.

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [24 June 2020 06:46 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/22 "2020-06-24T06:46:28Z")

</div>

> [@zenofmud](#):
>
> > [@janvda](#):
> >
> > Sorry Paul, not fully clear what you mean by one day change in RN. You mean the difference between column 4 and 5 ?
> 
> Exactly! Then you could see which way countries are going, getting better of worse and by how much.

The problem with that is that there is "noise" in the data. So just comparing the delta between 2 successive days will mainly show "noise" instead of the real changes of the reproduction number.

E.g. for Belgium we jumped from 0.6 (yesterday) to 0.91 (today).

... but of course it is very easy to add this column:

1. In the change node: `calculate reproduction rates,...` you need to add following extra line after line 10:

```auto
"reproduction_number_delta_today_versus_yesterday" : $new_cases_current - $new_cases_1day_ago,

```

1. in the table node you need to add this new column and play a bit with the column width settings.

2. If you want background coloring then you need to update the `html with background color` node.

> [@zenofmud](#):
>
> One other question, is there a location where I could get the same data for the US states? I'd like to be able to compare the various states and see how they are doing.

Yes, there is: see

- [https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-states.csv](https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-states.csv)

I have used it in my other COVID project:

- [GitHub - janvda/node-red-corona-comparison-hubei: A Node-RED flow allowing to compare historical corona data of any country with Hubei (China)](https://github.com/janvda/node-red-corona-comparison-hubei)

The data set I am currently using also contains province/substate information (not about the US states 😢) which I am currently not showing. I am thinking about adding these records as well.

---

<div class="post-metadata">

**Author:** ![dclear](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dclear/32/9107_2.png) [@dclear](https://discourse.nodered.org/u/dclear)\
**Post date:** [24 June 2020 09:15 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/23 "2020-06-24T09:15:46Z")

</div>

> [@janvda](#):
>
> had to restart my node-red

COOL! That fixed it! 🙂 🙂 🙂 thanks

Now I just have to wrap my head around some of the stats...

## ![dasds2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/6/16cfbd4d4366f4bb42650ac4def59a6fa15bcbd0.png)

 ![dasds](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/7/175f92efb2b61dbe9606989932a6e560f26ad0ce.png)

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [24 June 2020 09:45 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/24 "2020-06-24T09:45:19Z")

</div>

> [@dclear](#):
>
> Now I just have to wrap my head around some of the stats...

1. "Holy See" is Vatican (in Rome) - it has 12 reported cases and counts only 809 people that is why the total cases per million is so big. So that is not an error.

2. The 9999 reproduction number is explained when clicking on the INFO button:

---

<div class="post-metadata">

**Author:** ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)\
**Post date:** [25 June 2020 04:44 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/25 "2020-06-25T04:44:57Z")

</div>

Sorry, was away.

I can confirm that I had the same initial problem on a new install of Node Red. Installed the ui-table node and dashboard and had the table missing. Restarted Node Red, still the same. Rebooted to get it all to display (table missing).

I thought it may have been me!

@janvda Thank you. I am also learning a lot about JSONata from this flow!

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [25 June 2020 08:41 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/26 "2020-06-25T08:41:34Z")

</div>

> [@mudwalker](#):
>
> I can confirm that I had the same initial problem on a new install of Node Red. Installed the ui-table node and dashboard and had the table missing. Restarted Node Red, still the same. Rebooted to get it all to display (table missing).

I am sorry to hear you still have the problem.

1. Maybe you can try Paul Reed's solution specified here below:

> [@Paul-Reed](#):
>
> Upon importing the flow the table group was set correctly - `[COVID19 - country overview] table` , but reselected (the same group) again, deploy, and thereafter the flow worked OK.  
> Nice work @janvda

1. If that doesn't work you can also try to remove the flow and reimport it again.

Also check what is logged in the node-red log file.

---

<div class="post-metadata">

**Author:** ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)\
**Post date:** [25 June 2020 09:03 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/27 "2020-06-25T09:03:23Z")

</div>

Thank you.

Sorry, should have made myself clearer. All running now.

From your original Flow, the Dashboard output didn't take at all, defined the Tabs etc, as they were blank in the output node, defined the outputs and 'refresh' box appeared but no table. Your second Flow followed shortly afterwards, it again just showed the 'refresh' box, but no table. From there I decided a Reboot might be required - that made it work.

---

<div class="post-metadata">

**Author:** ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)\
**Post date:** [25 June 2020 13:29 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/28 "2020-06-25T13:29:59Z")

</div>

An FYI,

Just seen a news headline, 'WHO worried about resurgence in Europe', but didn't name countries. Using the flow putting Austria as the selected country, all becomes apparent!!

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [25 June 2020 22:52 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/29 "2020-06-25T22:52:07Z")

</div>

> [@zenofmud](#):
>
> One other question, is there a location where I could get the same data for the US states? I'd like to be able to compare the various states and see how they are doing.

**New FEATURE : Statistics for the US States are added**

To see them you have to click on the new button `RETRIEVE US STATES`.  
Note that it takes a bit of time to display the statistics (about 12 sec on my intel-NUC - most likely on a raspberry pi it will take a bit longer).

The flow is too big to embed it here.  
Instead you can clone it from my github repository : [GitHub - janvda/node-red-covid-status-by-country](https://github.com/janvda/node-red-covid-status-by-country) or copy paste it from following link:

- [node-red-covid-status-by-country/flow.json at master · janvda/node-red-covid-status-by-country · GitHub](https://github.com/janvda/node-red-covid-status-by-country/blob/master/flow.json)

Here an example output of the US states for today sorted according 3rd column :

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/3/0393c28a9ac79202b63d2ee878bf40f5286b4f98.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [26 June 2020 00:06 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/30 "2020-06-26T00:06:52Z")

</div>

@janvda Jan, thank you this makes it much easite to see what is going on over here. It's nice to see my state (Massachusetts has one of the lowest RN numbers today, hopefully it will keep going lower)

You deserve a pat on the back (at the least).

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [26 June 2020 16:47 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/31 "2020-06-26T16:47:54Z")

</div>

Ok, here is my weird issue for the week. Running NR on a Mac and using Safari to look at the dashboard. When I first display the dashboard it looks like this:

 ![Screen Shot 2020-06-26 at 12.40.03 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/5/85ce5b4dc879abf56aa09b1e969cadd1f9ca8ff0.png)  
notice the blank area at the bottom? If I scroll, new countries show up, but the blank area s still there.

The moment I resize the window I see this:

 ![Screen Shot 2020-06-26 at 12.40.35 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/9/594a7b1804359a4bf245b3ec5735a9e8f283cbc2.png)  
All the rows that will fit in the defined area show up.

This only happens is Safari, both FireFox and Chrome work fine...like I said, weird issue of the week 😂

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [28 June 2020 08:15 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/32 "2020-06-28T08:15:07Z")

</div>

**NEW EXTENSION : also the state/province data for China, Australia and Canada is available via the "RETRIEVE COUNTRIES" button.**

The flow can be down-loaded via following link:

- [https://github.com/janvda/node-red-covid-status-by-country/blob/master/flow.json](https://github.com/janvda/node-red-covid-status-by-country/blob/master/flow.json)

For Chinese provinces - the population data has also been added so that all columns in the table can be calculated.

See here below:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/2/9225e0e966b488afe09630c272bda55a44b71854.png)

**Observations for the Chinese provinces**

- new cases are reported in several Chinese provinces in the last 2-3 weeks.
- ... despite this the number of cases per day per million is extremely low (if we ignore Hong Kong, then Beijing has reported the highest number = 0.55 cases/day/million)
- ... after new cases are reported, the reproduction rate is going down very rapidly.

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [28 June 2020 08:48 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/33 "2020-06-28T08:48:21Z")

</div>

**ANOTHER FEATURE: "minimum population" dropdown button added.**

If you only want to see data for countries / states having a certain minimal population you can do that by setting the dropdown button and then clicking on the "RETRIEVE COUNTRIES" or "RETRIEVE US STATES" button.

If you select `>=0` then it will show all countries/states/provinces: including those for which the population is not specified.

The flow can be downloaded from:

- [https://github.com/janvda/node-red-covid-status-by-country/blob/master/flow.json](https://github.com/janvda/node-red-covid-status-by-country/blob/master/flow.json)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/3/6326f81ac7bd7e0a7ea50fd5f0ba66cd571f4ce8.png)

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [24 July 2020 09:27 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/34 "2020-07-24T09:27:10Z")

</div>

I have extended this flow so that it now shows the reproduction number for 6 more weeks : from 4 weeks ago up to 9 weeks ago.

- [https://github.com/janvda/node-red-covid-status-by-country](https://github.com/janvda/node-red-covid-status-by-country)

Here below todays **country** statistics sorted on increasing distance from **Belgium**

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/8/88fdf3957b8ea561b2df7200a50beb7606691e7a.png)

Here below todays **US states** statistics sorted on decreasing population

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/9/a9af07e783f682b11835c0a6a569e8fc6109c1b5.png)

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [26 July 2020 08:06 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/35 "2020-07-26T08:06:12Z")

</div>

With the new increase in cases in my country, I have further extended the table with columns showing the reproduction number for

- 2 days ago
- 4 days ago
- 10 weeks ago
- 11 weeks ago
- 12 weeks ago

This feature is NOT available for the US states (you will get blank columns). If you would like these columns for US states, please let me know.

Todays country chart sorted by **increasing distance from Belgium**

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/2/82105e14343fb9f256e7d5cde8676e06e8a5133e.png)

Todays country chart sorted by **decreasing population**

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/e/9e4a2b3c686c16fbcccec8e24f74ca9a2ae6c0a2.png)

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [19 August 2020 15:51 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/36 "2020-08-19T15:51:18Z")

</div>

Further updated the flow.  
It is now showing the weekly reproduction number for the last **25** weeks !

**Example** for countries with population \> 100.000, sorted based on distance from Belgium.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/d/0d16ffca937ec5be870a21f0682f6ed682455ae5.png)

**Column definitions**

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/2/f27b7cbec70d07ead6bd7b7cf18ba7ef82a51b6d.png)

**Observations:**

- the red at the right corresponds to the start of the lock down in european countries.
- the green part in the middle corresponds to the 2nd part of the lock down
- yellow - orange part at the left corresponds to the period the lock down measures are relaxed.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 August 2020 18:00 UTC](https://discourse.nodered.org/t/covid-19-status-by-country/28743/37 "2020-08-21T18:00:48Z")

</div>

Closed on 21 August 2020 18:00 UTC

This topic was automatically closed after 60 days. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/covid-19-status-by-country/28743.md?page=1)
