data

class janim.utils.data.ContextSetter(ctx: ContextVar[T], val: T)

Bases: Generic

class janim.utils.data.Array(*, dtype=<class 'numpy.float32'>)

Bases: object

Ensures that the id is different after modifying (assigning) with .data = xxx.

And the numpy array obtained through .data is always read-only.

len() int
property data: ndarray
copy() Array
is_share(other: Array) bool
class janim.utils.data.AlignedData(data1: T, data2: T, union: T)

Bases: Generic

Structure after data alignment, used for align_for_interpolate()

data1: T
data2: T
union: T
class janim.utils.data.Margins(buff: float | tuple[float], /)
class janim.utils.data.Margins(left: float, top: float, right: float, bottom: float, /)

Bases: object

Defines a set of four margins: left, top, right, bottom, used to describe the size of the border around a rectangle.

If a single value is passed directly, it represents the value for all four directions.

property left: float
property top: float
property right: float
property bottom: float
class janim.utils.data.Align(*values)

Bases: IntFlag

Center = 0
Left = 1
Right = 4
Top = 8
Bottom = 16