display

class janim.anims_core.display.DisplayType(*args, **kwargs)

Bases: StackableAnimation

The base class used for type checking and isinstance checks

class janim.anims_core.display.Display(data: Item, **kwargs)

Bases: DisplayType

Used to mark the data of an item in a specific time-range

As the result of display(), it indicates that “the item has been changed to this data starting from a specific time”

See also: detect_changes_of_all()

apply(params: ApplyParams) None

Initializes item data for params

Resets self.data to the data of self.data_orig and sets it to params.data to prevent the original data from being accidentally modified

Special case:

When the animation stack of AnimStack contains only one animation, which is this type of animation, this method is skipped and data_orig is accessed directly, providing a small optimization

class janim.anims_core.display.DelayedDisplay(item: Item, func: Callable[[DelayedDisplayParams], Item], **kwargs)

Bases: DisplayType

Basically the same as Display, but it only calls the func function to set the data state after the global timeline time reaches .t_range.at

Parameters:
  • item – The item to which the state is applied

  • func – The callback function invoked after the global time reaches .t_range.at. It must return an Item as the item state

apply(params: ApplyParams) None

For details, see the descriptions of StackableAnimation and ApplyParams

class janim.anims_core.display.DelayedDisplayParams(is_latest_display: 'bool')

Bases: object

is_latest_display: bool
class janim.anims_core.display.DoBecomeAtEnd(item: Item, end: float, **kwargs)

Bases: DelayedDisplay

A wrapper around DelayedDisplay that implements the become_at_end parameter for each animation

That is, it is registered for the end~FOREVER interval and uses the animation state calculated before the end time as the display state; it also automatically calls restore() when is_latest_display=True