This project implements a simple B-Tree and a Raylib-based visualizer with interactive controls.
Web Version (Desktop): https://aakrishtsp.github.io/B-tree-visualizer/btree-raylib.html
Note: This project was designed for desktop use and later ported to web. Mobile devices and keyboard-less interactions are not supported. For the best experience, use a desktop browser with a keyboard, or download the native application from the releases page.
- A : Add a single random key (incrementing seed)
- M : Add multiple random keys — press M, type a count, then Enter to insert that many
- I : Insert a specific key — press I, type the number, then Enter
- D : Delete the last-inserted key
- H : Delete the hovered key (hover over a key then press H)
- X : Clear all keys (reset tree)
- Z : Fit view to show the whole tree
- R : Reset the example scene (starts with 8 random keys)
- ESC: Cancel typing input
- Mouse drag (left button) : Pan the view
- Mouse wheel or +/- : Zoom in/out
Typing behavior
- When you press M or I the app enters typing mode; type digits (and an optional leading -), then press Enter to commit or Esc to cancel.
UI notes
- Hover a key with the mouse to highlight it; the hover value is shown in the legend.
- A legend is shown at the bottom-right with available controls and indicators.
Video Demo:
V13.mp4
Run a single-line configure+build (recommended):
cmake -S . -B build && cmake --build build -- -j4This will download Raylib via CMake's FetchContent and build the executable into build/bin.
Open a "x64 Native Tools Command Prompt" (or use CMake GUI). Then:
cmake -S . -B build -G "Visual Studio 17 2022" -A x64
cmake --build build --config ReleaseBuild for web browsers using WebAssembly:
./build-web.shOr manually with Emscripten:
emcmake cmake -S . -B build-web -DCMAKE_BUILD_TYPE=Release -DPLATFORM=Web
cmake --build build-web -j4Then serve locally:
cd build-web/bin && python3 -m http.server 8000See web/README.md for detailed instructions.
- CMake (>= 3.24) installed and available on PATH. Install from https://cmake.org if needed.
- A C/C++ toolchain: GCC/Clang on Linux/macOS or Visual Studio on Windows.
- The build uses FetchContent to download raylib automatically. If you are offline, pre-populate
build/_depsor install raylib system-wide.

