MobjectTable

Qualified name: manim.mobject.table.MobjectTable

class MobjectTable(table, element_to_mobject=<function MobjectTable.<lambda>>, **kwargs)[source]

Bases: manim.mobject.table.Table

A specialized Table mobject for use with with Mobject.

Examples

Example: MobjectTableExample

../_images/MobjectTableExample-1.png
from manim import *

class MobjectTableExample(Scene):
    def construct(self):
        cross = VGroup(
            Line(UP + LEFT, DOWN + RIGHT),
            Line(UP + RIGHT, DOWN + LEFT),
        )
        a = Circle().set_color(RED).scale(0.5)
        b = cross.set_color(BLUE).scale(0.5)
        t0 = MobjectTable(
            [[a.copy(),b.copy(),a.copy()],
            [b.copy(),a.copy(),a.copy()],
            [a.copy(),b.copy(),b.copy()]]
        )
        line = Line(
            t0.get_corner(DL), t0.get_corner(UR)
        ).set_color(RED)
        self.add(t0, line)

Special case of Table with element_to_mobject set to an identity function. Here, every item in table must already be of type Mobject.

Parameters
  • table (Iterable[Iterable[VMobject]]) – A 2D array or list of lists. Content of the table must be of type Mobject.

  • element_to_mobject (Callable[[VMobject], VMobject]) – The Mobject class applied to the table entries. Set as lambda m : m to return itself.

  • kwargs (Any) – Additional arguments to be passed to Table.

Methods

Attributes

animate

Used to animate the application of a method.

animation_overrides

depth

The depth of the mobject.

height

The height of the mobject.

width

The width of the mobject.