@@ -1,6 +1,6 @@
11 // Filters, sorts and searches the /projects list, and keeps the view in the URL.
22 // Tags from different pairs must all match; tags of the same pair match either.
3-// The date range keeps a project with any commit in a month between its two thumbs.
3+// The date range keeps a project with any commit in a month between its two thumbs, over a bar per month of active projects.
44 const form = document.getElementById("filters"), list = document.getElementById("rows");
55 const search = document.querySelector("input[name=q]"), rows = [...list.children];
66 const sorts = {
@@ -11,6 +11,9 @@ const sorts = {
1111 const ym = (y, m) => `${y}-${String(m).padStart(2, "0")}`, months = [];
1212 const lo = rows.map(r => r.dataset.first).sort()[0], hi = rows.map(r => r.dataset.last).sort().at(-1).slice(0, 7);
1313 for (let y = +lo.slice(0, 4), m = +lo.slice(5, 7); ym(y, m) <= hi; m === 12 ? (y++, m = 1) : m++) months.push(ym(y, m));
14+const active = months.map(m => rows.filter(r => r.dataset.months.includes(m)).length), peak = Math.max(...active);
15+const bars = months.map((m, i) => Object.assign(document.createElement("i"), { title: `${m}: ${active[i]} active`, style: `height:${active[i] / peak * 100}%` }));
16+document.getElementById("bars").append(...bars);
1417
1518 function apply() {
1619 const pairs = [...form.querySelectorAll("fieldset")].slice(0, -1)
@@ -19,6 +22,7 @@ function apply() {
1922 const a = Math.min(form.from.value, form.to.value), b = Math.max(form.from.value, form.to.value);
2023 const from = months[a], to = months[b];
2124 document.getElementById("span").textContent = `${from} – ${to}`;
25+ bars.forEach((e, i) => e.classList.toggle("on", i >= a && i <= b));
2226 let shown = 0;
2327 for (const r of rows.sort(sorts[sort])) {
2428 const tags = r.dataset.tags.split(" ");