GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Solar and storage design / solar-electrical-topology-analysis-engine-text-based / v8-leapfrog

Solar Electrical Topology Analysis Engine Text Based — V8 Leapfrog Style Sheet and 2 more files

A style sheet covering cables. Served with the page at https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v8-leapfrog/.

568 lines of CSS and JavaScript and HTML from solar-electrical-topology-analysis-engine-text-based, in 3 files. Topic: Solar and storage design. Section 254 of 2044.

Cut 2026-12-06T03:07:51+00:00. A copy for reading; the repository at the stated commit is the source.

In the State lines below, domain stage, users and canonical status are rule-based first approximations from code and path evidence (rules explore-agent-rules-v1), not observed facts: the rules.

In this section

  1. Solar Electrical Topology Analysis Engine Text Based — V8 Leapfrog Style Sheet render · solar-electrical-topology-analysis-engine-text-based / v8-leapfrog/styles.css lines 439–740
  2. Tests test · solar-electrical-topology-analysis-engine-text-based / v8-leapfrog/tests.html lines 1–84
  3. Solar Electrical Topology Analysis Engine Text Based — V9 Sandbox render · solar-electrical-topology-analysis-engine-text-based / v9-sandbox/app.js lines 1–182

Solar Electrical Topology Analysis Engine Text Based — V8 Leapfrog Style Sheet

A style sheet covering cables. Served with the page at https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v8-leapfrog/.

rendersolar-electrical-topology-analysis-engine-text-based / v8-leapfrog/styles.css · lines 439–740 of 740 (continued from section 253) · Entry point

What it does
Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage sub33kv_design (repository name word 'solar'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: cables.
Downstream impact
Used directly by 3 files: Solar Electrical Topology Analysis Engine Text Based — V8 Leapfrog Page (solar-electrical-topology-analysis-engine-text-based, https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v8-leapfrog/); Inverter24 (solar-electrical-topology-analysis-engine-text-based, https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v8-leapfrog/inverter24.html); Tests (solar-electrical-topology-analysis-engine-text-based, https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v8-leapfrog/tests.html). Reached from 125 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); Homepage V002 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v002.html). It is itself an entry point, published at https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v8-leapfrog/.
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name.
Why it matters
Loaded by the V8 Leapfrog page at https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v8-leapfrog/ and 1 other page. Checked by Tests.
Application
solar-electrical-topology-analysis-engine-text-based · v8-leapfrog · style sheet
Uses
none found
Used by
loaded by Solar Electrical Topology Analysis Engine Text Based — V8 Leapfrog Page (stylesheet), loaded by Inverter24 (stylesheet), loaded by Tests (stylesheet)
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
solar-electrical-topology-analysis-engine-text-based@d3b4c497144c2c9b3e8f0e82117e7e9abe4672b9 v8-leapfrog/styles.css:439-740 · blob 8347d3261a3665a30e13e7518bca18df2d29ca11 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
tbody tr:hover {
  background: #0b1721;
}

tfoot th,
tfoot td {
  background: #10202c;
  color: #fff;
}

.good-cell {
  color: var(--green);
  font-weight: 900;
}

.warning-cell {
  color: var(--amber);
  font-weight: 900;
}

.diagram-wrap {
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  background: #03070b;
}

#topologyDiagram {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
}

.svg-label {
  fill: #eef7ff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.svg-muted {
  fill: #9bb0c0;
}

.svg-module-east {
  fill: #153d50;
  stroke: #70dcff;
}

.svg-module-west {
  fill: #332b50;
  stroke: #c1a5ff;
}

.svg-inverter {
  fill: #ffb347;
  stroke: #ffe0ad;
}

.svg-cable-halo {
  fill: none;
  stroke: #dbe9f3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-opacity: 0.42;
}

.svg-cable {
  fill: none;
  stroke: #000;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-internal {
  fill: none;
  stroke: #000;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-saving {
  fill: none;
  stroke: #ff6170;
  stroke-width: 5;
  stroke-dasharray: 10 8;
}

.lead-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
}

.lead-box article {
  padding: 10px;
  border: 1px solid var(--line);
  background: #071019;
}

.lead-box span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.lead-box strong {
  display: block;
  margin-top: 6px;
  font: 900 15px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.runtime-error {
  display: none;
  margin: 10px 0;
  padding: 11px;
  border: 1px solid #7b2730;
  background: #2a0b0f;
  color: #ffb8bf;
  white-space: pre-wrap;
  font: 12px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.runtime-error.visible {
  display: block;
}

.trace {
  margin: 0;
  color: #d7ecff;
  white-space: pre-wrap;
  font: 11px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.comparison-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  background: #071019;
}

.comparison-grid h3 {
  margin: 0 0 7px;
  color: var(--cyan);
}

.comparison-grid p {
  margin: 0;
  color: #b8cbd9;
  font-size: 12px;
  line-height: 1.55;
}

.footer {
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  color: #8fa4b8;
  font-size: 11px;
  line-height: 1.5;
}

.test-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.test-head {
  margin-bottom: 14px;
}

.test-head h1 {
  font-size: 34px;
}

.test-result {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: #060a0f;
}

.test-result table {
  font-size: 13px;
}

.pass {
  color: var(--green);
  font-weight: 900;
}

.fail {
  color: var(--red);
  font-weight: 900;
}

.summary-line {
  padding: 12px;
  border: 1px solid var(--line);
  background: #071923;
  font: 900 14px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.summary-line.pass {
  border-color: #205838;
  background: #062014;
}

.summary-line.fail {
  border-color: #7b2730;
  background: #2a0b0f;
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .panel {
    margin: 0;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar {
    display: block;
    padding: 22px 17px;
  }

  .status-stack {
    min-width: 0;
    margin-top: 14px;
  }

  .layout {
    display: block;
    padding: 10px;
  }

  .controls {
    display: block;
  }

  .panel {
    margin-bottom: 10px;
  }

  .panel label {
    grid-template-columns: 1fr 132px;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .decomposition,
  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .lead-box {
    grid-template-columns: 1fr 1fr;
  }

  .workbench {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .panel label {
    grid-template-columns: 1fr;
  }

  .metrics,
  .lead-box {
    grid-template-columns: 1fr;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 33px;
  }
}

Tests

A web page in Solar Electrical Topology Analysis Engine Text Based. Published at https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v8-leapfrog/tests.html.

testsolar-electrical-topology-analysis-engine-text-based / v8-leapfrog/tests.html · lines 1–84 of 84 · Entry point

What it does
It tests its inputs. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage sub33kv_design (repository name word 'solar'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary.
Inputs & outputs
Out: web page.
Downstream impact
Used directly by 1 file: Solar Electrical Topology Analysis Engine Text Based — V8 Leapfrog Page (solar-electrical-topology-analysis-engine-text-based, https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v8-leapfrog/). Reached from 126 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); Homepage V002 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v002.html). It is itself an entry point, published at https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v8-leapfrog/tests.html.
What it achieves
V8 Leapfrog Golden Tests.
Why it matters
Loaded by the V8 Leapfrog page at https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v8-leapfrog/.
Application
solar-electrical-topology-analysis-engine-text-based · v8-leapfrog · page
Uses
Solar Electrical Topology Analysis Engine Text Based — V8 Leapfrog Style Sheet (stylesheet), Solar Electrical Topology Analysis Engine Text Based — V8 Leapfrog Page (link), Solar Electrical Topology Analysis Engine Text Based — Index Page (link), V7 Development — Feed I Page (link), Model (script src)
Used by
linked from Solar Electrical Topology Analysis Engine Text Based — V8 Leapfrog Page (link)
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
solar-electrical-topology-analysis-engine-text-based@d3b4c497144c2c9b3e8f0e82117e7e9abe4672b9 v8-leapfrog/tests.html:1-84 · blob 1bde2ff3dc07037fd2dca7510a61e9ab3cab0046 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <title>V8 Leapfrog Golden Tests</title>
  <link rel="stylesheet" href="./styles.css">
</head>
<body>
  <main class="test-shell">
    <header class="test-head">
      <div class="kicker">
        GLOBALGRID2050 · V8 TEST FIXTURE
      </div>
      <h1>Leapfrog Cable Model Golden Tests</h1>
      <p>
        These tests protect the 30-module archetype, lead-feasibility
        gate and actual-site-string aggregation against accidental change.
      </p>
      <div class="navlinks">
        <a href="./">Return to V8</a>
        <a href="../">V6</a>
        <a href="../v7-development/feed-i/">V7 FEED I</a>
      </div>
    </header>

    <div id="summary" class="summary-line">
      Running tests…
    </div>

    <section class="test-result">
      <table>
        <thead>
          <tr>
            <th>Test</th>
            <th>Status</th>
            <th>Actual</th>
            <th>Expected</th>
          </tr>
        </thead>
        <tbody id="results"></tbody>
      </table>
    </section>
  </main>

  <script src="./model.js"></script>
  <script>
    'use strict';

    (function runBrowserTests() {
      const model = window.V8LeapfrogModel;
      const summary = document.getElementById('summary');
      const results = document.getElementById('results');

      try {
        const run = model.runGoldenTests();

        summary.textContent =
          `${run.passed}/${run.total} tests passed · ` +
          `model ${run.version}`;
        summary.className =
          `summary-line ${run.allPassed ? 'pass' : 'fail'}`;

        results.innerHTML = run.tests
          .map((test) => `
            <tr>
              <td>${test.name}</td>
              <td class="${test.pass ? 'pass' : 'fail'}">
                ${test.pass ? 'PASS' : 'FAIL'}
              </td>
              <td>${String(test.actual)}</td>
              <td>${String(test.expected)}</td>
            </tr>
          `)
          .join('');
      } catch (error) {
        summary.textContent =
          `TEST RUNTIME ERROR: ${error.message}`;
        summary.className = 'summary-line fail';
      }
    })();
  </script>
</body>
</html>

Solar Electrical Topology Analysis Engine Text Based — V9 Sandbox

A JavaScript module that draws solar DC computation report and solar DC report, using IEC 60228. Served with the page at https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v9-sandbox/.

rendersolar-electrical-topology-analysis-engine-text-based / v9-sandbox/app.js · lines 1–182 of 182 · Entry point · pattern downloadJson (shared by 2 files)

What it does
It draws solar DC computation report and solar DC report. Defines 11 functions or classes, including byId, value, numeric, collectInput, downloadJson. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage experimental (path word 'sandbox'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
In: JSON file v9-solar-dc-computation-report.json; JSON file v9-solar-dc-test-report.json.
Downstream impact
Used directly by 1 file: Solar Electrical Topology Analysis Engine Text Based — V9 Sandbox Page (solar-electrical-topology-analysis-engine-text-based, https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v9-sandbox/). Reached from 124 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); Homepage V002 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v002.html). It is itself an entry point, published at https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v9-sandbox/.
What it achieves
It collects input (`collectInput`), downloads JSON (`downloadJson`) and renders tests (`renderTests`). Defines `byId`, `value`, `numeric` and 8 more. It responds to input, change and click events.
Why it matters
Loaded by the page of the same name at https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v9-sandbox/.
Application
solar-electrical-topology-analysis-engine-text-based · v9-sandbox · JavaScript module
Uses
Engine (import), Tests (import)
Used by
loaded by Solar Electrical Topology Analysis Engine Text Based — V9 Sandbox Page (script src)
Produces
byId, value, numeric, collectInput, downloadJson, renderTests, renderWarnings, renderString, renderProject, applyLegacyResistanceBoundary, rebuild
Defines here
byId, value, numeric, collectInput, downloadJson, renderTests, renderWarnings, renderString, renderProject, applyLegacyResistanceBoundary, rebuild
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
solar-electrical-topology-analysis-engine-text-based@d3b4c497144c2c9b3e8f0e82117e7e9abe4672b9 v9-sandbox/app.js:1-182 · blob f0b9965cf04349468b2d4380aec6895e390d731e · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
import { computeProject, parseIntegerList } from "./debug/engine.js";
import { runDebugTests } from "./debug/tests.js";

const LEGACY_RESISTANCE_MODEL = Object.freeze({
  authorityStatus: "historical_reference",
  basis: "ideal_bulk_estimate",
  valueKind: "lower_bound_estimate",
  sourceReference: (
    "0.017241 ohm mm2/m bulk-copper resistivity divided by nominal area"
  ),
  sourceRevision: "v9-sandbox-debug-legacy",
  warning: "Ideal bulk-copper screening calculation using nominal metallic area. Not a finished-cable declared resistance and not an IEC 60228 maximum-resistance calculation.",
});

const byId = (id) => document.getElementById(id);
let latestProject = null;
let latestTests = null;

function value(id) {
  return byId(id).value;
}

function numeric(id) {
  return Number(value(id));
}

function collectInput() {
  return {
    mpptCount: numeric("mpptCount"),
    defaultInputsPerMppt: numeric("defaultInputsPerMppt"),
    allocationOverride: parseIntegerList(value("allocationOverride")),
    modulesPerString: numeric("modulesPerString"),
    topology: value("topology"),
    customOrder: parseIntegerList(value("customOrder")),
    moduleWidthM: numeric("moduleWidthM"),
    moduleGapM: numeric("moduleGapM"),
    positiveLeadM: numeric("positiveLeadM"),
    negativeLeadM: numeric("negativeLeadM"),
    routeOneWayM: numeric("routeOneWayM"),
    externalCableCsaMm2: numeric("externalCableCsaMm2"),
    factoryLeadCsaMm2: numeric("factoryLeadCsaMm2"),
    conductorTemperatureC: numeric("conductorTemperatureC"),
    moduleVocStcV: numeric("moduleVocStcV"),
    vocTempCoefficientPercentPerC: numeric("vocTempCoefficientPercentPerC"),
    cellTemperatureC: numeric("cellTemperatureC"),
    systemVoltageLimitV: numeric("systemVoltageLimitV"),
    operatingCurrentA: numeric("operatingCurrentA"),
  };
}

function downloadJson(filename, data) {
  const blob = new Blob([JSON.stringify(data, null, 2)], { type: "application/json" });
  const url = URL.createObjectURL(blob);
  const link = document.createElement("a");
  link.href = url;
  link.download = filename;
  link.click();
  URL.revokeObjectURL(url);
}

function renderTests(report) {
  const tbody = byId("tests");
  tbody.replaceChildren();
  report.results.forEach((result) => {
    const row = document.createElement("tr");
    row.innerHTML = `<td>${result.name}</td><td class="${result.status}">${result.status.toUpperCase()}</td><td>${result.detail}</td>`;
    tbody.appendChild(row);
  });
}

function renderWarnings(project) {
  const host = byId("warnings");
  host.replaceChildren();
  project.warnings.forEach((warning) => {
    const paragraph = document.createElement("p");
    paragraph.className = warning.severity === "error" ? "fail" : warning.severity;
    paragraph.textContent = `${warning.code}: ${warning.message}`;
    host.appendChild(paragraph);
  });
  const assumptions = document.createElement("ol");
  project.assumptions.forEach((assumption) => {
    const item = document.createElement("li");
    item.textContent = assumption;
    assumptions.appendChild(item);
  });
  host.appendChild(assumptions);
}

function renderString(project) {
  const selector = byId("selectedString");
  const previous = selector.value;
  selector.replaceChildren();
  project.strings.forEach((string) => {
    const option = document.createElement("option");
    option.value = string.id;
    option.textContent = `${string.id} · MPPT ${string.mppt} / input ${string.input}`;
    selector.appendChild(option);
  });
  if (project.strings.some((string) => string.id === previous)) selector.value = previous;
  const selected = project.strings.find((string) => string.id === selector.value) ?? project.strings[0];
  byId("stringReport").textContent = selected
    ? JSON.stringify({ id: selected.id, electricalOrder: selected.electricalOrder, calculations: selected.calculations, segments: selected.segments }, null, 2)
    : "No active string.";
}

function renderProject(project, tests) {
  const summary = byId("summary");
  const entries = [
    ["Requested strings", project.allocation.requestedStrings],
    ["Active strings", project.allocation.activeStrings],
    ["Total modules", project.totals.modules],
    ["Corrected module Voc", `${project.voltage.moduleVocCorrectedV.toFixed(2)} V`],
    ["String Voc", `${project.voltage.stringVocV.toFixed(2)} V`],
    ["Voltage utilisation", `${(project.voltage.utilisation * 100).toFixed(1)}%`],
    ["Home-run conductor", `${project.totals.homeRunLengthM.toFixed(2)} m`],
    ["Provisional extensions", `${project.totals.extensionLengthM.toFixed(2)} m`],
    ["Calculated resistive loss", `${project.totals.lossW.toFixed(2)} W`],
    ["Resistance basis", project.resistanceModel.basis],
  ];
  summary.innerHTML = entries.map(([term, detail]) => `<dt>${term}</dt><dd>${detail}</dd>`).join("");
  renderWarnings(project);
  renderTests(tests);
  renderString(project);
  byId("reportPreview").textContent = JSON.stringify({ schema: project.schema, resistanceModel: project.resistanceModel, input: project.input, allocation: project.allocation, voltage: project.voltage, totals: project.totals, warnings: project.warnings }, null, 2);
  const status = byId("engineStatus");
  if (tests.failed > 0) {
    status.className = "status fail";
    status.textContent = `BLOCKED: ${tests.failed} deterministic test(s) failed.`;
  } else {
    status.className = "status pass";
    status.textContent = `ENGINE RUNNING: ${tests.passed} deterministic tests passed.`;
  }
}

function applyLegacyResistanceBoundary(project) {
  return {
    ...project,
    resistanceModel: LEGACY_RESISTANCE_MODEL,
    assumptions: [
      ...project.assumptions.filter((assumption) => (
        assumption !== "Resistance currently uses copper conductor properties only."
      )),
      LEGACY_RESISTANCE_MODEL.warning,
    ],
    warnings: [
      ...project.warnings,
      {
        severity: "warning",
        code: "RESISTANCE_MODEL_LOWER_BOUND",
        message: LEGACY_RESISTANCE_MODEL.warning,
      },
    ],
  };
}

function rebuild() {
  latestTests = runDebugTests();
  try {
    latestProject = applyLegacyResistanceBoundary(
      computeProject(collectInput())
    );
    renderProject(latestProject, latestTests);
  } catch (error) {
    latestProject = null;
    renderTests(latestTests);
    const status = byId("engineStatus");
    status.className = "status fail";
    status.textContent = `INPUT ERROR: ${error.message}`;
    byId("reportPreview").textContent = JSON.stringify({ error: error.message, field: error.field ?? null }, null, 2);
  }
}

document.querySelectorAll("input, select, textarea").forEach((control) => {
  if (control.id === "selectedString") return;
  control.addEventListener("input", rebuild);
  control.addEventListener("change", rebuild);
});
byId("selectedString").addEventListener("change", () => latestProject && renderString(latestProject));
byId("downloadReport").addEventListener("click", () => latestProject && downloadJson("v9-solar-dc-computation-report.json", { project: latestProject, tests: latestTests }));
byId("downloadTests").addEventListener("click", () => latestTests && downloadJson("v9-solar-dc-test-report.json", latestTests));

rebuild();