This repository is a collection of data structure, algorithm, and system design animations created with the Manim Python library.
The primary goal is to not only visualize these concepts but also to build a reusable open-source toolkit (manim_utils.py) that makes creating complex DSA animations in Manim simpler and more robust.
- Deep Learning: To deeply understand Manim's core concepts by building a production-ready animation toolkit from scratch.
- Open Source: To create a high-quality
manim_utils.pylibrary that others can use to create their own DSA animations (e.g.,LinkedList,Grid,Base_DSA_Scene). - Video Playlist: To produce a full YouTube playlist of animations, starting with data structure fundamentals (Linked Lists) and moving to more complex algorithms (Pathfinding, Sorting).
The core of this project is the manim_utils.py library, which provides a set of powerful, "smart" Mobjects and Scenes:
Base_DSA_Scene: A custom base class for all animations. It automatically sets up a dynamic three-zone layout:anim_zone: A dedicated area for the animation.listing: A code window for displaying and highlighting source code.log_zone: An output/status panel for showing status text or algorithm output.
LinkedListNode&LinkedList: "Smart" Mobjects that can build and animate themselves. Instead of manually moving nodes, you can simply call methods likemy_list.create_pointer()ormy_list.transfer_pointer()and get animations in return.- Helpers: Robust helper methods like
highlight_line()(which won't go out of bounds) andupdate_log_text()(with a clean cross-fade).
-
Base_DSA_Scenewith dynamic 3-zone layout is complete. -
highlight_line()utility is functional and bounds-checked. -
update_log_text()utility is functional with text-wrapping and cross-fade.
- Linked Lists
-
LinkedListNodeMobject. -
LinkedList"factory" Mobject. - Video 1: "Intro to Linked Lists" - Complete. (Animates
NodeandLinkedListclasses with code swapping).
-
- Title Cards
-
create_scrambled_title()utility (TransformMatchingStrings).
-
- Pathfinding (In Progress)
-
GridNodeandGridMobjects. -
AStarTitleCardprototype.
-
This project uses the Python library manim (community edition).
-
Install dependencies:
pip install manim
-
Render a scene: To render one of the videos, use the
manimcommand from your terminal.- For a high-quality (1080p) render:
manim -pqh scenes.py IntroToLinkedListScene
- For a quick low-quality preview:
manim -pql scenes.py TestFXScene
- For a high-quality (1080p) render: