📄️ Architecture Overview
Space Stager is a React 18 + Vite app using MapLibre GL for map rendering.
📄️ Map Integration & React Wiring
This page describes how MapLibre GL JS is initialized and managed inside React, and how we handle style reloads and event lifecycles.
📄️ Draw Tools & Modes Lifecycle
useDrawTools(map, focusedArea) owns MapboxDraw setup, custom modes, and event lifecycles.
📄️ Map Events Audit
Space Stager: Map Event Listeners, Hover/Popup, and Marker Overlay Audit
📄️ Dependency Graph
The following diagram shows the current module dependency graph.
📄️ Permit Areas Flow & Selection
usePermitAreas(map, mapLoaded, options) manages loading, search/filter, focus/subfocus, hover tooltips, and click/double-click selection across Parks, Plazas, and Intersections modes.
📄️ Test Coverage
This project uses Vitest with V8 coverage. A human-readable coverage report is published after local runs and in CI.
📄️ Export Pipeline (PNG/PDF)
The export system produces PNG or PDF site plans with optional citywide inset, legend, and blueprint styling.
📄️ Contexts & State Architecture
Top-level providers wire feature modules and share state across the app:
📄️ Nudge Rules & Engine
Nudges surface contextual guidance based on placed objects, custom shapes, and visible infrastructure.
📄️ Infrastructure Service & Layer Styling
infrastructureService.js loads and normalizes layer data by current bounds, with per-layer fetching logic and field normalization. Styling is computed by getLayerStyle() using icon metadata and enhanced rendering flags.
📄️ Sprite Resolver & Enhanced Rendering
Enhanced rendering uses angle-variant sprites and a resolver that provides stable URLs, preloading, and contrasting backgrounds.
📄️ Data Sources (NYC Open Data & Others)
Primary sources are NYC Open Data (Socrata), NY State Open Data, ArcGIS FeatureServer, and local static files.
📄️ Contributing
- Dev setup: Node 24+, pnpm 9+, pnpm install
📄️ Architecture Decisions (ADRs)
- Map events centralized via useMapEvents to avoid scattered handlers; reattach on style.load.