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 1 more file

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

700 lines of CSS and JavaScript from solar-electrical-topology-analysis-engine-text-based, in 2 files. Topic: Solar and storage design. Section 253 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. Model electrical · solar-electrical-topology-analysis-engine-text-based / v8-leapfrog/model.js lines 488–749
  2. Solar Electrical Topology Analysis Engine Text Based — V8 Leapfrog Style Sheet render · solar-electrical-topology-analysis-engine-text-based / v8-leapfrog/styles.css lines 1–438

Model

A JavaScript module in Solar Electrical Topology Analysis Engine Text Based that parses bands (`parseBands`), builds strings (`buildStrings`) and sums strings (`sumStrings`). Served with the page at https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v8-leapfrog/.

electricalsolar-electrical-topology-analysis-engine-text-based / v8-leapfrog/model.js · lines 488–749 of 749 (continued from section 252) · Entry point · pattern runGoldenTests (shared by 2 files)

What it does
It calculates its inputs. Defines 18 functions or classes, including buildModel, asNumber, atLeast, parseNumberList, parseBands.
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.
Downstream impact
Used directly by 4 files: V8 Model Test (solar-electrical-topology-analysis-engine-text-based); 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/); Tests (solar-electrical-topology-analysis-engine-text-based, https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v8-leapfrog/tests.html); V8 Tests Workflow (solar-electrical-topology-analysis-engine-text-based). Reached from 135 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
It parses number list (`parseNumberList`), parses bands (`parseBands`) and builds strings (`buildStrings`). Defines `buildModel`, `asNumber`, `atLeast` and 15 more.
Why it matters
Loaded by the V8 Leapfrog page at https://ventusltd.github.io/solar-electrical-topology-analysis-engine-text-based/v8-leapfrog/. Checked by 3 tests, including V8 Model Test.
Application
solar-electrical-topology-analysis-engine-text-based · v8-leapfrog · JavaScript module
Uses
none found
Used by
required by V8 Model Test (require), loaded by Solar Electrical Topology Analysis Engine Text Based — V8 Leapfrog Page (script src), loaded by Tests (script src), run by V8 Tests Workflow (workflow run)
Produces
buildModel, asNumber, atLeast, parseNumberList, parseBands, normalise, modulePitchM, rowSpanM, cableResistancePerM, sequentialPolarities, leadFeasibility, buildStrings
Defines here
scenarioStudies, nearlyEqual, testResult, runGoldenTests
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/model.js:488-749 · blob 93b9745e2be06d90f3a285e19173ee280f3c1390 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: transform · effects: none found · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
            archetype.theoreticalSavingM,
          availableSavingMPerArchetypeInverter:
            lead.feasible
              ? archetype.theoreticalSavingM
              : null,
          theoreticalSiteSavingKm:
            siteSavingM / 1000,
          availableSiteSavingKm:
            lead.feasible
              ? siteSavingM / 1000
              : null,
          theoreticalPowerLossSavingWPerArchetypeInverter:
            archetype.theoreticalPowerLossSavingW,
          availablePowerLossSavingWPerArchetypeInverter:
            lead.feasible
              ? archetype.theoreticalPowerLossSavingW
              : null,
          theoreticalSitePowerLossSavingKW:
            sitePowerLossSavingW / 1000,
          availableSitePowerLossSavingKW:
            lead.feasible
              ? sitePowerLossSavingW / 1000
              : null,
          theoreticalSiteInstalledCostSaving:
            siteInstalledCostSaving,
          availableSiteInstalledCostSaving:
            lead.feasible
              ? siteInstalledCostSaving
              : null
        },
        strings
      };
    }

    function scenarioStudies(raw = {}) {
      const input = normalise(raw);

      return input.scenarioDistancesM.map((distanceM) => {
        const study = calculate(input, distanceM);

        return {
          distanceM,
          feasible: study.feasibility.feasible,
          basePairMPerArchetypeInverter:
            study.totals
              .leapfrogExternalMPerArchetypeInverter,
          sequentialExternalMPerArchetypeInverter:
            study.totals
              .sequentialExternalMPerArchetypeInverter,
          leapfrogExternalMPerArchetypeInverter:
            study.totals
              .leapfrogExternalMPerArchetypeInverter,
          theoreticalSavingMPerArchetypeInverter:
            study.totals
              .theoreticalSavingMPerArchetypeInverter,
          availableSavingMPerArchetypeInverter:
            study.totals
              .availableSavingMPerArchetypeInverter,
          theoreticalSiteSavingKm:
            study.totals.theoreticalSiteSavingKm,
          availableSiteSavingKm:
            study.totals.availableSiteSavingKm,
          theoreticalPowerLossSavingKWPerArchetypeInverter:
            study.totals
              .theoreticalPowerLossSavingWPerArchetypeInverter /
            1000,
          availablePowerLossSavingKWPerArchetypeInverter:
            study.totals
              .availablePowerLossSavingWPerArchetypeInverter ==
            null
              ? null
              : study.totals
                  .availablePowerLossSavingWPerArchetypeInverter /
                1000
        };
      });
    }

    function nearlyEqual(actual, expected, tolerance = 1e-9) {
      return Math.abs(actual - expected) <= tolerance;
    }

    function testResult(name, pass, actual, expected) {
      return {
        name,
        pass,
        actual,
        expected
      };
    }

    function runGoldenTests() {
      const defaultStudy = calculate(DEFAULTS);
      const distance30Study = calculate({
        ...DEFAULTS,
        inverterDistanceM: 30
      });
      const leads12Study = calculate({
        ...DEFAULTS,
        positiveFactoryLeadM: 1.2,
        negativeFactoryLeadM: 1.2
      });
      const leads14Study = calculate({
        ...DEFAULTS,
        positiveFactoryLeadM: 1.4,
        negativeFactoryLeadM: 1.4
      });
      const westString = defaultStudy.strings.find(
        (string) => string.face === 'W'
      );
      const tests = [
        testResult(
          'Default module pitch is 1.323 m',
          nearlyEqual(defaultStudy.geometry.modulePitchM, 1.323),
          defaultStudy.geometry.modulePitchM,
          1.323
        ),
        testResult(
          'Default row span is 39.67 m',
          nearlyEqual(defaultStudy.geometry.rowSpanM, 39.67),
          defaultStudy.geometry.rowSpanM,
          39.67
        ),
        testResult(
          'Default leapfrog reach is two module pitches',
          nearlyEqual(
            defaultStudy.geometry.requiredLeapfrogReachM,
            2.646
          ),
          defaultStudy.geometry.requiredLeapfrogReachM,
          2.646
        ),
        testResult(
          'Default catalogue leads fail the reach screen',
          !defaultStudy.feasibility.feasible,
          defaultStudy.feasibility.status,
          'INFEASIBLE_LENGTH_SCREEN'
        ),
        testResult(
          'Two 1.2 m leads fail by 0.246 m',
          nearlyEqual(
            leads12Study.feasibility.marginM,
            -0.246
          ),
          leads12Study.feasibility.marginM,
          -0.246
        ),
        testResult(
          'Two 1.4 m leads pass the reach screen',
          leads14Study.feasibility.feasible,
          leads14Study.feasibility.status,
          'FEASIBLE_LENGTH_SCREEN'
        ),
        testResult(
          'Default archetype contains 24 strings',
          defaultStudy.totals.stringsPerArchetypeInverter === 24,
          defaultStudy.totals.stringsPerArchetypeInverter,
          24
        ),
        testResult(
          'Theoretical saving is 952.08 m per archetype inverter',
          nearlyEqual(
            defaultStudy.totals
              .theoreticalSavingMPerArchetypeInverter,
            952.08,
            1e-6
          ),
          defaultStudy.totals
            .theoreticalSavingMPerArchetypeInverter,
          952.08
        ),
        testResult(
          'Fleet saving uses 18,918 strings',
          nearlyEqual(
            defaultStudy.totals.theoreticalSiteSavingKm,
            750.47706,
            1e-8
          ),
          defaultStudy.totals.theoreticalSiteSavingKm,
          750.47706
        ),
        testResult(
          'Saving is independent of inverter distance',
          nearlyEqual(
            defaultStudy.totals
              .theoreticalSavingMPerArchetypeInverter,
            distance30Study.totals
              .theoreticalSavingMPerArchetypeInverter
          ),
          distance30Study.totals
            .theoreticalSavingMPerArchetypeInverter,
          defaultStudy.totals
            .theoreticalSavingMPerArchetypeInverter
        ),
        testResult(
          'West sequential polarity remains mirrored',
          Boolean(
            westString &&
            westString.sequential.positiveM ===
              westString.farRouteM &&
            westString.sequential.negativeM ===
              westString.nearRouteM
          ),
          westString
            ? `${westString.sequential.positiveM}/` +
              `${westString.sequential.negativeM}`
            : 'missing',
          westString
            ? `${westString.farRouteM}/` +
              `${westString.nearRouteM}`
            : 'west string'
        ),
        testResult(
          'Leapfrog terminals share the near route',
          defaultStudy.strings.every(
            (string) =>
              string.leapfrog.positiveM ===
                string.nearRouteM &&
              string.leapfrog.negativeM ===
                string.nearRouteM
          ),
          defaultStudy.strings[0]
            ? `${defaultStudy.strings[0].leapfrog.positiveM}/` +
              `${defaultStudy.strings[0].leapfrog.negativeM}`
            : 'missing',
          defaultStudy.strings[0]
            ? defaultStudy.strings[0].nearRouteM
            : 'near route'
        ),
        testResult(
          'Infeasible default does not claim available saving',
          defaultStudy.totals.availableSiteSavingKm === null,
          defaultStudy.totals.availableSiteSavingKm,
          null
        )
      ];

      return {
        version: VERSION,
        passed: tests.filter((test) => test.pass).length,
        total: tests.length,
        allPassed: tests.every((test) => test.pass),
        tests
      };
    }

    return Object.freeze({
      VERSION,
      DEFAULTS,
      COPPER_ALPHA_20,
      normalise,
      modulePitchM,
      rowSpanM,
      cableResistancePerM,
      leadFeasibility,
      buildStrings,
      calculate,
      scenarioStudies,
      runGoldenTests
    });
  }
);

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 1–438 of 740 · 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:1-438 · 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
:root {
  color-scheme: dark;
  --bg: #05070a;
  --panel: #0b121a;
  --panel-2: #101a25;
  --line: #263747;
  --line-2: #385068;
  --text: #eef7ff;
  --muted: #97aabd;
  --cyan: #27d8ff;
  --amber: #ffb347;
  --green: #53e28b;
  --red: #ff6170;
  --purple: #bd96ff;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(
    circle at 72% 0,
    #102b41 0,
    #05070a 42%
  );
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    Arial,
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 26px 28px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 7, 11, 0.84);
}

.kicker {
  color: var(--cyan);
  font: 900 12px ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 7px 0;
  font-size: clamp(31px, 4.7vw, 54px);
  line-height: 1.02;
}

.topbar p {
  max-width: 980px;
  margin: 0;
  color: #adc0cf;
  line-height: 1.48;
}

.status-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 235px;
}

.status-badge {
  padding: 10px 13px;
  border: 1px solid #255e3d;
  background: #062014;
  color: var(--green);
  text-align: center;
  font: 900 11px ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.07em;
}

.status-badge.testing {
  border-color: #3b5064;
  background: #0b141d;
  color: #b8d8ec;
}

.status-badge.error {
  border-color: #7b2730;
  background: #2a0b0f;
  color: #ffb8bf;
}

.navlinks {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.navlinks a {
  padding: 7px 9px;
  border: 1px solid var(--line-2);
  background: #09131d;
  color: #c7e6f4;
  text-decoration: none;
  font: 800 11px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.navlinks a:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.reliance {
  margin: 14px 18px 0;
  padding: 13px 15px;
  border: 1px solid #81581a;
  background: #281b05;
  color: #ffdda9;
  font-size: 13px;
  line-height: 1.5;
}

.reliance strong {
  display: block;
  margin-bottom: 3px;
  color: var(--amber);
  letter-spacing: 0.04em;
}

.layout {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 15px;
  padding: 15px 18px 28px;
}

.controls {
  min-width: 0;
}

.panel,
.workbench,
.section {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #111a25, #080d13);
}

.panel {
  padding: 13px;
  margin-bottom: 11px;
}

.panel h2,
.section h2 {
  margin: 0;
  font-size: 16px;
}

.panel h2 {
  margin-bottom: 8px;
}

.panel p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.panel label {
  display: grid;
  grid-template-columns: 1fr 148px;
  gap: 10px;
  align-items: center;
  padding: 5px 0;
  color: #d6e7f4;
  font-size: 12px;
}

.panel input,
.panel select {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #34495d;
  background: #05090e;
  color: var(--text);
  font: 800 12px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.panel input:focus,
.panel select:focus {
  outline: 1px solid var(--cyan);
  border-color: var(--cyan);
}

.note,
.provenance {
  margin-top: 8px;
  padding: 9px 10px;
  border-left: 4px solid var(--cyan);
  background: #061923;
  color: #b9cfdd;
  font-size: 11px;
  line-height: 1.5;
}

.provenance strong {
  color: #d8f5ff;
}

.formula {
  padding: 10px;
  border: 1px solid var(--line);
  background: #03070b;
  color: #d7ecff;
  white-space: pre-wrap;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 10px;
}

button,
.button {
  display: inline-flex;
  min-height: 41px;
  align-items: center;
  justify-content: center;
  padding: 9px 11px;
  border: 1px solid #35506a;
  background: #111d29;
  color: #deecf8;
  text-decoration: none;
  cursor: pointer;
  font: 900 11px ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

button:hover,
.button:hover {
  border-color: var(--cyan);
}

button.primary,
.button.primary {
  border-color: #0ea9c7;
  background: #06495a;
  color: #d7fbff;
}

.workbench {
  min-width: 0;
  padding: 13px;
}

.tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tab {
  min-height: 35px;
  padding: 7px 10px;
  letter-spacing: 0;
  text-transform: none;
}

.tab.active {
  border-color: var(--cyan);
  background: var(--cyan);
  color: #061017;
}

.tabpane {
  display: none;
}

.tabpane.active {
  display: block;
}

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

.metrics article,
.compare-card {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  background: #060b10;
}

.metrics span,
.compare-card span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.metrics strong,
.compare-card strong {
  display: block;
  margin: 7px 0 3px;
  overflow-wrap: anywhere;
  font: 900 19px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.metrics small,
.compare-card small {
  color: #8fa4b8;
  line-height: 1.4;
}

.green {
  color: var(--green);
}

.amber {
  color: var(--amber);
}

.red {
  color: var(--red);
}

.cyan {
  color: var(--cyan);
}

.purple {
  color: var(--purple);
}

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

.compare-card.sequential {
  border-top: 3px solid var(--red);
}

.compare-card.leapfrog {
  border-top: 3px solid var(--green);
}

.compare-card.difference {
  border-top: 3px solid var(--amber);
}

.section {
  margin-top: 10px;
  background: #060a0f;
}

.section > h2 {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--cyan);
}

.section-body {
  padding: 12px;
  color: #c5d6e5;
  font-size: 13px;
  line-height: 1.65;
}

.section-body p:first-child {
  margin-top: 0;
}

.section-body p:last-child {
  margin-bottom: 0;
}

.table-wrap {
  overflow: auto;
  max-height: 560px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font: 11px ui-monospace, SFMono-Regular, Consolas, monospace;
}

th,
td {
  padding: 8px 9px;
  border-bottom: 1px solid #203041;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0d1823;
  color: #b7ebff;
}