GithubHelp home page GithubHelp logo

lavolp3 / mmm-covid-19 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eouia/mmm-covid-19

0.0 1.0 0.0 885 KB

MM module for current COVID-19 virus status.

License: MIT License

CSS 13.04% JavaScript 86.96%

mmm-covid-19's Introduction

MMM-COVID-19

MM module for current COVID-19 virus status.

Credits

This data is derived from Johns Hopkins University Center for Systems Science and Engineering (JHU CCSE) via API by Laeyoung / COVID-19-API

Original data is located here

Screenshot

Install

cd ~/MagicMirror/modules
git clone https://github.com/eouia/MMM-COVID-19

Config

Simple

{
  module: "MMM-COVID-19",
  header: "COVID-19",
  position: "top_left",
  config:{}
}

Detailed & Default

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: {
  scanInterval: 1000 * 60 * 60 * 12,
  rotateInterval: 1000 * 5,
  detailProvince: false,
  pinned: ["Others", "Diamond Princess cruise ship"],
  logProvinceCountry: false,
  logOnce: true,
  sortOrder: null,
}
  • scanInterval : ms. Original data is updated once per day. So too frequent scanning is not needed.
  • rotateInterval : ms. Interval for rotating region infected.
  • detailProvice : If true, the data from provinces of country (US, China, Canada) will be shown. If false, sum of country will be shown.
  • pinned : If not null, your second slot will show pinned region. The structure is [COUNTRY_NAME, PROVINCE_NAME]. When PROVINCE_NAME is omitted or invalid, data(if exists, sum of provinces) of COUNTRY_NAME will be shown. (e.g: null, ["US"], ["US", "Seattle, WA"])

To get COUNTRY_NAME and PROVINCE_NAME, set logProvinceCountry:true then find it from your backend log, or find it directly from https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_daily_reports

  • logProvinceCountry : If true, COUNTRY_NAME and PROVINCE_NAME will be listed in your backend log.
  • logOnce : If true, Just log once on start.
  • sortOrder : Don't mind. but if you want to change the order, assign callback function for sort. Default is ;
(a, b)=> {
  if (b.countryregion !== a.countryregion) return (a.countryregion < b.countryregion) ? -1 : 1
  if (b.provincestate !== a.provincestate) return (a.provincestate < b.provincestate) ? -1 : 1
  if (b.confirmed !== a.confirmed) return b.confirmed - a.confirmed
  if (b.deaths !== a.deaths) return b.deaths - a.deaths
  return b.recover - a.recover
}

Don't Panic! This is not Z-Virus...

mmm-covid-19's People

Contributors

eouia avatar

Watchers

 avatar

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.