In this section
- Standalone geodesy · stars / library/standalone.mjs lines 8940–9639
Standalone
A JavaScript module in the library folder of Stars that maps Renewable Energy Planning Database (REPD) master and heavy emitters UK, using SHA-256, and uses data from the GridAtlas repository.
Set aside from the main view: A comment at the top of the file says a tool wrote it. (noise-generated, proposed by noise.py). All set-aside files, with reasons. Nothing was deleted.
Evidence
- line 2 comment: // Generated by the modular star 2026-12-05T23:26:43.596Z. Each export is one family's earliest-seen copy, unchanged; the comment links its source.
geodesystars / library/standalone.mjs · lines 8940–9639 of 12585 (continued from section 1562) · Entry point · pattern segmentConductors (shared by 2 files)
- What it does
- It maps REPD master, heavy emitters UK, notice and substations. Defines 1111 functions or classes, including f1586_invariant, f8767_representativePoint, f8768_voltagesKv, f8772_voltageOf, f8773_ratingsOf. Side effects: changes the web page (DOM); reads or writes files; makes network requests; uses storage (browser storage, DuckDB or Parquet).
- Why it exists in the grid workflow
- Domain terms in the code: substations, 750kV, 400kV, 275kV, 132kV, 66kV.
- Inputs & outputs
- In: data source: gridatlas data; JSON file repd_master.json; JSON file heavy_emitters_uk.json; JSON file notice.json; form fields (user input). Out: canvas drawing. Coordinate systems named: OSGB36 / EPSG:27700 (British National Grid), WGS84 / EPSG:4326. Voltage levels named: 750kV, 400kV, 275kV, 132kV, 66kV, 33kV, 1.5kV, 1500V.
- Downstream impact
- Used directly by 4 files: Code (stars, https://ventusltd.github.io/stars/code.html); Proof (stars); Modular Star Workflow (stars); Testcode — Code Record Page (globalgrid2050, https://globalgrid2050.com/testcode/202609141754/code-record/). Reached from 383 other entry points, including Code Generator — Index Page (code-generator, https://ventusltd.github.io/code-generator/); Generate (code-generator, https://ventusltd.github.io/code-generator/); 404 (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/404.html).
- What it achieves
- It snaps coordinate (`snapCoordinate`), paints cursor (`paintCursor`) and sets plan (`setPlan`). Compiled library of self-contained JavaScript functions that appear in two or more places across Ventusltd code. Its code works with 33 kV, 132 kV and 275 kV. It responds to abort events.
- Why it matters
- Loaded by the Code page at https://ventusltd.github.io/stars/code.html and 1 other page. Run by Proof and Modular Star Workflow.
- Application
- stars · library · JavaScript module
- VEDIC
- MEASURE (GG2050-VEDIC-000001): GridAtlas / Geodesy · Mathematics / Spherical geometry. coordinate_pair, coordinate_pair → distance_km
- VEDIC
- REPRESENT (GG2050-VEDIC-000002): GridAtlas / Geodesy · Computer science / Geometry processing. geojson_geometry → coordinate_pair_or_null
- VEDIC
- VOLTAGE (GG2050-VEDIC-000003): GridAtlas / Geodesy · Computer science / Data normalisation. voltage_properties → kilovolt_list
- Uses
- GlobalGrid2050 — Renewable Energy Planning Database (REPD) Grid Atlas v8 Page (estate URL), Declared Connections (estate URL)
- Used by
- named by URL in Code (estate URL), run by Proof (script call), run by Modular Star Workflow (workflow run), named by URL in Testcode — Code Record Page (estate URL)
- Produces
- f1586_invariant, f8767_representativePoint, f8768_voltagesKv, f8772_voltageOf, f8773_ratingsOf, f8775_parametersOf, f5168_escapeHTML, f8321_suppliedArrivalFields, f8850__anonymous_, f8786_crossing, f8788_legality, f8789_startNodes
- Defines here
- f179432_copyPin, f179588_walkTargets, f7392_zeroStats, f7393_buildStats, f32460_atlasUrlV9_5, f131382_emptyReason, f141931__anonymous_, pieces, line, ring, final, shown, guard, f173952_touchDrag, f31918__anonymous_, f64624_label, f172950__anonymous_, distanceKm, representativePoint, voltagesKv, destinationPoint, initialBearingDeg, f172960__anonymous_, distanceKm, distanceKm, representativePoint, voltagesKv, destinationPoint, initialBearingDeg, copy
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- stars@030ebc202d35959fecd162327892f671d1d9a0cc library/standalone.mjs:8940-9639 · blob fc3d8c8b93e14d4a56b8a26da47071d60bc5bc4d · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, network, storage · domain stage: unknown · users: none · canonical: unknown
+ '. Routing is ' + routing + ', which sets the loop and therefore the '
+ 'transient, and reaches neither the voltage nor the current above.';
return {
numbers: {
module_class: id,
bifaciality_derived: +phi.toFixed(3),
modules_in_series: se,
string_voltage_v: +v.toFixed(1),
headroom_to_rating_v: +head.toFixed(1),
working_current_a: +imp_e.toFixed(2),
short_circuit_current_a: +isc_e.toFixed(2),
design_current_a: +design_a.toFixed(2),
rear_gain_pct: +(rear * 100).toFixed(1),
blocks_drawn: BLOCKS_DRAWN
},
said: said,
how: 'The teeth of each comb are GROUPS of strings, not strings: a tube map '
+ 'does not draw every train, and a dot closer than three radii to its '
+ 'neighbour is the one thing this renderer will not draw. Bifaciality is '
+ 'derived from the sheet\'s own K_Corr at its printed rear-irradiance '
+ 'condition, never assumed, and the sheet publishes rear gain to '
+ TABLE_TOP + '%. The 1.25 factor is applied to cable and protection '
+ 'sizing only, never to a manufacturer\'s input limit. NOT MODELLED, '
+ 'and each one makes the real answer worse: the rise in open-circuit '
+ 'voltage with irradiance, uneven rear light along a string, and every '
+ 'transient effect beyond a first-order V = L I / t. Nothing here '
+ 'carries a coordinate, a length, a bearing or a name.',
sld: { kind:'site', pieces:pieces(), state:s, finalFor:final }
};
}, BOXES);
};
// Family #179432 · element #179432 · 6 places in 1 repositories · https://github.com/Ventusltd/gridatlas/blob/f944f8dcbc09cd09c0895f0126682ec241cd576f/tools/satnav/guidance/ordered-convergence-2km.mjs#L8-L19
export const f179432_copyPin = function copyPin(pin, ids) {
const at = pin?.coordinate;
if (typeof pin?.id !== 'string' || !pin.id || ids.has(pin.id)) {
throw new RangeError('Waypoints need unique IDs');
}
if (!Array.isArray(at) || at.length !== 2 || !at.every(Number.isFinite)
|| Math.abs(at[0]) > 180 || Math.abs(at[1]) > 90) {
throw new RangeError('Expected WGS84 [longitude, latitude]');
}
ids.add(pin.id);
return {id: pin.id, coordinate: [...at]};
};
// Family #179588 · element #179588 · 6 places in 1 repositories · https://github.com/Ventusltd/gridatlas/blob/f944f8dcbc09cd09c0895f0126682ec241cd576f/tools/satnav/walk/direct-convergence-2km.mjs#L9-L13
export const f179588_walkTargets = function walkTargets(pins, from, loop) {
const targets = from ? pins.slice(1) : pins.slice();
if (loop && from && pins.length >= 3) targets.push({id:'return-' + pins[0].id,coordinate:from});
return targets;
};
// Family #7392 · element #7392 · 5 places in 1 repositories · https://github.com/Ventusltd/globalgrid2050/blob/32ae2ded87b626ab573efa6887547f2128c55304/solar-bess-topology-v2/indexforgis-sld-v2.html#L603-L612
export const f7392_zeroStats = function zeroStats(dc_ac_ratio, mods_pallet, mods_container) {
return {
total_blocks: 0, block_ground_area_m2: 0, dc_mwp: 0, ac_mw: 0, module_count: 0,
net_mod_area_m2: 0, net_array_area_m2: 0, gross_site_area_m2: 0,
dc_ac_ratio, pallets: 0, containers: 0, spares_pct: 0,
modules_inc_spares: 0, pallets_inc_spares: 0, containers_inc_spares: 0,
mods_pallet, mods_container,
combiner_boxes_per_inverter: 0, total_combiner_boxes: 0
};
};
// Family #7393 · element #7393 · 5 places in 1 repositories · https://github.com/Ventusltd/globalgrid2050/blob/32ae2ded87b626ab573efa6887547f2128c55304/solar-bess-topology-v2/indexforgis-sld-v2.html#L614-L641
export const f7393_buildStats = function buildStats(opts) {
const { total_blocks, module_count, ac_mw_direct, dc_ac_ratio, physical, combiner_boxes_per_inverter, total_combiner_boxes } = opts;
const { mod_wp, mod_l, mod_w, gcr, gross_factor, mods_pallet, mods_container, spare_pct } = physical;
const dc_mwp = (module_count * mod_wp) / 1_000_000;
const ac_mw = ac_mw_direct != null ? ac_mw_direct : (dc_ac_ratio > 0 ? dc_mwp / dc_ac_ratio : 0);
const net_mod_area_m2 = module_count * mod_l * mod_w;
const net_array_area_m2 = gcr > 0 ? net_mod_area_m2 / gcr : 0;
const gross_site_area_m2 = net_array_area_m2 * gross_factor;
const block_ground_area_m2 = total_blocks > 0 ? net_array_area_m2 / total_blocks : 0;
const pallets = Math.ceil(module_count / mods_pallet);
const containers = Math.ceil(module_count / mods_container);
const modules_inc_spares = Math.ceil(module_count * (1 + spare_pct / 100));
const pallets_inc_spares = Math.ceil(modules_inc_spares / mods_pallet);
const containers_inc_spares = Math.ceil(modules_inc_spares / mods_container);
return {
total_blocks, block_ground_area_m2, dc_mwp, ac_mw, module_count,
net_mod_area_m2, net_array_area_m2, gross_site_area_m2, dc_ac_ratio,
pallets, containers, spares_pct: spare_pct,
modules_inc_spares, pallets_inc_spares, containers_inc_spares,
mods_pallet, mods_container,
combiner_boxes_per_inverter: combiner_boxes_per_inverter || 0,
total_combiner_boxes: total_combiner_boxes || 0
};
};
// Family #32460 · element #32460 · 5 places in 1 repositories · https://github.com/Ventusltd/globalgrid2050/blob/32ae2ded87b626ab573efa6887547f2128c55304/uk_renewables_pipeline/v9.5.1/scripts/plugins/projects-v9-5.js#L42-L53
export const f32460_atlasUrlV9_5 = function atlasUrlV9_5(project) {
if (project.geometry_status !== "valid") return "";
const url = new URL("https://globalgrid2050.com/repd_grid_atlasv8/");
url.searchParams.set("repd_ref", project.repd_ref);
url.searchParams.set("project", project.name);
url.searchParams.set("technology", project.technology);
url.searchParams.set("capacity_mw", project.capacity_mw);
url.searchParams.set("latitude", project.latitude);
url.searchParams.set("longitude", project.longitude);
url.searchParams.set("zoom", "12");
return url.href;
};
// Family #131382 · element #131382 · 5 places in 1 repositories · https://github.com/Ventusltd/galaxies-wafers/blob/5814793812add74605660fa821e6a39b8de80588/iterations/21-dark-pixels/layers-panel.mjs#L104-L116
export const f131382_emptyReason = function emptyReason(st) {
if (!st) return 'loaded; the layer holds no features and records no reason';
const parts = [];
if (typeof st.why === 'string') parts.push(st.why);
else if (typeof st.reason === 'string') parts.push(st.reason);
if (Array.isArray(st.unanchored) && st.unanchored.length) {
const r = st.unanchored[0].from_reason || st.unanchored[0].reason || 'no anchor established';
parts.push(`${st.unanchored.length} found in source, none anchored to a numbered line (${r.replace(/-/g, ' ')})`);
}
if (typeof st.scope === 'string') parts.push('scope: ' + st.scope);
if (typeof st.index_limit === 'string') parts.push('limit: ' + st.index_limit);
return parts.length ? parts.join(' · ') : 'loaded; the layer holds no features and records no reason';
};
// Family #141931 · element #141931 · 5 places in 1 repositories · https://github.com/Ventusltd/globalgrid2050/blob/32ae2ded87b626ab573efa6887547f2128c55304/kuiper-grid/i0093/cartridges/009300000000-kuiper-programs.js#L3762-L4013
export const f141931__anonymous_ = function (root) {
var F = root.FIRE; if (!F || !F.register) return;
/* the kind registers itself, the way the file asks a program to */
var K = root.FIRE_SLD_KIND || (root.FIRE_SLD_KIND = {});
K['site'] = 'site';
var BLOCKS_DRAWN = 8; /* columns across the busbar */
var TEETH = 4; /* string GROUPS drawn per block, not strings */
/* THE BINS, read off published datasheets and carried here as numbers.
phi is DERIVED, not assumed: the sheet prints K_Corr = Isc(BNPI)/Isc(STC)
at a BNPI condition whose rear irradiance is 135 W/m2, so
phi = (K_Corr - 1) / 0.135
and it lands near 0.85 on one family and 0.70 on the other. The class ids
are power-bin labels written here; no maker or product is named. */
var BINS = {
'T645': { voc:45.30, isc:18.31, imp:17.23, beta:-0.25, alpha:0.04, kcorr:1.0945, fuse:35, label:'645 W class' },
'T650': { voc:45.50, isc:18.35, imp:17.27, beta:-0.25, alpha:0.04, kcorr:1.0943, fuse:35, label:'650 W class' },
'T655': { voc:45.70, isc:18.40, imp:17.31, beta:-0.25, alpha:0.04, kcorr:1.0946, fuse:35, label:'655 W class' },
'T660': { voc:45.90, isc:18.45, imp:17.35, beta:-0.25, alpha:0.04, kcorr:1.0943, fuse:35, label:'660 W class' },
'T665': { voc:46.10, isc:18.50, imp:17.39, beta:-0.25, alpha:0.04, kcorr:1.0946, fuse:35, label:'665 W class, the top bin a 0 to +5 W tolerance can deliver' },
'W750': { voc:50.53, isc:18.56, imp:17.70, beta:-0.22, alpha:0.04, kcorr:1.1148, fuse:35, label:'750 W class' },
'W755': { voc:50.56, isc:18.59, imp:17.78, beta:-0.22, alpha:0.04, kcorr:1.1151, fuse:35, label:'755 W class' },
'W760': { voc:50.59, isc:18.62, imp:17.85, beta:-0.22, alpha:0.04, kcorr:1.1149, fuse:35, label:'760 W class' },
'W765': { voc:50.62, isc:18.65, imp:17.93, beta:-0.22, alpha:0.04, kcorr:1.1153, fuse:35, label:'765 W class' },
'W770': { voc:50.65, isc:18.68, imp:18.00, beta:-0.22, alpha:0.04, kcorr:1.1151, fuse:35, label:'770 W class' }
};
var BNPI_REAR = 0.135, TABLE_TOP = 25; /* the sheet's own top rear-gain row */
var V_CEIL = 1500; /* equipment rating, not a standards limit */
var STRING_INPUT_A = 20, MPPT_INPUT_A = 40, STRINGS_PER_MPPT = 2, SIZING = 1.25;
function pieces() {
var P = [];
function line(tag, d, x0, y0, x1, y1) {
P.push({ tag:tag, d:d, kind:'line', x0:x0, y0:y0, x1:x1, y1:y1,
len:Math.hypot(x1 - x0, y1 - y0) });
}
function ring(tag, d, cx, cy, r) {
P.push({ tag:tag, d:d, kind:'ring', cx:cx, cy:cy, r:r, len:2 * Math.PI * r });
}
ring('grid', 0, 0, 0.90, 0.07); /* the grid */
line('interface', 0.07, 0, 0.83, 0, 0.70);
ring('tx', 0.14, 0, 0.655, 0.05); /* down to the collection voltage */
ring('tx', 0.24, 0, 0.575, 0.05);
line('board', 0.34, 0, 0.525, 0, 0.455);
line('bus', 0.42, -0.92, 0.425, 0.92, 0.425); /* the collection busbar */
line('bus', 0.42, -0.92, 0.405, 0.92, 0.405);
var n = BLOCKS_DRAWN;
for (var i = 0; i < n; i++) {
var x = n === 1 ? 0 : -0.82 + 1.64 * i / (n - 1);
var d0 = 0.45 + Math.abs(x); /* further out is further along */
var t = 'b' + i;
line(t, d0, x, 0.395, x, 0.315); /* feeder off the busbar */
ring(t, d0 + 0.09, x, 0.275, 0.035); /* the switch */
ring('sk' + i, d0 + 0.16, x, 0.195, 0.042); /* skid transformer, two rings */
ring('sk' + i, d0 + 0.24, x, 0.118, 0.042);
line(t, d0 + 0.31, x, 0.070, x, 0.030);
ring('inv', d0 + 0.36, x, -0.015, 0.045); /* the inverter, a symbol */
line('dc' + i, d0 + 0.44, x, -0.062, x, -0.150); /* the DC it eats */
var w = 0.072;
line('dc' + i, d0 + 0.50, x - w, -0.150, x + w, -0.150);
/* THE TEETH ARE NOT TAGGED 'pv', AND THAT IS NOT A NAMING WHIM.
sldLayout decides which pieces are SYMBOLS - pieces given a floor of
dots so they read as the thing they are - with a PREFIX match:
t.startsWith('pv'). That was written when a network drawing had one
solar symbol on it. Tagging 32 comb pieces 'pv' claimed 32 symbol
floors, which is 704 of the 896 dots the whole drawing gets, and the
rounding loop cannot take a symbol below its floor. The collection
busbar - the spine of the picture - was left with scraps and did not
appear at all. The blocks hung off nothing. */
for (var j = 0; j < TEETH; j++) { /* teeth are GROUPS of strings */
var tx = x - w + 2 * w * j / (TEETH - 1);
line('sr' + i, d0 + 0.54, tx, -0.150, tx, -0.300);
ring('sr' + i, d0 + 0.62, tx, -0.340, 0.020);
}
}
return P;
}
/* brightness per tag: 0..1 lit, 2 = outside a rating (amber), -1 = dark */
function final(s, tag) {
return tag.map(function (t) {
if (t === 'grid' || t === 'interface' || t === 'bus') return 0.95;
if (t === 'tx' || t === 'board') return 0.90;
if (t.indexOf('sk') === 0) return 0.85;
if (t === 'inv') return s.over_mppt ? 2 : 1; /* the machine's own input */
if (t.indexOf('sr') === 0) return s.over_volts ? 2 : 1; /* the array's voltage */
if (t.indexOf('dc') === 0) return s.over_string ? 2 : 0.9; /* the string's current */
return 0.55;
});
}
var BOXES = [
{ key:'module_class', label:'module class', kind:'choice',
choices:Object.keys(BINS).map(function (k) { return [k, BINS[k].label]; }) },
{ key:'modules_in_series', label:'modules in series', unit:'',
kind:'number', min:20, max:34, step:1 },
{ key:'rear_gain_pct', label:'rear gain', unit:'%',
kind:'number', min:0, max:30, step:1 },
{ key:'site_min_c', label:'assessment temperature', unit:'C',
kind:'number', min:-20, max:0, step:1 },
{ key:'routing', label:'string routing', kind:'choice',
choices:[['leapfrog', 'leapfrog, go and return alongside each other'],
['one-after-another', 'one after another, return down the row']] }
];
/* THE GUARD. Written the way the sibling string program writes one: a value
the engine cannot hold is refused in words, never defaulted.
DEFAULTING IS WORSE THAN REFUSING, and not as a matter of taste. A typed
word where a number belongs becomes NaN, and every verdict below was
written `v > limit`. NaN > 1500 is false, so the garbage came back as
"inside the 1500 V rating by NaN V" - a PASS, in the voice of an answer.
A refusal is read; a default is obeyed. */
var NUMS = { modules_in_series:'modules in series',
rear_gain_pct:'rear gain, in %',
site_min_c:'the assessment temperature, in C' };
var CHOICE = { module_class:Object.keys(BINS),
routing:['leapfrog', 'one-after-another'] };
function shown(v) { return typeof v === 'string' ? '"' + v + '"' : String(v); }
function guard(inp) {
var bad = [], k, v, x;
for (k in inp) {
if (!Object.prototype.hasOwnProperty.call(inp, k)) continue;
v = inp[k];
if (v === undefined || v === null) continue; /* absent = take the default */
if (!NUMS[k] && !CHOICE[k]) {
bad.push('"' + k + '" is not an input this command has, so it was about '
+ 'to be ignored in silence while its default answered in its place; '
+ 'the inputs are '
+ Object.keys(CHOICE).concat(Object.keys(NUMS)).join(', ') + '.');
continue;
}
if (CHOICE[k]) {
if (CHOICE[k].indexOf(v) < 0)
bad.push(k + ' must be one of ' + CHOICE[k].join(', ')
+ '; you typed ' + shown(v) + '.');
continue;
}
x = typeof v === 'number' ? v
: (typeof v === 'string' && v.trim() !== '' ? Number(v) : NaN);
if (!isFinite(x))
bad.push(NUMS[k] + ' must be a number; you typed ' + shown(v) + '.');
}
return bad.slice(0, 6);
}
F.register('site', 'SITE', function (inputs) {
var stopped = guard(inputs || {});
if (stopped.length) {
return {
numbers: { drawn:'nothing', inputs_refused:stopped.length },
refused: true,
said: 'NOTHING IS DRAWN. ' + stopped.join(' ')
+ ' Refusing beats defaulting because a default still produces a '
+ 'confident number nobody asked for, and a value that is not a '
+ 'number produces NaN, which loses every comparison silently and '
+ 'reads as if the design were inside its rating. Change the input '
+ 'named above and fire again.',
how: 'Every value is read and checked before a coordinate is worked '
+ 'out. A refusal is not a failure: it is the engine declining to '
+ 'draw a plant whose arithmetic it cannot stand behind.',
sld: null
};
}
var id = inputs.module_class && BINS[inputs.module_class] ? inputs.module_class : 'T660';
var b = BINS[id];
var se = inputs.modules_in_series === undefined ? 30 : +inputs.modules_in_series;
var rear = (inputs.rear_gain_pct === undefined ? BNPI_REAR * 100 : +inputs.rear_gain_pct) / 100;
var tmin = inputs.site_min_c === undefined ? -10 : +inputs.site_min_c;
var routing = inputs.routing || 'leapfrog';
var phi = (b.kcorr - 1) / BNPI_REAR;
var kb = 1 + phi * rear; /* rear side adds current */
var kt = 1 + b.alpha / 100 * (tmin - 25); /* cold takes a little back */
var isc_e = b.isc * kb * kt, imp_e = b.imp * kb * kt;
var v = se * b.voc * (1 + b.beta / 100 * (tmin - 25));
/* THREE DIFFERENT TESTS, AND THE SIZING FACTOR BELONGS TO ONLY ONE OF THEM.
An earlier draft multiplied the machine's own input limit by 1.25 and so
failed designs that are inside it. 1.25 is a continuous-current factor
for array cable and overcurrent protection; a manufacturer's input limit
is a limit on the current itself. They are reported separately. */
/* `!(x <= limit)` NOT `x > limit`. On every finite number the two agree -
8,000,132 checks on the card, 0 disagreements - so nothing a real design
does changes. They part on NaN: `>` says false and passes it, `!(<=)`
says true and names it. The guard above should make that unreachable;
this is the second lock on the same door, for the day someone edits
the guard. */
var over_volts = !(v <= V_CEIL); /* equipment rating */
var over_string = !(imp_e <= STRING_INPUT_A); /* string input, working current */
var over_mppt = !(isc_e * STRINGS_PER_MPPT <= MPPT_INPUT_A); /* the machine's input */
var design_a = SIZING * isc_e; /* what cable and OCPD are sized to */
var over_fuse = !(design_a <= b.fuse); /* the sheet's max series fuse */
var s = { over_volts:over_volts, over_string:over_string, over_mppt:over_mppt };
var head = V_CEIL - v;
var said =
'The whole plant in one drawing: grid, interface, one transformer to the '
+ 'collection busbar, and ' + BLOCKS_DRAWN + ' blocks hanging off it. '
+ se + ' of the ' + b.label + ' in series reaches ' + v.toFixed(1)
+ ' V at ' + tmin + ' C, '
+ (over_volts ? 'OVER the ' + V_CEIL + ' V equipment rating by '
+ (-head).toFixed(1) + ' V'
: 'inside the ' + V_CEIL + ' V rating by ' + head.toFixed(1) + ' V')
+ (!over_volts && head < 25 ? ' - which at a 0 to +5 W tolerance is not a margin, '
+ 'because the module that arrives can be the top bin' : '')
+ '. At ' + (rear * 100).toFixed(1) + '% rear gain, with a bifaciality of '
+ phi.toFixed(3) + ' taken from this sheet\'s own published row, the string '
+ 'works at ' + imp_e.toFixed(2) + ' A and shorts at ' + isc_e.toFixed(2) + ' A: '
+ (over_string ? 'OVER the ' + STRING_INPUT_A + ' A string input'
: 'inside the ' + STRING_INPUT_A + ' A string input') + ', '
+ (over_mppt ? 'OVER the ' + MPPT_INPUT_A + ' A machine input on ' + STRINGS_PER_MPPT
+ ' strings' : 'inside the ' + MPPT_INPUT_A + ' A machine input') + ', '
+ 'and cable and protection size to ' + design_a.toFixed(2) + ' A against a '
+ b.fuse + ' A maximum series fuse'
+ (over_fuse ? ' - OVER it' : '')
+ '. Routing is ' + routing + ', which sets the loop and therefore the '
+ 'transient, and reaches neither the voltage nor the current above.';
return {
numbers: {
module_class: id,
bifaciality_derived: +phi.toFixed(3),
modules_in_series: se,
string_voltage_v: +v.toFixed(1),
headroom_to_rating_v: +head.toFixed(1),
working_current_a: +imp_e.toFixed(2),
short_circuit_current_a: +isc_e.toFixed(2),
design_current_a: +design_a.toFixed(2),
rear_gain_pct: +(rear * 100).toFixed(1),
blocks_drawn: BLOCKS_DRAWN
},
said: said,
how: 'The teeth of each comb are GROUPS of strings, not strings: a tube map '
+ 'does not draw every train, and a dot closer than three radii to its '
+ 'neighbour is the one thing this renderer will not draw. Bifaciality is '
+ 'derived from the sheet\'s own K_Corr at its printed rear-irradiance '
+ 'condition, never assumed, and the sheet publishes rear gain to '
+ TABLE_TOP + '%. The 1.25 factor is applied to cable and protection '
+ 'sizing only, never to a manufacturer\'s input limit. NOT MODELLED, '
+ 'and each one makes the real answer worse: the rise in open-circuit '
+ 'voltage with irradiance, uneven rear light along a string, and every '
+ 'transient effect beyond a first-order V = L I / t. Nothing here '
+ 'carries a coordinate, a length, a bearing or a name.',
sld: { kind:'site', pieces:pieces(), state:s, finalFor:final }
};
}, BOXES);
};
// Family #173952 · element #173952 · 5 places in 1 repositories · https://github.com/Ventusltd/globalgrid2050/blob/32ae2ded87b626ab573efa6887547f2128c55304/automation/v929_preview/browser.mjs#L82-L86
export const f173952_touchDrag = async function touchDrag(session,{x,y,dx=0,dy=0}){
await session.send('Input.dispatchTouchEvent',{type:'touchStart',touchPoints:[{x,y,id:1,radiusX:2,radiusY:2,force:1}]});
for(let step=1;step<=10;step++){await session.send('Input.dispatchTouchEvent',{type:'touchMove',touchPoints:[{x:x+dx*step/10,y:y+dy*step/10,id:1,radiusX:2,radiusY:2,force:1}]});await new Promise(r=>setTimeout(r,16));}
await session.send('Input.dispatchTouchEvent',{type:'touchEnd',touchPoints:[]});
};
// Family #31918 · element #31918 · 78 places in 1 repositories · https://github.com/Ventusltd/globalgrid2050/blob/32ae2ded87b626ab573efa6887547f2128c55304/uk_renewables_pipeline/202609051156/tests/browser_smoke_v9_6_1.mjs#L180-L183
export const f31918__anonymous_ = (wrap) => {
wrap.scrollLeft = wrap.scrollWidth;
return wrap.scrollLeft;
};
// Family #64624 · element #64624 · 43 places in 1 repositories · https://github.com/Ventusltd/gridatlas/blob/f944f8dcbc09cd09c0895f0126682ec241cd576f/atlas/cartridges/202609070913-sld-sandbox-v9-8.js#L7481-L7485
export const f64624_label = function label(link, km) {
const gb = String(link.gb_converter || 'GB end').replace(/ (Static Inverter Plant|Converter Station|Substation)$/i, '');
const far = String(link.far_converter || 'far end').replace(/^HVDC /i, '');
return `${km}km ← ${gb} ──[ ${link.link} ${link.straight_line_km} km ]── ${far} → ${km}km`;
};
// Family #172950 · element #172950 · 7 places in 1 repositories · https://github.com/Ventusltd/gridatlas/blob/f944f8dcbc09cd09c0895f0126682ec241cd576f/atlas/cartridges/202611161645-sld-sandbox-v9-8.js#L5-L149
export const f172950__anonymous_ = () => {
/**
* Module: geodesy
*
* Extracted verbatim (formula and constant unchanged) from
* gridatlas/atlas/modules/202609011950-geodesy.js.
*
* One Earth radius for the whole estate, and the three operations every
* measurement here is built from. This existed three times tonight - in
* the sandbox, in the substation cartridge and in the data repository -
* which is exactly how two of them end up on different radii without
* anyone noticing.
*
* Radius 6378.137 km, matching Ventusltd/grid-distance-maths. Haversine.
* No projection, no turf, no second radius for geometry.
*
* Pure functions. No DOM, no network, no state.
*
* CHANGED: source wraps this in `(() => { ... NS.geodesy = Object.freeze({...}) })()`
* and registers itself on `window.__GRIDATLAS_MODULES__.geodesy`. That
* closure/global-namespace wiring is removed; every function below is
* otherwise byte-identical to the source, including the atan2 argument
* order that the source's own comment insists on for numerical parity
* with ventus-corev8engine.js haversine() (see distanceKm below).
*/
const EARTH_RADIUS_KM = 6378.137;
const DEG = Math.PI / 180;
function distanceKm(lon1, lat1, lon2, lat2) {
const dLat = (lat2 - lat1) * DEG;
const dLon = (lon2 - lon1) * DEG;
const a = Math.sin(dLat / 2) ** 2
+ Math.cos(lat1 * DEG) * Math.cos(lat2 * DEG) * Math.sin(dLon / 2) ** 2;
/* atan2, in this operand order, because that is the form every version
of this estate has shipped - ventus-corev8engine.js haversine() and
every cartridge carried from it.
-------------------------------------------------------------------
The extraction wrote 2 * R * asin(sqrt(a)) instead. Algebraically the
same; numerically one unit in the last place apart, which the
all-versions proof caught on West Burton Solar to Cottam:
7.050150827184836 shipped, 7.050150827184837 from the module. It is
1e-15 km and changes no figure any reader will ever see - and it is
still wrong, because the claim being made is PARITY. A module that is
nearly the incumbent is a module that has to be argued about every
time a digit differs. */
return EARTH_RADIUS_KM * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
}
/* A polygon reduces to the mean of its outer ring, not its first corner.
A substation drawn as a compound outline would otherwise be measured
from whichever vertex the mapper happened to start at.
Point, Polygon and MultiPolygon, and NOTHING ELSE. The first draft of
this module accepted any nested coordinate array and so returned a
mean for a LineString where the incumbent returns null; the parity
proof caught it against the live cartridge. Extraction is not the
moment to change behaviour, so the behaviour is pinned here and any
widening becomes its own version with its own reasoning.
One deliberate difference, on malformed input only: this returns null
where the incumbent would throw on a Point with no coordinates. No
real geometry reaches that path, and a proof asserts it. */
function representativePoint(geometry) {
if (!geometry) return null;
const { type, coordinates } = geometry;
if (type === 'Point') {
return Array.isArray(coordinates) && coordinates.length >= 2
? [coordinates[0], coordinates[1]] : null;
}
const ring = type === 'Polygon' ? coordinates && coordinates[0]
: type === 'MultiPolygon' ? coordinates && coordinates[0] && coordinates[0][0]
: null;
if (!Array.isArray(ring) || !ring.length) return null;
let sumLon = 0;
let sumLat = 0;
for (const point of ring) {
sumLon += point[0];
sumLat += point[1];
}
return [sumLon / ring.length, sumLat / ring.length];
}
/* OpenStreetMap's `voltage` is VOLTS at every magnitude, and a feature
may carry several separated by a semicolon. Magnitude is not the unit:
750 is a DC traction supply at a railway depot, not 750 kV. An audit
of the served payload found 229 features (3.95%) carrying a token
below 1,000, every one of which had been misread. An explicit `kv`
property is already kilovolts and is trusted as such. */
function voltagesKv(properties) {
if (!properties) return [];
const out = [];
const explicit = properties.kv ?? properties.KV;
if (explicit != null && String(explicit).trim() !== '') {
for (const token of String(explicit).match(/\d+(?:\.\d+)?/g) || []) {
const value = Number(token);
if (Number.isFinite(value) && value > 0) out.push(value);
}
}
const volts = properties.voltage ?? properties.VOLTAGE;
if (volts != null) {
for (const token of String(volts).match(/\d+(?:\.\d+)?/g) || []) {
const value = Number(token);
if (Number.isFinite(value) && value > 0) out.push(value / 1000);
}
}
return [...new Set(out)].sort((a, b) => b - a);
}
/* Projection and bearing, carried in from the sandbox verbatim.
----------------------------------------------------------------------
The deep scan found the body carrying a SECOND geodesy section - "the
geodesy the layout needs, all on R_ATLAS" - four hundred lines away
from the first. Two geodesies in one file, on a constant that must
never differ, is the configuration that produced the divergence the
all-versions proof caught. Both belong here, on the one radius, and
the body now delegates rather than defining.
The bodies below are the incumbent's, character for character apart
from the radius identifier, so parity is a property of the move rather
than something to argue about afterwards. */
function destinationPoint(lon, lat, km, bearingDeg) {
const ad = km / EARTH_RADIUS_KM;
const brg = bearingDeg * DEG;
const p1 = lat * DEG;
const p2 = Math.asin(Math.sin(p1) * Math.cos(ad)
+ Math.cos(p1) * Math.sin(ad) * Math.cos(brg));
const l2 = lon * DEG + Math.atan2(
Math.sin(brg) * Math.sin(ad) * Math.cos(p1),
Math.cos(ad) - Math.sin(p1) * Math.sin(p2));
return [l2 / DEG, p2 / DEG];
}
function initialBearingDeg(lon1, lat1, lon2, lat2) {
const p1 = lat1 * DEG; const p2 = lat2 * DEG;
const dl = (lon2 - lon1) * DEG;
const y = Math.sin(dl) * Math.cos(p2);
const x = Math.cos(p1) * Math.sin(p2) - Math.sin(p1) * Math.cos(p2) * Math.cos(dl);
return (Math.atan2(y, x) / DEG + 360) % 360;
}
const schema = 'gridatlas.module.geodesy.v1';
return distanceKm;
};
// Family #172960 · element #172960 · 7 places in 1 repositories · https://github.com/Ventusltd/gridatlas/blob/f944f8dcbc09cd09c0895f0126682ec241cd576f/atlas/cartridges/202611161645-sld-sandbox-v9-8.js#L3-L273
export const f172960__anonymous_ = () => {
'use strict';
const distanceKm = (() => {
/**
* Module: geodesy
*
* Extracted verbatim (formula and constant unchanged) from
* gridatlas/atlas/modules/202609011950-geodesy.js.
*
* One Earth radius for the whole estate, and the three operations every
* measurement here is built from. This existed three times tonight - in
* the sandbox, in the substation cartridge and in the data repository -
* which is exactly how two of them end up on different radii without
* anyone noticing.
*
* Radius 6378.137 km, matching Ventusltd/grid-distance-maths. Haversine.
* No projection, no turf, no second radius for geometry.
*
* Pure functions. No DOM, no network, no state.
*
* CHANGED: source wraps this in `(() => { ... NS.geodesy = Object.freeze({...}) })()`
* and registers itself on `window.__GRIDATLAS_MODULES__.geodesy`. That
* closure/global-namespace wiring is removed; every function below is
* otherwise byte-identical to the source, including the atan2 argument
* order that the source's own comment insists on for numerical parity
* with ventus-corev8engine.js haversine() (see distanceKm below).
*/
const EARTH_RADIUS_KM = 6378.137;
const DEG = Math.PI / 180;
function distanceKm(lon1, lat1, lon2, lat2) {
const dLat = (lat2 - lat1) * DEG;
const dLon = (lon2 - lon1) * DEG;
const a = Math.sin(dLat / 2) ** 2
+ Math.cos(lat1 * DEG) * Math.cos(lat2 * DEG) * Math.sin(dLon / 2) ** 2;
/* atan2, in this operand order, because that is the form every version
of this estate has shipped - ventus-corev8engine.js haversine() and
every cartridge carried from it.
-------------------------------------------------------------------
The extraction wrote 2 * R * asin(sqrt(a)) instead. Algebraically the
same; numerically one unit in the last place apart, which the
all-versions proof caught on West Burton Solar to Cottam:
7.050150827184836 shipped, 7.050150827184837 from the module. It is
1e-15 km and changes no figure any reader will ever see - and it is
still wrong, because the claim being made is PARITY. A module that is
nearly the incumbent is a module that has to be argued about every
time a digit differs. */
return EARTH_RADIUS_KM * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
}
/* A polygon reduces to the mean of its outer ring, not its first corner.
A substation drawn as a compound outline would otherwise be measured
from whichever vertex the mapper happened to start at.
Point, Polygon and MultiPolygon, and NOTHING ELSE. The first draft of
this module accepted any nested coordinate array and so returned a
mean for a LineString where the incumbent returns null; the parity
proof caught it against the live cartridge. Extraction is not the
moment to change behaviour, so the behaviour is pinned here and any
widening becomes its own version with its own reasoning.
One deliberate difference, on malformed input only: this returns null
where the incumbent would throw on a Point with no coordinates. No
real geometry reaches that path, and a proof asserts it. */
function representativePoint(geometry) {
if (!geometry) return null;
const { type, coordinates } = geometry;
if (type === 'Point') {
return Array.isArray(coordinates) && coordinates.length >= 2
? [coordinates[0], coordinates[1]] : null;
}
const ring = type === 'Polygon' ? coordinates && coordinates[0]
: type === 'MultiPolygon' ? coordinates && coordinates[0] && coordinates[0][0]
: null;
if (!Array.isArray(ring) || !ring.length) return null;
let sumLon = 0;
let sumLat = 0;
for (const point of ring) {
sumLon += point[0];
sumLat += point[1];
}
return [sumLon / ring.length, sumLat / ring.length];
}
/* OpenStreetMap's `voltage` is VOLTS at every magnitude, and a feature
may carry several separated by a semicolon. Magnitude is not the unit:
750 is a DC traction supply at a railway depot, not 750 kV. An audit
of the served payload found 229 features (3.95%) carrying a token
below 1,000, every one of which had been misread. An explicit `kv`
property is already kilovolts and is trusted as such. */
function voltagesKv(properties) {
if (!properties) return [];
const out = [];
const explicit = properties.kv ?? properties.KV;
if (explicit != null && String(explicit).trim() !== '') {
for (const token of String(explicit).match(/\d+(?:\.\d+)?/g) || []) {
const value = Number(token);
if (Number.isFinite(value) && value > 0) out.push(value);
}
}
const volts = properties.voltage ?? properties.VOLTAGE;
if (volts != null) {
for (const token of String(volts).match(/\d+(?:\.\d+)?/g) || []) {
const value = Number(token);
if (Number.isFinite(value) && value > 0) out.push(value / 1000);
}
}
return [...new Set(out)].sort((a, b) => b - a);
}
/* Projection and bearing, carried in from the sandbox verbatim.
----------------------------------------------------------------------
The deep scan found the body carrying a SECOND geodesy section - "the
geodesy the layout needs, all on R_ATLAS" - four hundred lines away
from the first. Two geodesies in one file, on a constant that must
never differ, is the configuration that produced the divergence the
all-versions proof caught. Both belong here, on the one radius, and
the body now delegates rather than defining.
The bodies below are the incumbent's, character for character apart
from the radius identifier, so parity is a property of the move rather
than something to argue about afterwards. */
function destinationPoint(lon, lat, km, bearingDeg) {
const ad = km / EARTH_RADIUS_KM;
const brg = bearingDeg * DEG;
const p1 = lat * DEG;
const p2 = Math.asin(Math.sin(p1) * Math.cos(ad)
+ Math.cos(p1) * Math.sin(ad) * Math.cos(brg));
const l2 = lon * DEG + Math.atan2(
Math.sin(brg) * Math.sin(ad) * Math.cos(p1),
Math.cos(ad) - Math.sin(p1) * Math.sin(p2));
return [l2 / DEG, p2 / DEG];
}
function initialBearingDeg(lon1, lat1, lon2, lat2) {
const p1 = lat1 * DEG; const p2 = lat2 * DEG;
const dl = (lon2 - lon1) * DEG;
const y = Math.sin(dl) * Math.cos(p2);
const x = Math.cos(p1) * Math.sin(p2) - Math.sin(p1) * Math.cos(p2) * Math.cos(dl);
return (Math.atan2(y, x) / DEG + 360) % 360;
}
const schema = 'gridatlas.module.geodesy.v1';
return distanceKm;
})();
/** Actual-computation receipts, shared by Node and browsers. No DOM or network. */
const schema = 'ventus.grid-compute-receipt.v1';
const copy = value => JSON.parse(JSON.stringify(value));
const finite = value => typeof value === 'number' && Number.isFinite(value);
const located = point => point && finite(point.lon) && finite(point.lat)