Skip to content

[235] Rename unclear identifiers across frontend and backend (high-value pass) - #236

Draft
CarsonDavis wants to merge 12 commits into
developmentfrom
feature/235-rename-unclear-identifiers
Draft

[235] Rename unclear identifiers across frontend and backend (high-value pass)#236
CarsonDavis wants to merge 12 commits into
developmentfrom
feature/235-rename-unclear-identifiers

Conversation

@CarsonDavis

@CarsonDavis CarsonDavis commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Closes #235

What this is

A readability pass over src/essence and API/: ~230 identifier renames across four passes, behavior-preserving throughout, with one deliberate schema exception (the tileFormat config key, which ships with a backward-compat alias — see its section below). Focused on the highest-leverage cases per the issue — single-letter or misleading names holding domain objects, the config-vs-instance ambiguity (s / layerObj / l all meaning "layer" in different senses), and names people already had to explain in review — not an exhaustive sweep of every loop index.

How the list was built

Pass 1 — the base inventory. Eight area-scoped inventory passes collected 199 candidates; a synthesis pass unified them under one vocabulary (one concept = one name everywhere); an adversarial review then attacked every entry (string coupling to selectors/DOM ids, persisted-schema property keys, shadowing, misread meaning, low value) and rejected or amended the weak ones. 151 renames survived review; 150 were applied (one was skipped during application because two approved renames in DrawTool_Files.js turned out to be mutually exclusive — the stronger one was kept). Three further passes followed; each has its own section below.

Second review pass (post-PR)

After the PR was opened, the full diff went through a second adversarial review: 8 fresh per-area reviewers (two of them verified via AST lockstep comparison that the diff is structurally identical to base apart from renames) plus a 3-judge name-quality panel (accuracy / consistency / readability). Result: zero must-fix findings and three independent 'these are good renames' verdicts. The actionable findings were consistency completions — correct renames that had stopped at a file boundary, leaving twin code on old names — and are applied in the follow-up commit:

Post-review consistency completions — twin files and adjacent functions brought onto the same vocabulary
File Old New Why
Basics/Layers_/LayerConstructors.js layerObj layerConfig 147 occurrences; the direct consumer of the object Layers_.js already calls layerConfig
Basics/Layers_/LayerConstructors.js finalRad finalRadius last abbreviated member of the finalColor/finalOpacity/… sibling set
Basics/Layers_/LayerConstructors.js layerObjName layerConfigName stale after the sweep
Basics/Layers_/Layers_.js l (getLayerOpacity) mapLayer matches adjacent setLayerOpacity
Basics/Layers_/Layers_.js d / dNext (getSublayers ×2) layerConfig / sublayerConfigs same concept as surrounding renames
Basics/Layers_/Layers_.js d (getListOfUsedGeoDatasets, dataFlat.forEach) layerConfig finishes the concept sweep in-file
Basics/Layers_/Layers_.js layerData (transformStacUrl, getUrl, getDynamicProps) layerConfig 22 remaining aliases of the same concept
Basics/Layers_/Layers_.js layerObj (updateVectorLayer) layerConfig same concept
Basics/Map_/Map_.js raster parsedGeoraster keeps the library's term without shadowing the load-bearing georaster import
Basics/Map_/Map_.js vectorImageIndices vectorAndImageIndices holds indices of vector AND image layers, not 'vector-image' layers
Basics/Map_/Map_.js (JSDoc) velocity-layer JSDoc no longer claims the value is GeoJSON
Ancillary/QueryURL.js pP panelPercents the vocabulary name used ~50× in UserInterface_* (panePercents URL string untouched)
Ancillary/QueryURL.js s (2nd site) selectedParts matches the first site's rename
Basics/Formulae_/Formulae_.js node (depthTraversal) layerConfigs line-for-line twin of API/utils.js which was renamed
Basics/TimeControl_/TimeControl.js layer (setLayerWmsParams + 5 config locals) layerConfig config-vs-instance: now reads layerConfig → mapLayer
Ancillary/Description.js layerData / for-in layer layerConfig / layerName same-concept-two-names pairs in an edited file
Tools/Draw/DrawTool_Editing.js cml selectionEntry the file already uses selectionEntry 50× for this exact value
Tools/Draw/DrawTool_Templater.js t (2nd forEach) templateField matches the first callback
API/Backend/Draw/routes/draw.js template templateFields delivers the promised frontend/backend parity (payload keys untouched)
Tools/Draw/DrawTool_Shapes.js f (addShapeToList) drawnLayer + featureLayers same split already applied in DrawTool.js destroy()
Tools/Shade/ShadeTool.js p, c, dl, dlc, val, inner c, layerUrl urlParts, scratchCanvas, tileDataUrls, tileCanvases, resultRow/visibilityCode, pixelColor, tileDataUrls mirrors its ViewshedTool.js twin; also kills a live c-shadows-c trap
Tools/Shade/ShadeTool_Manager.js dv, d, d shadeData, tileIndex, heightGrid mirrors ViewshedTool_Manager.js
Tools/Shade/ShadeTool_Algorithm.js observerHeight sourceHeight agrees with targetSourceCell; header legend + one explanatory comment updated
Tools/Viewshed/ViewshedTool.js tileCanvas scratchCanvas no longer two characters away from tileCanvases at the assignment site
Tools/Legend/LegendTool.js layerName layerUUID the same value is already layerUUID in drawLegends/overwriteLegends in this file

Deliberately deferred (so the asymmetry is not read as an oversight)

  • layerObj in Map_.js (~310 uses) — a defensible name there; renaming it is a large mechanical sweep worth its own pass.
  • The layer.layerObj property key in LayerConstructors.js pathGradient — property keys are out of scope by rule.
  • layerData in files the review did not flag (Map_.js:361, MetadataCapturer.js, LayersTool.js, other Description.js functions).
  • refreshFile(id, …) in DrawTool_Files.js — renaming the outer id to fileId would be captured by the inner renderFileFeatures(fileId, …) parameter inside two closures (verified: the closure reads the outer binding, and the values differ — raw argument vs parsed id). Left as-is on purpose.

Third pass — names people had to explain

A final sweep targeted the highest-signal rename class: names someone already paid a confusion cost for on record. Sources: (1) the last ~40 PR review threads mined for name-confessions, (2) the codebase's own comments mined for apologies (//sf for search field), (3) mechanism-names — identifiers named for how a value is computed instead of what it means. Every candidate went through the same adversarial vetting gate (25 survived: 19 as proposed, 6 amended, 0 rejected).

The two that came straight from PR #213 review:

  • performTimeUrlReplacementsapplyUrlReplacementsAndCacheBust — the pipeline doc literally said "Despite the name, it does not substitute the {time}/{starttime}/{endtime} family" and the review reply was "don't call it that then, lmao". Renamed; the doc's apology paragraph is rewritten to a plain description.
  • splitColonTypetileSourceType"can we rename splitcolontype to something that actually indicated the value?" It holds which tile-source scheme a layer URL uses (stac-collection / COG / titiler-url). This is an internal-only object key, verified contained to the tile pipeline modules and tests.
Confession-driven renames — 25 vetted entries, grouped into the rows below
File(s) Old New Why
Basics/Layers_/tileUrlUtils.ts nextUrl compiledUrl matches its function, compileTileUrl (asked in #213 review)
tileLayerSource.js / Layers_.js / LayerCapturer.js / LayersTool.js / Map_.js / MetadataCapturer.js / essence.js / API stac.js splitColonLayerUrl, splitColonUrl+splitParams, urlSplitRaw+urlSplit ×2, urlSplit ×3, split sourceUrlParts, stacUrlParts+collectionNameAndParams, urlParts+urlPartsLower ×2, urlParts/hrefParts ×3, urlParts the whole colon-split family: named for the split, not for what the parts mean
Basics/Map_/Map_.js sf, str searchFieldPairs, searchFieldParamString carried a literal apology comment (//sf for search field) — comment deleted
Validators/DashboardConfigValidator.js isFloat (param) fromFloatingPanelsArray an apology comment distinguished it from the real float test, isFloatPosition
Tools/Isochrone (Algorithm + Tool) cPx, tPx, cCost, cLatLng, tLatLng, tPxIndex, di currentPixel, neighborPixel, currentCost, currentLatLng, neighborLatLng, neighborHeapIndex, imgDataIndex trailing comments existed solely to decode the abbreviations (comments removed); tPx was verified to be the Dijkstra neighbor, not the 'target' the old comment claimed
Tools/Layers/LayersTool.js tUrl, oSplit toolStateParts, orderTriple tUrl held tool-state parts, not a URL — the name lied
Tools/Shade/ShadeTool.js rawTime utcTime held the parsed UTC output — inverted mechanism name (the raw DOM attribute it feeds stays)
Tools/Draw/DrawTool_Files.js parsedId targetFileId at one of its two sites nothing is parsed at all
Tools/Draw/DrawTool_Editing.js p (10 sites) metaProps the drawing's properties._ meta bag, the module's most-manipulated object
Tools/Draw/DrawTool_Templater.js + API draw.js (twins) split/start/end; bestVal, featuresVal, numVal, extractedVal [prefix, suffix] destructure; nextAvailableNumber, existingFieldValue, requestedNumber, otherFeatureNumber increment-template validator read like date math; vetting caught that featuresVal holds the raw string, not a number
API utils.js + Formulae_.js (twins) ret layerAction holds the 'remove' traversal directive, not a generic return
API configs.js found, result matchIndex, matchedUuidEntry found sounded boolean but held a findIndex result
API Utils/routes/utils.js urlSplit, relUrlSplit, split, t, n timeDirPath, dirCacheKey, dirNameParts, timestamp, label locals only — the {t, n} response keys are external shape and stay
API geodatasets.js filterSplit, fSplit, spatialFilterSplit, vSplit ×2 filterEntries, filterParts, spatialFilterParts, pathSegments split-mechanism names over meaningful parts
Basics/TimeControl_ (timeUtils, TimeControl, TimeUI) initialendSplit, d, s, opMult, dateAddSec, dateStaged dateAndOffsetParts, timeString, hmsParts, offsetSign, timeWithOffset, parsedDate fossilized copy-paste names in the generic time utils
Ancillary/QueryURL.js arr, s layerEntries, nameAndOpacity a comment documented the format because the names carried nothing
Tools/AOI/aoiBoundaryLoader.ts stripped pathWithoutExt named for the .replace calls
Basics/Layers_/LayerConstructors.js splitPath pathSegments same mechanism-name family

The tileFormat schema rename (deliberate exception)

tileformattileFormat — the one externally-visible rename in this PR, explicitly approved by the stakeholder ("missions can be updated"; also flagged in #213 review: "why is tileformat not camelCase?"). What shipped:

  • All readers/writers renamed across the frontend, the backend validator, the Configure metaconfig field definitions, tests, docs, in-repo sample mission configs, and the auxiliary/bulk_tiles.py config generator.
  • Back-compat: a save-time normalization in the backend validator plus a single load-time alias where mission configs are ingested (parseConfig/expandLayers) — old missions keep rendering with zero manual edits and convert on their next save. Both alias lines are commented as removable once stored configs are migrated.
  • Other mis-cased config keys (demtileurl, demparser, scalefactor, strokecolor, nointeraction, legacy visibilitycutoff, ~46 mission-level tab keys) are enumerated in a drafted follow-up issue using the same alias pattern.

What is deliberately NOT touched

  • Object property keys, stored configuration fields, DB columns, request/response payloads, URL parameters — the persisted/external schema is untouched (one deliberate, stakeholder-approved exception: the tileFormat config key, detailed below); existing missions and permalinks are unaffected.
  • The short global module aliases (L_, F_, Map_, …) — explicitly out of scope per the issue.
  • The Configure admin interface — except the two metaconfig field definitions renamed as part of the tileFormat schema change.
  • String literals, DOM ids, CSS classes, jQuery selectors.
  • Standard math notation (dx/dy, haversine a/c, sx/cx) — where non-obvious, a one-line comment names the formula instead.

Verification

  • npm run typecheck — clean
  • npm run test:unit — 889/889 tests pass (57 files), matching the pre-change baseline
  • npm run build — production build succeeds
  • e2e: 32/33 pass. The 1 failure ('application loads successfully' title check) is pre-existing and unrelated: the seeded demo mission titles the page 'Disasters Program - Demo Dashboard', which does not match the test's /MMGIS/i — it fails identically at the base commit (verified by running the suite at ab7a99e on the same deployment).
  • Diff audited for CRLF/line-ending preservation and string-literal changes

Every rename in the per-area tables at the end also names what the value actually holds, so the list is reviewable without reading the diff. Where a later pass amended a pass-1 name, the table shows the final name with the intermediate in parentheses.

Naming conventions (issue #235)

The rules below governed the variable/parameter/private-function renames. Aside from the two documented key exceptions (tileSourceType, an internal-only key, and the tileFormat schema change), no property key, DB column, request/response field, URL parameter, DOM id, CSS class, or window.* global is touched.

Vocabulary

Concept Canonical name Replaces
Persisted layer config (L_.layers.data, configData.layers) layerConfig / layerConfigs s, d, l, node, layerObj, layerData
Layer-name key string layerName l, n, s, layer
Layer name split on _ layerNameParts s
Constructed layer at L_.layers.layer[name] mapLayer l
Layer for one feature / its collection / its key featureLayer, featureLayers, featureLayerId l, g, e, l2, _layer
Draw file's layer array / one element fileLayers, drawnLayer l, lg, f, layer
Attachment (uncertainty_ellipses, image_overlays, models) sublayerName, sublayer sub, s
GeoJSON feature / collection / coordinates feature, geojson, coords f, d, g, c, data
Coordinates in lat/lng form <qualifier>LatLng, lngLatPoint when x = lng ll, llM, xy, ell
DOM / jQuery node <role>El, <role>Input, <role>Canvas t, c, n, bb
Per-tool state record <tool>Data, <tool>State d, dv
Draw template field / array templateField, templateFields t, template
Draw file id fileId id, index
Context-menu selection entry / its key selectionEntry, selectionIndex l, cml, c
{layer, index, fileid} locator featureLocator lif
Style value that may be prop:<name> <prop>OrProp col, fiC, fiO, opa, wei, rad
Function-valued identifier on<Event>, <what>Callback add, f, d
API response payload <what>Response d, s, res
SQL string / appended fragment sql, timeClause q, t
Result of splitting a serialized string <param>Parts, <thing>Tokens, searchTerms p, s, string, fieldString, x

Rules

  1. Config vs instance is the point. A name says which side of the boundary it is on: layerConfig is the persisted JSON, mapLayer / featureLayer is the thing built from it, layerName is the string key between them. Never l for all three.
  2. A name that lies gets renamed even when it is only read twice. layerUrl holding a data-URL map, selfish meaning "this is the retry", index meaning a file id, res meaning a response payload in Express code, singular names holding arrays.
  3. Abbreviations are fine when the scope is short and the concept is local (sql, coords, bbox, ctx where it really is a canvas context). They are not fine when the declaration is more than a screen from its use — that is the actual test, not letter count.
  4. Loop indices stay. i, j, k, x, y in numeric loops; e/err in catch blocks. But a for-in key that is a layer name, a UUID, or a file id is not an index and gets named for what it holds.
  5. Math notation stays. dx/dy/dz, sx/cx/sy/cy, plane coefficients a/b/c/d, haversine a/c, raster i/j scans. Where the formula is non-obvious the fix is one comment line naming it, not a rename.
  6. Rename per declaration, with an AST/LSP tool — never sed. Several targets are single letters that also appear inside string literals in the same file: 'v' is a live DOM attribute in DrawTool_Editing.js, 'rad' is an angle unit in LayerConstructors.js, 's' is a pluralization suffix in LayerGeologic.js, var(--color-l) in LegendTool.js, xyorll: 'xy' in MeasureTool.js, .val( in ViewshedTool.js, and @param {string} JSDoc in DrawTool_Files.js. Repo files are CRLF, so edits must be byte-safe or the diff explodes to whole files.

Deliberately out of scope

Module aliases (L_, F_, Map_, Globe_, L, $, …); layerObj in Map_.js (~310 uses — a defensible name there; the LayerConstructors.js twin WAS unified to layerConfig in the second pass, leaving only the layer.layerObj property key untouched); and, beyond the two documented exceptions, all property keys, persisted schema, API payload fields, permalink field order, DOM ids and CSS classes.

Adjacent defects found while reading — NOT fixed here; an issue is drafted for the first, the rest are queued for filing: Layers_.js:3082 references an undeclared layerObj (latent ReferenceError on an error path); LayersTool.js:1487 recurses with node[0] where node[i] is meant; several dead locals (ctx in five make*Layer functions, unused bb bounds blocks, ts in both *Tool_Manager.js, makeDataLayer's unused third parameter, Layers_.modifyLayer's unused data).

Renames by area

layers-core — src/essence/Basics/Layers_/ — 25 renames
File Old New Holds
Basics/Layers_/Layers_.js s layerConfig the persisted layer configuration object from L_.layers.data / dataFlat — s.name, s.type, s.url, s.kind, s.til
Basics/Layers_/Layers_.js d layerConfigs an array of layer configuration objects for one level of the config tree; every use is d[i].name / .type / .ur
Basics/Layers_/Layers_.js s layerConfig the layer configuration object for the current dataFlat entry (s.name, s.type, s.url, s.demtileurl, s.demparse
Basics/Layers_/Layers_.js sub sublayerName the attachment/sublayer key into L_.layers.attachments[layerName], compared against 'uncertainty_ellipses' / '
Basics/Layers_/Layers_.js d layerConfig a single layer configuration object being expanded from a STAC catalog/collection — d.url, d.name, d.sublayers
Basics/Layers_/LayerConstructors.js l featureLayer the constructed Leaflet layer for one feature (l.feature, l.useKeyAsName, l.options) — an instance, sitting th
Basics/Layers_/Layers_.js g featureLayers the Leaflet layer's _layers map, whose values are per-feature layers with .feature and ._latlng
Basics/Layers_/Layers_.js l featureLayerId a KEY into the _layers map (a string id) — the layer is g[l]. Directly misleading, since l means a constru
Basics/Layers_/Layers_.js l featureLayer a single Leaflet feature layer — l._hidden, l.feature.properties.style, l._path, l._container, l._icon
Basics/Layers_/Layers_.js p propName a feature property name; used to read props[p] and as the human-readable name: of the returned image descrip
Basics/Layers_/Layers_.js l mapLayer the constructed layer instance (l.options, l.setOpacity, l.setStyle, l.options.initialFillOpacity) — the insta
Basics/Layers_/Layers_.js layerObj layerConfig the layer configuration object (.type, .minZoom, .maxZoom, .visibilitycutoff, .display_name, .name)
Basics/Layers_/Layers_.js s layerConfig the layer configuration object passed in by callers (s.name, s.type, s.time, s.controlled), forwarded to toggl
Basics/Layers_/LayerConstructors.js rad radiusOrProp either a literal radius or the sentinel string 'prop:' telling the style function to read radius
Basics/Layers_/Layers_.js s featureStyle the feature's style sub-object (color, strokeOpacity, weight, fillColor, fontSize, rotation) used to build the
Basics/Layers_/Layers_.js l layerConfig a layer configuration object (l.name, l.visibility) — config, not instance, despite the l
Basics/Layers_/Layers_.js d layerConfigs an array of layer configuration objects for one level of the tree; used as d[i].type, d[i].name and fed to get
Basics/Layers_/LayerConstructors.js fiC fillColorOrProp either a literal fill color or the sentinel string 'prop:'
Basics/Layers_/LayerConstructors.js col colorOrProp either a literal stroke color or the sentinel string 'prop:'
Basics/Layers_/LayerGeologic/LayerGeologic.js s geologicStyle the feature's geologic style sub-config (s.type, s.tag, s.rep, s.size, s.color, s.pos)
Basics/Layers_/LayerGeologic/LayerGeologic.js g geologicStyle the same geologic style sub-config as s at L89 (g.type, g.tag, g.color, g.size, g.rot) — one concept, two on
Basics/Layers_/LayerConstructors.js opa opacityOrProp either a literal stroke opacity or the sentinel string 'prop:'
Basics/Layers_/LayerConstructors.js wei weightOrProp either a literal stroke weight or the sentinel string 'prop:'
Basics/Layers_/LayerConstructors.js fiO fillOpacityOrProp either a literal fill opacity or the sentinel string 'prop:'
Basics/Layers_/Layers_.js s layerNameParts the '_'-split parts of a layer key — s[0] is the tool prefix ('DrawTool'), s[1] the numeric id or 'master'. No
map-core — src/essence/Basics/Map_/Map_.js — 16 renames
File Old New Holds
Basics/Map_/Map_.js ctx mapContext the map context {map, layerRegistry, default} — target map plus the registry to write into. 'ctx' reads as a c
Basics/Map_/Map_.js data geojson a GeoJSON FeatureCollection (or the sentinel string 'off', or null). Reassigned at L1159 via F_.parseIntoGeoJS
Basics/Map_/Map_.js hasIndex vectorAndImageIndices (via vectorImageIndices) an ARRAY of indices into L_._layersOrdered for the vector and image layers that were removed and must be re-ad
Basics/Map_/Map_.js bb configBounds an L.latLngBounds built from the layer config's boundingBox, passed as the Leaflet bounds: option. The same
Basics/Map_/Map_.js georaster parsedGeoraster (via raster) the parsed raster returned by the global parseGeoraster (noDataValue, numberOfRasters). It SHADOWS the module
Basics/Map_/Map_.js fieldString fieldTokens starts as a config string, then is immediately reassigned to an ARRAY of [function, parameter] pairs by succes
Basics/Map_/Map_.js min bandMin the single-band raster's minimum pixel value (from layerObj.cogMin, TiTiler /cog/statistics, or gdal), used wi
Basics/Map_/Map_.js add onGeoJSONFetched the GeoJSON completion callback: builds the layer from fetched data, writes it into the registry, marks it loa
Basics/Map_/Map_.js p clickPoint the clicked pixel point (e.sourceTarget._point) with .x/.y, compared against each rendered feature's _pxBounds
Basics/Map_/Map_.js s sublayerName the KEY of an entry in L_.layers.attachments[layerName], used to reach [s].layer, [s].on, [s].type. The loop b
Basics/Map_/Map_.js f onExtentChange a FUNCTION, not data — the dynamic-extent refetch handler from LayerCapturer, wired to 'moveend' and to the ti
Basics/Map_/Map_.js hasIndexRaster rasterIndices array of indices into L_._layersOrdered for tile/data (raster) layers, kept separate because rasters only get
Basics/Map_/Map_.js l layerName a layer NAME string (it iterates Object.keys(L_.layers.data)) but is immediately used as L_.layers.layer[l], w
Basics/Map_/Map_.js keyAsName featureNameValue the property VALUE of the feature's display property (layer.feature.properties[layer.useKeyAsName]) — a name,
Basics/Map_/Map_.js ell latlngEvent a minimal synthetic event object { latlng } forwarded to Kinds.use and InfoTool.use where a real Leaflet event
Basics/Map_/Map_.js _layer featureLayers an ARRAY of sublayers (layer.getLayers()) despite the singular name, immediately iterated as _layer[x], sittin
draw-main — DrawTool_Editing.js + DrawTool_Drawing.js — 16 renames
File Old New Holds
Tools/Draw/DrawTool_Drawing.js d drawState the per-shape drawing-mode state object: {intent, style, drawing (the Leaflet.Draw handler), shape (the in-pro
Tools/Draw/DrawTool_Editing.js v color / opacity / dashArray / weight / fillColor / fillOpacity / symbol / radius / width / length / lineCap / lineJoin / fontSize / rotation (one per setter, in declaration order L1339/1457/1542/1610/1724/1830/1898/1928/1993/2059/2125/2191/2257/2298) the new style value being applied — a CSS color, an opacity, a dashArray, a weight, a symbol name, a radius/wi
Tools/Draw/DrawTool_Editing.js layer targetLayer a single constructed layer to restyle (layer.setStyle({...})), or undefined meaning 'apply to every entry in D
Tools/Draw/DrawTool_Editing.js s shapeLayer the constructed layer for one selected feature (has .setStyle, ._layers, .feature, .start/.end for arrows, .is
Tools/Draw/DrawTool_Editing.js c selectionIndex the for-in KEY (array index as a string) into DrawTool.contextMenuLayers, the currently multi-selected feature
Tools/Draw/DrawTool_Drawing.js d drawState the same per-shape drawing-state object, passed in by the shape's stop() — read for d.shape (the finished feat
Tools/Draw/DrawTool_Editing.js l selectionEntry one entry of DrawTool.contextMenuLayers: {shape, layer, properties, style, file, l_i_f, selectionLayer} — the
Tools/Draw/DrawTool_Drawing.js lg fileLayers the array of constructed layers for the current draw file — indexed lg[i], swapped in place, bringToBack/bring
Tools/Draw/DrawTool_Drawing.js n newNameInput the jQuery-wrapped new-feature-name ; read as n.val() || n.attr('placeholder') to name the shape bein
Tools/Draw/DrawTool_Editing.js h swatchHtml an SVG swatch markup string for the picker preview; the function rewrites y1/y2 in it and injects it with $('.
Tools/Draw/DrawTool_Editing.js l selectionEntry one DrawTool.contextMenuLayers selection entry — l.layer, l.shape, l.properties._.id, l.file.id are read to bu
Tools/Draw/DrawTool_Editing.js sl selectionLayer the white dashed L.rectangle / L.circleMarker drawn behind the selected feature to show it is selected
Tools/Draw/DrawTool_Editing.js l featureLayer the candidate layer unwrapped one level — if it has ._layers it is replaced by its first sub-layer — used only
Tools/Draw/DrawTool_Editing.js e drawnLayer one element of a draw file's layer array — actively misleading, since e reads as an event everywhere else in
Tools/Draw/DrawTool_Editing.js c headerNameEl the jQuery-wrapped context-menu header title element — .text(v) and .css('color', …) are called on it. Reuses
Tools/Draw/DrawTool_Drawing.js ctx drawEvent the Leaflet 'draw:created' event, not a context — only ctx.layer._bounds is read to build the rectangle featur
draw-rest — DrawTool.js, _Files, _Shapes, _Templater, _Publish — 21 renames
File Old New Holds
Tools/Draw/DrawTool_Templater.js t templateField one template FIELD DEFINITION object from templateObj.template — t.field, t.type, t.default, t.min/max/step, t
Tools/Draw/DrawTool_Templater.js t templateField one template field definition — t.field, t.type, t.intersectedGeodataset, t.intersectedProp, t.intersectedConf
Tools/Draw/DrawTool_Files.js l fileLayers an ARRAY of constructed layers for one draw file; indexed as l[i], testing l[i].setStyle, l[i]._layers, l[i].f
Tools/Draw/DrawTool.js l drawnLayer one constructed layer for a drawn feature — l.feature, l.options, l.setStyle, l.savedOptions, l.temporallyHidd
Tools/Draw/DrawTool_Shapes.js layer layerName NOT a layer — a layer-NAME string like 'DrawTool_5'; used as L_.layers.layer[layer][index] and to build the DO
Tools/Draw/DrawTool.js l2 featureLayer TWO things in three lines: the parameter arrives as a _layers KEY string, then is immediately reassigned to
Tools/Draw/DrawTool_Shapes.js l layerName a layer-name KEY string ('DrawTool_5'); paired with var s = l.split('_') on the next line and passed to addF
Tools/Draw/DrawTool.js f drawnLayer TWO things: first the constructed layer for one drawn feature (possibly a group), then at L783-784 it is REASS
Tools/Draw/DrawTool_Files.js id resolvedFileId the resolved draw file id — either the fileId parameter (programmatic call) or the file_id attribute of the
Tools/Draw/DrawTool_Shapes.js e featureLayer an individual constructed sub-layer — popups are bound to it and mousemove/mouseover/mouseout/click handlers a
Tools/Draw/DrawTool_Publish.js s issue one validation issue object from the compile response — s.severity, s.message, s.antecedent.{id,intent}, s.con
Tools/Draw/DrawTool_Files.js d fileResponse the API file response — d.geojson is the FeatureCollection, d.file is the file-metadata array (file_name, id,
Tools/Draw/DrawTool.js l layerName a layer-name KEY string such as 'DrawTool_5' / 'DrawTool_master'; used as L_.layers.layer[l] and passed to Kin
Tools/Draw/DrawTool_Files.js index fileId NOT an array index — the draw file id (callers pass targetFileId, formerly parsedId); used as 'DrawTool_' + index, DrawTool.fileGeo
Tools/Draw/DrawTool_Templater.js t templateField a template field definition of type 'incrementer' — t._default, t.default, t.field
Tools/Draw/DrawTool_Files.js keepGoing renderFileFeatures a ~265-line module-private function that clears the file's existing layers and rebuilds every feature (arrows,
Tools/Draw/DrawTool.js e featureLayer an individual constructed sub-layer that click/mouseover/mouseout handlers are bound to
Tools/Draw/DrawTool_Templater.js layer fileLayers an ARRAY of layer instances for the file; iterated for (var i = 0; i < layer.length; i++) reading layer[i].f
Tools/Draw/DrawTool.js s layerNameParts the layer name split on '_': s[0] is the tool prefix ('DrawTool'), s[1] the file id or 'master'
Tools/Draw/DrawTool_Templater.js layer fileLayers an ARRAY of layer instances — callers pass L_.layers.layer[DrawTool_${fileId}]; forwarded to _validateIncrem
Tools/Draw/DrawTool_Templater.js template templateFields the ARRAY of template field definitions (callers pass file.template.template) — yet elsewhere in this same fil
viewshed-shade — 20 renames
File Old New Holds
Tools/Viewshed/ViewshedTool_Algorithm.js o observerCell the observer's grid cell — an {x,y} index into the elevation grid (the code already annotates it with a traili
Tools/Shade/ShadeTool_Algorithm.js o targetSourceCell the grid cell of the illumination SOURCE, not an observer: ShadeTool_Manager.locateSource projects d.targetSou
Tools/Shade/ShadeTool_Algorithm.js d shadeData the whole per-shade state object from ShadeTool_Manager.gather — .data (elevation grid), .dataSource, .source,
Tools/Viewshed/ViewshedTool_Algorithm.js d viewshedData the whole per-viewshed state object built by ViewshedTool_Manager.gather — .data, .dataSource, .source, .optio
Tools/Viewshed/ViewshedTool_Algorithm.js g grids the {refGrid, resultGrid} pair returned by initializeGrids; every use is g.refGrid[..][..] or g.resultGrid[..]
Tools/Shade/ShadeTool_Algorithm.js g grids the {refGrid, resultGrid} pair returned by initializeGrids
Tools/Viewshed/ViewshedTool.js p urlParts the positional fields of one viewshed's permalink segment: p[0] name, p[1] on, p[2] dataIndex, p[3] packed rgb
Tools/Viewshed/ViewshedTool_Algorithm.js dataH cellTargetHeight terrain elevation of the cell under test plus the configured target height (d.data[j][i] + d.options.targetHei
Tools/Viewshed/ViewshedTool_Algorithm.js a / b / c / d / a1 / b1 / c1 / a2 / b2 / c2 (comment) coefficients of the plane through p (observer), q and r, solved for z at (i,j) — standard cross-product plane-
Tools/Viewshed/ViewshedTool.js d viewshedData the per-viewshed state object from the Manager: .result grid, .bottomLeftLatLng, .cellSize, .source (lng/lat/h
Tools/Shade/ShadeTool.js s aerResponse the az/el/range API response for the sun/target relative to the map centre: .azimuth, .elevation, .range, .lat
Tools/Viewshed/ViewshedTool_Manager.js d heightGrid the 2-D elevation grid whose tile seams are being smoothed — d[y][x] is a height in metres
Tools/Viewshed/ViewshedTool.js c pixelColor the RGBA colour object chosen for one output pixel from the viewshed result code (0 hidden / 1 visible / 2 obs
Tools/Viewshed/ViewshedTool_Manager.js d tileIndex an integer INDEX into data[viewshedId].desiredTiles — not data. Used as desiredTiles[d] and compared against s
Tools/Viewshed/ViewshedTool.js c scratchCanvas (via tileCanvas) the single reusable off-screen each output tile is drawn into before toDataURL()/cloneCanvas()
Tools/Viewshed/ViewshedTool.js dl tileDataUrls nested {z}{x}{y} -> canvas dataURL string map for the generated viewshed tiles
Tools/Viewshed/ViewshedTool.js dlc tileCanvases nested {z}{x}{y} -> cloned map (F_.cloneCanvas), stored on ViewshedTool.canvases[activeElmId] and han
Tools/Viewshed/ViewshedTool_Manager.js dv viewshedData the per-viewshed state object (the same object the Algorithm file receives as d) — .topLeftTile, .source, .z
Tools/Viewshed/ViewshedTool.js val visibilityCode ONE NAME, TWO THINGS: first a whole row of the viewshed result grid, then, after the null check, the single ce
Tools/Viewshed/ViewshedTool.js layerUrl tileDataUrls MISLEADING — not a URL. It is the nested {z}{x}{y} -> dataURL object, passed straight into L.tileLayer.gl as t
tools-misc — src/essence/Tools except Draw/Viewshed/Shade — 18 renames
File Old New Holds
Tools/Layers/LayersTool.js node layerConfigs the ARRAY of persisted layer-config objects at the current tree depth (called with L_.configData.layers at L55
Tools/Layers/LayersTool.js t listItemEl the jQuery-wrapped
  • DOM node for the current row: t.attr('id'/'depth'/'childrenon'/'type'/'on'), t.css(…),
  • Tools/Legend/LegendTool.js l layerUUID (via layerName) a layer NAME string (node[i].name): L_.layers.on[l], L_.layers.data[l], L_.layers.opacity[l], and it is passed
    Tools/Identifier/IdentifierTool.js v rawValue the raw pixel/band data value being formatted — may be a string, null, or a number that gets scaled, rounded t
    Tools/Curtain/CurtainTool.js g lineCoords the GeoJSON coordinate array of the curtain's map feature (coordinates[0] for MultiLineString, coordinates for
    Tools/Identifier/IdentifierTool.js n layerName a layer NAME string: L_.layers.on[n], L_.layers.data[n].type/.url/.maxNativeZoom/.tileFormat, pushed into Iden
    Tools/Layers/LayersTool.js s sublayerName an attachment/sublayer NAME string; used as L_.layers.attachments[layerName][s], F_.prettifyName(s), and inter
    Tools/Measure/MeasureTool.js rAm roundAmount the rounding factor used as Math.round(x * rAm) / rAm to round distances/azimuths to 2 decimals
    Tools/Layers/LayersTool.js node layerConfigs the array of persisted layer-config objects at this tree depth (node[i].type === 'header', .expanded, .name, .
    Tools/Layers/LayersTool.js f layerFilters the CSS filter map for a layer, L_.layers.filters[node[i].name] — read only by string key: f['brightness'], f[
    Tools/Identifier/IdentifierTool.js d2 refreshedDataSource the per-layer data-source descriptor freshly re-read from IdentifierTool.vars.data[layerName].data[j]: {url, b
    Tools/Layers/LayersTool.js data layerConfig the persisted layer CONFIG object, L_.layers.data[layerName] — read for .boundingBox. It sits one line above `
    Tools/Legend/LegendTool.js node layerConfigs the array of persisted layer-config objects at this tree depth (called with L_.configData.layers at L203 and n
    Tools/Curtain/CurtainTool.js ll lngLatPoint the point returned by CurtainTool.pxToLngLat(): an {x, y, z} object where x is LONGITUDE and y is LATITUDE, so
    Tools/Measure/MeasureTool.js temp pointMarker an L.circleMarker for the current clicked measurement point — it gets a distance/azimuth tooltip bound to it a
    Tools/Curtain/CurtainTool.js llM markerLatLng the Leaflet-order [lat, lng] pair built by flipping the lngLat point ([ll.y, ll.x]) so it can be handed to L.c
    Tools/Identifier/IdentifierTool.js selfish isRequery a boolean that is true only on the self-scheduled follow-up call at L532; it suppresses scheduling yet another
    Tools/Info/InfoTool.js l featureLayer a constructed layer instance (only l.feature is read, then JSON-stringified to match against the feature array
    basics-misc — src/essence/Basics (excl. Layers_ and Map_) + src/essence/Ancillary — 21 renames
    File Old New Holds
    Basics/UserInterface_/UserInterfaceDefault_.js pp panelPercents the {viewer, map, globe} percentage split returned by getPanelPercents(), read as pp.viewer / pp.map / pp.glob
    Basics/Formulae_/Formulae_.js f feature one GeoJSON Feature from the cloned FeatureCollection; the body reads f.geometry.type and writes ~14 simplesty
    Basics/Formulae_/Formulae_.js sx / cx / sy / cy / sz / cz (comment) sines/cosines of the per-axis Euler angles, composed into a 3x3 rotation matrix applied to the offset vector
    Basics/Formulae_/Formulae_.js l featureLayers either a one-element array [layers] or the layer group's _layers dict; every use is l[i].feature.geometry.co
    Basics/Viewer_/Viewer_.js o imageConfig the image descriptor from Viewer_.images[imageId] — .url, .master, .isModel, .isPanoramic — which drives which
    Ancillary/QueryURL.js s selectedParts the comma-split parts of the selected URL parameter: [layerName, lat-or-key, lon-or-value, view, zoom]
    Basics/Formulae_/Formulae_.js g coords feature.geometry.coordinates — reassigned to g[0] for polygon/multilinestring, then indexed as g[i][0]/g[i][1]
    Ancillary/Search.js sf searchFieldSpecs Search.searchFields[name] — an array of [functionName, propertyPath] pairs parsed out of the layer's search co
    Ancillary/Description.js l layerConfig the persisted layer CONFIG object L_.layers.data[layer] — .variables.info, .variables.dynamicExtent, .url
    Ancillary/Search.js x searchTerms the array of search strings to match against — either [textbox value], [value], L_.searchStrings, or the force
    Basics/TimeControl_/TimeUI.js e endTimestamp the timeline's end timestamp in ms — clamped to <= 3155788800000 then written to TimeUI._timelineEndTimestamp
    Basics/TimeControl_/TimeUI.js s startTimestamp the timeline's start timestamp in ms — clamped to >= 0, written to TimeUI._timelineStartTimestamp and used as
    Ancillary/ContextMenu.js l clickedFeatureLayer the clicked feature layer instance — l.feature.geometry for WKT substitution, l.getBounds()/l._latlng for the
    Ancillary/Search.js doX action the action string 'goto' | 'select' | 'both', branched on to decide whether to highlight features, pan the m
    Ancillary/Description.js v layerVariables L_.layers.data[layerName].variables — only .links is read, to build external link markup
    Basics/Formulae_/Formulae_.js c coords feature.geometry.coordinates for a multipolygon — indexed c[i][0][j][0..2] as lng/lat/alt
    Basics/TimeControl_/TimeControl.js l mapLayer the CONSTRUCTED map layer from L_.layers.layer[layer.name]; its .options.time/.starttime/.endtime are mutated
    Basics/TimeControl_/TimeControl.js r urlReplacement one entry of layer.variables.urlReplacements — a config object with .on, .url, .type, .body, .return that driv
    Basics/TimeControl_/TimeUI.js l layerConfig the persisted layer CONFIG from L_.layers.data[name] — .type === 'tile', .time.enabled, .url
    Basics/TimeControl_/TimeUI.js l sparklineLayer a locally-built sparkline descriptor {name, path} or {name, stacCollection} — NOT a layer config and NOT a con
    Ancillary/Description.js f feature nothing new — a pure alias of the feature parameter, used for booleanIntersects(bounds, f), bbox(f), f.prope
    api — API/ — 13 renames
    File Old New Holds
    API/Backend/Geodatasets/routes/geodatasets.js q sql the incrementally built SELECT … FROM SQL string (bounds clause, time clause, filters, spatial filter,
    API/Backend/Draw/routes/files.js f featureRow one user_features DB row (id, file_id, level, intent, properties JSON string, st_asgeojson)
    API/Backend/Geodatasets/routes/geodatasets.js f filter one decoded filter descriptor: either {isGroup:true, op} or {key, op, type, value}
    API/Backend/Geodatasets/routes/geodatasets.js t timeClause the SQL fragment for the start_time/end_time WHERE/AND clause, appended to the query string
    API/updateTools.js items toolItems fs.Dirent entries of ./src/essence/Tools (each items[i] is a tool directory entry: .isDirectory(), .name)
    API/Backend/Draw/routes/draw.js t templateField one draw-file template field definition ({type:'incrementer', field, default/_default}); read as t.field, t.ty
    API/Backend/Geodatasets/routes/geodatasets.js r features array of assembled GeoJSON Feature objects built from the query rows; later sorted, offset-sliced and sent as
    API/utils.js node layerConfigs an ARRAY of layer config objects (config.layers or a .sublayers array) — node[i] is the actual layer; the sing
    API/Backend/Webhooks/processes/triggerwebhooks.js wh webhook one configured webhook entry (wh.action; passed on as the webhook parameter of drawFileUpdate/drawFileDelete
    API/utils.js str input NOT necessarily a string — the function explicitly branches on string / number / Array, and callers pass parse
    API/Backend/Webhooks/processes/triggerwebhooks.js res fileResponse the getfile RESPONSE PAYLOAD ({status, body:{file, geojson}}), not an Express response — res.body.geojson / re
    API/Backend/Draw/routes/draw.js layer features NOT a layer — the caller passes geojson.features, i.e. an array of GeoJSON Features (let geojson = layer[i],
    API/Backend/Config/routes/configs.js i uuid NOT an index — a layer UUID string from layerUUIDs

    @CarsonDavis CarsonDavis self-assigned this Jul 29, 2026
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    None yet

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    Audit and rename unclear identifiers across the frontend and backend for readability

    1 participant