Skip to content

nathanialwm/PathingVisualizer

Repository files navigation

Pathfinding Algorithm Visualizer

This is a 24-hour hackathon entry. A web project that creates a 2D drawable grid and uses the option of 4 different pathfinding algorithms to animate how the algorithm "thinks"

Table of Contents

Tech Stack

  • React: Web Framework
  • Node: JS Environment
  • Vite: Build Tool
  • Typescript: Type safe scripting language, logic and UI is built with this
  • Tailwind.css: CSS with utility classes

Preview

Drawn Grid Preview After Animation Preview

The drawing and animation of the grid is all based on this interface which is created in each grid cell

export interface GridNode {
    row: number;
    col: number;
    isStart: boolean;
    isEnd: boolean;
    isWall: boolean;
    distance: number;     // How far from start (actual distance traveled)
    heuristic: number;    // Estimated distance to end (for A* algorithm)
    totalDistance: number; // distance + heuristic
    previousNode: GridNode | null;  // Which node did we come from? (for backtracking)
    isVisited: boolean;   // Has this node been visited?
    isPath: boolean;      // Is this node part of the final path?
    terrain: 'normal' | 'water' | 'mountain' | 'wall';  // What type of terrain?
    weight: number;       // How "costly" to move through this cell
} 

Installation

Clone Repository

cd desired directory
git clone https://github.com/nathanialwm/PathingVisualizer.git

Install dependencies

npm install

Usage

npm run dev

This will provide a webpage through localhost

License

Unlicensed

Contact

Nathanial Martin @ Linkedin

About

A hackathon entry for visualizing pathfinding algorithms using React and Typescript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published