A specialized React application built with TypeScript and Vite to debug and visualize complex pathfinding and segment generation logic for multi-level buildings.
This project provides a sandbox for testing the useActiveSegments hook, which is responsible for transforming a GeoJSON itinerary into a set of active segments (vertical and horizontal) across multiple zones and levels.
- Itinerary Visualization: Select from multiple predefined itineraries to see how they are processed.
- Segment Breakdown: Clear visualization of vertical (elevators, escalators) and horizontal (walking) segments.
- Dynamic Configuration: Utilizes building level configurations and zone graph access to determine path validity.
- Node.js (v18 or higher recommended)
- npm or yarn
-
Clone the repository:
git clone https://github.com/bkmed/pocItinerairy.git cd pocItinerairy -
Install dependencies:
npm install
Start the development server:
npm run devThe application will be available at http://localhost:5173.
src/utils.ts: Contains the core logic foruseActiveSegments.src/constants.ts: Defines building levels, zone access graphs, and test itineraries.src/App.tsx: The main debug viewer interface.
The useActiveSegments hook follows these principles:
- Vertical Segments:
- In a Descent, vertical segments are assigned to the arrival level.
- In an Ascent, vertical segments are assigned to the exit level.
- Horizontal Segments: Added at the "pivot level" where a zone change occurs.
- Graph Access: Zone changes are only permitted at levels defined in the
graphAccessconfiguration. - No Duplicates: Ensures the same segment isn't added multiple times.
Access the live version of the application here: