# Coronavirus local new cases Chart

**URL:** <https://discourse.nodered.org/t/coronavirus-local-new-cases-chart/25258>\
**Category:** Share Your Projects\
**Created:** [21 April 2020 18:39 UTC](https://discourse.nodered.org/t/coronavirus-local-new-cases-chart/25258 "2020-04-21T18:39:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [21 April 2020 18:39 UTC](https://discourse.nodered.org/t/coronavirus-local-new-cases-chart/25258/1 "2020-04-21T18:39:20Z")

</div>

I wanted to track how many new positive tests were recorded daily for people living in my local town, so with some help from @janvda (thanks!), I've created a flow to display the data obtained from [coronavirus.gov.uk](http://coronavirus.gov.uk) limited to upper tier Local Authorities (such as Sheffield, Doncaster, Rotherham etc).  
A full list of those locations can be seen [https://coronavirus.data.gov.uk/#local-authorities](https://coronavirus.data.gov.uk/#local-authorities)

 ![flow](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/2/d2d9b40273d6ce48e57634b48471fbf321d66fdd.jpeg)

The location is changed in the 'Parse data' change node. It is currently set to London, just change it to whichever upper tier Local Authority you want, but ensure that it's spelled/capitalised exactly as per the website list.  
The data is generally updated daily by the Government between 3pm & 4pm, and also previous days data may also be amended.  
It's a bit rough & ready, but feel free to further develop it, if you find it useful.

// Sorry - it only holds UK data.

 ![chart](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/c/bcdbcea9364e02df1122d3c31da4caa686936966.jpeg)

```auto
[{"id":"5a81d56f.1408ac","type":"inject","z":"a4801683.1c0448","name":"Run flow","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":100,"y":1490,"wires":[["6769369c.c727d8"]]},{"id":"6769369c.c727d8","type":"http request","z":"a4801683.1c0448","name":"","method":"GET","ret":"txt","paytoqs":false,"url":"https://coronavirus.data.gov.uk/downloads/csv/coronavirus-cases_latest.csv","tls":"","persist":false,"proxy":"","authType":"","x":250,"y":1490,"wires":[["a0c3e735.8118a8"]]},{"id":"a0c3e735.8118a8","type":"csv","z":"a4801683.1c0448","name":"csv2array","sep":",","hdrin":true,"hdrout":false,"multi":"mult","ret":"\\n","temp":"","skip":"0","strings":true,"x":400,"y":1490,"wires":[["86f34f8b.1002e"]]},{"id":"f26d54ac.167168","type":"ui_chart","z":"a4801683.1c0448","name":"","group":"61d2dced.3db8f4","order":8,"width":"13","height":"8","label":"Daily Positive tests","chartType":"line","legend":"false","xformat":"D/M","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"8","removeOlderPoints":"1000","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#ff0000","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":890,"y":1490,"wires":[[]]},{"id":"7352b95.7fb5b48","type":"function","z":"a4801683.1c0448","name":"Format chart","func":"msg.payload = [{\n \"series\": [\"New cases\"],\n \"data\": [msg.payload],\n \"labels\": [\"\"]\n}];\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":1490,"wires":[["f26d54ac.167168"]]},{"id":"86f34f8b.1002e","type":"change","z":"a4801683.1c0448","name":"Parse data","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[`Area name`='London'].{ \"x\" : $toMillis(`Specimen date`), \"y\" : `Daily lab-confirmed cases` }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":1490,"wires":[["7352b95.7fb5b48"]]},{"id":"61d2dced.3db8f4","type":"ui_group","z":0,"name":"flowtest","tab":"3c94630c.13381c","order":1,"disp":true,"width":22,"collapse":false},{"id":"3c94630c.13381c","type":"ui_tab","z":0,"name":"Test","icon":"dashboard","order":9}]

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [21 April 2020 23:11 UTC](https://discourse.nodered.org/t/coronavirus-local-new-cases-chart/25258/2 "2020-04-21T23:11:41Z")

</div>

Just note the usual caveats relating to the source data. e.g. the lack of testing and some deliberate choices as to when testing is not done.

Also, Sheffield for example shows a surprisingly high number but that is actually because we have one of the largest hospital testing labs in the country - not because we have a large number of cases - which we don't.

Numbers always come with a story that you need to understand before you can make sense of them.

---

<div class="post-metadata">

**Author:** ![Bobo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobo/32/8401_2.png) [@Bobo](https://discourse.nodered.org/u/Bobo)\
**Post date:** [22 April 2020 02:22 UTC](https://discourse.nodered.org/t/coronavirus-local-new-cases-chart/25258/3 "2020-04-22T02:22:30Z")

</div>

Wasn't it Ronald Reagan who said you can never trust statistics? Oh wait, sorry, he actually said "never trust anyone who says we're from the government and we are here to help". Same thing really. 😝

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [22 April 2020 05:36 UTC](https://discourse.nodered.org/t/coronavirus-local-new-cases-chart/25258/4 "2020-04-22T05:36:05Z")

</div>

I think it was Churchill who said: _"I only believe in statistics that I doctored myself"_ (can't remember the exact wording) 🧐 😆

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [22 April 2020 07:03 UTC](https://discourse.nodered.org/t/coronavirus-local-new-cases-chart/25258/5 "2020-04-22T07:03:40Z")

</div>

See also [https://en.wikipedia.org/wiki/Lies,\_damned\_lies,\_and\_statistics](https://en.wikipedia.org/wiki/Lies,_damned_lies,_and_statistics)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [22 April 2020 08:28 UTC](https://discourse.nodered.org/t/coronavirus-local-new-cases-chart/25258/6 "2020-04-22T08:28:03Z")

</div>

For those following along, this is a very interesting analysis of the UK numbers and that not only shows how high they probably really are but puts them into context with "normal" seasonal deaths.

From the economics editor of the Financial Times

> <https://twitter.com/ChrisGiles_/status/1252841436317315072>

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [22 April 2020 11:15 UTC](https://discourse.nodered.org/t/coronavirus-local-new-cases-chart/25258/7 "2020-04-22T11:15:40Z")

</div>

Well fortunately this flow doesn't process death rates, just the number of positive test results in a defined area, which I would hope would be more accurate.  
But as you say Julian, numbers always come with a story...

I think at some stage, they changed the data format for tests, instead of using the date that the result was determined, they claim that they use the date that the test was made... if I understand it correctly.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [22 April 2020 12:08 UTC](https://discourse.nodered.org/t/coronavirus-local-new-cases-chart/25258/8 "2020-04-22T12:08:45Z")

</div>

> [@Paul-Reed](#):
>
> just the number of positive test results in a defined area, which I would hope would be more accurate

Sadly, this clearly isn't the case with plenty of reports now coming out about how hospitals and 111 are declining to test and sending people home for whatever reason. While this is still a complex issue, I can't help but feel that a review of all of this will result in people loosing jobs if not worse. The whole thing is a debacle that is resulting in unnecessary deaths.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [20 June 2020 18:39 UTC](https://discourse.nodered.org/t/coronavirus-local-new-cases-chart/25258/9 "2020-06-20T18:39:24Z")

</div>

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