R-Tree Visualizer


Description

An R-Tree is a data structure useful in spatial access methods. This implementation of an R-Tree is focused on 2 things.
Firstly to provide a tool used to see what an R-Tree looks like in order to get a better understanding of the data structure. Secondly this implementation adds a fun twist where the shape of any leaf region as well as any combined region can be a circle or rectangle.

Reducing an R-Tree is the process of taking a list of regions (shapes) and repeatedly combining the closest 2 regions into one parent region until there is only 1 region left. That region is now the root of the R-Tree.


General Directions

This visualizer is used by
First: Choose between the Preset, Build Your Own, or Random GUI modes.
Second: Generate shapes in the Leaf Generation Options.
Third: Choose your Combination Shape Types.
Fourth: Hit the Reduce Shapes button.
Fifth (Optional): using step foreward/step back buttons to watch the reduction process that makes the tree.

Helpful Tips
1. The width and height of the shape canvas is 100 units when filled randomly but you can manually add a shape anywhere under the Build Your Own GUI.
2. WARNING the reduce algorithm takes exponential time with more shapes so if you have more then 1500 shapes expect to wait a long time.
3. In the Build Your Own and Random Gui the colors of Rectangles and Circles can be chosen separately.


Leaf Generation Options

GUI Mode
  • Preset
  • Build Your Own
  • Random
Random Leaf shapes are made circles or rectangles randomly
Random Leaf shapes are all rectangles
Random Leaf shapes are all circles
4 leaf circles picked manually. 2 circles are intersecting
Preset 4 with one circle swapped for a rectangle. No Intersecting
Add a large rectangle far away from preset 5
Rectangle
Min X
Min Y
Width
Height

Circle
Center X
Center Y
Radius

Color


Rectangles
Min Width
Max Width
Min Height
Max Height

rand
color
Circles
Min Diameter
Max Diameter

rand
color
Leaf Shape Types




How Many

Reduce Options

Combined Region Types
All Circles
All Rectangles
Random Mix