growing¶
- class janim.anims.growing.GrowFromPoint(item: Points, point: ndarray, root_only: bool = False, **kwargs)¶
Bases:
DataUpdater[Points]Grow and appear from the specified position
GrowFromPointExample ¶
from janim.imports import * class GrowFromPointExample(Timeline): def construct(self): group = Group( Square(fill_alpha=0.5), Circle(fill_alpha=0.5), Text('Text', font_size=48), color=BLUE ) group.points.arrange(buff=LARGE_BUFF) directions=[UP,LEFT,DOWN,RIGHT] for direction in directions: self.play( *[ GrowFromPoint(item, item.points.box.center + direction * 3) for item in group ] ) self.forward()
- class janim.anims.growing.GrowFromCenter(item: Points, **kwargs)¶
Bases:
GrowFromPointGrow and appear from the center of the item
GrowFromCenterExample ¶
from janim.imports import * class GrowFromCenterExample(Timeline): def construct(self): group = Group( Square(fill_alpha=0.5), Circle(fill_alpha=0.5), Text('Text', font_size=48), color=BLUE ) group.points.arrange(buff=LARGE_BUFF) self.play(*map(GrowFromCenter, group)) self.forward()
- class janim.anims.growing.GrowFromEdge(item: Points, edge: ndarray, **kwargs)¶
Bases:
GrowFromPointGrow and appear from the specified edge of the item
GrowFromEdgeExample ¶
from janim.imports import * class GrowFromEdgeExample(Timeline): def construct(self): group = Group( Square(fill_alpha=0.5), Circle(fill_alpha=0.5), Text('Text', font_size=48), color=BLUE ) group.points.arrange(buff=LARGE_BUFF) directions=[UP,LEFT,DOWN,RIGHT] for direction in directions: self.play( *[ GrowFromEdge(item, direction) for item in group ] ) self.forward()
- class janim.anims.growing.ShrinkToPoint(item: Points, point: ndarray, root_only: bool = False, hide_at_end: bool = True, become_at_end: bool = False, **kwargs)¶
Bases:
DataUpdater[Points]Shrink and disappear to the specified position
ShrinkToPointExample ¶
from janim.imports import * class ShrinkToPointExample(Timeline): def construct(self): group = Group( Square(fill_alpha=0.5), Circle(fill_alpha=0.5), Text('Text', font_size=48), color=BLUE ) group.points.arrange(buff=LARGE_BUFF) directions=[UP,LEFT,DOWN,RIGHT] for direction in directions: self.play( *[ ShrinkToPoint(item, item.points.box.center + direction * 3) for item in group ] ) self.forward()
- class janim.anims.growing.ShrinkToCenter(item: Points, **kwargs)¶
Bases:
ShrinkToPointShrink and disappear to the center of the item
ShrinkToCenterExample ¶
from janim.imports import * class ShrinkToCenterExample(Timeline): def construct(self): group = Group( Square(fill_alpha=0.5), Circle(fill_alpha=0.5), Text('Text', font_size=48), color=BLUE ) group.points.arrange(buff=LARGE_BUFF) self.play(*map(ShrinkToCenter, group)) self.forward()
- class janim.anims.growing.ShrinkToEdge(item: Points, edge: ndarray, **kwargs)¶
Bases:
ShrinkToPointShrink and disappear to the specified edge of the item
ShrinkToEdgeExample ¶
from janim.imports import * class ShrinkToEdgeExample(Timeline): def construct(self): group = Group( Square(fill_alpha=0.5), Circle(fill_alpha=0.5), Text('Text', font_size=48), color=BLUE ) group.points.arrange(buff=LARGE_BUFF) directions=[UP,LEFT,DOWN,RIGHT] for direction in directions: self.play( *[ ShrinkToEdge(item, direction) for item in group ] ) self.forward()
- class janim.anims.growing.SpinInFromNothing(item: Points, *, path_arc=1.5707963267948966, **kwargs)¶
Bases:
GrowFromCenterRotate half a turn from the center of the item and grow to appear
SpinInFromNothingExample ¶
from janim.imports import * class SpinInFromNothingExample(Timeline): def construct(self): group = Group( Square(fill_alpha=0.5), Circle(fill_alpha=0.5), Text('Text', font_size=48), color=BLUE ) group.points.arrange(buff=LARGE_BUFF) self.play( *map(SpinInFromNothing, group), duration=2 ) self.forward()
- class janim.anims.growing.SpinOutToNothing(item: ~janim.items.points.Points, *, path_arc=1.5707963267948966, rate_func=<function rush_into>, **kwargs)¶
Bases:
ShrinkToCenterRotate half a turn toward the center of the item and shrink to disappear
SpinOutToNothingExample ¶
from janim.imports import * class SpinOutToNothingExample(Timeline): def construct(self): group = Group( Square(fill_alpha=0.5), Circle(fill_alpha=0.5), Text('Text', font_size=48), color=BLUE ) group.points.arrange(buff=LARGE_BUFF) self.play( *map(SpinOutToNothing, group), duration=2 ) self.forward()
- class janim.anims.growing.GrowArrowByBoundFunc(arrow: Arrow, bound_func: Callable[[float], tuple[float, float]], **kwargs)¶
Bases:
GroupUpdaterBase class for
GrowArrowandGrowDoubleArrow
- class janim.anims.growing.GrowArrow(arrow: Arrow, **kwargs)¶
Bases:
GrowArrowByBoundFuncShow the appearance process of the arrow, drawing from start to end, and automatically adjust the arrowhead position
GrowArrowExample ¶
from janim.imports import * class GrowArrowExample(Timeline): def construct(self): group = Group( Arrow(ORIGIN, RIGHT * 6), Vector(RIGHT * 6, color=YELLOW) ) group.points.arrange(DOWN, buff=2) self.play( *map(GrowArrow, group), duration=2 ) self.forward()
- class janim.anims.growing.GrowDoubleArrow(arrow: Arrow, start_ratio: float = 0.5, **kwargs)¶
Bases:
GrowArrowByBoundFuncShow the appearance process of the arrow, by default appearing from the middle to both sides, and automatically adjust the arrowhead positions
Passing
start_ratio(default0.5) can adjust the starting position
GrowDoubleArrowExample ¶
from janim.imports import * class GrowDoubleArrowExample(Timeline): def construct(self): group = DoubleArrow(ORIGIN, RIGHT * 7) * 3 group.points.arrange(DOWN, buff=LARGE_BUFF) self.play( GrowDoubleArrow(group[0], start_ratio=0.2), GrowDoubleArrow(group[1]), GrowDoubleArrow(group[2], start_ratio=0.8), duration=2 ) self.forward()