mikh3x4 / CS166-Ropes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rope Vizualization

This is a small GUI vizalization of how the datastructures behind a rope backed text editor would work. The balancing scheme is taken from the original paper that introduced ropes (Ropes: an Alternative to Strings). Currently the max leaf size is set to 5 characters for demonstration purposes, but it can be easily chagned in the code.

This project was done for Stanford's CS166 datastructures class.

Features

  • Fibonacci based balancing scheme
  • Edit the text anywhere and see the rope datastrcuture live update
  • You can use both arrow keys and the mouse to move around and the appropriate part of the rope tree will be highlighted in red
  • Cut, copy and paste are supported and will update the rope correctly (although cut will just reinitalize the tree)

Demo

Demo 1

Demo 2

Demo 3

Demo 4

Installation

Dependancies can be installed using: pip install matplotlib networkx

Note that tkinter is also required and although its supposed to be bundled with python, recently there are some issues with it on Mac OS.

Running is simply python ropes.py

About


Languages

Language:Python 100.0%