Skip to content

B-Ricey763/splay-tree-visualizer

Repository files navigation

Features

Visualize splay trees!

The interactive component was built using Typescript and React, with Shadcn/ui for the beautiful components, Tanstack Router for routing (of which there is only a home page), and framer-motion for the smooth animations.

The site is hosted via Github pages for free, easy access on the web. The splay tree code uses an alternate implementation than the original paper, using a left and right node pointer instead of a child-sibling pointer approach. During every operation, the current tree state is pushed to an animation stack that saves that "frame" of the tree's state, so it can be animated once the operation completes.

Getting Started

To run this application:

pnpm install
pnpm start  

Building For Production

To build this application for production:

pnpm build

Styling

This project uses Tailwind CSS for styling.

Shadcn

Add components using the latest version of Shadcn.

pnpx shadcn@latest add button

Routing

This project uses TanStack Router. The initial setup is a file based router. Which means that the routes are managed as files in src/routes.

Adding A Route

To add a new route to your application just add another a new file in the ./src/routes directory.

TanStack will automatically generate the content of the route file for you.

Now that you have two routes you can use a Link component to navigate between them.

Adding Links

To use SPA (Single Page Application) navigation you will need to import the Link component from @tanstack/react-router.

import { Link } from "@tanstack/react-router";

Then anywhere in your JSX you can use it like so:

<Link to="/about">About</Link>

This will create a link that will navigate to the /about route.

More information on the Link component can be found in the Link documentation.

About

Splay Tree data structure visualization using React, Shadcn/ui, and framer-motion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors