Repository navigation
Demo: one-click preset contrasts for the candidate CRS lookup - #10
Merged
Merged
Conversation
Add a preset bar with three A/B contrasts (place, historical-grid,
area-filter). Each button fills in the extent and filters, moves the
markers to the extent corners, fits the map, runs one lookup, and shows a
one-line description of what should be visible. Preset values live only in
demo/presets.js, which both the page and the tests import.
- demo/main.js now exports initDemo({ runtime, doc }); the page starts it.
- Show the number of candidates whose area name does not mention Japan and
the number of excluded rows next to the result count.
- Show the @c4h/atlas version in the footer.
- tests/demo-presets.test.ts checks with the real engine that each contrast
splits, including repeated lookups with and without the area filter.
- tests/demo-wiring.test.ts (jsdom) checks that each button calls the
lookup once with the preset arguments and that the defaults are unchanged.
- Add jsdom as a dev dependency and run test files one at a time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kochizufan
marked this pull request as ready for review
October 27, 2026 13:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a preset bar to
demo/crs-candidate-lookup.htmlwith three A/B contrasts whose results differ clearly:placeEPSG:6674) + historical grid zone B vs VIII/IX (EPSG:6676,EPSG:6677) + zone Ahistorical-gridUTJCP:ZONE-B; one more rowarea-filterJapanPressing a button fills in the extent and filters, puts the markers on the extent corners, fits the map, runs one lookup, highlights the button (
aria-pressed) and shows a one-line description of what should be visible. The existing controls keep working afterwards.Also:
demo/main.jsexportsinitDemo({ runtime, doc }); the page starts it (no side effects on import).@c4h/atlasversion.demo/presets.js; the page and the tests import the same data.Tests
tests/demo-presets.test.ts(real engine): each contrast splits as described, including four lookups in a row with and without the area filter and an A → B → A round trip (60 s limit per call).tests/demo-wiring.test.ts(jsdom, stub runtime, real page HTML): each button calls the lookup exactly once with the preset arguments, setsaria-pressed, shows the matching description; the defaults before any preset are unchanged.jsdomadded as a dev dependency. Test files now run one at a time (fileParallelism: false) because the proj-wasm worker pools of several engine test files competed for memory and hit timeouts.Local:
pnpm run test(22 files / 131 tests),typecheck,build,verify:demo,verify:packed-browserall exit 0;distunchanged;pnpm pack --dry-runlists nodemo/and no jsdom. Checked in a real browser: Kyoto 11 / Tokyo 15 candidates, 10 / 11 without / with custom projections, 11 / 168 / 11 for the area filter round trip.🤖 Generated with Claude Code