MM module for current COVID-19 virus status. (Will be deprecated, use alternative)
- When I created this module, there was no COVID-19 related modules, so I made it by myself. This module consumes data from the FIRST original root source from Johns Hopkins University Center for Systems Science and Engineering (JHU CCSE) But JHU CCSE changes its data format too often and without notice, so this module is not stable. (I'm very disappointed about JHU CCSS data management)
And at this moment, there are at least two working COVID-19 related modules in MagicMirror. So I'll quit supporting this module. Use alternatives.
Sorry, and thank you for things.
This data is derived from Johns Hopkins University Center for Systems Science and Engineering (JHU CCSE)
At this moment(Mar. 22.) US and France don't provide recovered data any more. I'm not sure it will be fixed or not.
- Fixed: Minor fix for safe initialization for regions which has no data.
- Added: thousands separator for numbers
cd ~/MagicMirror/modules
git clone https://github.com/eouia/MMM-COVID-19
cd MMM-COVID-19
npm install
{
module: "MMM-COVID-19",
header: "COVID-19",
position: "top_left",
config:{}
}
These values are set as default, you don't need to copy all of these. Just pick what you need only and add it into your
config:{}
config: {
debug:false,
scanInterval: 1000 * 60 * 60 * 3,
rotateInterval: 1000 * 5, // 0 means no rotate
pinned: ["World", "China Total"],
myPosition: null,
//myPosition: {latitude:50.0836, longitude:8.4694, metric:"km",}, //or null. // reserved for later.
reportTimeFormat: "YYYY.MM.DD hh a",
drawGraph: true,
logTerritory: true,
thousandsSeparator: "",
}
debug
:true
orfalse
. To log details.scanInterval
: ms. Original data is updated once per day. So too frequent scanning is not needed.rotateInterval
: ms. Interval for rotating region infected.pinned
: Array of pinned regions. If notnull
, your next slots will showpinned regions
. See territory name section.myPosition
:Object
({...}
) ornull
. You can setmyPosition
to get the distance to the region.
myPosition: {
latitude: 50.0836,
longitude: 8.4694,
metric: "km", // or `mile`
},
reportTimeFormat
: By exampleYYYY.MM.DD h a
will show "2020.03.04 9 am"drawGraph
:true
for draw graph.false
for not. If you feel some CPU burden, set this tofalse
.logTerritory
:true
for log territory name. Sometimes Original data source format is changed. So, will log in every scan time.thousandsSeparator
: By default, none. If you set,
,123456
will be displayed like123,456
- You can get name from log with
logTerritory:true
option. - Normal countries like
Vietnam
: Just use"Vietnam"
. But some country name is changed. (e.g:"South Korea"
=>"Korea, South"
) - Some countries can have provinces. And the rule is very.... WEIRD.
For example,
"United Kingdom"
has 3 provinces(or colonies) reported at this moment.(2020.03.16)
'Channel Islands, United Kingdom'
: If you want to getChannel Islands
data, use this.'Gibraltar, United Kingdom'
'United Kingdom'
: This is for MAINLAND ofUnited Kingdom
, not total of UK territories.'United Kingdom Total'
: So, If you want to display total UK, use the name'United Kingdom Total'
'Guernsey'
: ButGuernsey
is not categorized as UK at this moment. Is it an independent state? I don't know. Maybe someday this will be included to UK data. At that time,United Kingdom Total
will accumulateGuernsey
data also.
France
andDenmark
are the same cases.'France'
means Mainland of France.'France Total'
is sum of all France territories.- But,
US
,Canada
,China
,Australia
,Cruise Ship
has noMAINLAND
. To show summary, use'US Total'
or'Canada Total'
, ... Hong Kong
andMacau
are included intoChina
. So use"Hong Kong, China"
.Cruise Ship
is new born country!!! Use'Cruise Ship Total'
or'Diamond Princess, Cruise Ship'
- To get total of world, use
'World'
.
pinned: [
"World",
"Germany",
"US Total",
"District of Columbia, US"
],
I've refactored to reduce CPU and memory usage. But if you still feel some issues,
- Not too often scan. Set
scanInterval
long enough. Original data would be updated once per day. So I think 6 hours or 12 hours are enough. - Not too often rotate. Set
rotateInterval
long enough. I think 5 sec is enough, but if you want, set it long. - Disable rotate animation. In your
css/custom.css
add this.
.covid .item.rotate {
animation-name: none;
}
- Disable
drawGraph
. Set itfalse
I think this would be overspec. So I removed.
detailProvice
logProvinceCountry
logOnce
sortOrder
- Whole refactored. (Orignial source format is changed.)
- Changed: the territory name rule is changed. (See configuration section)
- Changed: reduction of CPU usage (I hope. See note section also)
- added:
drawGraph
option to show graph or not. - added:
logTerritory
option to log territory names.
- Whole new build. (
npm install
is needed to update) - Removed: depedency of external API. Data is derived from original source directly.
- Removed: some overspec config options.
- Added: past 7-days bar graph.
- Added: new confirmed, new deaths, new recovered of 1 day before (... of update date)
- Added : info section, last reported time, distance from me.
- Changed : multi pinned. pin key format changed.
- Chagned : more controllable by CSS.