Customized create-type function for tables. Parameters ---------- lag_ratio The lag ratio of the animation. line_animation The animation style of the table lines, see :mod:`~.creation` for examples. label_animation The anim
(
self,
lag_ratio: float = 1,
line_animation: Callable[[VMobject | VGroup], Animation] = Create,
label_animation: Callable[[VMobject | VGroup], Animation] = Write,
element_animation: Callable[[VMobject | VGroup], Animation] = Create,
entry_animation: Callable[[VMobject | VGroup], Animation] = FadeIn,
**kwargs,
)
| 890 | return self |
| 891 | |
| 892 | def create( |
| 893 | self, |
| 894 | lag_ratio: float = 1, |
| 895 | line_animation: Callable[[VMobject | VGroup], Animation] = Create, |
| 896 | label_animation: Callable[[VMobject | VGroup], Animation] = Write, |
| 897 | element_animation: Callable[[VMobject | VGroup], Animation] = Create, |
| 898 | entry_animation: Callable[[VMobject | VGroup], Animation] = FadeIn, |
| 899 | **kwargs, |
| 900 | ) -> AnimationGroup: |
| 901 | """Customized create-type function for tables. |
| 902 | |
| 903 | Parameters |
| 904 | ---------- |
| 905 | lag_ratio |
| 906 | The lag ratio of the animation. |
| 907 | line_animation |
| 908 | The animation style of the table lines, see :mod:`~.creation` for examples. |
| 909 | label_animation |
| 910 | The animation style of the table labels, see :mod:`~.creation` for examples. |
| 911 | element_animation |
| 912 | The animation style of the table elements, see :mod:`~.creation` for examples. |
| 913 | entry_animation |
| 914 | The entry animation of the table background, see :mod:`~.creation` for examples. |
| 915 | kwargs |
| 916 | Further arguments passed to the creation animations. |
| 917 | |
| 918 | Returns |
| 919 | ------- |
| 920 | :class:`~.AnimationGroup` |
| 921 | AnimationGroup containing creation of the lines and of the elements. |
| 922 | |
| 923 | Examples |
| 924 | -------- |
| 925 | |
| 926 | .. manim:: CreateTableExample |
| 927 | |
| 928 | class CreateTableExample(Scene): |
| 929 | def construct(self): |
| 930 | table = Table( |
| 931 | [["First", "Second"], |
| 932 | ["Third","Fourth"]], |
| 933 | row_labels=[Text("R1"), Text("R2")], |
| 934 | col_labels=[Text("C1"), Text("C2")], |
| 935 | include_outer_lines=True) |
| 936 | self.play(table.create()) |
| 937 | self.wait() |
| 938 | """ |
| 939 | animations: Sequence[Animation] = [ |
| 940 | line_animation( |
| 941 | VGroup(self.vertical_lines, self.horizontal_lines), |
| 942 | **kwargs, |
| 943 | ), |
| 944 | element_animation(self.elements_without_labels.set_z_index(2), **kwargs), |
| 945 | ] |
| 946 | |
| 947 | if self.get_labels(): |
| 948 | animations += [ |
| 949 | label_animation(self.get_labels(), **kwargs), |