FEAT: separate line for incidence; remove trend
This commit is contained in:
parent
9d9ea75b41
commit
824db10e0c
4 changed files with 6 additions and 22 deletions
|
@ -7,6 +7,6 @@
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.covid19 .new7 .good { color: darkgreen; }
|
.covid19 .good { color: darkgreen; }
|
||||||
.covid19 .new7 .warn { color: darkorange; }
|
.covid19 .warn { color: darkorange; }
|
||||||
.covid19 .new7 .bad { color: darkred; }
|
.covid19 .bad { color: darkred; }
|
||||||
|
|
|
@ -22,7 +22,6 @@ Module.register("MMM-covid19", {
|
||||||
total: "N/A",
|
total: "N/A",
|
||||||
death: "N/A",
|
death: "N/A",
|
||||||
cured: "N/A",
|
cured: "N/A",
|
||||||
trend: "N/A",
|
|
||||||
ts: "N/A",
|
ts: "N/A",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -78,19 +77,5 @@ Module.register("MMM-covid19", {
|
||||||
this.cases.death = data[this.config.region]["tot"];
|
this.cases.death = data[this.config.region]["tot"];
|
||||||
this.cases.cured = data[this.config.region]["gesund"];
|
this.cases.cured = data[this.config.region]["gesund"];
|
||||||
this.cases.ts = data[this.config.region]["date"];
|
this.cases.ts = data[this.config.region]["date"];
|
||||||
|
|
||||||
// determine trend:
|
|
||||||
// calc this and last weeks cases and substract
|
|
||||||
// result is the difference of new cases between this and last week
|
|
||||||
currentToLastWeekDiff = (data[this.config.region]["last_7"] * 2) - data[this.config.region]["last_14"]
|
|
||||||
if (currentToLastWeekDiff > 10) {
|
|
||||||
this.cases.trend = "bad";
|
|
||||||
} else if (currentToLastWeekDiff > 0) {
|
|
||||||
this.cases.trend = "warn";
|
|
||||||
} else if (currentToLastWeekDiff == 0) {
|
|
||||||
this.cases.trend = "even";
|
|
||||||
} else if (currentToLastWeekDiff < 0) {
|
|
||||||
this.cases.trend = "good";
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -23,11 +23,10 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="small covid19">
|
<div class="small covid19">
|
||||||
<span class="bright new7">
|
<span class="bright incidence">
|
||||||
Neu: {{ cases.new7 }}
|
Inzidenz: <span class={{new7_class}}>{{ cases.new7_100k }}</span>
|
||||||
(<span class={{new7_class}}>{{ cases.new7_100k }}</span>)
|
|
||||||
<span class={{trend_class}}>{{ trend | safe }}</span>
|
|
||||||
</span><br/>
|
</span><br/>
|
||||||
|
<span class="bright new7"> Neu: {{ cases.new7 }} </span><br/>
|
||||||
<span class="bright active">Aktiv: {{ cases.active }}</span><br/>
|
<span class="bright active">Aktiv: {{ cases.active }}</span><br/>
|
||||||
<span class="total">Gesamt: {{ cases.total }}</span><br/>
|
<span class="total">Gesamt: {{ cases.total }}</span><br/>
|
||||||
<span class="death">Tote: {{ cases.death }}</span><br/>
|
<span class="death">Tote: {{ cases.death }}</span><br/>
|
||||||
|
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
Loading…
Reference in a new issue