From bcb457304ab8bfab7f7fb8ff0dee901ba648c812 Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Thu, 14 May 2026 08:19:22 -0700 Subject: [PATCH] explorer: fix OJS top-level scope of VIEWPORT_PAD_FACTOR (hotfix) `const VIEWPORT_PAD_FACTOR = 0.3;` is a JS-style top-level declaration that OJS does not bind into the module scope. Within an `{ojs}` block, names are exposed to other cells only via `name = value` cell syntax (or `function name() {}`). Because the broken cell sat at the head of the block, every dependent cell (`zoomWatcher`, `tableView`, `facetFilters`, `phase1`, `viewer`, ...) failed with "applyQueryToFacetFilters / updatePhaseMsg / updateSamples is not defined" and the live explorer page was unusable. Fix: change to OJS cell syntax `VIEWPORT_PAD_FACTOR = 0.3`. Co-Authored-By: Claude Opus 4.7 (1M context) --- explorer.qmd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/explorer.qmd b/explorer.qmd index ac650d0..90bc34a 100644 --- a/explorer.qmd +++ b/explorer.qmd @@ -747,7 +747,10 @@ function facetFilterSQL() { // stat (issue #221 round 2) all expand the raw view rectangle by this // factor so the three surfaces agree on a single "in view" predicate. // Pass 0 (or undefined) for exact-viewport semantics (area search). -const VIEWPORT_PAD_FACTOR = 0.3; +// OJS cell syntax (bare `name = value`); `const` here would not bind +// the name into the OJS module scope and would break every dependent +// cell (issue #223 quick-fix). +VIEWPORT_PAD_FACTOR = 0.3 // Return the viewer's current view rectangle, optionally padded in each // direction by `padFactor × span`, normalized into [-180, 180] longitude