This commit is contained in:
2026-07-06 16:38:24 +07:00
parent 5d2c055912
commit 8182a8d4d5
5 changed files with 52 additions and 73 deletions

View File

@@ -197,10 +197,7 @@ function loadTrend(periodType, startYear, startWeek, endYear, endWeek) {
grid: {
display: false
},
title: {
display: true,
text: 'Surveillance'
},
}
}
}
@@ -215,15 +212,16 @@ function loadInfluenzaSubtypeDistribution(periodType, startYear, startWeek, endY
.then(res => res.json())
.then(data => {
const displayData = data.map(item => ({
...item,
subtype: item.subtype === "B/VIC" ? "B/Vic" : item.subtype
}));
data.forEach(row => {
if (row.subtype === 'B/VIC') {
row.subtype = 'B/Vic';
}
});
Charts.buildDistributionChart(
'influenzaSubtypeDistribution',
'bar',
displayData,
data,
'subtype',
'total',
label => Charts.SUBTYPE_COLORS[label] || '#9ca3af'
@@ -260,8 +258,6 @@ function loadCovidLineageFrequency(periodType, startYear, startWeek, endYear, en
const lineages = [...new Set(data.map(item => item.lineage))];
const datasets = lineages.map((lineage, index) => {
const lineageData = periods.map(period => {
@@ -886,11 +882,6 @@ function getRadius(total) {
return Math.max(4, Math.min(r * 2, 22));
}
function getPositivityColor(subtype) {
return Charts.SUBTYPE_COLORS[subtype] || "#9ca3af";
}
const getColorByPathogen = name =>
Charts.SUBTYPE_COLORS[name] || '#9ca3af';
function addPositivityLegend() {
@@ -1202,9 +1193,7 @@ function loadProvinceMap(
[lat, lng],
{
radius: getRadius(row.total),
fillColor: getColorByPathogen(
row.pathogen_name === 'B/VIC' ? 'B/Vic' : row.pathogen_name
),
fillColor: Charts.SUBTYPE_COLORS[row.pathogen_name === 'B/VIC' ? 'B/Vic' : row.pathogen_name] || '#9ca3af',
fillOpacity: 0.85,
stroke: false
}