change legend color on pathogen map view and sort filter year by descending

This commit is contained in:
pcalengratha
2026-04-20 09:11:42 +07:00
parent 4534f502e2
commit d97de4516b
2 changed files with 7 additions and 6 deletions

View File

@@ -75,7 +75,8 @@ class DashboardFilter {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
for (let y = year-10; y <= year; y++) { //for (let y = year-10; y <= year; y++) {
for (let y = year; y >= year-10; y--) {
this.startYear.innerHTML += `<option value="${y}">${y}</option>`; this.startYear.innerHTML += `<option value="${y}">${y}</option>`;
this.endYear.innerHTML += `<option value="${y}">${y}</option>`; this.endYear.innerHTML += `<option value="${y}">${y}</option>`;

View File

@@ -931,13 +931,13 @@ function addPositivityLegend() {
<div style="background:white;padding:10px 12px;border-radius:6px; <div style="background:white;padding:10px 12px;border-radius:6px;
box-shadow:0 2px 6px rgba(0,0,0,0.2);font-size:12px;"> box-shadow:0 2px 6px rgba(0,0,0,0.2);font-size:12px;">
<div style="font-weight:600;margin-bottom:6px;">Influenza Subtypes</div> <div style="font-weight:600;margin-bottom:6px;">Influenza Subtypes</div>
<div><span style="background: #2563eb; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>A/H1N1pdm</div> <div><span style="background: #ff0200; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>A/H1N1pdm</div>
<div><span style="background: #11de9d; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>A/H3N2</div> <div><span style="background: #11de9d; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>A/H3N2</div>
<div><span style="background: #b91081; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>A/H9N2</div> <div><span style="background: #b91081; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>A/H9N2</div>
<div><span style="background: #ad850d; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>A/H5N1</div> <div><span style="background: #ad850d; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>A/H5N1</div>
<div><span style="background: #047393; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>A/Unsubtypable</div> <div><span style="background: #047393; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>A/Unsubtypable</div>
<div><span style="background: #9333ea; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>B/Yam</div> <div><span style="background: #9333ea; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>B/Yam</div>
<div><span style="background: #1021b9; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>B/Vic</div> <div><span style="background: #086037; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>B/Vic</div>
<div><span style="background: #890512; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>B/Unsubtypable</div> <div><span style="background: #890512; border: 2px solid #aa9d9d; width:12px;height:12px;display:inline-block;margin-right:6px; border-radius: 50%;"></span>B/Unsubtypable</div>
</div> </div>
`; `;
@@ -1036,10 +1036,10 @@ function loadProvinceMap(startYear, startWeek, endYear, endWeek) {
function getColorByPathogen(name) { function getColorByPathogen(name) {
const colors = { const colors = {
"A/H1N1pdm": "#2563eb", "A/H1N1pdm": "#ff0200",
"A/H3N2": "#11de9d", "A/H3N2": "#11de9d",
"B/Yam": "#9333ea", "B/Yam": "#9333ea",
"B/Vic" : "#1021b9", "B/Vic" : "#086037",
"A/H9N2": "#b91081", "A/H9N2": "#b91081",
"A/H5N1": "#ad850d", "A/H5N1": "#ad850d",
"A/Unsubtypable": "#047393", "A/Unsubtypable": "#047393",