Skip to content

v0.2.8: embeddable report viewer

Choose a tag to compare

@avalonreset avalonreset released this 19 Nov 20:04
· 27 commits to main since this release

Embeddable report viewer

This release adds a standalone viewer you can drop into any page. It renders GeoGrid results as a rank pin map with scores, ring and quadrant zone statistics, a competitor table and the change since the previous scan.

Download

geogrid-viewer-0.2.8.tgz contains:

  • geogrid-viewer.js (one script, global GeoGridViewer)
  • geogrid-viewer.css
  • geogrid-viewer-worker.js (map worker, serve it from your own origin)
  • LICENSE, THIRD_PARTY_NOTICES.md
  • docs/VIEWER.md, docs/viewer-model.md, docs/geogrid-viewer-v1.schema.json
  • examples/viewer-lean-fixture.json

Verify the download against SHA256SUMS before you serve it.

Use

const viewer = GeoGridViewer.mount(element, model, {
  capabilities: { perPointListings: false, profiles: false, nameReview: false, campaignResearch: false, strategyRoom: false },
  defaultBasemap: 'ofm-dark',
  workerUrl: '/geogrid-viewer-worker.js',
})
viewer.destroy()
  • The viewer reads no page globals and keeps every style rule under one root class.
  • It runs under a strict Content Security Policy: no eval, no inline script, no new Function, and a same-origin worker. Required origins are listed in docs/VIEWER.md.
  • The default background is the OpenFreeMap dark vector style with attribution. It makes no request to tile.openstreetmap.org.
  • An optional Google basemap is available only when you pass googleSessionPath. If a Google request fails, the viewer returns to the default style and hides the Google options for the session.
  • Capability flags hide the per-point listings, profiles, name review, campaign research and strategy room panels. Anything switched off is hidden, and missing data never raises an error.

Models

  • geogrid-viewer/v1 is a small model with the business, scan, rank points, scores, zones, aggregate competitors, an optional change summary and optional per-zone competitors. A JSON Schema and an example are included.
  • The existing geogrid-companion/v1 study also opens in the viewer.

Other changes

  • The local app is unchanged. Every capability stays on there.
  • A basemap that fails half-way no longer throws while it is being detached.
  • 12 new tests build the viewer, scan the bundle, and mount it in jsdom. The Node suite is now 141 tests.

Build it yourself with pnpm build:viewer. Full changelog: https://github.com/avalonreset/legends-geogrid/blob/v0.2.8/CHANGELOG.md