In this section
- Newspaper V9 6 2 render · globalgrid2050 / testcode/202609051152/pipeline/scripts/plugins/newspaper-v9-6-2.js lines 1–77
- Newspaper V9 7 render · globalgrid2050 / testcode/202609051152/pipeline/scripts/plugins/newspaper-v9-7.js lines 1–102
- Newspaper render · globalgrid2050 / testcode/202609051152/pipeline/scripts/plugins/newspaper.js lines 1–123
- Project Export render · globalgrid2050 / testcode/202609051152/pipeline/scripts/plugins/project-export.js lines 1–33
- Project Filters interaction · globalgrid2050 / testcode/202609051152/pipeline/scripts/plugins/project-filters.js lines 1–41
- Project Table render · globalgrid2050 / testcode/202609051152/pipeline/scripts/plugins/project-table.js lines 1–21
- Projects V9 1 energy-data · globalgrid2050 / testcode/202609051152/pipeline/scripts/plugins/projects-v9-1.js lines 1–134
Newspaper V9 6 2
A JavaScript module in the plugins folder of GlobalGrid2050 that queries matches (`queryMatches`) and draws regional (`drawRegional`) and news v9 (`drawNewsV9_6_2`), covering solar and battery storage (BESS).
renderglobalgrid2050 / testcode/202609051152/pipeline/scripts/plugins/newspaper-v9-6-2.js · lines 1–77 of 77 · version 2026-09-05 11:52 · pattern drawRegional (shared by 7 files)
- What it does
- It draws solar and battery storage (BESS). Defines 6 functions or classes, including queryMatches, regionalRows, drawRegional, drawNewsV9_6_2, loadNewsV9_6_2. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: solar, battery storage (BESS).
- Downstream impact
- Used directly by 1 file: App V9 6 2 (globalgrid2050). Reached from 91 other entry points, including Grid Engine — Compute Against Charging Page (globalgrid2050, https://globalgrid2050.com/grid_engine/202609060324-compute-against-charging/); Grid Engine — Connection Cap Page (globalgrid2050, https://globalgrid2050.com/grid_engine/202609060212-connection-cap/); Grid Engine — Corridor Estimate Page (globalgrid2050, https://globalgrid2050.com/grid_engine/202609060237-corridor-estimate/).
- What it achieves
- It queries matches (`queryMatches`), draws regional (`drawRegional`) and draws news v9 (`drawNewsV9_6_2`). Defines `queryMatches`, `regionalRows`, `drawRegional` and 3 more.
- Why it matters
- Imported by App V9 6 2.
- Application
- globalgrid2050 · testcode/202609051152/pipeline/scripts/plugins · JavaScript module
- Uses
- State (import), Testcode — Pipeline (import), News Regions V9 6 2 (import), Newspaper V9 5 1 (import)
- Used by
- imported by App V9 6 2 (import)
- Produces
- drawNewsV9_6_2, loadNewsV9_6_2, bindNewspaperV9_6_2
- Defines here
- queryMatches, regionalRows, drawRegional, drawNewsV9_6_2, loadNewsV9_6_2, bindNewspaperV9_6_2
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609051152/pipeline/scripts/plugins/newspaper-v9-6-2.js:1-77 · blob b676b5b1eba30ce0fa5e5c6a38b54b635eb50a08 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
import { state } from "../core/state.js";
import { escapeHtml, normaliseProject } from "../core/utils.js";
import { classifyInternationalV9_6_2, regionalCountsV9_6_2 } from "../core/news-regions-v9-6-2.js";
import { bindNewspaperV9_5_1, drawNewsV9_5_1, loadNewsV9_5_1 } from "./newspaper-v9-5-1.js";
const REGIONAL_MODES = new Set(["INTERNATIONAL", "US", "EUROPE"]);
function queryMatches(item) {
if (!state.newsQuery) return true;
const haystack = normaliseProject([
item.headline, item.project, item.operator, item.source, item.event,
].join(" "));
return normaliseProject(state.newsQuery).split(" ").filter(Boolean)
.every((token) => haystack.includes(token));
}
function regionalRows() {
return state.newsItems.flatMap((item) => {
const classification = classifyInternationalV9_6_2(item);
if (!classification || !queryMatches(item)) return [];
if (state.newsMode === "US" && classification.region !== "US") return [];
if (state.newsMode === "EUROPE" && classification.region !== "EUROPE") return [];
return [{ item, classification }];
});
}
function drawRegional() {
const stories = document.getElementById("stories");
const rows = regionalRows();
if (!rows.length) {
stories.innerHTML = '<div class="news-empty">No location-verified international solar or battery headlines match this filter.</div>';
return;
}
stories.innerHTML = rows.map(({ item, classification }) => {
const articleClass = classification.technology.includes("BESS") ? "bess" : "solar";
const region = classification.region === "INTERNATIONAL_OTHER" ? "INTERNATIONAL" : classification.region;
return `<a class="story ${articleClass}" href="${escapeHtml(item.url)}" target="_blank" rel="noopener"><div class="kicker">${escapeHtml(classification.technology)} · ${escapeHtml(item.event || "PROJECT UPDATE")} · ${escapeHtml(item.published || "")}</div><h3>${escapeHtml(item.headline || "International solar and storage update")}</h3><p><span class="project">${escapeHtml(region)}</span>${item. … [line shortened here: 640 characters; full line on GitHub]
}).join("");
}
export function drawNewsV9_6_2() {
if (REGIONAL_MODES.has(state.newsMode)) {
drawRegional();
return;
}
if (state.newsMode === "UK") {
state.newsMode = "RELEVANT";
drawNewsV9_5_1();
state.newsMode = "UK";
return;
}
drawNewsV9_5_1();
}
export async function loadNewsV9_6_2() {
await loadNewsV9_5_1();
const counts = regionalCountsV9_6_2(state.newsItems);
const uk = state.newsItems.filter((item) => item.canonical_relevant === true).length;
document.getElementById("newsMeta").textContent = `${uk} UK · ${counts.international} international (${counts.us} US · ${counts.europe} Europe · ${counts.other} other) · ${state.newsItems.length} headlines · Pages`;
drawNewsV9_6_2();
}
export function bindNewspaperV9_6_2(onNewsLoaded) {
bindNewspaperV9_5_1(onNewsLoaded);
document.querySelectorAll("#newsTools button").forEach((button) => {
button.onclick = () => {
document.querySelectorAll("#newsTools button").forEach((candidate) => candidate.classList.remove("active"));
button.classList.add("active");
state.newsMode = button.dataset.news;
drawNewsV9_6_2();
};
});
document.getElementById("newsSearch").oninput = (event) => {
state.newsQuery = event.target.value.trim();
drawNewsV9_6_2();
};
}Newspaper V9 7
A JavaScript module in the plugins folder of GlobalGrid2050 that draws regional news, solar and battery storage (BESS). It queries matches (`queryMatches`), draws regional (`drawRegional`) and draws news v9 (`drawNewsV9_7`).
Set aside from the main view: 97% of its lines are the same as uk_renewables_pipeline/202611141017/scripts/plugins/newspaper-v9-7.js (globalgrid2050), which stays. (near-copy-of, proposed by families.py). 97% of lines shared with Newspaper V9 7; read that one first. All set-aside files, with reasons. Nothing was deleted.
Evidence
- line-jaccard 0.9726 to globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_renewables_pipeline/202611141017/scripts/plugins/newspaper-v9-7.js:1-102 2808d97e1198e968a82a846c63a3cad90638b97f
- sha256 81b71eee9d720e4dc223a16677680e295db6d3aeaa226a76ec01680265ee1e34
- target sha256 f8a4232da85e31cbc15b22dfd056ec41c072253bb1aedc1a4e136768a20dbaf3
- group of 2 (identity.json near-copy edges >= 0.9)
- canonical rule: reachable, newest stamp, core repo, most lines
renderglobalgrid2050 / testcode/202609051152/pipeline/scripts/plugins/newspaper-v9-7.js · lines 1–102 of 102 · version 2026-09-05 11:52 · pattern fetchCommitted (shared by 4 files)
- What it does
- It draws regional news, solar and battery storage (BESS). Defines 7 functions or classes, including queryMatches, regionalRows, drawRegional, drawNewsV9_7, fetchCommitted. Side effects: changes the web page (DOM); makes network requests.
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: solar, battery storage (BESS).
- Inputs & outputs
- In: JSON file regional_news.json; JSON file regional_manifest.json.
- Downstream impact
- Used directly by 1 file: App V9 7 (globalgrid2050). Reached from 88 other entry points, including Grid Engine — Compute Against Charging Page (globalgrid2050, https://globalgrid2050.com/grid_engine/202609060324-compute-against-charging/); Grid Engine — Connection Cap Page (globalgrid2050, https://globalgrid2050.com/grid_engine/202609060212-connection-cap/); Grid Engine — Corridor Estimate Page (globalgrid2050, https://globalgrid2050.com/grid_engine/202609060237-corridor-estimate/).
- What it achieves
- Defines `queryMatches`, `regionalRows`, `drawRegional` and 4 more.
- Why it matters
- Imported by App V9 7.
- Application
- globalgrid2050 · testcode/202609051152/pipeline/scripts/plugins · JavaScript module
- Uses
- State (import), Testcode — Pipeline (import), Newspaper V9 5 1 (import)
- Used by
- imported by App V9 7 (import)
- Produces
- drawNewsV9_7, loadNewsV9_7, bindNewspaperV9_7
- Defines here
- queryMatches, regionalRows, drawRegional, drawNewsV9_7, fetchCommitted, loadNewsV9_7, bindNewspaperV9_7
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609051152/pipeline/scripts/plugins/newspaper-v9-7.js:1-102 · blob dc0c1c3bc16c434fe96ec6a77a5dce1e5b0ad445 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom, network · domain stage: experimental · users: none · canonical: production_core
import { state } from "../core/state.js";
import { escapeHtml, normaliseProject } from "../core/utils.js";
import { bindNewspaperV9_5_1, drawNewsV9_5_1, loadNewsV9_5_1 } from "./newspaper-v9-5-1.js";
const REGIONAL_MODES = new Set(["INTERNATIONAL", "US", "EUROPE"]);
let regionalItems = [];
let regionalManifest = null;
function queryMatches(item) {
if (!state.newsQuery) return true;
const haystack = normaliseProject([
item.headline, item.source, item.technology, item.country, item.region,
].join(" "));
return normaliseProject(state.newsQuery).split(" ").filter(Boolean)
.every((token) => haystack.includes(token));
}
function regionalRows() {
return regionalItems.filter((item) => {
if (!queryMatches(item)) return false;
if (state.newsMode === "US") return item.region === "US";
if (state.newsMode === "EUROPE") return item.region === "EUROPE";
return true;
});
}
function drawRegional() {
const stories = document.getElementById("stories");
const rows = regionalRows();
if (!rows.length) {
stories.innerHTML = '<div class="news-empty">No build-verified regional solar or battery headlines match this filter.</div>';
return;
}
stories.innerHTML = rows.map((item) => {
const articleClass = item.technology.includes("BESS") ? "bess" : "solar";
const region = item.region === "INTERNATIONAL_OTHER" ? "INTERNATIONAL" : item.region;
return `<a class="story ${articleClass}" href="${escapeHtml(item.url)}" target="_blank" rel="noopener"><div class="kicker">${escapeHtml(item.technology)} · REGIONAL DISCOVERY · ${escapeHtml(item.published)}</div><h3>${escapeHtml(item.headline)}</h3><p><span class="project">${escapeHtml(region)} · ${escapeHtml(item.country)}</span>${item.source ? ` · ${escapeHtml(item.source)}` : ""}</p><span c … [line shortened here: 600 characters; full line on GitHub]
}).join("");
}
export function drawNewsV9_7() {
if (REGIONAL_MODES.has(state.newsMode)) {
drawRegional();
return;
}
if (state.newsMode === "UK") {
state.newsMode = "RELEVANT";
drawNewsV9_5_1();
state.newsMode = "UK";
return;
}
drawNewsV9_5_1();
}
async function fetchCommitted(path) {
const url = new URL(path, import.meta.url);
url.searchParams.set("v", "9.7");
const response = await fetch(url, { cache: "no-store" });
if (!response.ok) throw new Error(`${path} ${response.status}`);
return response.json();
}
export async function loadNewsV9_7() {
await loadNewsV9_5_1();
try {
const [regional, manifest] = await Promise.all([
fetchCommitted("../../data/v9.7/regional_news.json"),
fetchCommitted("../../data/v9.7/regional_manifest.json"),
]);
if (regional.schema !== "globalgrid2050.regional-news.v9.7"
|| regional.release !== "9.7" || !Array.isArray(regional.articles)
|| !regional.articles.every((item) => item.project_signal_eligible === false)) {
throw new Error("invalid committed regional artifact");
}
regionalItems = regional.articles;
regionalManifest = manifest;
const counts = regionalManifest.telemetry.by_region;
const uk = state.newsItems.filter((item) => item.canonical_relevant === true).length;
document.getElementById("newsMeta").textContent = `${uk} UK · ${regionalItems.length} international (${counts.US} US · ${counts.EUROPE} Europe · ${counts.INTERNATIONAL_OTHER} other) · ${state.newsItems.length} headlines · audited snapshot`;
} catch (error) {
regionalItems = [];
document.getElementById("newsMeta").textContent = `${state.newsItems.length} inherited headlines · regional ledger unavailable`;
console.error("V9.7 regional artifact unavailable", error);
}
drawNewsV9_7();
}
export function bindNewspaperV9_7(onNewsLoaded) {
bindNewspaperV9_5_1(onNewsLoaded);
document.querySelectorAll("#newsTools button").forEach((button) => {
button.onclick = () => {
document.querySelectorAll("#newsTools button").forEach((candidate) => candidate.classList.remove("active"));
button.classList.add("active");
state.newsMode = button.dataset.news;
drawNewsV9_7();
};
});
document.getElementById("newsSearch").oninput = (event) => {
state.newsQuery = event.target.value.trim();
drawNewsV9_7();
};
}Newspaper
A JavaScript module in the plugins folder of GlobalGrid2050 that refreshes projects (`refreshProjects`) and fetches payload (`fetchPayload`), covering battery storage (BESS), solar and the Renewable Energy Planning Database (REPD) register.
renderglobalgrid2050 / testcode/202609051152/pipeline/scripts/plugins/newspaper.js · lines 1–123 of 123 · version 2026-09-05 11:52 · pattern signalForProject (shared by 9 files)
- What it does
- It draws battery storage (BESS), solar and the REPD register. Defines 10 functions or classes, including refreshProjects, signalForProject, newsMatches, drawNews, renderNews. Side effects: changes the web page (DOM); makes network requests.
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: battery storage (BESS), solar, the REPD register.
- Downstream impact
- Used directly by 9 files: Project Export (globalgrid2050); Project Table (globalgrid2050); Projects V9 1 (globalgrid2050); Projects (globalgrid2050); and 5 more. Reached from 187 other entry points, including GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html); GlobalGrid2050 Homepage Before Four Nests (globalgrid2050, https://globalgrid2050.com/homepage-before-four-nests-20260925.html); GlobalGrid2050 — PipelineNews Intelligence Page (globalgrid2050, https://globalgrid2050.com/pipelinenews_intelligence/202609050309/).
- What it achieves
- It refreshes projects (`refreshProjects`), draws news (`drawNews`) and renders news (`renderNews`). Defines `refreshProjects`, `signalForProject`, `newsMatches` and 7 more.
- Why it matters
- Imported by 8 files, including Project Export, Project Table and Projects V9 1. Checked by Check Modules.
- Application
- globalgrid2050 · testcode/202609051152/pipeline/scripts/plugins · JavaScript module
- Uses
- State (import), Testcode — Pipeline (import)
- Used by
- imported by Project Export (import), imported by Project Table (import), imported by Projects V9 1 (import), imported by Projects (import), imported by Check Modules (import), imported by UK Renewables Pipeline — V7 (import), imported by UK Renewables Pipeline — V8 (import), imported by Projects (import), and 1 more
- Produces
- signalForProject, drawNews, loadNews, bindNewspaper
- Defines here
- refreshProjects, signalForProject, newsMatches, drawNews, renderNews, validPayload, payloadTime, fetchPayload, loadNews, bindNewspaper
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609051152/pipeline/scripts/plugins/newspaper.js:1-123 · blob e17eb4e52a3736976ec5f69d345b11e3667b41a2 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom, network · domain stage: experimental · users: none · canonical: production_core
import { DATA_SOURCES, state } from "../core/state.js";
import { escapeHtml, isFinanceEvent, normaliseProject } from "../core/utils.js";
let refreshProjects = () => {};
export function signalForProject(name) {
const normalised = normaliseProject(name);
const hit = state.newsItems.find((item) => normaliseProject(item.project) === normalised);
if (!hit) return { label: "—", cls: "none", note: "no matched headline" };
const event = String(hit.event || "PROJECT UPDATE").toUpperCase();
if (event === "CONSENT") return { label: "APPROVED*", cls: "approved", note: `headline ${hit.published || ""}` };
if (event === "OPERATIONAL") return { label: "OPERATIONAL*", cls: "operational", note: `headline ${hit.published || ""}` };
if (event === "CONSTRUCTION") return { label: "CONSTRUCTION*", cls: "construction", note: `headline ${hit.published || ""}` };
if (["FINANCIAL CLOSE", "ACQUISITION"].includes(event)) {
return {
label: event === "ACQUISITION" ? "M&A*" : "FINANCED*",
cls: "finance",
note: `headline ${hit.published || ""}`,
};
}
return { label: `${event}*`.slice(0, 22), cls: "", note: `headline ${hit.published || ""}` };
}
function newsMatches(item) {
const event = String(item.event || "").toUpperCase();
const technology = String(item.technology || "").toUpperCase();
if (state.newsMode === "SOLAR" && technology !== "SOLAR") return false;
if (state.newsMode === "BESS" && technology !== "BESS") return false;
if (state.newsMode === "CONSENT" && event !== "CONSENT") return false;
if (state.newsMode === "CONSTRUCTION" && event !== "CONSTRUCTION") return false;
if (state.newsMode === "OPERATIONAL" && event !== "OPERATIONAL") return false;
if (state.newsMode === "FINANCE" && !isFinanceEvent(event)) return false;
if (state.newsQuery) {
const haystack = [item.headline, item.project, item.operator, item.county, item.source, item.event]
.join(" ")
.toUpperCase();
if (!haystack.includes(state.newsQuery)) return false;
}
return true;
}
export function drawNews() {
const stories = document.getElementById("stories");
const rows = state.newsItems.filter(newsMatches);
if (!rows.length) {
stories.innerHTML = '<div class="news-empty">No headlines match this newspaper filter.</div>';
return;
}
stories.innerHTML = rows.map((item) => {
const articleClass = item.technology === "bess" ? "bess" : "solar";
const capacity = Number(item.capacity_mw || 0);
const confidence = Number(item.confidence || 0);
return `<a class="story ${articleClass}" href="${escapeHtml(item.url)}" target="_blank" rel="noopener"><div class="kicker">${escapeHtml((item.technology || "").toUpperCase())} · ${escapeHtml(item.event || "PROJECT UPDATE")} · ${escapeHtml(item.published || "")}</div><h3>${escapeHtml(item.headline || item.project)}</h3><p><span class="project">${escapeHtml(item.project || "")}${capacity ? ` · $ … [line shortened here: 676 characters; full line on GitHub]
}).join("");
}
function renderNews(payload) {
state.newsItems = Array.isArray(payload.items) ? payload.items : [];
const eligible = payload.eligible_projects == null
? "REPD universe pending first refresh"
: `${Number(payload.eligible_projects).toLocaleString()} eligible projects`;
document.getElementById("newsMeta").textContent = `${state.newsItems.length} headlines · ${eligible} · ${String(payload.updated || "").slice(0, 10)}`;
drawNews();
if (state.all.length) refreshProjects();
}
function validPayload(payload) {
return payload
&& Array.isArray(payload.items)
&& Number.isFinite(Number(payload.headline_count ?? payload.items.length));
}
function payloadTime(payload) {
const timestamp = Date.parse(String(payload && payload.updated || ""));
return Number.isFinite(timestamp) ? timestamp : 0;
}
async function fetchPayload(label, url) {
const response = await fetch(url, { cache: "no-store" });
if (!response.ok) throw new Error(`${label} ${response.status}`);
const data = await response.json();
if (!validPayload(data)) throw new Error(`${label} invalid payload`);
return { label, data };
}
export async function loadNews() {
const stamp = Date.now();
const sources = [
["Pages", `${DATA_SOURCES.newsPages}?v=${stamp}`],
["GitHub main", `${DATA_SOURCES.newsGitHub}?v=${stamp}`],
];
const settled = await Promise.allSettled(sources.map(([label, url]) => fetchPayload(label, url)));
const good = settled.filter((result) => result.status === "fulfilled").map((result) => result.value);
if (!good.length) {
document.getElementById("stories").innerHTML = '<div class="news-empty">Daily newspaper feed unavailable. REPD analytics below remain live.</div>';
document.getElementById("newsMeta").textContent = "feed unavailable";
return;
}
good.sort((left, right) => payloadTime(right.data) - payloadTime(left.data)
|| ((right.data.items || []).length - (left.data.items || []).length));
const best = good[0];
renderNews(best.data);
document.getElementById("newsMeta").textContent += ` · ${best.label}`;
}
export function bindNewspaper(onNewsLoaded) {
refreshProjects = onNewsLoaded;
document.querySelectorAll("#newsTools button").forEach((button) => {
button.onclick = () => {
document.querySelectorAll("#newsTools button").forEach((candidate) => candidate.classList.remove("active"));
button.classList.add("active");
state.newsMode = button.dataset.news;
drawNews();
};
});
document.getElementById("newsSearch").oninput = (event) => {
state.newsQuery = event.target.value.trim().toUpperCase();
drawNews();
};
}Project Export
A JavaScript module in the plugins folder of GlobalGrid2050 that exports CSV (`exportCsv`) (units: MW), covering the Renewable Energy Planning Database (REPD) register. It exports CSV (`exportCsv`).
renderglobalgrid2050 / testcode/202609051152/pipeline/scripts/plugins/project-export.js · lines 1–33 of 33 · version 2026-09-05 11:52 · pattern exportCsv (shared by 2 files)
- What it does
- It draws the REPD register. Defines exportCsv, bindProjectExport. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: the REPD register.
- Downstream impact
- Used directly by 1 file: Projects (globalgrid2050). Reached from 188 other entry points, including GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html); GlobalGrid2050 Homepage Before Four Nests (globalgrid2050, https://globalgrid2050.com/homepage-before-four-nests-20260925.html); GlobalGrid2050 — PipelineNews Intelligence Page (globalgrid2050, https://globalgrid2050.com/pipelinenews_intelligence/202609050309/).
- What it achieves
- Defines `exportCsv` and `bindProjectExport`.
- Why it matters
- Imported by Projects.
- Application
- globalgrid2050 · testcode/202609051152/pipeline/scripts/plugins · JavaScript module
- Uses
- State (import), Newspaper (import)
- Used by
- imported by Projects (import)
- Produces
- bindProjectExport
- Defines here
- exportCsv, bindProjectExport
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609051152/pipeline/scripts/plugins/project-export.js:1-33 · blob 06d1727722f347f7a4da874c194e56e6b3ae70b6 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
import { state } from "../core/state.js";
import { signalForProject } from "./newspaper.js";
function exportCsv(event) {
event.preventDefault();
const rows = state.filtered.length ? state.filtered : state.all;
const output = ["Site Name,County,Operator,Technology,REPD Status,Capacity MW,News Signal,News Signal Note"];
rows.forEach((project) => {
const signal = signalForProject(project.name);
output.push([
project.name,
project.county,
project.op,
project.cat,
project.status,
project.mw,
signal.label,
`${signal.note}; not REPD-confirmed`,
].map((value) => `"${String(value).replace(/"/g, '""')}"`).join(","));
});
const url = URL.createObjectURL(new Blob([`\ufeff${output.join("\n")}`], { type: "text/csv" }));
const anchor = document.createElement("a");
anchor.href = url;
anchor.download = `globalgrid2050_uk_renewables_pipeline_v7_1_${new Date().toISOString().slice(0, 10)}.csv`;
document.body.appendChild(anchor);
anchor.click();
anchor.remove();
URL.revokeObjectURL(url);
}
export function bindProjectExport() {
document.getElementById("export").onclick = exportCsv;
}Project Filters
A JavaScript module in the plugins folder of GlobalGrid2050.
interactionglobalgrid2050 / testcode/202609051152/pipeline/scripts/plugins/project-filters.js · lines 1–41 of 41 · version 2026-09-05 11:52 · pattern applyProjectFilters (shared by 2 files)
- What it does
- It lists and searches its content. Defines applyProjectFilters, bindProjectFilters. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
- Downstream impact
- Used directly by 1 file: Projects (globalgrid2050). Reached from 188 other entry points, including GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html); GlobalGrid2050 Homepage Before Four Nests (globalgrid2050, https://globalgrid2050.com/homepage-before-four-nests-20260925.html); GlobalGrid2050 — PipelineNews Intelligence Page (globalgrid2050, https://globalgrid2050.com/pipelinenews_intelligence/202609050309/).
- What it achieves
- Defines `applyProjectFilters` and `bindProjectFilters`.
- Why it matters
- Imported by Projects.
- Application
- globalgrid2050 · testcode/202609051152/pipeline/scripts/plugins · JavaScript module
- Uses
- State (import), Gauges (import), Project Table (import)
- Used by
- imported by Projects (import)
- Produces
- applyProjectFilters, bindProjectFilters
- Defines here
- applyProjectFilters, bindProjectFilters
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609051152/pipeline/scripts/plugins/project-filters.js:1-41 · blob 914fc4b7389fed8d454682ee2e52ab7719da7b95 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
import { state } from "../core/state.js";
import { updateGauges } from "./gauges.js";
import { drawProjectTable } from "./project-table.js";
export function applyProjectFilters() {
state.filtered = state.all.filter((project) => (
(state.tech === "All" || project.cat === state.tech)
&& (state.status === "All" || project.status.includes(state.status))
&& (state.county === "All" || project.county === state.county)
&& (!state.search || project.op.includes(state.search) || project.name.toUpperCase().includes(state.search))
));
updateGauges(state.filtered);
drawProjectTable(state.filtered);
}
export function bindProjectFilters() {
document.querySelectorAll("#tech .btn").forEach((button) => {
button.onclick = () => {
document.querySelectorAll("#tech .btn").forEach((candidate) => candidate.classList.remove("active"));
button.classList.add("active");
state.tech = button.dataset.tech;
applyProjectFilters();
};
});
document.querySelectorAll("#status .btn").forEach((button) => {
button.onclick = () => {
document.querySelectorAll("#status .btn").forEach((candidate) => candidate.classList.remove("active"));
button.classList.add("active");
state.status = button.dataset.status;
applyProjectFilters();
};
});
document.getElementById("county").onchange = (event) => {
state.county = event.target.value;
applyProjectFilters();
};
document.getElementById("search").oninput = (event) => {
state.search = event.target.value.trim().toUpperCase();
applyProjectFilters();
};
}Project Table
A JavaScript module in the plugins folder of GlobalGrid2050.
renderglobalgrid2050 / testcode/202609051152/pipeline/scripts/plugins/project-table.js · lines 1–21 of 21 · version 2026-09-05 11:52
- What it does
- It draws its content. Defines drawProjectTable, refreshProjectTable. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
- Downstream impact
- Used directly by 2 files: Project Filters (globalgrid2050); UK Renewables Pipeline — V7 (globalgrid2050). Reached from 187 other entry points, including GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html); GlobalGrid2050 Homepage Before Four Nests (globalgrid2050, https://globalgrid2050.com/homepage-before-four-nests-20260925.html); GlobalGrid2050 — PipelineNews Intelligence Page (globalgrid2050, https://globalgrid2050.com/pipelinenews_intelligence/202609050309/).
- What it achieves
- Defines `drawProjectTable` and `refreshProjectTable`.
- Why it matters
- Imported by Project Filters and UK Renewables Pipeline — V7.
- Application
- globalgrid2050 · testcode/202609051152/pipeline/scripts/plugins · JavaScript module
- Uses
- State (import), Testcode — Pipeline (import), Newspaper (import)
- Used by
- imported by Project Filters (import), imported by UK Renewables Pipeline — V7 (import)
- Produces
- drawProjectTable, refreshProjectTable
- Defines here
- drawProjectTable, refreshProjectTable
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609051152/pipeline/scripts/plugins/project-table.js:1-21 · blob bd5f7611ef533751211c3321723ce8cb4a3dffa8 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
import { COLORS, state } from "../core/state.js";
import { escapeHtml } from "../core/utils.js";
import { signalForProject } from "./newspaper.js";
export function drawProjectTable(projects) {
const tableBody = document.getElementById("tbody");
tableBody.innerHTML = "";
projects.forEach((project) => {
const row = document.createElement("tr");
const query = encodeURIComponent(`${project.name} ${project.cat}`);
const mobileSubline = [project.county, project.op].filter(Boolean).join(" | ");
const foreground = project.cat === "Offshore Wind" ? "#fff" : "#000";
const signal = signalForProject(project.name);
row.innerHTML = `<td class="site">${escapeHtml(project.name)}${mobileSubline ? `<div class="mobile-extra">${escapeHtml(mobileSubline)}</div>` : ""}</td><td class="hide-mobile">${escapeHtml(project.county || "-")}</td><td class="hide-mobile">${escapeHtml(project.op || "-")}</td><td><span class="badge" style="background:${COLORS[project.cat] || "#888"};color:${foreground}">${escapeHtml(project.c … [line shortened here: 777 characters; full line on GitHub]
tableBody.appendChild(row);
});
}
export function refreshProjectTable() {
drawProjectTable(state.filtered);
}Projects V9 1
A JavaScript module in the plugins folder of GlobalGrid2050 that renders table (`renderTable`), downloads CSV (`downloadCsv`) and binds project controls v9 (`bindProjectControlsV9_1`) (units: MW), using EPSG:27700 and SHA-256.
energy-dataglobalgrid2050 / testcode/202609051152/pipeline/scripts/plugins/projects-v9-1.js · lines 1–134 of 134 · version 2026-09-05 11:52 · Not reached from any entry point (candidate for review) · pattern loadProjects (shared by 28 files)
- What it does
- It draws the REPD register, solar, battery storage (BESS) and wind. Defines 10 functions or classes, including atlasUrl, displayDate, renderTable, apply, populateCounties. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: the REPD register, solar, battery storage (BESS), wind.
- Inputs & outputs
- Coordinate systems named: OSGB36 / EPSG:27700 (British National Grid), WGS84 / EPSG:4326.
- What it achieves
- It renders table (`renderTable`), downloads CSV (`downloadCsv`) and loads projects v9 (`loadProjectsV9_1`). Its `downloadCsv` function gives CSV download or refusal from active table owner, filtered register rows and official detail partitions (VEDIC: export filtered projects).
- Why it matters
- No other file in the estate was found to import it.
- Application
- globalgrid2050 · testcode/202609051152/pipeline/scripts/plugins · JavaScript module
- VEDIC
- EXPORT FILTERED PROJECTS (GG2050-VEDIC-000060): Pipeline News · Renewable project register. active_table_owner, filtered_register_rows, official_detail_partitions → csv_download_or_refusal
- Uses
- Testcode — Pipeline (import), Atlas Receiver V9 7 (import), Canonical Projects V9 1 (import), Gauges V9 1 (import), Newspaper (import)
- Used by
- mentioned in Standalone (comment link)
- Produces
- loadProjectsV9_1, refreshProjectsV9_1, bindProjectControlsV9_1
- Defines here
- atlasUrl, displayDate, renderTable, apply, populateCounties, csvCell, downloadCsv, loadProjectsV9_1, refreshProjectsV9_1, bindProjectControlsV9_1
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609051152/pipeline/scripts/plugins/projects-v9-1.js:1-134 · blob 4259f28f52b5113ae3b33f7bb6f0ff29da3b4699 · GitHub at these lines
- State
- achieves: code · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: unreached_review
import { escapeHtml } from "../core/utils.js";
import { buildAtlasDeepLinkV9_7 } from "../core/atlas-receiver-v9-7.js";
import { loadCanonicalProjectsV9_1 } from "../data/canonical-projects-v9-1.js";
import { setGaugeUniverseV9_1, updateGaugesV9_1 } from "./gauges-v9-1.js";
import { signalForProject } from "./newspaper.js";
const LABELS = Object.freeze({ solar: "Solar", bess: "Battery Storage", wind_onshore: "Onshore Wind", wind_offshore: "Offshore Wind" });
const COLOURS = Object.freeze({ solar: "#ffff00", bess: "#ffae00", wind_onshore: "#00ffff", wind_offshore: "#0066ff" });
const UNITS = Object.freeze({ solar: "MWp", bess: "MW", wind_onshore: "MW", wind_offshore: "MW" });
let all = [];
let filtered = [];
let metadata = null;
let technology = "all";
let status = "All";
let county = "All";
let query = "";
let controlsBound = false;
function atlasUrl(project) {
// The receiver is not named here. It is read from the deep-link contract the
// engine publishes -- see ../core/atlas-receiver-v9-7.js for the measurement
// that made this necessary. Seven files in this directory each held their own
// copy of a route that had quietly stopped carrying the engine.
return buildAtlasDeepLinkV9_7(project);
}
function displayDate(value) {
if (!value) return "not supplied by REPD";
const [year, month, day] = value.split("-");
return `${day}/${month}/${year}`;
}
function renderTable() {
const body = document.getElementById("tbody");
body.innerHTML = filtered.map((project) => {
const label = LABELS[project.technology];
const unit = UNITS[project.technology];
const location = [project.county, project.region].filter(Boolean).join(" · ");
const signal = signalForProject(project.name);
const news = new URL("https://www.google.com/search");
news.searchParams.set("q", `${project.name} ${label} UK`);
news.searchParams.set("tbm", "nws");
return `<tr><td class="site">${escapeHtml(project.name)}<div class="mobile-extra">${escapeHtml([location, project.operator, project.repd_ref].filter(Boolean).join(" | "))}</div></td><td class="hide-mobile">${escapeHtml(location || "-")}</td><td class="hide-mobile">${escapeHtml(project.operator || "-")}</td><td><span class="badge" style="background:${COLOURS[project.technology]}">${escapeHtml(l … [line shortened here: 1,183 characters; full line on GitHub]
}).join("");
}
function apply() {
filtered = all.filter((project) => {
const haystack = [project.name, project.operator, project.repd_ref, project.gg_project_id, project.gg_development_id, project.planning_application_reference, project.planning_authority, project.county, project.region].join(" ").toLocaleLowerCase("en-GB");
return (technology === "all" || project.technology === technology)
&& (status === "All" || project.status.includes(status))
&& (county === "All" || project.county === county)
&& (!query || haystack.includes(query));
});
updateGaugesV9_1(filtered);
renderTable();
}
function populateCounties() {
const select = document.getElementById("county");
[...new Set(all.map((project) => project.county).filter(Boolean))].sort((left, right) => left.localeCompare(right, "en-GB")).forEach((value) => {
const option = document.createElement("option");
option.value = value;
option.textContent = `📍 ${value}`;
select.appendChild(option);
});
}
function csvCell(value) {
let text = value === null || value === undefined ? "" : String(value);
if (/^(?:[=+\-@]|\s+[=+\-@]|\t|\r|\n)/u.test(text)) text = `'${text}`;
return `"${text.replaceAll('"', '""')}"`;
}
function downloadCsv(event) {
event.preventDefault();
const headers = ["Site Name", "REPD Ref", "GlobalGrid Project ID", "GlobalGrid Development ID", "Identity Status", "Identity Confidence", "Technology", "Official REPD Technology", "Official REPD Capacity", "Capacity Unit", "Official REPD Status", "Derived Lifecycle", "Operator or Applicant", "County", "Region", "Country", "Planning Authority", "Planning Application Reference", "REPD Record Updat … [line shortened here: 1,125 characters; full line on GitHub]
const rows = filtered.map((project) => {
const signal = signalForProject(project.name);
return [project.name, project.repd_ref, project.gg_project_id, project.gg_development_id, project.identity_status, project.identity_confidence, LABELS[project.technology], project.repd_technology, project.capacity_mw, UNITS[project.technology], project.status, project.lifecycle, project.operator, project.county, project.region, project.country, project.planning_authority, project.planning_appl … [line shortened here: 1,386 characters; full line on GitHub]
});
const content = `\ufeff${[headers, ...rows].map((row) => row.map(csvCell).join(",")).join("\r\n")}`;
const url = URL.createObjectURL(new Blob([content], { type: "text/csv;charset=utf-8" }));
const anchor = document.createElement("a");
anchor.href = url;
anchor.download = `globalgrid2050_uk_renewables_pipeline_v9_1_${new Date().toISOString().slice(0, 10)}.csv`;
anchor.click();
URL.revokeObjectURL(url);
document.getElementById("exportMeta").textContent = `${filtered.length.toLocaleString("en-GB")} filtered records exported`;
}
export async function loadProjectsV9_1() {
try {
const model = await loadCanonicalProjectsV9_1();
all = [...model.projects];
filtered = all;
metadata = model.metadata;
setGaugeUniverseV9_1(all);
populateCounties();
apply();
} catch (error) {
console.error(error);
document.getElementById("tbody").innerHTML = '<tr><td colspan="13" style="text-align:center;color:#ff6666">Canonical Q2 REPD data unavailable. V9.1 has failed closed.</td></tr>';
}
}
export function refreshProjectsV9_1() {
if (metadata) renderTable();
}
export function bindProjectControlsV9_1() {
if (controlsBound) return;
controlsBound = true;
document.querySelectorAll("#tech .btn").forEach((button) => {
button.onclick = () => {
document.querySelectorAll("#tech .btn").forEach((candidate) => candidate.classList.remove("active"));
button.classList.add("active");
technology = button.dataset.technology;
apply();
};
});
document.querySelectorAll("#status .btn").forEach((button) => {
button.onclick = () => {
document.querySelectorAll("#status .btn").forEach((candidate) => candidate.classList.remove("active"));
button.classList.add("active");
status = button.dataset.officialStatus;
apply();
};
});
document.getElementById("county").onchange = (event) => { county = event.target.value; apply(); };
document.getElementById("search").oninput = (event) => { query = event.target.value.trim().toLocaleLowerCase("en-GB"); apply(); };
document.getElementById("export").onclick = downloadCsv;
document.getElementById("exportInline").onclick = downloadCsv;
}