@honua/react 0.0.20-alpha.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/LICENSE +201 -0
- package/README.md +9 -0
- package/contract/analytics-sources.d.ts +149 -0
- package/contract/analytics-sources.d.ts.map +1 -0
- package/contract/analytics-sources.js +235 -0
- package/contract/edit-session.d.ts +203 -0
- package/contract/edit-session.d.ts.map +1 -0
- package/contract/edit-session.js +760 -0
- package/contract/edit-sketch.d.ts +91 -0
- package/contract/edit-sketch.d.ts.map +1 -0
- package/contract/edit-sketch.js +281 -0
- package/contract/index.d.ts +61 -0
- package/contract/index.d.ts.map +1 -0
- package/contract/index.js +51 -0
- package/contract/jobs.d.ts +149 -0
- package/contract/jobs.d.ts.map +1 -0
- package/contract/jobs.js +40 -0
- package/contract/source.d.ts +423 -0
- package/contract/source.d.ts.map +1 -0
- package/contract/source.js +3802 -0
- package/contract/spatial-aggregation.d.ts +336 -0
- package/contract/spatial-aggregation.d.ts.map +1 -0
- package/contract/spatial-aggregation.js +298 -0
- package/contract/temporal.d.ts +455 -0
- package/contract/temporal.d.ts.map +1 -0
- package/contract/temporal.js +146 -0
- package/contract/tiles.d.ts +370 -0
- package/contract/tiles.d.ts.map +1 -0
- package/contract/tiles.js +519 -0
- package/contract/types.d.ts +665 -0
- package/contract/types.d.ts.map +1 -0
- package/contract/types.js +175 -0
- package/contract/widget-source.d.ts +205 -0
- package/contract/widget-source.d.ts.map +1 -0
- package/contract/widget-source.js +1473 -0
- package/control-plane/client.d.ts +95 -0
- package/control-plane/client.d.ts.map +1 -0
- package/control-plane/client.js +374 -0
- package/control-plane/index.d.ts +18 -0
- package/control-plane/index.d.ts.map +1 -0
- package/control-plane/index.js +14 -0
- package/control-plane/types.d.ts +233 -0
- package/control-plane/types.d.ts.map +1 -0
- package/control-plane/types.js +7 -0
- package/core/batch.d.ts +37 -0
- package/core/batch.d.ts.map +1 -0
- package/core/batch.js +79 -0
- package/core/cache-state.d.ts +79 -0
- package/core/cache-state.d.ts.map +1 -0
- package/core/cache-state.js +87 -0
- package/core/client.d.ts +577 -0
- package/core/client.d.ts.map +1 -0
- package/core/client.js +1664 -0
- package/core/compatibility.d.ts +18 -0
- package/core/compatibility.d.ts.map +1 -0
- package/core/compatibility.js +245 -0
- package/core/errors.d.ts +107 -0
- package/core/errors.d.ts.map +1 -0
- package/core/errors.js +156 -0
- package/core/esri-geojson.d.ts +66 -0
- package/core/esri-geojson.d.ts.map +1 -0
- package/core/esri-geojson.js +363 -0
- package/core/geoservices.d.ts +34 -0
- package/core/geoservices.d.ts.map +1 -0
- package/core/geoservices.js +434 -0
- package/core/grpc-adapter.d.ts +23 -0
- package/core/grpc-adapter.d.ts.map +1 -0
- package/core/grpc-adapter.js +688 -0
- package/core/odata.d.ts +347 -0
- package/core/odata.d.ts.map +1 -0
- package/core/odata.js +913 -0
- package/core/ogc-conformance.d.ts +35 -0
- package/core/ogc-conformance.d.ts.map +1 -0
- package/core/ogc-conformance.js +134 -0
- package/core/ogc-features.d.ts +23 -0
- package/core/ogc-features.d.ts.map +1 -0
- package/core/ogc-features.js +114 -0
- package/core/ogc-maps.d.ts +49 -0
- package/core/ogc-maps.d.ts.map +1 -0
- package/core/ogc-maps.js +126 -0
- package/core/ogc-processes.d.ts +118 -0
- package/core/ogc-processes.d.ts.map +1 -0
- package/core/ogc-processes.js +423 -0
- package/core/ogc-records.d.ts +75 -0
- package/core/ogc-records.d.ts.map +1 -0
- package/core/ogc-records.js +251 -0
- package/core/ogc-tiles.d.ts +125 -0
- package/core/ogc-tiles.d.ts.map +1 -0
- package/core/ogc-tiles.js +183 -0
- package/core/path-utils.d.ts +69 -0
- package/core/path-utils.d.ts.map +1 -0
- package/core/path-utils.js +123 -0
- package/core/pbf-decoder.d.ts +39 -0
- package/core/pbf-decoder.d.ts.map +1 -0
- package/core/pbf-decoder.js +702 -0
- package/core/process-runner.d.ts +104 -0
- package/core/process-runner.d.ts.map +1 -0
- package/core/process-runner.js +315 -0
- package/core/protocol-transport.d.ts +76 -0
- package/core/protocol-transport.d.ts.map +1 -0
- package/core/protocol-transport.js +15 -0
- package/core/query-builder.d.ts +261 -0
- package/core/query-builder.d.ts.map +1 -0
- package/core/query-builder.js +538 -0
- package/core/request-pipeline.d.ts +88 -0
- package/core/request-pipeline.d.ts.map +1 -0
- package/core/request-pipeline.js +273 -0
- package/core/spatial-filter.d.ts +93 -0
- package/core/spatial-filter.d.ts.map +1 -0
- package/core/spatial-filter.js +153 -0
- package/core/stac.d.ts +55 -0
- package/core/stac.d.ts.map +1 -0
- package/core/stac.js +229 -0
- package/core/surfaces.d.ts +527 -0
- package/core/surfaces.d.ts.map +1 -0
- package/core/surfaces.js +1917 -0
- package/core/terrain-elevation.d.ts +114 -0
- package/core/terrain-elevation.d.ts.map +1 -0
- package/core/terrain-elevation.js +150 -0
- package/core/types.d.ts +1355 -0
- package/core/types.d.ts.map +1 -0
- package/core/types.js +13 -0
- package/core/wfs-capabilities.d.ts +143 -0
- package/core/wfs-capabilities.d.ts.map +1 -0
- package/core/wfs-capabilities.js +478 -0
- package/core/wfs-filter.d.ts +118 -0
- package/core/wfs-filter.d.ts.map +1 -0
- package/core/wfs-filter.js +634 -0
- package/core/wfs.d.ts +219 -0
- package/core/wfs.d.ts.map +1 -0
- package/core/wfs.js +406 -0
- package/core/wire-shared.d.ts +32 -0
- package/core/wire-shared.d.ts.map +1 -0
- package/core/wire-shared.js +76 -0
- package/core/wms-axis.d.ts +36 -0
- package/core/wms-axis.d.ts.map +1 -0
- package/core/wms-axis.js +73 -0
- package/core/wms-capabilities.d.ts +110 -0
- package/core/wms-capabilities.d.ts.map +1 -0
- package/core/wms-capabilities.js +559 -0
- package/core/wms-types.d.ts +128 -0
- package/core/wms-types.d.ts.map +1 -0
- package/core/wms-types.js +32 -0
- package/core/wms.d.ts +144 -0
- package/core/wms.d.ts.map +1 -0
- package/core/wms.js +338 -0
- package/core/wmts-capabilities.d.ts +82 -0
- package/core/wmts-capabilities.d.ts.map +1 -0
- package/core/wmts-capabilities.js +402 -0
- package/core/wmts.d.ts +103 -0
- package/core/wmts.d.ts.map +1 -0
- package/core/wmts.js +332 -0
- package/core/xml-text.d.ts +20 -0
- package/core/xml-text.d.ts.map +1 -0
- package/core/xml-text.js +85 -0
- package/esri-compat/basemap-gallery.d.ts +38 -0
- package/esri-compat/basemap-gallery.d.ts.map +1 -0
- package/esri-compat/basemap-gallery.js +159 -0
- package/esri-compat/basemap-layer-list.d.ts +35 -0
- package/esri-compat/basemap-layer-list.d.ts.map +1 -0
- package/esri-compat/basemap-layer-list.js +139 -0
- package/esri-compat/basemap.d.ts +32 -0
- package/esri-compat/basemap.d.ts.map +1 -0
- package/esri-compat/basemap.js +84 -0
- package/esri-compat/bookmarks.d.ts +36 -0
- package/esri-compat/bookmarks.d.ts.map +1 -0
- package/esri-compat/bookmarks.js +108 -0
- package/esri-compat/class-breaks-renderer.d.ts +50 -0
- package/esri-compat/class-breaks-renderer.d.ts.map +1 -0
- package/esri-compat/class-breaks-renderer.js +164 -0
- package/esri-compat/color.d.ts +22 -0
- package/esri-compat/color.d.ts.map +1 -0
- package/esri-compat/color.js +106 -0
- package/esri-compat/controls.d.ts +174 -0
- package/esri-compat/controls.d.ts.map +1 -0
- package/esri-compat/controls.js +479 -0
- package/esri-compat/coordinate-conversion.d.ts +41 -0
- package/esri-compat/coordinate-conversion.d.ts.map +1 -0
- package/esri-compat/coordinate-conversion.js +125 -0
- package/esri-compat/directions.d.ts +45 -0
- package/esri-compat/directions.d.ts.map +1 -0
- package/esri-compat/directions.js +123 -0
- package/esri-compat/editor.d.ts +47 -0
- package/esri-compat/editor.d.ts.map +1 -0
- package/esri-compat/editor.js +170 -0
- package/esri-compat/esri-config.d.ts +16 -0
- package/esri-compat/esri-config.d.ts.map +1 -0
- package/esri-compat/esri-config.js +23 -0
- package/esri-compat/esri-request.d.ts +17 -0
- package/esri-compat/esri-request.d.ts.map +1 -0
- package/esri-compat/esri-request.js +127 -0
- package/esri-compat/event-bus.d.ts +106 -0
- package/esri-compat/event-bus.d.ts.map +1 -0
- package/esri-compat/event-bus.js +90 -0
- package/esri-compat/expand.d.ts +36 -0
- package/esri-compat/expand.d.ts.map +1 -0
- package/esri-compat/expand.js +97 -0
- package/esri-compat/extent.d.ts +43 -0
- package/esri-compat/extent.d.ts.map +1 -0
- package/esri-compat/extent.js +140 -0
- package/esri-compat/feature-filter.d.ts +55 -0
- package/esri-compat/feature-filter.d.ts.map +1 -0
- package/esri-compat/feature-filter.js +109 -0
- package/esri-compat/feature-form.d.ts +64 -0
- package/esri-compat/feature-form.d.ts.map +1 -0
- package/esri-compat/feature-form.js +137 -0
- package/esri-compat/feature-layer.d.ts +173 -0
- package/esri-compat/feature-layer.d.ts.map +1 -0
- package/esri-compat/feature-layer.js +661 -0
- package/esri-compat/feature-set.d.ts +32 -0
- package/esri-compat/feature-set.d.ts.map +1 -0
- package/esri-compat/feature-set.js +80 -0
- package/esri-compat/feature-table.d.ts +141 -0
- package/esri-compat/feature-table.d.ts.map +1 -0
- package/esri-compat/feature-table.js +500 -0
- package/esri-compat/feature-templates.d.ts +41 -0
- package/esri-compat/feature-templates.d.ts.map +1 -0
- package/esri-compat/feature-templates.js +97 -0
- package/esri-compat/feature.d.ts +33 -0
- package/esri-compat/feature.d.ts.map +1 -0
- package/esri-compat/feature.js +83 -0
- package/esri-compat/geojson-layer.d.ts +86 -0
- package/esri-compat/geojson-layer.d.ts.map +1 -0
- package/esri-compat/geojson-layer.js +191 -0
- package/esri-compat/geometry-engine.d.ts +107 -0
- package/esri-compat/geometry-engine.d.ts.map +1 -0
- package/esri-compat/geometry-engine.js +266 -0
- package/esri-compat/graphic.d.ts +46 -0
- package/esri-compat/graphic.d.ts.map +1 -0
- package/esri-compat/graphic.js +103 -0
- package/esri-compat/graphics-layer.d.ts +49 -0
- package/esri-compat/graphics-layer.d.ts.map +1 -0
- package/esri-compat/graphics-layer.js +185 -0
- package/esri-compat/group-layer.d.ts +48 -0
- package/esri-compat/group-layer.d.ts.map +1 -0
- package/esri-compat/group-layer.js +212 -0
- package/esri-compat/identify.d.ts +71 -0
- package/esri-compat/identify.d.ts.map +1 -0
- package/esri-compat/identify.js +299 -0
- package/esri-compat/identity-manager.d.ts +31 -0
- package/esri-compat/identity-manager.d.ts.map +1 -0
- package/esri-compat/identity-manager.js +115 -0
- package/esri-compat/imagery-layer.d.ts +78 -0
- package/esri-compat/imagery-layer.d.ts.map +1 -0
- package/esri-compat/imagery-layer.js +167 -0
- package/esri-compat/label-class.d.ts +31 -0
- package/esri-compat/label-class.d.ts.map +1 -0
- package/esri-compat/label-class.js +102 -0
- package/esri-compat/layer-list.d.ts +77 -0
- package/esri-compat/layer-list.d.ts.map +1 -0
- package/esri-compat/layer-list.js +342 -0
- package/esri-compat/legend.d.ts +53 -0
- package/esri-compat/legend.d.ts.map +1 -0
- package/esri-compat/legend.js +254 -0
- package/esri-compat/map-image-layer.d.ts +162 -0
- package/esri-compat/map-image-layer.d.ts.map +1 -0
- package/esri-compat/map-image-layer.js +709 -0
- package/esri-compat/map-view.d.ts +323 -0
- package/esri-compat/map-view.d.ts.map +1 -0
- package/esri-compat/map-view.js +1175 -0
- package/esri-compat/map.d.ts +47 -0
- package/esri-compat/map.d.ts.map +1 -0
- package/esri-compat/map.js +209 -0
- package/esri-compat/measurement-2d.d.ts +61 -0
- package/esri-compat/measurement-2d.d.ts.map +1 -0
- package/esri-compat/measurement-2d.js +184 -0
- package/esri-compat/measurement.d.ts +45 -0
- package/esri-compat/measurement.d.ts.map +1 -0
- package/esri-compat/measurement.js +193 -0
- package/esri-compat/oauth-info.d.ts +35 -0
- package/esri-compat/oauth-info.d.ts.map +1 -0
- package/esri-compat/oauth-info.js +115 -0
- package/esri-compat/picture-marker-symbol.d.ts +35 -0
- package/esri-compat/picture-marker-symbol.d.ts.map +1 -0
- package/esri-compat/picture-marker-symbol.js +126 -0
- package/esri-compat/point.d.ts +31 -0
- package/esri-compat/point.d.ts.map +1 -0
- package/esri-compat/point.js +102 -0
- package/esri-compat/polygon.d.ts +31 -0
- package/esri-compat/polygon.d.ts.map +1 -0
- package/esri-compat/polygon.js +107 -0
- package/esri-compat/polyline.d.ts +31 -0
- package/esri-compat/polyline.d.ts.map +1 -0
- package/esri-compat/polyline.js +107 -0
- package/esri-compat/popup-template.d.ts +55 -0
- package/esri-compat/popup-template.d.ts.map +1 -0
- package/esri-compat/popup-template.js +128 -0
- package/esri-compat/popup.d.ts +54 -0
- package/esri-compat/popup.d.ts.map +1 -0
- package/esri-compat/popup.js +312 -0
- package/esri-compat/print.d.ts +47 -0
- package/esri-compat/print.d.ts.map +1 -0
- package/esri-compat/print.js +105 -0
- package/esri-compat/query.d.ts +58 -0
- package/esri-compat/query.d.ts.map +1 -0
- package/esri-compat/query.js +128 -0
- package/esri-compat/reactive-utils.d.ts +24 -0
- package/esri-compat/reactive-utils.d.ts.map +1 -0
- package/esri-compat/reactive-utils.js +193 -0
- package/esri-compat/request.d.ts +41 -0
- package/esri-compat/request.d.ts.map +1 -0
- package/esri-compat/request.js +253 -0
- package/esri-compat/route-layer.d.ts +59 -0
- package/esri-compat/route-layer.d.ts.map +1 -0
- package/esri-compat/route-layer.js +223 -0
- package/esri-compat/route-task.d.ts +88 -0
- package/esri-compat/route-task.d.ts.map +1 -0
- package/esri-compat/route-task.js +225 -0
- package/esri-compat/scene-view.d.ts +41 -0
- package/esri-compat/scene-view.d.ts.map +1 -0
- package/esri-compat/scene-view.js +68 -0
- package/esri-compat/search.d.ts +112 -0
- package/esri-compat/search.d.ts.map +1 -0
- package/esri-compat/search.js +820 -0
- package/esri-compat/simple-fill-symbol.d.ts +27 -0
- package/esri-compat/simple-fill-symbol.d.ts.map +1 -0
- package/esri-compat/simple-fill-symbol.js +85 -0
- package/esri-compat/simple-line-symbol.d.ts +27 -0
- package/esri-compat/simple-line-symbol.d.ts.map +1 -0
- package/esri-compat/simple-line-symbol.js +85 -0
- package/esri-compat/simple-marker-symbol.d.ts +29 -0
- package/esri-compat/simple-marker-symbol.d.ts.map +1 -0
- package/esri-compat/simple-marker-symbol.js +92 -0
- package/esri-compat/simple-renderer.d.ts +29 -0
- package/esri-compat/simple-renderer.d.ts.map +1 -0
- package/esri-compat/simple-renderer.js +92 -0
- package/esri-compat/sketch.d.ts +64 -0
- package/esri-compat/sketch.d.ts.map +1 -0
- package/esri-compat/sketch.js +227 -0
- package/esri-compat/spatial-reference.d.ts +31 -0
- package/esri-compat/spatial-reference.d.ts.map +1 -0
- package/esri-compat/spatial-reference.js +102 -0
- package/esri-compat/swipe.d.ts +34 -0
- package/esri-compat/swipe.d.ts.map +1 -0
- package/esri-compat/swipe.js +93 -0
- package/esri-compat/table-list.d.ts +36 -0
- package/esri-compat/table-list.d.ts.map +1 -0
- package/esri-compat/table-list.js +126 -0
- package/esri-compat/text-symbol.d.ts +37 -0
- package/esri-compat/text-symbol.d.ts.map +1 -0
- package/esri-compat/text-symbol.js +123 -0
- package/esri-compat/tile-layer.d.ts +52 -0
- package/esri-compat/tile-layer.d.ts.map +1 -0
- package/esri-compat/tile-layer.js +168 -0
- package/esri-compat/time-slider.d.ts +70 -0
- package/esri-compat/time-slider.d.ts.map +1 -0
- package/esri-compat/time-slider.js +208 -0
- package/esri-compat/track.d.ts +51 -0
- package/esri-compat/track.d.ts.map +1 -0
- package/esri-compat/track.js +174 -0
- package/esri-compat/unique-value-renderer.d.ts +41 -0
- package/esri-compat/unique-value-renderer.d.ts.map +1 -0
- package/esri-compat/unique-value-renderer.js +127 -0
- package/esri-compat/url.d.ts +13 -0
- package/esri-compat/url.d.ts.map +1 -0
- package/esri-compat/url.js +68 -0
- package/esri-compat/vector-tile-layer.d.ts +47 -0
- package/esri-compat/vector-tile-layer.d.ts.map +1 -0
- package/esri-compat/vector-tile-layer.js +130 -0
- package/esri-compat/web-map.d.ts +14 -0
- package/esri-compat/web-map.d.ts.map +1 -0
- package/esri-compat/web-map.js +24 -0
- package/esri-compat/wfs-layer.d.ts +64 -0
- package/esri-compat/wfs-layer.d.ts.map +1 -0
- package/esri-compat/wfs-layer.js +145 -0
- package/esri-compat/wms-layer.d.ts +76 -0
- package/esri-compat/wms-layer.d.ts.map +1 -0
- package/esri-compat/wms-layer.js +157 -0
- package/exploration/context.d.ts +25 -0
- package/exploration/context.d.ts.map +1 -0
- package/exploration/context.js +396 -0
- package/exploration/index.d.ts +27 -0
- package/exploration/index.d.ts.map +1 -0
- package/exploration/index.js +24 -0
- package/exploration/presets.d.ts +27 -0
- package/exploration/presets.d.ts.map +1 -0
- package/exploration/presets.js +114 -0
- package/exploration/reducer.d.ts +23 -0
- package/exploration/reducer.d.ts.map +1 -0
- package/exploration/reducer.js +332 -0
- package/exploration/selection.d.ts +25 -0
- package/exploration/selection.d.ts.map +1 -0
- package/exploration/selection.js +34 -0
- package/exploration/selectors.d.ts +56 -0
- package/exploration/selectors.d.ts.map +1 -0
- package/exploration/selectors.js +110 -0
- package/exploration/types.d.ts +294 -0
- package/exploration/types.d.ts.map +1 -0
- package/exploration/types.js +33 -0
- package/expr/expression.d.ts +457 -0
- package/expr/expression.d.ts.map +1 -0
- package/expr/expression.js +663 -0
- package/expr/index.d.ts +32 -0
- package/expr/index.d.ts.map +1 -0
- package/expr/index.js +30 -0
- package/gen/honua/v1/feature_service_pb.d.ts +918 -0
- package/gen/honua/v1/feature_service_pb.d.ts.map +1 -0
- package/gen/honua/v1/feature_service_pb.js +375 -0
- package/generated-app/errors.d.ts +41 -0
- package/generated-app/errors.d.ts.map +1 -0
- package/generated-app/errors.js +41 -0
- package/generated-app/index.d.ts +17 -0
- package/generated-app/index.d.ts.map +1 -0
- package/generated-app/index.js +12 -0
- package/generated-app/manifest.d.ts +183 -0
- package/generated-app/manifest.d.ts.map +1 -0
- package/generated-app/manifest.js +14 -0
- package/generated-app/projection.d.ts +44 -0
- package/generated-app/projection.d.ts.map +1 -0
- package/generated-app/projection.js +234 -0
- package/generated-app/runtime.d.ts +215 -0
- package/generated-app/runtime.d.ts.map +1 -0
- package/generated-app/runtime.js +1196 -0
- package/interactions/detail-model.d.ts +54 -0
- package/interactions/detail-model.d.ts.map +1 -0
- package/interactions/detail-model.js +105 -0
- package/interactions/exploration-bindings.d.ts +120 -0
- package/interactions/exploration-bindings.d.ts.map +1 -0
- package/interactions/exploration-bindings.js +218 -0
- package/interactions/feature-state.d.ts +144 -0
- package/interactions/feature-state.d.ts.map +1 -0
- package/interactions/feature-state.js +169 -0
- package/interactions/hit-test.d.ts +112 -0
- package/interactions/hit-test.d.ts.map +1 -0
- package/interactions/hit-test.js +291 -0
- package/interactions/index.d.ts +31 -0
- package/interactions/index.d.ts.map +1 -0
- package/interactions/index.js +24 -0
- package/interactions/share-state.d.ts +36 -0
- package/interactions/share-state.d.ts.map +1 -0
- package/interactions/share-state.js +123 -0
- package/map/feature-service-adapter.d.ts +138 -0
- package/map/feature-service-adapter.d.ts.map +1 -0
- package/map/feature-service-adapter.js +279 -0
- package/map/honua-map.d.ts +203 -0
- package/map/honua-map.d.ts.map +1 -0
- package/map/honua-map.js +347 -0
- package/map/index.d.ts +27 -0
- package/map/index.d.ts.map +1 -0
- package/map/index.js +22 -0
- package/map/maplibre-target.d.ts +103 -0
- package/map/maplibre-target.d.ts.map +1 -0
- package/map/maplibre-target.js +164 -0
- package/map/webmap-maplibre.d.ts +60 -0
- package/map/webmap-maplibre.d.ts.map +1 -0
- package/map/webmap-maplibre.js +212 -0
- package/package.json +37 -0
- package/react/context.d.ts +32 -0
- package/react/context.d.ts.map +1 -0
- package/react/context.js +19 -0
- package/react/honua-layer.d.ts +35 -0
- package/react/honua-layer.d.ts.map +1 -0
- package/react/honua-layer.js +47 -0
- package/react/honua-map.d.ts +83 -0
- package/react/honua-map.d.ts.map +1 -0
- package/react/honua-map.js +109 -0
- package/react/honua-popup.d.ts +26 -0
- package/react/honua-popup.d.ts.map +1 -0
- package/react/honua-popup.js +34 -0
- package/react/hooks.d.ts +127 -0
- package/react/hooks.d.ts.map +1 -0
- package/react/hooks.js +206 -0
- package/react/index.d.ts +42 -0
- package/react/index.d.ts.map +1 -0
- package/react/index.js +34 -0
- package/react/provider.d.ts +36 -0
- package/react/provider.d.ts.map +1 -0
- package/react/provider.js +35 -0
- package/react/query-cache.d.ts +76 -0
- package/react/query-cache.d.ts.map +1 -0
- package/react/query-cache.js +188 -0
- package/runtime/diff.d.ts +31 -0
- package/runtime/diff.d.ts.map +1 -0
- package/runtime/diff.js +143 -0
- package/runtime/errors.d.ts +40 -0
- package/runtime/errors.d.ts.map +1 -0
- package/runtime/errors.js +35 -0
- package/runtime/index.d.ts +59 -0
- package/runtime/index.d.ts.map +1 -0
- package/runtime/index.js +43 -0
- package/runtime/legend.d.ts +23 -0
- package/runtime/legend.d.ts.map +1 -0
- package/runtime/legend.js +38 -0
- package/runtime/load-package.d.ts +125 -0
- package/runtime/load-package.d.ts.map +1 -0
- package/runtime/load-package.js +264 -0
- package/runtime/map-package-fetch.d.ts +107 -0
- package/runtime/map-package-fetch.d.ts.map +1 -0
- package/runtime/map-package-fetch.js +336 -0
- package/runtime/map-package-realtime.d.ts +169 -0
- package/runtime/map-package-realtime.d.ts.map +1 -0
- package/runtime/map-package-realtime.js +350 -0
- package/runtime/map-package-validation.d.ts +43 -0
- package/runtime/map-package-validation.d.ts.map +1 -0
- package/runtime/map-package-validation.js +269 -0
- package/runtime/map-package-watch.d.ts +78 -0
- package/runtime/map-package-watch.d.ts.map +1 -0
- package/runtime/map-package-watch.js +695 -0
- package/runtime/map-package.d.ts +167 -0
- package/runtime/map-package.d.ts.map +1 -0
- package/runtime/map-package.js +15 -0
- package/runtime/ogc-styles.d.ts +110 -0
- package/runtime/ogc-styles.d.ts.map +1 -0
- package/runtime/ogc-styles.js +195 -0
- package/runtime/popups.d.ts +62 -0
- package/runtime/popups.d.ts.map +1 -0
- package/runtime/popups.js +95 -0
- package/runtime/query-tiles.d.ts +217 -0
- package/runtime/query-tiles.d.ts.map +1 -0
- package/runtime/query-tiles.js +801 -0
- package/runtime/runtime.d.ts +243 -0
- package/runtime/runtime.d.ts.map +1 -0
- package/runtime/runtime.js +1147 -0
- package/runtime/source-bridge.d.ts +99 -0
- package/runtime/source-bridge.d.ts.map +1 -0
- package/runtime/source-bridge.js +401 -0
- package/runtime/style-compose.d.ts +46 -0
- package/runtime/style-compose.d.ts.map +1 -0
- package/runtime/style-compose.js +144 -0
- package/runtime/style-interactions.d.ts +141 -0
- package/runtime/style-interactions.d.ts.map +1 -0
- package/runtime/style-interactions.js +574 -0
- package/runtime/style-spec-validation.d.ts +23 -0
- package/runtime/style-spec-validation.d.ts.map +1 -0
- package/runtime/style-spec-validation.js +357 -0
- package/studio/capability-manifest.d.ts +285 -0
- package/studio/capability-manifest.d.ts.map +1 -0
- package/studio/capability-manifest.js +59 -0
- package/studio/chart-spec.d.ts +85 -0
- package/studio/chart-spec.d.ts.map +1 -0
- package/studio/chart-spec.js +106 -0
- package/studio/index.d.ts +34 -0
- package/studio/index.d.ts.map +1 -0
- package/studio/index.js +27 -0
- package/studio/provenance.d.ts +131 -0
- package/studio/provenance.d.ts.map +1 -0
- package/studio/provenance.js +39 -0
- package/studio/publish.d.ts +64 -0
- package/studio/publish.d.ts.map +1 -0
- package/studio/publish.js +13 -0
- package/studio/types.d.ts +278 -0
- package/studio/types.d.ts.map +1 -0
- package/studio/types.js +71 -0
- package/studio/validate.d.ts +45 -0
- package/studio/validate.d.ts.map +1 -0
- package/studio/validate.js +255 -0
- package/studio/validation.d.ts +112 -0
- package/studio/validation.d.ts.map +1 -0
- package/studio/validation.js +42 -0
- package/style/factory.d.ts +30 -0
- package/style/factory.d.ts.map +1 -0
- package/style/factory.js +61 -0
- package/style/index.d.ts +25 -0
- package/style/index.d.ts.map +1 -0
- package/style/index.js +24 -0
- package/style/specification.d.ts +203 -0
- package/style/specification.d.ts.map +1 -0
- package/style/specification.js +178 -0
- package/style/wms-wmts-resolvers.d.ts +38 -0
- package/style/wms-wmts-resolvers.d.ts.map +1 -0
- package/style/wms-wmts-resolvers.js +92 -0
- package/webmap/contract.d.ts +28 -0
- package/webmap/contract.d.ts.map +1 -0
- package/webmap/contract.js +130 -0
- package/webmap/convert-basemap.d.ts +17 -0
- package/webmap/convert-basemap.d.ts.map +1 -0
- package/webmap/convert-basemap.js +78 -0
- package/webmap/convert-extent.d.ts +17 -0
- package/webmap/convert-extent.d.ts.map +1 -0
- package/webmap/convert-extent.js +114 -0
- package/webmap/convert-label.d.ts +13 -0
- package/webmap/convert-label.d.ts.map +1 -0
- package/webmap/convert-label.js +125 -0
- package/webmap/convert-layer.d.ts +22 -0
- package/webmap/convert-layer.d.ts.map +1 -0
- package/webmap/convert-layer.js +181 -0
- package/webmap/convert-popup.d.ts +34 -0
- package/webmap/convert-popup.d.ts.map +1 -0
- package/webmap/convert-popup.js +68 -0
- package/webmap/convert-renderer.d.ts +17 -0
- package/webmap/convert-renderer.d.ts.map +1 -0
- package/webmap/convert-renderer.js +161 -0
- package/webmap/convert-symbol.d.ts +17 -0
- package/webmap/convert-symbol.d.ts.map +1 -0
- package/webmap/convert-symbol.js +122 -0
- package/webmap/index.d.ts +44 -0
- package/webmap/index.d.ts.map +1 -0
- package/webmap/index.js +33 -0
- package/webmap/parse.d.ts +25 -0
- package/webmap/parse.d.ts.map +1 -0
- package/webmap/parse.js +83 -0
- package/webmap/types.d.ts +264 -0
- package/webmap/types.d.ts.map +1 -0
- package/webmap/types.js +13 -0
- package/webmap/warnings.d.ts +30 -0
- package/webmap/warnings.d.ts.map +1 -0
- package/webmap/warnings.js +37 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature-state interaction helpers.
|
|
3
|
+
*
|
|
4
|
+
* These utilities wrap MapLibre GL JS's `setFeatureState` / `removeFeatureState`
|
|
5
|
+
* behind duck-typed interfaces so the SDK carries no hard runtime dependency on
|
|
6
|
+
* `maplibre-gl`. Any object that implements {@link FeatureStateMap} works.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { sourceFeatureSelectionTarget } from "../exploration/selection.js";
|
|
11
|
+
// ── Core helpers ──────────────────────────────────────────────
|
|
12
|
+
/**
|
|
13
|
+
* Set state on a feature.
|
|
14
|
+
*
|
|
15
|
+
* Thin wrapper that constructs the MapLibre target object. Prefer this over
|
|
16
|
+
* calling `map.setFeatureState()` directly when working with Honua source IDs
|
|
17
|
+
* and feature IDs from query results.
|
|
18
|
+
*/
|
|
19
|
+
export function setFeatureState(map, source, id, state, sourceLayer) {
|
|
20
|
+
map.setFeatureState({ source, id, sourceLayer }, state);
|
|
21
|
+
}
|
|
22
|
+
/** Get current state for a feature. */
|
|
23
|
+
export function getFeatureState(map, source, id, sourceLayer) {
|
|
24
|
+
return map.getFeatureState({ source, id, sourceLayer });
|
|
25
|
+
}
|
|
26
|
+
/** Remove a single state key (or all state) from a feature. */
|
|
27
|
+
export function removeFeatureState(map, source, id, key, sourceLayer) {
|
|
28
|
+
map.removeFeatureState({ source, id, sourceLayer }, key);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a hover handler that manages `feature-state` hover state.
|
|
32
|
+
*
|
|
33
|
+
* Wires up `mousemove` / `mouseleave` events on the specified layer and
|
|
34
|
+
* toggles a boolean state key (default `"hover"`) on the underlying source.
|
|
35
|
+
* Pair with a paint expression like:
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { expr } from "@honua/sdk";
|
|
39
|
+
* const opacity = expr.case([expr.featureState("hover"), 1.0], 0.5);
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const hover = createHoverHandler(map, {
|
|
45
|
+
* source: "parcels",
|
|
46
|
+
* layer: "parcel-fill",
|
|
47
|
+
* });
|
|
48
|
+
* // Later:
|
|
49
|
+
* hover.remove();
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export function createHoverHandler(map, options) {
|
|
53
|
+
const { source, layer, stateKey = "hover", sourceLayer } = options;
|
|
54
|
+
let hoveredId;
|
|
55
|
+
function onMouseMove(...args) {
|
|
56
|
+
const e = args[0];
|
|
57
|
+
const featureId = e?.features?.[0]?.id;
|
|
58
|
+
if (featureId === undefined || featureId === null)
|
|
59
|
+
return;
|
|
60
|
+
if (hoveredId !== undefined && hoveredId !== featureId) {
|
|
61
|
+
map.setFeatureState({ source, id: hoveredId, sourceLayer }, { [stateKey]: false });
|
|
62
|
+
}
|
|
63
|
+
hoveredId = featureId;
|
|
64
|
+
map.setFeatureState({ source, id: hoveredId, sourceLayer }, { [stateKey]: true });
|
|
65
|
+
}
|
|
66
|
+
function onMouseLeave() {
|
|
67
|
+
if (hoveredId !== undefined) {
|
|
68
|
+
map.setFeatureState({ source, id: hoveredId, sourceLayer }, { [stateKey]: false });
|
|
69
|
+
hoveredId = undefined;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
map.on("mousemove", layer, onMouseMove);
|
|
73
|
+
map.on("mouseleave", layer, onMouseLeave);
|
|
74
|
+
return {
|
|
75
|
+
remove() {
|
|
76
|
+
onMouseLeave(); // clear any lingering state
|
|
77
|
+
map.off("mousemove", layer, onMouseMove);
|
|
78
|
+
map.off("mouseleave", layer, onMouseLeave);
|
|
79
|
+
},
|
|
80
|
+
get hoveredId() {
|
|
81
|
+
return hoveredId;
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Create a selection handler that manages `feature-state` selection.
|
|
87
|
+
*
|
|
88
|
+
* Wires up `click` events on the specified layer and toggles a boolean state
|
|
89
|
+
* key (default `"selected"`) on the underlying source. Supports single-select
|
|
90
|
+
* (default) and multi-select modes.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* const selection = createSelectionHandler(map, {
|
|
95
|
+
* source: "parcels",
|
|
96
|
+
* layer: "parcel-fill",
|
|
97
|
+
* onChange: (ids) => updateSidebar(ids),
|
|
98
|
+
* });
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
export function createSelectionHandler(map, options) {
|
|
102
|
+
const { source, layer, stateKey = "selected", multiSelect = false, sourceLayer, onChange, onSelectionTargetsChange, } = options;
|
|
103
|
+
const selected = new Set();
|
|
104
|
+
function clearAll() {
|
|
105
|
+
for (const id of selected) {
|
|
106
|
+
map.setFeatureState({ source, id, sourceLayer }, { [stateKey]: false });
|
|
107
|
+
}
|
|
108
|
+
selected.clear();
|
|
109
|
+
}
|
|
110
|
+
function notifyChange() {
|
|
111
|
+
onChange?.(selected);
|
|
112
|
+
onSelectionTargetsChange?.(selectionTargets());
|
|
113
|
+
}
|
|
114
|
+
function selectionTargets() {
|
|
115
|
+
return [...selected].map((id) => sourceFeatureSelectionTarget(source, id, { sourceLayer }));
|
|
116
|
+
}
|
|
117
|
+
function onClick(...args) {
|
|
118
|
+
const e = args[0];
|
|
119
|
+
const featureId = e?.features?.[0]?.id;
|
|
120
|
+
if (featureId === undefined || featureId === null)
|
|
121
|
+
return;
|
|
122
|
+
if (selected.has(featureId)) {
|
|
123
|
+
// Deselect
|
|
124
|
+
map.setFeatureState({ source, id: featureId, sourceLayer }, { [stateKey]: false });
|
|
125
|
+
selected.delete(featureId);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
// New selection
|
|
129
|
+
if (!multiSelect) {
|
|
130
|
+
clearAll();
|
|
131
|
+
}
|
|
132
|
+
map.setFeatureState({ source, id: featureId, sourceLayer }, { [stateKey]: true });
|
|
133
|
+
selected.add(featureId);
|
|
134
|
+
}
|
|
135
|
+
notifyChange();
|
|
136
|
+
}
|
|
137
|
+
map.on("click", layer, onClick);
|
|
138
|
+
return {
|
|
139
|
+
remove() {
|
|
140
|
+
clearAll();
|
|
141
|
+
map.off("click", layer, onClick);
|
|
142
|
+
},
|
|
143
|
+
get selectedIds() {
|
|
144
|
+
return selected;
|
|
145
|
+
},
|
|
146
|
+
get selectedTargets() {
|
|
147
|
+
return selectionTargets();
|
|
148
|
+
},
|
|
149
|
+
clearSelection() {
|
|
150
|
+
clearAll();
|
|
151
|
+
notifyChange();
|
|
152
|
+
},
|
|
153
|
+
select(id) {
|
|
154
|
+
if (!multiSelect) {
|
|
155
|
+
clearAll();
|
|
156
|
+
}
|
|
157
|
+
map.setFeatureState({ source, id, sourceLayer }, { [stateKey]: true });
|
|
158
|
+
selected.add(id);
|
|
159
|
+
notifyChange();
|
|
160
|
+
},
|
|
161
|
+
deselect(id) {
|
|
162
|
+
if (selected.has(id)) {
|
|
163
|
+
map.setFeatureState({ source, id, sourceLayer }, { [stateKey]: false });
|
|
164
|
+
selected.delete(id);
|
|
165
|
+
notifyChange();
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renderer-neutral hit-test and pointer primitives.
|
|
3
|
+
*
|
|
4
|
+
* The helpers in this module normalize MapLibre-shaped rendered features into
|
|
5
|
+
* Honua source-qualified identities without importing a renderer package.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { type QueryTileFeatureIdentityTarget, type QueryTileSourceDescriptor, type Source } from "../contract/index.js";
|
|
10
|
+
import type { FeatureId } from "../contract/types.js";
|
|
11
|
+
import type { SourceQualifiedFeatureSelectionTarget } from "../exploration/types.js";
|
|
12
|
+
export interface HonuaScreenPoint {
|
|
13
|
+
readonly x: number;
|
|
14
|
+
readonly y: number;
|
|
15
|
+
}
|
|
16
|
+
export interface HonuaLngLat {
|
|
17
|
+
readonly lng: number;
|
|
18
|
+
readonly lat: number;
|
|
19
|
+
}
|
|
20
|
+
export type HonuaPointerEventType = "click" | "dblclick" | "mousemove" | "mouseenter" | "mouseleave" | "pointer";
|
|
21
|
+
export interface HonuaPointerInput {
|
|
22
|
+
readonly type?: HonuaPointerEventType | string;
|
|
23
|
+
readonly point?: HonuaScreenPoint | readonly [number, number];
|
|
24
|
+
readonly lngLat?: HonuaLngLat | readonly [number, number];
|
|
25
|
+
readonly originalEvent?: unknown;
|
|
26
|
+
}
|
|
27
|
+
export interface HonuaPointerEvent {
|
|
28
|
+
readonly type: HonuaPointerEventType | string;
|
|
29
|
+
readonly point: HonuaScreenPoint;
|
|
30
|
+
readonly lngLat?: readonly [number, number];
|
|
31
|
+
readonly originalEvent?: unknown;
|
|
32
|
+
}
|
|
33
|
+
export type HonuaHitTestDegradedReason = "renderer-unsupported" | "lnglat-unavailable" | "geometry-unavailable" | "feature-id-unavailable" | "source-binding-unavailable" | "raster-value-unavailable" | "detail-unavailable" | "detail-aborted" | "detail-failed";
|
|
34
|
+
export interface HonuaHitTestDegradedState {
|
|
35
|
+
readonly reason: HonuaHitTestDegradedReason;
|
|
36
|
+
readonly message: string;
|
|
37
|
+
readonly layerId?: string;
|
|
38
|
+
readonly sourceId?: string;
|
|
39
|
+
readonly featureId?: FeatureId;
|
|
40
|
+
readonly cause?: unknown;
|
|
41
|
+
}
|
|
42
|
+
export interface HonuaHitTestRasterSample {
|
|
43
|
+
readonly value?: unknown;
|
|
44
|
+
readonly band?: number | string;
|
|
45
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
46
|
+
}
|
|
47
|
+
export interface HonuaHitFeature {
|
|
48
|
+
readonly layerId?: string;
|
|
49
|
+
readonly sourceId?: string;
|
|
50
|
+
readonly sourceLayer?: string;
|
|
51
|
+
readonly featureId?: FeatureId;
|
|
52
|
+
readonly selectionTarget?: SourceQualifiedFeatureSelectionTarget;
|
|
53
|
+
readonly properties: Readonly<Record<string, unknown>>;
|
|
54
|
+
readonly geometry?: unknown;
|
|
55
|
+
readonly raster?: HonuaHitTestRasterSample;
|
|
56
|
+
readonly detail?: unknown;
|
|
57
|
+
readonly rawFeature: unknown;
|
|
58
|
+
readonly degraded: readonly HonuaHitTestDegradedState[];
|
|
59
|
+
}
|
|
60
|
+
export interface HonuaHitTestResult {
|
|
61
|
+
readonly point: HonuaScreenPoint;
|
|
62
|
+
readonly lngLat?: readonly [number, number];
|
|
63
|
+
readonly features: readonly HonuaHitFeature[];
|
|
64
|
+
readonly degraded: readonly HonuaHitTestDegradedState[];
|
|
65
|
+
readonly rawFeatures?: readonly unknown[];
|
|
66
|
+
}
|
|
67
|
+
export interface HonuaRenderedFeatureContext {
|
|
68
|
+
readonly layerId?: string;
|
|
69
|
+
readonly layerType?: string;
|
|
70
|
+
readonly sourceId?: string;
|
|
71
|
+
readonly sourceLayer?: string;
|
|
72
|
+
readonly protocol?: string;
|
|
73
|
+
readonly queryTileDescriptor?: QueryTileSourceDescriptor;
|
|
74
|
+
}
|
|
75
|
+
export interface HonuaHitTestFeatureOptions {
|
|
76
|
+
readonly featureIdProperty?: string;
|
|
77
|
+
readonly resolveFeatureId?: (feature: unknown, context: HonuaRenderedFeatureContext) => FeatureId | undefined;
|
|
78
|
+
readonly resolveFeatureContext?: (feature: unknown) => HonuaRenderedFeatureContext | undefined;
|
|
79
|
+
readonly queryTileSources?: Readonly<Record<string, QueryTileSourceDescriptor>>;
|
|
80
|
+
}
|
|
81
|
+
export interface HonuaHitTestOptions extends HonuaHitTestFeatureOptions {
|
|
82
|
+
readonly layers?: readonly string[];
|
|
83
|
+
readonly sourceIds?: readonly string[];
|
|
84
|
+
readonly sourceLayers?: readonly string[];
|
|
85
|
+
readonly tolerance?: number;
|
|
86
|
+
readonly maxResults?: number;
|
|
87
|
+
readonly loadDetails?: boolean;
|
|
88
|
+
readonly signal?: AbortSignal;
|
|
89
|
+
}
|
|
90
|
+
export interface HonuaHitTestMap {
|
|
91
|
+
queryRenderedFeatures?(geometry?: HonuaScreenPoint | readonly [HonuaScreenPoint, HonuaScreenPoint], options?: {
|
|
92
|
+
layers?: readonly string[];
|
|
93
|
+
}): readonly unknown[];
|
|
94
|
+
unproject?(point: HonuaScreenPoint | readonly [number, number]): HonuaLngLat | readonly [number, number];
|
|
95
|
+
}
|
|
96
|
+
export interface HonuaHitTestDetailContext extends HonuaRenderedFeatureContext {
|
|
97
|
+
readonly target: QueryTileFeatureIdentityTarget;
|
|
98
|
+
readonly hit: HonuaHitFeature;
|
|
99
|
+
}
|
|
100
|
+
export type HonuaHitTestDetailLoader = (context: HonuaHitTestDetailContext, options: {
|
|
101
|
+
readonly signal?: AbortSignal;
|
|
102
|
+
}) => Promise<unknown>;
|
|
103
|
+
export interface HonuaNormalizeHitTestOptions extends HonuaHitTestOptions {
|
|
104
|
+
readonly featureContexts?: Readonly<Record<string, HonuaRenderedFeatureContext>>;
|
|
105
|
+
readonly detailLoader?: HonuaHitTestDetailLoader;
|
|
106
|
+
}
|
|
107
|
+
export declare function hitTestMap(map: HonuaHitTestMap, input: HonuaPointerInput, options?: HonuaNormalizeHitTestOptions): Promise<HonuaHitTestResult>;
|
|
108
|
+
export declare function normalizePointerEvent(input: HonuaPointerInput | unknown, map?: Pick<HonuaHitTestMap, "unproject">): HonuaPointerEvent;
|
|
109
|
+
export declare function normalizeHitTestFeatures(features: readonly unknown[], options?: HonuaNormalizeHitTestOptions): HonuaHitFeature[];
|
|
110
|
+
export declare function normalizeHitFeature(feature: unknown, context: HonuaRenderedFeatureContext, options?: HonuaHitTestFeatureOptions): HonuaHitFeature;
|
|
111
|
+
export declare function createQueryTileDetailLoader(sources: Readonly<Record<string, Source>>, descriptors: Readonly<Record<string, QueryTileSourceDescriptor>>): HonuaHitTestDetailLoader;
|
|
112
|
+
//# sourceMappingURL=hit-test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hit-test.d.ts","sourceRoot":"","sources":["../../../src/interactions/hit-test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,MAAM,EAGZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,yBAAyB,C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EAClC,GAAG,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,GACvC,iBAAiB,CAUnB;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,OAAO,GAAE,4BAAiC,GACzC,eAAe,EAAE,CAYnB;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,2BAA2B,EACpC,OAAO,GAAE,0BAA+B,GACvC,eAAe,CA0DjB;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACzC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC,GAC/D,wBAAwB,CAY1B"}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renderer-neutral hit-test and pointer primitives.
|
|
3
|
+
*
|
|
4
|
+
* The helpers in this module normalize MapLibre-shaped rendered features into
|
|
5
|
+
* Honua source-qualified identities without importing a renderer package.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { loadQueryTileFeatureDetail, mapQueryTileFeatureIdentity, } from "../contract/index.js";
|
|
10
|
+
import { sourceFeatureSelectionTarget } from "../exploration/selection.js";
|
|
11
|
+
export async function hitTestMap(map, input, options = {}) {
|
|
12
|
+
const pointer = normalizePointerEvent(input, map);
|
|
13
|
+
const degraded = pointer.lngLat
|
|
14
|
+
? []
|
|
15
|
+
: [
|
|
16
|
+
{
|
|
17
|
+
reason: "lnglat-unavailable",
|
|
18
|
+
message: "The renderer did not provide lngLat and cannot unproject screen coordinates.",
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
if (!map.queryRenderedFeatures) {
|
|
22
|
+
return {
|
|
23
|
+
point: pointer.point,
|
|
24
|
+
lngLat: pointer.lngLat,
|
|
25
|
+
features: [],
|
|
26
|
+
degraded: [
|
|
27
|
+
...degraded,
|
|
28
|
+
{ reason: "renderer-unsupported", message: "The renderer does not support queryRenderedFeatures." },
|
|
29
|
+
],
|
|
30
|
+
rawFeatures: [],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const rawFeatures = map.queryRenderedFeatures(queryGeometry(pointer.point, options.tolerance), {
|
|
34
|
+
...(options.layers ? { layers: options.layers } : {}),
|
|
35
|
+
});
|
|
36
|
+
const normalized = normalizeHitTestFeatures(rawFeatures, options);
|
|
37
|
+
const withDetails = options.loadDetails ? await loadHitDetails(normalized, options) : normalized;
|
|
38
|
+
return {
|
|
39
|
+
point: pointer.point,
|
|
40
|
+
lngLat: pointer.lngLat,
|
|
41
|
+
features: withDetails,
|
|
42
|
+
degraded,
|
|
43
|
+
rawFeatures,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export function normalizePointerEvent(input, map) {
|
|
47
|
+
const event = isRecord(input) ? input : {};
|
|
48
|
+
const point = normalizePoint(event.point) ?? normalizePoint(event) ?? clientPoint(event) ?? { x: 0, y: 0 };
|
|
49
|
+
const lngLat = normalizeLngLat(event.lngLat) ?? (map?.unproject ? normalizeLngLat(map.unproject(point)) : undefined);
|
|
50
|
+
return {
|
|
51
|
+
type: typeof event.type === "string" ? event.type : "pointer",
|
|
52
|
+
point,
|
|
53
|
+
...(lngLat ? { lngLat } : {}),
|
|
54
|
+
originalEvent: input,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export function normalizeHitTestFeatures(features, options = {}) {
|
|
58
|
+
if (options.maxResults !== undefined && options.maxResults <= 0)
|
|
59
|
+
return [];
|
|
60
|
+
const out = [];
|
|
61
|
+
for (const feature of features) {
|
|
62
|
+
const context = featureContext(feature, options);
|
|
63
|
+
const hit = normalizeHitFeature(feature, context, options);
|
|
64
|
+
if (options.sourceIds && (!hit.sourceId || !options.sourceIds.includes(hit.sourceId)))
|
|
65
|
+
continue;
|
|
66
|
+
if (options.sourceLayers && (!hit.sourceLayer || !options.sourceLayers.includes(hit.sourceLayer)))
|
|
67
|
+
continue;
|
|
68
|
+
out.push(hit);
|
|
69
|
+
if (options.maxResults !== undefined && out.length >= options.maxResults)
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
return out;
|
|
73
|
+
}
|
|
74
|
+
export function normalizeHitFeature(feature, context, options = {}) {
|
|
75
|
+
const properties = featureProperties(feature);
|
|
76
|
+
const queryTileDescriptor = context.queryTileDescriptor ?? queryTileDescriptorForContext(context, options);
|
|
77
|
+
const queryTileIdentity = queryTileDescriptor ? mapQueryTileFeatureIdentity(queryTileDescriptor, feature) : undefined;
|
|
78
|
+
const sourceId = queryTileIdentity?.sourceId ?? context.sourceId;
|
|
79
|
+
const sourceLayer = queryTileIdentity?.sourceLayer ?? context.sourceLayer;
|
|
80
|
+
const featureId = queryTileIdentity?.id ??
|
|
81
|
+
options.resolveFeatureId?.(feature, context) ??
|
|
82
|
+
featureIdFromFeature(feature, properties, options.featureIdProperty);
|
|
83
|
+
const geometry = featureGeometry(feature);
|
|
84
|
+
const raster = rasterSample(feature);
|
|
85
|
+
const degraded = [];
|
|
86
|
+
if (!sourceId) {
|
|
87
|
+
degraded.push({ reason: "source-binding-unavailable", message: "Rendered feature has no Honua source binding." });
|
|
88
|
+
}
|
|
89
|
+
if (featureId === undefined) {
|
|
90
|
+
degraded.push({
|
|
91
|
+
reason: "feature-id-unavailable",
|
|
92
|
+
message: "Rendered feature has no stable feature id.",
|
|
93
|
+
layerId: context.layerId,
|
|
94
|
+
sourceId,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (geometry === undefined) {
|
|
98
|
+
degraded.push({
|
|
99
|
+
reason: "geometry-unavailable",
|
|
100
|
+
message: "Rendered feature did not include geometry.",
|
|
101
|
+
layerId: context.layerId,
|
|
102
|
+
sourceId,
|
|
103
|
+
featureId,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
if (context.layerType === "raster" && raster?.value === undefined) {
|
|
107
|
+
degraded.push({
|
|
108
|
+
reason: "raster-value-unavailable",
|
|
109
|
+
message: "Rendered raster hit did not include a sample value.",
|
|
110
|
+
layerId: context.layerId,
|
|
111
|
+
sourceId,
|
|
112
|
+
featureId,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
layerId: context.layerId,
|
|
117
|
+
sourceId,
|
|
118
|
+
sourceLayer,
|
|
119
|
+
featureId,
|
|
120
|
+
...(sourceId && featureId !== undefined
|
|
121
|
+
? { selectionTarget: sourceFeatureSelectionTarget(sourceId, featureId, { sourceLayer }) }
|
|
122
|
+
: {}),
|
|
123
|
+
properties,
|
|
124
|
+
geometry,
|
|
125
|
+
raster,
|
|
126
|
+
rawFeature: feature,
|
|
127
|
+
degraded,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
export function createQueryTileDetailLoader(sources, descriptors) {
|
|
131
|
+
return async (context, options) => {
|
|
132
|
+
const descriptor = descriptors[context.target.sourceId] ?? descriptors[context.sourceId ?? ""];
|
|
133
|
+
const source = sources[context.target.sourceId] ?? (context.sourceId ? sources[context.sourceId] : undefined);
|
|
134
|
+
if (!descriptor || !source)
|
|
135
|
+
return undefined;
|
|
136
|
+
return loadQueryTileFeatureDetail({
|
|
137
|
+
source,
|
|
138
|
+
descriptor,
|
|
139
|
+
target: context.target,
|
|
140
|
+
signal: options.signal,
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
async function loadHitDetails(features, options) {
|
|
145
|
+
if (!options.detailLoader) {
|
|
146
|
+
return features.map((hit) => ({
|
|
147
|
+
...hit,
|
|
148
|
+
degraded: [
|
|
149
|
+
...hit.degraded,
|
|
150
|
+
{ reason: "detail-unavailable", message: "No hit-test detail loader was configured.", sourceId: hit.sourceId },
|
|
151
|
+
],
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
const out = [];
|
|
155
|
+
for (const hit of features) {
|
|
156
|
+
if (options.signal?.aborted) {
|
|
157
|
+
out.push(withDegraded(hit, "detail-aborted", "Hit-test detail loading was aborted."));
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
if (!hit.sourceId || hit.featureId === undefined) {
|
|
161
|
+
out.push(withDegraded(hit, "detail-unavailable", "Hit-test detail requires a source id and feature id."));
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
try {
|
|
165
|
+
const target = {
|
|
166
|
+
sourceId: hit.sourceId,
|
|
167
|
+
id: hit.featureId,
|
|
168
|
+
...(hit.sourceLayer ? { sourceLayer: hit.sourceLayer } : {}),
|
|
169
|
+
properties: hit.properties,
|
|
170
|
+
feature: hit.rawFeature,
|
|
171
|
+
};
|
|
172
|
+
const detail = await options.detailLoader({ ...hit, target, hit }, { signal: options.signal });
|
|
173
|
+
out.push(detail === undefined ? withDegraded(hit, "detail-unavailable", "No detail was available.") : { ...hit, detail });
|
|
174
|
+
}
|
|
175
|
+
catch (cause) {
|
|
176
|
+
out.push(withDegraded(hit, options.signal?.aborted ? "detail-aborted" : "detail-failed", options.signal?.aborted ? "Hit-test detail loading was aborted." : "Hit-test detail loading failed.", cause));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return out;
|
|
180
|
+
}
|
|
181
|
+
function withDegraded(hit, reason, message, cause) {
|
|
182
|
+
return {
|
|
183
|
+
...hit,
|
|
184
|
+
degraded: [
|
|
185
|
+
...hit.degraded,
|
|
186
|
+
{ reason, message, layerId: hit.layerId, sourceId: hit.sourceId, featureId: hit.featureId, cause },
|
|
187
|
+
],
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
function queryGeometry(point, tolerance) {
|
|
191
|
+
const hitTolerance = tolerance ?? 0;
|
|
192
|
+
if (hitTolerance <= 0)
|
|
193
|
+
return point;
|
|
194
|
+
return [
|
|
195
|
+
{ x: point.x - hitTolerance, y: point.y - hitTolerance },
|
|
196
|
+
{ x: point.x + hitTolerance, y: point.y + hitTolerance },
|
|
197
|
+
];
|
|
198
|
+
}
|
|
199
|
+
function featureContext(feature, options) {
|
|
200
|
+
const explicit = options.resolveFeatureContext?.(feature);
|
|
201
|
+
if (explicit)
|
|
202
|
+
return explicit;
|
|
203
|
+
const layerId = featureLayerId(feature);
|
|
204
|
+
return {
|
|
205
|
+
...(layerId ? { layerId } : {}),
|
|
206
|
+
...(layerId && options.featureContexts?.[layerId] ? options.featureContexts[layerId] : {}),
|
|
207
|
+
...featureNativeSourceContext(feature),
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function queryTileDescriptorForContext(context, options) {
|
|
211
|
+
if (!context.sourceId)
|
|
212
|
+
return undefined;
|
|
213
|
+
return options.queryTileSources?.[context.sourceId];
|
|
214
|
+
}
|
|
215
|
+
function normalizePoint(value) {
|
|
216
|
+
if (Array.isArray(value) && typeof value[0] === "number" && typeof value[1] === "number") {
|
|
217
|
+
return { x: value[0], y: value[1] };
|
|
218
|
+
}
|
|
219
|
+
if (isRecord(value) && typeof value.x === "number" && typeof value.y === "number") {
|
|
220
|
+
return { x: value.x, y: value.y };
|
|
221
|
+
}
|
|
222
|
+
return undefined;
|
|
223
|
+
}
|
|
224
|
+
function normalizeLngLat(value) {
|
|
225
|
+
if (Array.isArray(value) && typeof value[0] === "number" && typeof value[1] === "number")
|
|
226
|
+
return [value[0], value[1]];
|
|
227
|
+
if (isRecord(value) && typeof value.lng === "number" && typeof value.lat === "number")
|
|
228
|
+
return [value.lng, value.lat];
|
|
229
|
+
return undefined;
|
|
230
|
+
}
|
|
231
|
+
function clientPoint(value) {
|
|
232
|
+
return typeof value.clientX === "number" && typeof value.clientY === "number"
|
|
233
|
+
? { x: value.clientX, y: value.clientY }
|
|
234
|
+
: undefined;
|
|
235
|
+
}
|
|
236
|
+
function featureIdFromFeature(feature, properties, featureIdProperty) {
|
|
237
|
+
if (isRecord(feature) && (typeof feature.id === "string" || typeof feature.id === "number"))
|
|
238
|
+
return feature.id;
|
|
239
|
+
const propertyId = (featureIdProperty ? properties[featureIdProperty] : undefined) ??
|
|
240
|
+
properties.OBJECTID ??
|
|
241
|
+
properties.objectid ??
|
|
242
|
+
properties.ObjectID ??
|
|
243
|
+
properties.id;
|
|
244
|
+
return typeof propertyId === "string" || typeof propertyId === "number" ? propertyId : undefined;
|
|
245
|
+
}
|
|
246
|
+
function featureProperties(feature) {
|
|
247
|
+
return isRecord(feature) && isRecord(feature.properties) ? feature.properties : {};
|
|
248
|
+
}
|
|
249
|
+
function featureGeometry(feature) {
|
|
250
|
+
return isRecord(feature) && "geometry" in feature ? feature.geometry : undefined;
|
|
251
|
+
}
|
|
252
|
+
function featureLayerId(feature) {
|
|
253
|
+
if (!isRecord(feature))
|
|
254
|
+
return undefined;
|
|
255
|
+
const layer = feature.layer;
|
|
256
|
+
return isRecord(layer) && typeof layer.id === "string" ? layer.id : undefined;
|
|
257
|
+
}
|
|
258
|
+
function featureNativeSourceContext(feature) {
|
|
259
|
+
if (!isRecord(feature))
|
|
260
|
+
return {};
|
|
261
|
+
const layer = isRecord(feature.layer) ? feature.layer : {};
|
|
262
|
+
const sourceId = typeof feature.source === "string" ? feature.source : typeof layer.source === "string" ? layer.source : undefined;
|
|
263
|
+
const sourceLayer = typeof feature.sourceLayer === "string"
|
|
264
|
+
? feature.sourceLayer
|
|
265
|
+
: typeof feature.sourceLayer === "number"
|
|
266
|
+
? String(feature.sourceLayer)
|
|
267
|
+
: typeof layer["source-layer"] === "string"
|
|
268
|
+
? layer["source-layer"]
|
|
269
|
+
: undefined;
|
|
270
|
+
return {
|
|
271
|
+
...(typeof layer.id === "string" ? { layerId: layer.id } : {}),
|
|
272
|
+
...(typeof layer.type === "string" ? { layerType: layer.type } : {}),
|
|
273
|
+
...(sourceId ? { sourceId } : {}),
|
|
274
|
+
...(sourceLayer ? { sourceLayer } : {}),
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function rasterSample(feature) {
|
|
278
|
+
if (!isRecord(feature))
|
|
279
|
+
return undefined;
|
|
280
|
+
const sample = feature.raster ?? feature.sample;
|
|
281
|
+
if (!isRecord(sample))
|
|
282
|
+
return undefined;
|
|
283
|
+
return {
|
|
284
|
+
value: sample.value,
|
|
285
|
+
band: typeof sample.band === "number" || typeof sample.band === "string" ? sample.band : undefined,
|
|
286
|
+
metadata: isRecord(sample.metadata) ? sample.metadata : undefined,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
function isRecord(value) {
|
|
290
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
291
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@honua/sdk-js/interactions` — hit-test, pointer normalization, and the
|
|
3
|
+
* binding primitives that wire chart / map / table widgets to an
|
|
4
|
+
* `ExplorationContext`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { hitTestMap, bindMapSelectionToExploration } from "@honua/sdk-js/interactions";
|
|
9
|
+
*
|
|
10
|
+
* map.on("click", async (event) => {
|
|
11
|
+
* const hit = await hitTestMap(map, event);
|
|
12
|
+
* if (hit?.feature) ctx.dispatch({ type: "select", target: hit.feature });
|
|
13
|
+
* });
|
|
14
|
+
* bindMapSelectionToExploration({ map, context: ctx, sourceId: "parcels" });
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @packageDocumentation
|
|
18
|
+
*/
|
|
19
|
+
export { createQueryTileDetailLoader, hitTestMap, normalizeHitFeature, normalizeHitTestFeatures, normalizePointerEvent, } from "./hit-test.js";
|
|
20
|
+
export { extentToSpatialFilter, selectLinkedViewQueryProjection, subscribeExplorationSelector, } from "../exploration/selectors.js";
|
|
21
|
+
export { setFeatureState, getFeatureState, removeFeatureState, createHoverHandler, createSelectionHandler, } from "./feature-state.js";
|
|
22
|
+
export { bindDetailToSelection, bindChartToExploration, bindFilterControlsToExploration, bindMapExtentToExploration, bindMapSelectionToExploration, bindQueryProjectionToExploration, bindTableSelectionToExploration, syncMapLayerFilterToExploration, syncFeatureStateSelection, } from "./exploration-bindings.js";
|
|
23
|
+
export { preparePrimaryDetailModel, prepareSelectionDetailModels } from "./detail-model.js";
|
|
24
|
+
export { interactionQueryParamNames, parseInteractionQueryState, parseSelection, serializeInteractionQueryState, serializeSelection, } from "./share-state.js";
|
|
25
|
+
export type { HonuaHitFeature, HonuaHitTestDegradedReason, HonuaHitTestDegradedState, HonuaHitTestDetailContext, HonuaHitTestDetailLoader, HonuaHitTestFeatureOptions, HonuaHitTestMap, HonuaHitTestOptions, HonuaHitTestRasterSample, HonuaHitTestResult, HonuaLngLat, HonuaNormalizeHitTestOptions, HonuaPointerEvent, HonuaPointerEventType, HonuaPointerInput, HonuaRenderedFeatureContext, HonuaScreenPoint, } from "./hit-test.js";
|
|
26
|
+
export type { FeatureStateMap, MapEventTarget, InteractiveMap, FeatureTarget, HoverHandlerOptions, HoverHandle, SelectionHandlerOptions, SelectionHandle, } from "./feature-state.js";
|
|
27
|
+
export type { ExplorationSelector, ExplorationSelectorListener, ExplorationSelectorSubscribeOptions, LinkedViewQueryProjection, LinkedViewQueryProjectionOptions, LinkedViewSpatialMode, } from "../exploration/selectors.js";
|
|
28
|
+
export type { FeatureStateSelectionSyncOptions, ChartBucketSelection, ChartBucketSelectionOptions, ChartExplorationBinding, FilterControlsExplorationBinding, InteractionBindingHandle, LinkedViewQueryBindingOptions, MapExtentExplorationBindingOptions, MapExtentExplorationSource, MapLayerFilterExplorationBindingOptions, MapLayerFilterTarget, MapSelectionExplorationBindingOptions, SelectionDetailListener, TableSelectionExplorationBinding, } from "./exploration-bindings.js";
|
|
29
|
+
export type { DetailFeatureLike, DetailFieldDefinition, DetailFieldModel, DetailModel, DetailModelOptions, DetailSelectionStatus, } from "./detail-model.js";
|
|
30
|
+
export type { ShareableInteractionQueryParams, ShareableInteractionQueryState } from "./share-state.js";
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","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tB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,gCAAgC,EAChC,oBAAoB,EACpB,2BAA2B,EAC3B,uBAAuB,EACvB,gCAAgC,EAChC,wBAAwB,EACxB,6BAA6B,EAC7B,kCAAkC,EAClC,0BAA0B,EAC1B,uCAAuC,EACvC,oBAAoB,EACpB,qCAAqC,EACrC,uBAAuB,EACvB,gCAAgC,GACjC,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,+BAA+B,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@honua/sdk-js/interactions` — hit-test, pointer normalization, and the
|
|
3
|
+
* binding primitives that wire chart / map / table widgets to an
|
|
4
|
+
* `ExplorationContext`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { hitTestMap, bindMapSelectionToExploration } from "@honua/sdk-js/interactions";
|
|
9
|
+
*
|
|
10
|
+
* map.on("click", async (event) => {
|
|
11
|
+
* const hit = await hitTestMap(map, event);
|
|
12
|
+
* if (hit?.feature) ctx.dispatch({ type: "select", target: hit.feature });
|
|
13
|
+
* });
|
|
14
|
+
* bindMapSelectionToExploration({ map, context: ctx, sourceId: "parcels" });
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @packageDocumentation
|
|
18
|
+
*/
|
|
19
|
+
export { createQueryTileDetailLoader, hitTestMap, normalizeHitFeature, normalizeHitTestFeatures, normalizePointerEvent, } from "./hit-test.js";
|
|
20
|
+
export { extentToSpatialFilter, selectLinkedViewQueryProjection, subscribeExplorationSelector, } from "../exploration/selectors.js";
|
|
21
|
+
export { setFeatureState, getFeatureState, removeFeatureState, createHoverHandler, createSelectionHandler, } from "./feature-state.js";
|
|
22
|
+
export { bindDetailToSelection, bindChartToExploration, bindFilterControlsToExploration, bindMapExtentToExploration, bindMapSelectionToExploration, bindQueryProjectionToExploration, bindTableSelectionToExploration, syncMapLayerFilterToExploration, syncFeatureStateSelection, } from "./exploration-bindings.js";
|
|
23
|
+
export { preparePrimaryDetailModel, prepareSelectionDetailModels } from "./detail-model.js";
|
|
24
|
+
export { interactionQueryParamNames, parseInteractionQueryState, parseSelection, serializeInteractionQueryState, serializeSelection, } from "./share-state.js";
|