various edits

This commit is contained in:
2026-07-21 16:43:22 -06:00
parent 88161a6f16
commit c1e453d962
16 changed files with 526 additions and 31 deletions
+8 -1
View File
@@ -230,9 +230,16 @@ function updateExplorer() {
scorecardLabel(row).toLowerCase().includes(query),
);
visibleScorecards = sortedScorecards(matches, sortMode);
const cohortCount = visibleScorecards.length;
let summary = "0 supported sample cohorts.";
if (cohortCount > 0 && cohortCount <= 12) {
summary = `${cohortCount} supported sample cohort${cohortCount === 1 ? "" : "s"}; all shown.`;
} else if (cohortCount > 12) {
summary = `${cohortCount} supported sample cohorts; showing ${Math.min(cohortCount, 18)} cards and 12 chart rows.`;
}
setText(
"result-summary",
`${visibleScorecards.length} supported sample cohort${visibleScorecards.length === 1 ? "" : "s"}; showing up to 18 cards and 12 chart rows.`,
summary,
);
byId("empty-results").hidden = visibleScorecards.length > 0;
renderCohortDotPlot(byId("cohort-dot-plot"), visibleScorecards);
+26 -13
View File
@@ -205,37 +205,50 @@ export function renderCohortDotPlot(container, rows) {
);
}
// Simplified from the Census 2025 1:20m cartographic boundary for Utah
// (GEOID 49). Utah's defining step is on the northeast edge, not both sides.
const UTAH_OUTLINE_PATH = "M44 20H153V67H226V255H44Z";
// Census county centers projected into the same Utah map frame.
const COUNTY_POINTS = {
cache: [154, 40],
weber: [137, 86],
davis: [126, 108],
salt_lake: [133, 133],
"salt lake": [133, 133],
utah: [140, 170],
cache: [128, 33],
weber: [123, 54],
davis: [111, 65],
"salt lake": [121, 83],
utah: [131, 108],
};
function normalizeCountyName(county) {
return String(county).trim().toLowerCase().replaceAll("_", " ").replace(/\s+/g, " ");
}
function displayCountyName(county) {
return county.replace(/\b\w/g, (letter) => letter.toUpperCase());
}
export function renderUtahCoverage(container, coveredCounties) {
const normalized = new Set(coveredCounties.map((county) => county.toLowerCase()));
const normalized = new Set(coveredCounties.map(normalizeCountyName));
const points = [...normalized]
.map((county) => ({ county, coordinates: COUNTY_POINTS[county] }))
.filter((item) => item.coordinates);
const countyNames = [...normalized].map(displayCountyName);
container.innerHTML = `
<svg viewBox="0 0 270 300" aria-hidden="true" focusable="false">
<path d="M79 18h101v54l18 18v183H52V116l27-27V18Z" fill="var(--gray-100)" stroke="var(--gray-300)" stroke-width="3"></path>
<path d="M80 20h98v53l17 18v179H55V117l25-27V20Z" fill="none" stroke="var(--sand-200)" stroke-width="1.5" stroke-dasharray="4 5"></path>
<path data-map-feature="utah-outline" d="${UTAH_OUTLINE_PATH}" fill="var(--gray-100)" stroke="var(--gray-300)" stroke-width="3" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path>
${points
.map(
({ county, coordinates }) => `
<circle cx="${coordinates[0]}" cy="${coordinates[1]}" r="8" fill="var(--teal-700)" stroke="var(--paper)" stroke-width="3"><title>${escapeText(county.replace("_", " "))} feed available</title></circle>`,
<circle cx="${coordinates[0]}" cy="${coordinates[1]}" r="8" fill="var(--teal-700)" stroke="var(--paper)" stroke-width="3" vector-effect="non-scaling-stroke"><title>${escapeText(displayCountyName(county))} County feed available</title></circle>`,
)
.join("")}
<text x="135" y="205" text-anchor="middle" class="state-label">UTAH</text>
<text x="135" y="288" text-anchor="middle" class="axis-label">Participating feeds highlighted</text>
</svg>`;
container.setAttribute(
"aria-label",
coveredCounties.length
? `Development-sample feed availability includes ${coveredCounties.join(", ")}. This is not an outcome ranking; other counties are unavailable.`
: "No county feed coverage is available.",
countyNames.length
? `Outline of Utah showing development-sample feed availability for ${countyNames.join(", ")} County feeds. This is not an outcome ranking; other counties are unavailable.`
: "Outline of Utah. No county feed coverage is available.",
);
}