Public
Edited
Jan 21
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
processedData = rawData
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
activeEMSRegion
Insert cell
activePlanRegion
Insert cell
Insert cell
Insert cell
Insert cell
//UPDATE A NEW TIER STATUS HERE, AS SUCH:
// 1: "phase_4_tier_X"
RegionStatus = ({
1: "phase_4",
2: "phase_4",
3: "phase_4",
4: "phase_4_tier_2",
5: "phase_4",
6: "phase_4",
7: "phase_4",
8: "phase_4",
9: "phase_4",
10: "phase_4",
11: "phase_4"
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
activityRow = (row, lang) => {
let statusColor;
let statusLabel;
let mitigationIcon;
let alertIcon = "warning";

//activity label remains the same for all
const activityLabel = getTranslatedLabel(row, lang, "activity");

//get region modifier
const modifiedRowData = row.regionTierModifier.filter(
d => +d.region === activeEMSRegion.id
);

if (modifiedRowData.length > 1) {
statusColor = "magenta";
statusLabel = "something is wrong, do not publish";
} else if (modifiedRowData.length > 0) {
//do the appropriate thing
statusColor = modifiedRowData[0].statusColor;
statusLabel = getTranslatedLabel(modifiedRowData, lang, "status");
mitigationIcon =
modifiedRowData[0].modifierType === "Local guideline"
? "star"
: "warning";
} else {
statusColor = row.statusColor;
statusLabel = getTranslatedLabel(row, lang, "status");
}

return html`<tr>
<td class="icon"><i class="material-icons">${row.activityIcon}</i></td>
<th class="activity">${activityLabel}</th>
<td class="status status-${statusColor}">
${
modifiedRowData.length > 0
? html`<i class="material-icons mitigation">${mitigationIcon}</i>`
: html``
}
${statusLabel}</td>
</tr>`;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
activeGeoQuery
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
//UPDATE ME
rawData = {
if (dataSource === "File") {
return await FileAttachment(
"covid-19-in-illinois-the-restore-illinois-plan(18).json"
).json();
} else if (dataSource === "Airtable") {
return await baseql({ query: baseQLQuery });
}
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more