@mailwoman/react 10.0.0 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -16
- package/fonts.css +97 -22
- package/lib/common/About.tsx +10 -10
- package/lib/common/ClientOnly.tsx +2 -14
- package/lib/common/CopyButton.tsx +9 -3
- package/lib/common/LoadingIndicator.tsx +13 -5
- package/lib/common/PresetChips.tsx +11 -8
- package/lib/common/confidence-tiers.ts +8 -7
- package/lib/common/cx.ts +3 -1
- package/lib/common/text-tokens.ts +10 -13
- package/lib/common/useBuildInfo.ts +54 -0
- package/lib/common/useClipboard.ts +2 -11
- package/lib/common.ts +22 -0
- package/lib/index.ts +27 -18
- package/lib/map/AppIdentity.tsx +89 -0
- package/lib/map/CompareToggle.tsx +8 -31
- package/lib/map/DebugInfo.tsx +75 -0
- package/lib/map/Geocoder.tsx +65 -50
- package/lib/map/GeocoderControls.tsx +425 -141
- package/lib/map/GraticuleLayer.tsx +56 -0
- package/lib/map/MapCanvas.tsx +26 -13
- package/lib/map/MapChipRow.tsx +4 -8
- package/lib/map/MapCompass.tsx +18 -25
- package/lib/map/MapControlStack.tsx +11 -10
- package/lib/map/MapFooter.tsx +5 -17
- package/lib/map/MapProgressBar.tsx +10 -13
- package/lib/map/MapSearchBar.tsx +31 -17
- package/lib/map/MapSheet.tsx +24 -15
- package/lib/map/OverlayLayers.tsx +14 -3
- package/lib/map/PlaceAutocomplete.tsx +12 -21
- package/lib/map/PlaceMarker.tsx +10 -4
- package/lib/map/ResolvedPlaceLayers.tsx +14 -15
- package/lib/map/ResultCamera.tsx +10 -31
- package/lib/map/ResultOverlay.tsx +14 -16
- package/lib/map/ResultPanel.tsx +1 -20
- package/lib/map/VersionPicker.tsx +10 -19
- package/lib/map/fake-runtime.ts +46 -19
- package/lib/map/geometry.ts +14 -47
- package/lib/map/graticule.ts +80 -0
- package/lib/map/map-debug.ts +4 -2
- package/lib/map/place-render.ts +30 -62
- package/lib/map/types.ts +57 -116
- package/lib/map/useCompareState.ts +5 -4
- package/lib/map/useGeocode.ts +7 -5
- package/lib/map/useMapBearing.ts +13 -13
- package/lib/map/useMapLabelPick.ts +21 -30
- package/lib/map/useMapPlaceRender.ts +3 -7
- package/lib/map/usePlaceAutocomplete.ts +44 -50
- package/lib/map.ts +92 -0
- package/lib/pipeline/CandidatePicker.tsx +13 -5
- package/lib/pipeline/ConfidenceCell.tsx +2 -2
- package/lib/pipeline/FailureDiagnostic.tsx +8 -2
- package/lib/pipeline/PipelineExplorer.tsx +6 -3
- package/lib/pipeline/QueryForm.tsx +5 -2
- package/lib/pipeline/ResolvedPlace.tsx +2 -2
- package/lib/pipeline/SpanHighlight.tsx +7 -5
- package/lib/pipeline/TimingPanel.tsx +1 -1
- package/lib/pipeline/TreeView.tsx +2 -2
- package/lib/pipeline/copy.ts +22 -25
- package/lib/pipeline/presets.ts +15 -13
- package/lib/pipeline/types.ts +20 -17
- package/lib/pipeline/useParsePipeline.ts +16 -13
- package/lib/pipeline.ts +36 -0
- package/lib/poi/AbstainPanel.tsx +1 -1
- package/lib/poi/LiveResultsBlock.tsx +2 -1
- package/lib/poi/POIExplorer.tsx +29 -17
- package/lib/poi/QueryInput.tsx +1 -1
- package/lib/poi/SubjectPanel.tsx +4 -3
- package/lib/poi/runtime.ts +14 -16
- package/lib/poi/types.ts +58 -47
- package/lib/poi/usePOISearch.ts +91 -82
- package/lib/poi.ts +40 -0
- package/lib/runtime/useReleaseRuntime.ts +122 -90
- package/lib/search/SearchModal.tsx +478 -0
- package/lib/search/search.css +282 -0
- package/lib/search/types.ts +68 -0
- package/lib/search.ts +11 -0
- package/out/common/About.d.ts +6 -6
- package/out/common/About.d.ts.map +1 -1
- package/out/common/About.js +1 -1
- package/out/common/About.js.map +1 -1
- package/out/common/ClientOnly.d.ts +2 -11
- package/out/common/ClientOnly.d.ts.map +1 -1
- package/out/common/ClientOnly.js +1 -13
- package/out/common/ClientOnly.js.map +1 -1
- package/out/common/CopyButton.d.ts +9 -3
- package/out/common/CopyButton.d.ts.map +1 -1
- package/out/common/CopyButton.js.map +1 -1
- package/out/common/LoadingIndicator.d.ts +13 -5
- package/out/common/LoadingIndicator.d.ts.map +1 -1
- package/out/common/LoadingIndicator.js.map +1 -1
- package/out/common/PresetChips.d.ts +11 -8
- package/out/common/PresetChips.d.ts.map +1 -1
- package/out/common/PresetChips.js.map +1 -1
- package/out/common/confidence-tiers.d.ts +8 -7
- package/out/common/confidence-tiers.d.ts.map +1 -1
- package/out/common/confidence-tiers.js +7 -6
- package/out/common/confidence-tiers.js.map +1 -1
- package/out/common/cx.d.ts +3 -1
- package/out/common/cx.d.ts.map +1 -1
- package/out/common/cx.js +3 -1
- package/out/common/cx.js.map +1 -1
- package/out/common/text-tokens.d.ts +6 -11
- package/out/common/text-tokens.d.ts.map +1 -1
- package/out/common/text-tokens.js +6 -3
- package/out/common/text-tokens.js.map +1 -1
- package/out/common/useBuildInfo.d.ts +27 -0
- package/out/common/useBuildInfo.d.ts.map +1 -0
- package/out/common/useBuildInfo.js +32 -0
- package/out/common/useBuildInfo.js.map +1 -0
- package/out/common/useClipboard.d.ts +1 -3
- package/out/common/useClipboard.d.ts.map +1 -1
- package/out/common/useClipboard.js +2 -11
- package/out/common/useClipboard.js.map +1 -1
- package/out/common.d.ts +22 -0
- package/out/common.d.ts.map +1 -0
- package/out/common.js +15 -0
- package/out/common.js.map +1 -0
- package/out/index.d.ts +26 -16
- package/out/index.d.ts.map +1 -1
- package/out/index.js +21 -15
- package/out/index.js.map +1 -1
- package/out/map/AppIdentity.d.ts +46 -0
- package/out/map/AppIdentity.d.ts.map +1 -0
- package/out/map/AppIdentity.js +16 -0
- package/out/map/AppIdentity.js.map +1 -0
- package/out/map/CompareToggle.d.ts +8 -31
- package/out/map/CompareToggle.d.ts.map +1 -1
- package/out/map/CompareToggle.js +4 -1
- package/out/map/CompareToggle.js.map +1 -1
- package/out/map/DebugInfo.d.ts +27 -0
- package/out/map/DebugInfo.d.ts.map +1 -0
- package/out/map/DebugInfo.js +36 -0
- package/out/map/DebugInfo.js.map +1 -0
- package/out/map/Geocoder.d.ts +41 -30
- package/out/map/Geocoder.d.ts.map +1 -1
- package/out/map/Geocoder.js +23 -37
- package/out/map/Geocoder.js.map +1 -1
- package/out/map/GeocoderControls.d.ts +15 -44
- package/out/map/GeocoderControls.d.ts.map +1 -1
- package/out/map/GeocoderControls.js +250 -39
- package/out/map/GeocoderControls.js.map +1 -1
- package/out/map/GraticuleLayer.d.ts +30 -0
- package/out/map/GraticuleLayer.d.ts.map +1 -0
- package/out/map/GraticuleLayer.js +25 -0
- package/out/map/GraticuleLayer.js.map +1 -0
- package/out/map/MapCanvas.d.ts +26 -13
- package/out/map/MapCanvas.d.ts.map +1 -1
- package/out/map/MapCanvas.js +5 -2
- package/out/map/MapCanvas.js.map +1 -1
- package/out/map/MapChipRow.d.ts +4 -8
- package/out/map/MapChipRow.d.ts.map +1 -1
- package/out/map/MapChipRow.js.map +1 -1
- package/out/map/MapCompass.d.ts +14 -21
- package/out/map/MapCompass.d.ts.map +1 -1
- package/out/map/MapCompass.js +5 -1
- package/out/map/MapCompass.js.map +1 -1
- package/out/map/MapControlStack.d.ts +11 -10
- package/out/map/MapControlStack.d.ts.map +1 -1
- package/out/map/MapControlStack.js +4 -1
- package/out/map/MapControlStack.js.map +1 -1
- package/out/map/MapFooter.d.ts +5 -16
- package/out/map/MapFooter.d.ts.map +1 -1
- package/out/map/MapFooter.js +0 -14
- package/out/map/MapFooter.js.map +1 -1
- package/out/map/MapProgressBar.d.ts +10 -13
- package/out/map/MapProgressBar.d.ts.map +1 -1
- package/out/map/MapProgressBar.js.map +1 -1
- package/out/map/MapSearchBar.d.ts +16 -17
- package/out/map/MapSearchBar.d.ts.map +1 -1
- package/out/map/MapSearchBar.js +6 -0
- package/out/map/MapSearchBar.js.map +1 -1
- package/out/map/MapSheet.d.ts +15 -12
- package/out/map/MapSheet.d.ts.map +1 -1
- package/out/map/MapSheet.js +8 -12
- package/out/map/MapSheet.js.map +1 -1
- package/out/map/OverlayLayers.d.ts +8 -2
- package/out/map/OverlayLayers.d.ts.map +1 -1
- package/out/map/OverlayLayers.js +3 -3
- package/out/map/OverlayLayers.js.map +1 -1
- package/out/map/PlaceAutocomplete.d.ts +12 -21
- package/out/map/PlaceAutocomplete.d.ts.map +1 -1
- package/out/map/PlaceAutocomplete.js +2 -1
- package/out/map/PlaceAutocomplete.js.map +1 -1
- package/out/map/PlaceMarker.d.ts +10 -4
- package/out/map/PlaceMarker.d.ts.map +1 -1
- package/out/map/PlaceMarker.js +3 -1
- package/out/map/PlaceMarker.js.map +1 -1
- package/out/map/ResolvedPlaceLayers.d.ts +14 -15
- package/out/map/ResolvedPlaceLayers.d.ts.map +1 -1
- package/out/map/ResolvedPlaceLayers.js +1 -1
- package/out/map/ResolvedPlaceLayers.js.map +1 -1
- package/out/map/ResultCamera.d.ts +10 -31
- package/out/map/ResultCamera.d.ts.map +1 -1
- package/out/map/ResultCamera.js +3 -28
- package/out/map/ResultCamera.js.map +1 -1
- package/out/map/ResultOverlay.d.ts +14 -16
- package/out/map/ResultOverlay.d.ts.map +1 -1
- package/out/map/ResultOverlay.js +1 -2
- package/out/map/ResultOverlay.js.map +1 -1
- package/out/map/ResultPanel.d.ts +1 -20
- package/out/map/ResultPanel.d.ts.map +1 -1
- package/out/map/ResultPanel.js.map +1 -1
- package/out/map/VersionPicker.d.ts +7 -19
- package/out/map/VersionPicker.d.ts.map +1 -1
- package/out/map/VersionPicker.js +5 -2
- package/out/map/VersionPicker.js.map +1 -1
- package/out/map/fake-runtime.d.ts +9 -11
- package/out/map/fake-runtime.d.ts.map +1 -1
- package/out/map/fake-runtime.js +45 -19
- package/out/map/fake-runtime.js.map +1 -1
- package/out/map/geometry.d.ts +13 -34
- package/out/map/geometry.d.ts.map +1 -1
- package/out/map/geometry.js +9 -34
- package/out/map/geometry.js.map +1 -1
- package/out/map/graticule.d.ts +17 -0
- package/out/map/graticule.d.ts.map +1 -0
- package/out/map/graticule.js +67 -0
- package/out/map/graticule.js.map +1 -0
- package/out/map/map-debug.d.ts +4 -2
- package/out/map/map-debug.d.ts.map +1 -1
- package/out/map/map-debug.js +1 -1
- package/out/map/map-debug.js.map +1 -1
- package/out/map/place-render.d.ts +25 -45
- package/out/map/place-render.d.ts.map +1 -1
- package/out/map/place-render.js +4 -39
- package/out/map/place-render.js.map +1 -1
- package/out/map/types.d.ts +57 -113
- package/out/map/types.d.ts.map +1 -1
- package/out/map/types.js +1 -10
- package/out/map/types.js.map +1 -1
- package/out/map/useCompareState.d.ts +5 -4
- package/out/map/useCompareState.d.ts.map +1 -1
- package/out/map/useCompareState.js +3 -3
- package/out/map/useCompareState.js.map +1 -1
- package/out/map/useGeocode.d.ts +5 -3
- package/out/map/useGeocode.d.ts.map +1 -1
- package/out/map/useGeocode.js +4 -4
- package/out/map/useGeocode.js.map +1 -1
- package/out/map/useMapBearing.d.ts +11 -11
- package/out/map/useMapBearing.d.ts.map +1 -1
- package/out/map/useMapBearing.js +6 -11
- package/out/map/useMapBearing.js.map +1 -1
- package/out/map/useMapLabelPick.d.ts +4 -14
- package/out/map/useMapLabelPick.d.ts.map +1 -1
- package/out/map/useMapLabelPick.js +21 -30
- package/out/map/useMapLabelPick.js.map +1 -1
- package/out/map/useMapPlaceRender.d.ts +3 -7
- package/out/map/useMapPlaceRender.d.ts.map +1 -1
- package/out/map/useMapPlaceRender.js +2 -6
- package/out/map/useMapPlaceRender.js.map +1 -1
- package/out/map/usePlaceAutocomplete.d.ts +30 -28
- package/out/map/usePlaceAutocomplete.d.ts.map +1 -1
- package/out/map/usePlaceAutocomplete.js +6 -33
- package/out/map/usePlaceAutocomplete.js.map +1 -1
- package/out/map.d.ts +67 -0
- package/out/map.d.ts.map +1 -0
- package/out/map.js +45 -0
- package/out/map.js.map +1 -0
- package/out/pipeline/CandidatePicker.d.ts +12 -2
- package/out/pipeline/CandidatePicker.d.ts.map +1 -1
- package/out/pipeline/CandidatePicker.js +1 -1
- package/out/pipeline/CandidatePicker.js.map +1 -1
- package/out/pipeline/ConfidenceCell.d.ts +2 -2
- package/out/pipeline/ConfidenceCell.d.ts.map +1 -1
- package/out/pipeline/ConfidenceCell.js +1 -1
- package/out/pipeline/FailureDiagnostic.d.ts +8 -2
- package/out/pipeline/FailureDiagnostic.d.ts.map +1 -1
- package/out/pipeline/FailureDiagnostic.js +3 -0
- package/out/pipeline/FailureDiagnostic.js.map +1 -1
- package/out/pipeline/PipelineExplorer.d.ts +6 -2
- package/out/pipeline/PipelineExplorer.d.ts.map +1 -1
- package/out/pipeline/PipelineExplorer.js +1 -1
- package/out/pipeline/PipelineExplorer.js.map +1 -1
- package/out/pipeline/QueryForm.d.ts +5 -2
- package/out/pipeline/QueryForm.d.ts.map +1 -1
- package/out/pipeline/QueryForm.js.map +1 -1
- package/out/pipeline/ResolvedPlace.d.ts +1 -1
- package/out/pipeline/ResolvedPlace.d.ts.map +1 -1
- package/out/pipeline/SpanHighlight.d.ts +4 -3
- package/out/pipeline/SpanHighlight.d.ts.map +1 -1
- package/out/pipeline/SpanHighlight.js +3 -2
- package/out/pipeline/SpanHighlight.js.map +1 -1
- package/out/pipeline/TimingPanel.d.ts +1 -1
- package/out/pipeline/TreeView.d.ts +1 -1
- package/out/pipeline/TreeView.js.map +1 -1
- package/out/pipeline/copy.d.ts +1 -1
- package/out/pipeline/copy.d.ts.map +1 -1
- package/out/pipeline/copy.js +4 -3
- package/out/pipeline/copy.js.map +1 -1
- package/out/pipeline/presets.d.ts +5 -4
- package/out/pipeline/presets.d.ts.map +1 -1
- package/out/pipeline/presets.js +15 -13
- package/out/pipeline/presets.js.map +1 -1
- package/out/pipeline/types.d.ts +20 -17
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/pipeline/types.js +2 -4
- package/out/pipeline/types.js.map +1 -1
- package/out/pipeline/useParsePipeline.d.ts +14 -9
- package/out/pipeline/useParsePipeline.d.ts.map +1 -1
- package/out/pipeline/useParsePipeline.js +7 -8
- package/out/pipeline/useParsePipeline.js.map +1 -1
- package/out/pipeline.d.ts +33 -0
- package/out/pipeline.d.ts.map +1 -0
- package/out/pipeline.js +21 -0
- package/out/pipeline.js.map +1 -0
- package/out/poi/AbstainPanel.d.ts +1 -1
- package/out/poi/LiveResultsBlock.d.ts +2 -1
- package/out/poi/LiveResultsBlock.d.ts.map +1 -1
- package/out/poi/LiveResultsBlock.js.map +1 -1
- package/out/poi/POIExplorer.d.ts +22 -12
- package/out/poi/POIExplorer.d.ts.map +1 -1
- package/out/poi/POIExplorer.js +11 -10
- package/out/poi/POIExplorer.js.map +1 -1
- package/out/poi/QueryInput.d.ts +1 -1
- package/out/poi/SubjectPanel.d.ts +2 -2
- package/out/poi/SubjectPanel.d.ts.map +1 -1
- package/out/poi/SubjectPanel.js +2 -1
- package/out/poi/SubjectPanel.js.map +1 -1
- package/out/poi/runtime.d.ts +5 -14
- package/out/poi/runtime.d.ts.map +1 -1
- package/out/poi/runtime.js +14 -16
- package/out/poi/runtime.js.map +1 -1
- package/out/poi/types.d.ts +53 -45
- package/out/poi/types.d.ts.map +1 -1
- package/out/poi/types.js +2 -4
- package/out/poi/types.js.map +1 -1
- package/out/poi/usePOISearch.d.ts +30 -17
- package/out/poi/usePOISearch.d.ts.map +1 -1
- package/out/poi/usePOISearch.js +48 -64
- package/out/poi/usePOISearch.js.map +1 -1
- package/out/poi.d.ts +23 -0
- package/out/poi.d.ts.map +1 -0
- package/out/poi.js +15 -0
- package/out/poi.js.map +1 -0
- package/out/runtime/useReleaseRuntime.d.ts +63 -74
- package/out/runtime/useReleaseRuntime.d.ts.map +1 -1
- package/out/runtime/useReleaseRuntime.js +31 -32
- package/out/runtime/useReleaseRuntime.js.map +1 -1
- package/out/{runtime/index.d.ts → runtime.d.ts} +1 -1
- package/out/runtime.d.ts.map +1 -0
- package/out/{runtime/index.js → runtime.js} +1 -1
- package/out/runtime.js.map +1 -0
- package/out/search/SearchModal.d.ts +40 -0
- package/out/search/SearchModal.d.ts.map +1 -0
- package/out/search/SearchModal.js +255 -0
- package/out/search/SearchModal.js.map +1 -0
- package/out/search/types.d.ts +65 -0
- package/out/search/types.d.ts.map +1 -0
- package/out/search/types.js +13 -0
- package/out/search/types.js.map +1 -0
- package/out/search.d.ts +11 -0
- package/out/search.d.ts.map +1 -0
- package/out/search.js +9 -0
- package/out/search.js.map +1 -0
- package/package.json +73 -165
- package/styles.css +482 -266
- package/tokens/index.css +24 -6
- package/tokens/tokens.json +114 -6
- package/lib/common/index.ts +0 -22
- package/lib/map/BackendControl.tsx +0 -51
- package/lib/map/index.ts +0 -95
- package/lib/pipeline/index.ts +0 -36
- package/lib/poi/index.ts +0 -39
- package/out/common/index.d.ts +0 -22
- package/out/common/index.d.ts.map +0 -1
- package/out/common/index.js +0 -15
- package/out/common/index.js.map +0 -1
- package/out/map/BackendControl.d.ts +0 -32
- package/out/map/BackendControl.d.ts.map +0 -1
- package/out/map/BackendControl.js +0 -8
- package/out/map/BackendControl.js.map +0 -1
- package/out/map/index.d.ts +0 -69
- package/out/map/index.d.ts.map +0 -1
- package/out/map/index.js +0 -46
- package/out/map/index.js.map +0 -1
- package/out/pipeline/index.d.ts +0 -33
- package/out/pipeline/index.d.ts.map +0 -1
- package/out/pipeline/index.js +0 -21
- package/out/pipeline/index.js.map +0 -1
- package/out/poi/index.d.ts +0 -23
- package/out/poi/index.d.ts.map +0 -1
- package/out/poi/index.js +0 -15
- package/out/poi/index.js.map +0 -1
- package/out/runtime/index.d.ts.map +0 -1
- package/out/runtime/index.js.map +0 -1
- package/styleframe.config.ts +0 -329
- package/vitest.node.config.ts +0 -20
- /package/lib/{runtime/index.ts → runtime.ts} +0 -0
package/out/map/fake-runtime.js
CHANGED
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* A fake geocoder runtime: canned parse + resolve, an offline stub map style, canned autocomplete, a version list.
|
|
7
|
-
* No network, no ONNX, no maplibre at run time — everything is data. It is what the stories and component tests
|
|
8
|
-
* mount, and what a host mounts to show the UI without the model.
|
|
9
5
|
*/
|
|
10
6
|
/**
|
|
11
|
-
*
|
|
7
|
+
* Defines an offline map style with a single background layer and no sources,
|
|
8
|
+
* so it renders in headless Storybook without network access.
|
|
12
9
|
*/
|
|
13
10
|
export const STUB_MAP_STYLE = {
|
|
14
11
|
version: 8,
|
|
@@ -25,11 +22,11 @@ export const FAKE_SUGGESTIONS = [
|
|
|
25
22
|
{ value: "Newark", placetype: "locality" },
|
|
26
23
|
];
|
|
27
24
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
25
|
+
* Creates an offline {@link GeocoderRuntime} that extends {@link makePipelineRuntime}
|
|
26
|
+
* with the stub style, canned suggestions and versions.
|
|
27
|
+
*
|
|
28
|
+
* It also provides `resolveMapPlace` that gives the candidate a bounding box so overlays draw.
|
|
29
|
+
* The fake ignores the bias passed to `runParseWithBias`.
|
|
33
30
|
*/
|
|
34
31
|
export function makeFakeGeocoderRuntime(overrides = {}) {
|
|
35
32
|
const base = makePipelineRuntime();
|
|
@@ -48,10 +45,7 @@ export function makeFakeGeocoderRuntime(overrides = {}) {
|
|
|
48
45
|
],
|
|
49
46
|
selectedVersion: "v7.2.0",
|
|
50
47
|
selectVersion: () => { },
|
|
51
|
-
activeBackend: "
|
|
52
|
-
forceWASM: false,
|
|
53
|
-
setForceWASM: () => { },
|
|
54
|
-
// Enrich the selected candidate with a bbox so an outline renders (case 4: bbox → approximate circle + fit).
|
|
48
|
+
activeBackend: "wasm (28 MB int8)",
|
|
55
49
|
resolveMapPlace: (candidate) => ({
|
|
56
50
|
...candidate,
|
|
57
51
|
bbox: {
|
|
@@ -65,7 +59,8 @@ export function makeFakeGeocoderRuntime(overrides = {}) {
|
|
|
65
59
|
};
|
|
66
60
|
}
|
|
67
61
|
/**
|
|
68
|
-
*
|
|
62
|
+
* Creates a fixed, fully populated parse-and-resolve result for the given input,
|
|
63
|
+
* shared by the fake pipeline runtime and result-panel fixtures.
|
|
69
64
|
*/
|
|
70
65
|
export function makeFakeParseResult(input = "350 5th Ave, New York, NY 10118") {
|
|
71
66
|
return {
|
|
@@ -74,17 +69,48 @@ export function makeFakeParseResult(input = "350 5th Ave, New York, NY 10118") {
|
|
|
74
69
|
nodes: [
|
|
75
70
|
{ tag: "house_number", value: "350", confidence: 0.97, start: 0, end: 3 },
|
|
76
71
|
{ tag: "street", value: "5th Ave", confidence: 0.88, start: 4, end: 11 },
|
|
77
|
-
{ tag: "locality", value: "New York", confidence: 0.71 },
|
|
72
|
+
{ tag: "locality", value: "New York", confidence: 0.71, start: null, end: null },
|
|
78
73
|
],
|
|
79
74
|
kindResult: { kind: "structured_address", confidence: 0.95, alternatives: [] },
|
|
80
75
|
timing: { shape: 0.4, classify: 12.1, resolve: 4.2 },
|
|
81
|
-
resolved: {
|
|
76
|
+
resolved: {
|
|
77
|
+
id: 85_977_539,
|
|
78
|
+
name: "New York",
|
|
79
|
+
placetype: "locality",
|
|
80
|
+
lat: 40.7128,
|
|
81
|
+
lon: -74.006,
|
|
82
|
+
score: 0.82,
|
|
83
|
+
bbox: null,
|
|
84
|
+
tier: null,
|
|
85
|
+
uncertaintyM: null,
|
|
86
|
+
},
|
|
82
87
|
candidates: [
|
|
83
|
-
{
|
|
84
|
-
|
|
88
|
+
{
|
|
89
|
+
id: 85_977_539,
|
|
90
|
+
name: "New York",
|
|
91
|
+
placetype: "locality",
|
|
92
|
+
lat: 40.7128,
|
|
93
|
+
lon: -74.006,
|
|
94
|
+
score: 0.82,
|
|
95
|
+
bbox: null,
|
|
96
|
+
tier: null,
|
|
97
|
+
uncertaintyM: null,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: 101_715_829,
|
|
101
|
+
name: "New York",
|
|
102
|
+
placetype: "region",
|
|
103
|
+
lat: 43,
|
|
104
|
+
lon: -75,
|
|
105
|
+
score: 0.55,
|
|
106
|
+
bbox: null,
|
|
107
|
+
tier: null,
|
|
108
|
+
uncertaintyM: null,
|
|
109
|
+
},
|
|
85
110
|
],
|
|
86
111
|
fstActive: true,
|
|
87
112
|
fstProvenance: { builtAt: "2026-07-01T00:00:00Z", stateCount: 51, placeCount: 94_000, importanceMatches: 12_000 },
|
|
113
|
+
dualRoles: null,
|
|
88
114
|
};
|
|
89
115
|
}
|
|
90
116
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake-runtime.js","sourceRoot":"","sources":["../../lib/map/fake-runtime.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fake-runtime.js","sourceRoot":"","sources":["../../lib/map/fake-runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC7C,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,kBAAkB,EAAE,SAAS,EAAE,EAAE,CAAC;CAC5F,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAiB;IAC7C,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE;IAC5C,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE;IAC/C,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE;CAC1C,CAAA;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,SAAS,GAA6B,EAAE;IAC/E,MAAM,IAAI,GAAG,mBAAmB,EAAE,CAAA;IAElC,OAAO;QACN,GAAG,IAAI;QACP,QAAQ,EAAE,cAAc;QACxB,aAAa,EAAE,CA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AG,EAAE,EAAE;gBACP,GAAG,EAAE,CAAC,EAAE;gBACR,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE,IAAI;gBACV,YAAY,EAAE,IAAI;aAClB;SACD;QACD,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE;QACjH,SAAS,EAAE,IAAI;KACf,CAAA;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAS,GAA6B,EAAE;IAC3E,OAAO;QACN,KAAK,EAAE,IAAI;QACX,gBAAgB,EAAE,CAAC,wBAAwB,EAAE,4BAA4B,EAAE,yBAAyB,CAAC;QACrG,YAAY,EAAE,IAAI;QAClB,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAwB,EAAE;YAC5D,OAAO,CAAC,CAAC,CAAC,CAAA;YACV,OAAO,CAAC,CAAC,CAAC,CAAA;YAEV,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAA;QAClC,CAAC;QACD,GAAG,SAAS;KACZ,CAAA;AACF,CAAC"}
|
package/out/map/geometry.d.ts
CHANGED
|
@@ -2,19 +2,8 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Pure map geometry for the geocoder demo — the resolved-place outline math, lifted verbatim from the
|
|
7
|
-
* docs demo's `_map-helpers.ts`. Zero imports: no React, no `react-map-gl`, no `maplibre-gl`, no DOM.
|
|
8
|
-
* Every function takes plain numbers and returns plain GeoJSON, so the whole module runs (and is
|
|
9
|
-
* tested) under bare node — see `geometry.node.test.ts`.
|
|
10
|
-
*
|
|
11
|
-
* WHY NOT `@mailwoman/spatial`: the only truly-spatial primitive here is the bbox half-diagonal (a
|
|
12
|
-
* great-circle-ish distance). `@mailwoman/spatial` exposes `haversineKm`, but ONLY via its root barrel,
|
|
13
|
-
* which pulls `@mailwoman/core` + `h3-js` + `wkx` — a heavy, partly node-only graph — into what must
|
|
14
|
-
* stay a lightweight, browser-only map bundle (the `@mailwoman/react/map` subpath). The original
|
|
15
|
-
* `_map-helpers.ts` made the same call: a planar `kmPerDeg` approximation, local, no dependency. We
|
|
16
|
-
* preserve it so the ported behavior is byte-identical and the browser graph stays clean.
|
|
17
5
|
*/
|
|
6
|
+
import type { LatLonBounds } from "@mailwoman/spatial";
|
|
18
7
|
/**
|
|
19
8
|
* A GeoJSON Polygon / MultiPolygon — what the polygon DB stores and the map draws as the place outline.
|
|
20
9
|
*/
|
|
@@ -25,39 +14,29 @@ export type PlaceGeometry = {
|
|
|
25
14
|
type: "MultiPolygon";
|
|
26
15
|
coordinates: number[][][][];
|
|
27
16
|
};
|
|
28
|
-
/**
|
|
29
|
-
* A place bounding box in the demo's object form (the WOF points DB carries only these four numbers).
|
|
30
|
-
*/
|
|
31
|
-
export interface PlaceBBox {
|
|
32
|
-
minLat: number;
|
|
33
|
-
maxLat: number;
|
|
34
|
-
minLon: number;
|
|
35
|
-
maxLon: number;
|
|
36
|
-
}
|
|
37
17
|
/**
|
|
38
18
|
* A `[west, south, east, north]` → `[[minLon, minLat], [maxLon, maxLat]]` pair, the shape `fitBounds` wants.
|
|
39
19
|
*/
|
|
40
20
|
export type BoundsTuple = [[number, number], [number, number]];
|
|
41
21
|
/**
|
|
42
|
-
*
|
|
43
|
-
* half
|
|
44
|
-
* poles. With no bbox (anchor-centroid postcodes carry no extent) it defaults to a ~ZIP-sized 3 km radius.
|
|
22
|
+
* Returns a circle approximating the extent of a place that has no polygon, with a radius
|
|
23
|
+
* of half the bbox diagonal clamped to 0.5–50 km, or 3 km when there is no bbox.
|
|
45
24
|
*/
|
|
46
|
-
export declare function approxCircleGeometry(lat: number, lon: number, bbox?:
|
|
25
|
+
export declare function approxCircleGeometry(lat: number, lon: number, bbox?: LatLonBounds): PlaceGeometry;
|
|
47
26
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* honors small radii so an exact building reads as a tight dot (an ~8 m floor keeps a 10 m situs circle visible).
|
|
27
|
+
* Returns a circle with the given radius in meters for street-level uncertainty, floored at 8 m
|
|
28
|
+
* so that a precise point stays visible, unlike {@link approxCircleGeometry}'s 0.5 km floor.
|
|
51
29
|
*/
|
|
52
30
|
export declare function radiusCircleGeometry(lat: number, lon: number, radiusM: number): PlaceGeometry;
|
|
53
31
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
32
|
+
* Returns the bounding box of a Polygon or MultiPolygon for `fitBounds`.
|
|
33
|
+
*
|
|
34
|
+
* Geometry that crosses the antimeridian gets a naive min/max box, so callers
|
|
35
|
+
* that need a wrapped box must handle it themselves.
|
|
57
36
|
*/
|
|
58
|
-
export declare function geomBounds(geometry: PlaceGeometry):
|
|
37
|
+
export declare function geomBounds(geometry: PlaceGeometry): LatLonBounds;
|
|
59
38
|
/**
|
|
60
|
-
* Reshape a {@link
|
|
39
|
+
* Reshape a {@link LatLonBounds} into the `[[minLon, minLat], [maxLon, maxLat]]` pair `fitBounds` expects.
|
|
61
40
|
*/
|
|
62
|
-
export declare function bboxToBounds(bbox:
|
|
41
|
+
export declare function bboxToBounds(bbox: LatLonBounds): BoundsTuple;
|
|
63
42
|
//# sourceMappingURL=geometry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../lib/map/geometry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../lib/map/geometry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAMtD;;GAEG;AACH,MAAM,MAAM,aAAa,GACtB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,CAAA;CAAE,GAC9C;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAA;CAAE,CAAA;AAExD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AAmB9D;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,aAAa,CAQjG;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,CAI7F;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,aAAa,GAAG,YAAY,CAwChE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,WAAW,CAK5D"}
|
package/out/map/geometry.js
CHANGED
|
@@ -2,36 +2,12 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Pure map geometry for the geocoder demo — the resolved-place outline math, lifted verbatim from the
|
|
7
|
-
* docs demo's `_map-helpers.ts`. Zero imports: no React, no `react-map-gl`, no `maplibre-gl`, no DOM.
|
|
8
|
-
* Every function takes plain numbers and returns plain GeoJSON, so the whole module runs (and is
|
|
9
|
-
* tested) under bare node — see `geometry.node.test.ts`.
|
|
10
|
-
*
|
|
11
|
-
* WHY NOT `@mailwoman/spatial`: the only truly-spatial primitive here is the bbox half-diagonal (a
|
|
12
|
-
* great-circle-ish distance). `@mailwoman/spatial` exposes `haversineKm`, but ONLY via its root barrel,
|
|
13
|
-
* which pulls `@mailwoman/core` + `h3-js` + `wkx` — a heavy, partly node-only graph — into what must
|
|
14
|
-
* stay a lightweight, browser-only map bundle (the `@mailwoman/react/map` subpath). The original
|
|
15
|
-
* `_map-helpers.ts` made the same call: a planar `kmPerDeg` approximation, local, no dependency. We
|
|
16
|
-
* preserve it so the ported behavior is byte-identical and the browser graph stays clean.
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* Segments used to approximate a circle as a polygon ring.
|
|
20
5
|
*/
|
|
21
6
|
const CIRCLE_SEGMENTS = 64;
|
|
22
|
-
/**
|
|
23
|
-
* Mean km per degree of latitude (WGS84 average).
|
|
24
|
-
*/
|
|
25
7
|
const KM_PER_DEG_LAT = 111.32;
|
|
26
|
-
/**
|
|
27
|
-
* Km per degree of longitude at a given latitude — the meridians converge toward the poles.
|
|
28
|
-
*/
|
|
29
8
|
function kmPerDegLon(lat) {
|
|
30
9
|
return KM_PER_DEG_LAT * Math.cos((lat * Math.PI) / 180);
|
|
31
10
|
}
|
|
32
|
-
/**
|
|
33
|
-
* A closed 64-segment (65-point) GeoJSON ring of `radiusKM` around `[lon, lat]`, with latitude correction.
|
|
34
|
-
*/
|
|
35
11
|
function circleRing(lat, lon, radiusKM) {
|
|
36
12
|
const perLon = kmPerDegLon(lat);
|
|
37
13
|
const ring = [];
|
|
@@ -42,9 +18,8 @@ function circleRing(lat, lon, radiusKM) {
|
|
|
42
18
|
return ring;
|
|
43
19
|
}
|
|
44
20
|
/**
|
|
45
|
-
*
|
|
46
|
-
* half
|
|
47
|
-
* poles. With no bbox (anchor-centroid postcodes carry no extent) it defaults to a ~ZIP-sized 3 km radius.
|
|
21
|
+
* Returns a circle approximating the extent of a place that has no polygon, with a radius
|
|
22
|
+
* of half the bbox diagonal clamped to 0.5–50 km, or 3 km when there is no bbox.
|
|
48
23
|
*/
|
|
49
24
|
export function approxCircleGeometry(lat, lon, bbox) {
|
|
50
25
|
const halfDiagKm = bbox
|
|
@@ -54,18 +29,18 @@ export function approxCircleGeometry(lat, lon, bbox) {
|
|
|
54
29
|
return { type: "Polygon", coordinates: [circleRing(lat, lon, radiusKM)] };
|
|
55
30
|
}
|
|
56
31
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* honors small radii so an exact building reads as a tight dot (an ~8 m floor keeps a 10 m situs circle visible).
|
|
32
|
+
* Returns a circle with the given radius in meters for street-level uncertainty, floored at 8 m
|
|
33
|
+
* so that a precise point stays visible, unlike {@link approxCircleGeometry}'s 0.5 km floor.
|
|
60
34
|
*/
|
|
61
35
|
export function radiusCircleGeometry(lat, lon, radiusM) {
|
|
62
36
|
const radiusKM = Math.max(0.008, radiusM / 1000);
|
|
63
37
|
return { type: "Polygon", coordinates: [circleRing(lat, lon, radiusKM)] };
|
|
64
38
|
}
|
|
65
39
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
40
|
+
* Returns the bounding box of a Polygon or MultiPolygon for `fitBounds`.
|
|
41
|
+
*
|
|
42
|
+
* Geometry that crosses the antimeridian gets a naive min/max box, so callers
|
|
43
|
+
* that need a wrapped box must handle it themselves.
|
|
69
44
|
*/
|
|
70
45
|
export function geomBounds(geometry) {
|
|
71
46
|
let minLon = Infinity;
|
|
@@ -100,7 +75,7 @@ export function geomBounds(geometry) {
|
|
|
100
75
|
return { minLon, minLat, maxLon, maxLat };
|
|
101
76
|
}
|
|
102
77
|
/**
|
|
103
|
-
* Reshape a {@link
|
|
78
|
+
* Reshape a {@link LatLonBounds} into the `[[minLon, minLat], [maxLon, maxLat]]` pair `fitBounds` expects.
|
|
104
79
|
*/
|
|
105
80
|
export function bboxToBounds(bbox) {
|
|
106
81
|
return [
|
package/out/map/geometry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry.js","sourceRoot":"","sources":["../../lib/map/geometry.ts"],"names":[],"mappings":"AAAA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GAAG,CAAA;YACb,CAAC;YAED,IAAI,GAAG,GAAG,MAAM,EAAE,CAAC;gBAClB,MAAM,GAAG,GAAG,CAAA;YACb,CAAC;YAED,IAAI,GAAG,GAAG,MAAM,EAAE,CAAC;gBAClB,MAAM,GAAG,GAAG,CAAA;YACb,CAAC;YAED,IAAI,GAAG,GAAG,MAAM,EAAE,CAAC;gBAClB,MAAM,GAAG,GAAG,CAAA;YACb,CAAC;YAED,OAAM;QACP,CAAC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACzB,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;gBAC1B,KAAK,CAAC,KAAK,CAAC,CAAA;YACb,CAAC;QACF,CAAC;IACF,CAAC,CAAA;IAED,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;IAE3B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAAkB;IAC9C,OAAO;QACN,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;QAC1B,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;KAC1B,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* The graticule's geometry, apart from its component — the same split `place-render.ts` keeps from
|
|
7
|
+
* `ResolvedPlaceLayers.tsx`. Pure and node-testable; `#*` resolves `.ts` only, so this is also the file the test can
|
|
8
|
+
* import.
|
|
9
|
+
*/
|
|
10
|
+
import type { FeatureCollection, MultiLineString } from "geojson";
|
|
11
|
+
/**
|
|
12
|
+
* Build the graticule as one MultiLineString.
|
|
13
|
+
*
|
|
14
|
+
* Pure — same step, same geometry — so it is built once at module scope and never rebuilt for a render.
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildGraticule(stepDegrees?: number): FeatureCollection<MultiLineString>;
|
|
17
|
+
//# sourceMappingURL=graticule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graticule.d.ts","sourceRoot":"","sources":["../../lib/map/graticule.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAgCjE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,WAAW,GAAE,MAA6B,GAAG,iBAAiB,CAAC,eAAe,CAAC,CAgC7G"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* The graticule's geometry, apart from its component — the same split `place-render.ts` keeps from
|
|
7
|
+
* `ResolvedPlaceLayers.tsx`. Pure and node-testable; `#*` resolves `.ts` only, so this is also the file the test can
|
|
8
|
+
* import.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Degrees between grid lines. 15° is one hour of longitude — twelve meridians and eleven
|
|
12
|
+
* parallels, dense enough to read as a globe and sparse enough not to read as graph paper.
|
|
13
|
+
*/
|
|
14
|
+
const DEFAULT_STEP_DEGREES = 15;
|
|
15
|
+
/**
|
|
16
|
+
* Degrees between vertices along each line.
|
|
17
|
+
*
|
|
18
|
+
* A meridian drawn as two points is a straight chord through the sphere under a globe projection.
|
|
19
|
+
* It has to be densified to curve. 2° keeps the longest line under 100 vertices.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* The antimeridian, in degrees.
|
|
23
|
+
*
|
|
24
|
+
* Longitude runs [-180, 180]; meridians are drawn from the first bound up to but not including
|
|
25
|
+
* the second, because -180 and 180 are the same line and drawing both puts two strokes on one pixel.
|
|
26
|
+
*/
|
|
27
|
+
const MAX_LONGITUDE = 180;
|
|
28
|
+
const VERTEX_STEP_DEGREES = 2;
|
|
29
|
+
/**
|
|
30
|
+
* The latitude the parallels stop at.
|
|
31
|
+
*
|
|
32
|
+
* Past ~85° the meridians have converged close enough that more rings read as a smudge at the pole.
|
|
33
|
+
* Web Mercator's own limit is 85.051129.
|
|
34
|
+
*/
|
|
35
|
+
const MAX_LATITUDE = 85;
|
|
36
|
+
/**
|
|
37
|
+
* Build the graticule as one MultiLineString.
|
|
38
|
+
*
|
|
39
|
+
* Pure — same step, same geometry — so it is built once at module scope and never rebuilt for a render.
|
|
40
|
+
*/
|
|
41
|
+
export function buildGraticule(stepDegrees = DEFAULT_STEP_DEGREES) {
|
|
42
|
+
const lines = [];
|
|
43
|
+
// Meridians: constant longitude, walking latitude pole to pole.
|
|
44
|
+
for (let lon = -MAX_LONGITUDE; lon < MAX_LONGITUDE; lon += stepDegrees) {
|
|
45
|
+
const line = [];
|
|
46
|
+
for (let lat = -MAX_LATITUDE; lat <= MAX_LATITUDE; lat += VERTEX_STEP_DEGREES) {
|
|
47
|
+
line.push([lon, lat]);
|
|
48
|
+
}
|
|
49
|
+
line.push([lon, MAX_LATITUDE]);
|
|
50
|
+
lines.push(line);
|
|
51
|
+
}
|
|
52
|
+
// Parallels: constant latitude, walking longitude all the way round.
|
|
53
|
+
// The equator is included.
|
|
54
|
+
// The poles are not.
|
|
55
|
+
for (let lat = -MAX_LATITUDE + stepDegrees; lat < MAX_LATITUDE; lat += stepDegrees) {
|
|
56
|
+
const line = [];
|
|
57
|
+
for (let lon = -MAX_LONGITUDE; lon <= MAX_LONGITUDE; lon += VERTEX_STEP_DEGREES) {
|
|
58
|
+
line.push([lon, lat]);
|
|
59
|
+
}
|
|
60
|
+
lines.push(line);
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
type: "FeatureCollection",
|
|
64
|
+
features: [{ type: "Feature", properties: {}, geometry: { type: "MultiLineString", coordinates: lines } }],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=graticule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graticule.js","sourceRoot":"","sources":["../../lib/map/graticule.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;GAGG;AACH,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAE/B;;;;;GAKG;AACH;;;;;GAKG;AACH,MAAM,aAAa,GAAG,GAAG,CAAA;AAEzB,MAAM,mBAAmB,GAAG,CAAC,CAAA;AAE7B;;;;;GAKG;AACH,MAAM,YAAY,GAAG,EAAE,CAAA;AAEvB;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,WAAW,GAAW,oBAAoB;IACxE,MAAM,KAAK,GAAiB,EAAE,CAAA;IAE9B,gEAAgE;IAChE,KAAK,IAAI,GAAG,GAAG,CAAC,aAAa,EAAE,GAAG,GAAG,aAAa,EAAE,GAAG,IAAI,WAAW,EAAE,CAAC;QACxE,MAAM,IAAI,GAAe,EAAE,CAAA;QAE3B,KAAK,IAAI,GAAG,GAAG,CAAC,YAAY,EAAE,GAAG,IAAI,YAAY,EAAE,GAAG,IAAI,mBAAmB,EAAE,CAAC;YAC/E,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;QACtB,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,CAAA;QAC9B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjB,CAAC;IAED,qEAAqE;IACrE,2BAA2B;IAC3B,qBAAqB;IACrB,KAAK,IAAI,GAAG,GAAG,CAAC,YAAY,GAAG,WAAW,EAAE,GAAG,GAAG,YAAY,EAAE,GAAG,IAAI,WAAW,EAAE,CAAC;QACpF,MAAM,IAAI,GAAe,EAAE,CAAA;QAE3B,KAAK,IAAI,GAAG,GAAG,CAAC,aAAa,EAAE,GAAG,IAAI,aAAa,EAAE,GAAG,IAAI,mBAAmB,EAAE,CAAC;YACjF,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;QACtB,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjB,CAAC;IAED,OAAO;QACN,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC;KAC1G,CAAA;AACF,CAAC"}
|
package/out/map/map-debug.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @file The bare MapLibre control both debug panels portal into.
|
|
6
6
|
*
|
|
7
7
|
* `DashboardMap`'s inspector and the demo page's `_debug.tsx` panel each need an `IControl` whose
|
|
8
|
-
* only job is to own a container element for `createPortal`. The class was duplicated in both
|
|
8
|
+
* only job is to own a container element for `createPortal`. The class was duplicated in both.
|
|
9
9
|
* the position and container class are the only differences, so they are parameters here.
|
|
10
10
|
*/
|
|
11
11
|
import type { ControlPosition } from "maplibre-gl";
|
|
@@ -16,7 +16,9 @@ export interface DebugControlBaseOptions {
|
|
|
16
16
|
*/
|
|
17
17
|
className?: string;
|
|
18
18
|
/**
|
|
19
|
-
* Where MapLibre docks the control.
|
|
19
|
+
* Where MapLibre docks the control.
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue `"bottom-left"`
|
|
20
22
|
*/
|
|
21
23
|
position?: ControlPosition;
|
|
22
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-debug.d.ts","sourceRoot":"","sources":["../../lib/map/map-debug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAElE,MAAM,WAAW,uBAAuB;IACvC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB
|
|
1
|
+
{"version":3,"file":"map-debug.d.ts","sourceRoot":"","sources":["../../lib/map/map-debug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAElE,MAAM,WAAW,uBAAuB;IACvC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAA;CAC1B;AAED,qBAAa,gBAAiB,YAAW,QAAQ;;IAChD,SAAgB,SAAS,EAAE,WAAW,CAAA;IAGtC,YAAY,EAAE,SAAS,EAAE,QAAwB,EAAE,GAAE,uBAA4B,EAQhF;IAEM,KAAK,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,CAE3C;IAEM,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAEvC;IAEM,kBAAkB,IAAI,eAAe,CAE3C;CACD"}
|
package/out/map/map-debug.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @file The bare MapLibre control both debug panels portal into.
|
|
6
6
|
*
|
|
7
7
|
* `DashboardMap`'s inspector and the demo page's `_debug.tsx` panel each need an `IControl` whose
|
|
8
|
-
* only job is to own a container element for `createPortal`. The class was duplicated in both
|
|
8
|
+
* only job is to own a container element for `createPortal`. The class was duplicated in both.
|
|
9
9
|
* the position and container class are the only differences, so they are parameters here.
|
|
10
10
|
*/
|
|
11
11
|
export class DebugControlBase {
|
package/out/map/map-debug.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-debug.js","sourceRoot":"","sources":["../../lib/map/map-debug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"map-debug.js","sourceRoot":"","sources":["../../lib/map/map-debug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAkBH,MAAM,OAAO,gBAAgB;IACZ,SAAS,CAAa;IAC7B,SAAS,CAAiB;IAEnC,YAAY,EAAE,SAAS,EAAE,QAAQ,GAAG,aAAa,EAAE,GAA4B,EAAE;QAChF,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QAE9C,IAAI,SAAS,EAAE,CAAC;YACf,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;QACxC,CAAC;QAED,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAEM,KAAK,CAAC,IAAiB;QAC7B,OAAO,IAAI,CAAC,SAAS,CAAA;IACtB,CAAC;IAEM,QAAQ,CAAC,IAAiB;QAChC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAA;IACxB,CAAC;IAEM,kBAAkB;QACxB,OAAO,IAAI,CAAC,SAAS,CAAA;IACtB,CAAC;CACD"}
|
|
@@ -2,60 +2,45 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* `computeMapPlaceRenderSpec` — the PURE core that replaces the docs demo's ~100-line imperative
|
|
7
|
-
* marker/bbox/camera redraw effect (`_app.tsx:601-705`). It takes an ALREADY-RESOLVED place (the async
|
|
8
|
-
* polygon-DB fetch is a host/runtime concern — a later phase — so a crisp polygon arrives pre-fetched
|
|
9
|
-
* as `place.geometry`) and returns a declarative render spec: the marker position(s), the outline
|
|
10
|
-
* geometry to draw, and the camera target. No map instance, no DOM, no `react-map-gl` — so it is
|
|
11
|
-
* node-testable (see `place-render.node.test.ts`). The declarative components in this folder render
|
|
12
|
-
* the spec; a controlled-viewport consumer applies the camera.
|
|
13
|
-
*
|
|
14
|
-
* The decision cascade is a faithful, side-effect-free transcription of the imperative effect:
|
|
15
|
-
* 1. street tier (situs / interp) → exact-radius circle, fly to a tight zoom
|
|
16
|
-
* 2. crisp admin polygon (pre-fetched) → draw the polygon, fit its bounds
|
|
17
|
-
* 3. anchor-centroid postcode (no bbox) → ~3 km "around here" circle, fly to zoom 11
|
|
18
|
-
* 4. bbox with real extent → bbox-sized approximate circle, fit the bbox
|
|
19
|
-
* 5. bare point → no outline, fly to zoom 12
|
|
20
5
|
*/
|
|
21
6
|
import type { ResolvedPlaceView } from "@mailwoman/core/pipeline/client-result";
|
|
22
|
-
import type {
|
|
7
|
+
import type { LatLonBounds } from "@mailwoman/spatial";
|
|
8
|
+
import type { BoundsTuple, PlaceGeometry } from "#map/geometry";
|
|
23
9
|
/**
|
|
24
|
-
* `[longitude, latitude]`.
|
|
10
|
+
* A coordinate pair as `[longitude, latitude]`.
|
|
25
11
|
*/
|
|
26
12
|
export type LngLat = [number, number];
|
|
27
13
|
/**
|
|
28
|
-
*
|
|
14
|
+
* How a street-level result was located: `address_point` is an exact building point
|
|
15
|
+
* and `interpolated` an estimate from a TIGER address range.
|
|
29
16
|
*/
|
|
30
17
|
export type PlaceTier = "address_point" | "interpolated";
|
|
31
18
|
/**
|
|
32
|
-
*
|
|
33
|
-
* demo's `ResolvedHit` carries (bbox, street tier + uncertainty), and an optional PRE-FETCHED crisp polygon. Extending
|
|
34
|
-
* `ResolvedPlaceView` keeps the map render aligned with the shared parse result; the extras are additive.
|
|
19
|
+
* A resolved place with the extra fields the map uses to draw it.
|
|
35
20
|
*/
|
|
36
21
|
export interface ResolvedMapPlace extends ResolvedPlaceView {
|
|
37
22
|
/**
|
|
38
|
-
* The place's bounding box
|
|
23
|
+
* The place's bounding box.
|
|
24
|
+
* Postcodes located by an anchor centroid have none.
|
|
39
25
|
*/
|
|
40
|
-
bbox
|
|
26
|
+
bbox: LatLonBounds | null;
|
|
41
27
|
/**
|
|
42
|
-
*
|
|
28
|
+
* The street-level tier, set only for results from address points or interpolation.
|
|
43
29
|
*/
|
|
44
|
-
tier
|
|
30
|
+
tier: PlaceTier | null;
|
|
45
31
|
/**
|
|
46
|
-
*
|
|
32
|
+
* The uncertainty radius in meters of a street-level result, drawn as a circle when `tier` is set.
|
|
47
33
|
*/
|
|
48
|
-
uncertaintyM
|
|
34
|
+
uncertaintyM: number | null;
|
|
49
35
|
/**
|
|
50
|
-
* The
|
|
51
|
-
*
|
|
36
|
+
* The admin polygon, if the host has already fetched it.
|
|
37
|
+
* When present the outline and camera follow it.
|
|
52
38
|
*/
|
|
53
39
|
geometry?: PlaceGeometry;
|
|
54
40
|
}
|
|
55
41
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* NOT — `fitBounds` needs the map's pixel dimensions, so it is applied imperatively by `<ResultCamera>`.
|
|
42
|
+
* Only a `center` target can be applied declaratively through {@link cameraToViewState};
|
|
43
|
+
* fitting bounds needs the map's pixel size, so `<ResultCamera>` applies it imperatively.
|
|
59
44
|
*/
|
|
60
45
|
export type MapCameraTarget = {
|
|
61
46
|
kind: "center";
|
|
@@ -67,33 +52,28 @@ export type MapCameraTarget = {
|
|
|
67
52
|
padding: number;
|
|
68
53
|
};
|
|
69
54
|
/**
|
|
70
|
-
* The
|
|
55
|
+
* The markers, outline and camera target for one resolved place, as returned
|
|
56
|
+
* by {@link computeMapPlaceRenderSpec}.
|
|
71
57
|
*/
|
|
72
58
|
export interface MapPlaceRenderSpec {
|
|
73
59
|
/**
|
|
74
|
-
*
|
|
60
|
+
* The marker positions as `[lon, lat]`; there is always exactly one marker.
|
|
75
61
|
*/
|
|
76
62
|
markers: LngLat[];
|
|
77
63
|
/**
|
|
78
|
-
* The
|
|
64
|
+
* The polygon or circle outline to draw, or `null` when the place renders as a bare point.
|
|
79
65
|
*/
|
|
80
66
|
outline: PlaceGeometry | null;
|
|
81
|
-
/**
|
|
82
|
-
* The camera target — animate or fit to this.
|
|
83
|
-
*/
|
|
84
67
|
camera: MapCameraTarget;
|
|
85
68
|
}
|
|
86
69
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* inverse of the old redraw effect with the imperative map mutation and the async DB load removed.
|
|
70
|
+
* Computes the markers, outline and camera target for a resolved place without loading data,
|
|
71
|
+
* so the caller must put any fetched polygon in `place.geometry` first.
|
|
90
72
|
*/
|
|
91
73
|
export declare function computeMapPlaceRenderSpec(place: ResolvedMapPlace): MapPlaceRenderSpec;
|
|
92
74
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* needs the map's pixel dimensions, which only the live map has, so that case is applied imperatively by
|
|
96
|
-
* `<ResultCamera>`. Pure + node-testable.
|
|
75
|
+
* Converts a `center` camera target into a `viewState` patch for a controlled `<MapCanvas>`,
|
|
76
|
+
* returning `null` for a `bounds` target that `<ResultCamera>` must fit imperatively.
|
|
97
77
|
*/
|
|
98
78
|
export declare function cameraToViewState(camera: MapCameraTarget): {
|
|
99
79
|
longitude: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place-render.d.ts","sourceRoot":"","sources":["../../lib/map/place-render.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"place-render.d.ts","sourceRoot":"","sources":["../../lib/map/place-render.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGtD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE/D;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAErC;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG,cAAc,CAAA;AA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