Skip to content

A little extension to ManimGL for presenting and animating database tables

Notifications You must be signed in to change notification settings

philippe2803/manim-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

manim-table

A simple library to create and animate tables in ManimGL.

Installation

You can install the library via pip:

pip install manim-table

Usage

Here is how you create a basic table.

from manimlib import Scene, Write
from manim_table import Table

class TableExample(Scene):
    def construct(self):
        data = [
            ["Name", "Age", "City"],
            ["Alice", "25", "New York"],
            ["Bob", "30", "Paris"],
        ]
        
        # Create the table
        table = Table(data)
        
        # Animate it
        self.play(Write(table))

Modifying the Table

You can add or remove rows and columns with animations.

# Add a new row
new_row, anims = table.add_row(["Charlie", "35", "London"])
self.play(AnimationGroup(*anims, lag_ratio=0.05))

# Delete a row (index starts at 1 for data rows)
deleted_row, anims = table.delete_row(1)
self.play(AnimationGroup(*anims, lag_ratio=0.05))

Styling

You can easily change colors and styles.

from manimlib import BLUE, RED

# Style the header
table.set_header_background_color(BLUE)

# Style specific cells (row, column)
# Row 0 is header, Row 1 is first data row
table.get_cell(1, 1).set_font_color(RED)

About

A little extension to ManimGL for presenting and animating database tables

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages