MArrayElement#
Qualified name: manim\_data\_structures.m\_array.MArrayElement
- class manim_data_structures.m_array.MArrayElement(mob_square_args: dict = {}, mob_value_args: dict = {}, mob_index_args: dict = {}, mob_label_args: dict = {}, index_pos: ndarray = array([0., 1., 0.]), index_gap: float = 0.25, label_pos: ndarray = array([-1., 0., 0.]), label_gap: float = 0.5, next_to_mob: Optional[MArrayElement] = None, next_to_dir: ndarray = array([1., 0., 0.]), **kwargs)#
Bases:
VGroup
A class that represents an array element.
Parameters#
- mob_square_args
dict
, default: {} Arguments for
manim.Square
that represents the element body.- mob_value_args
dict
, default: {} Arguments for
manim.Text
that represents the element value.- mob_index_args
dict
, default: {} Arguments for
manim.Text
that represents the element index.- index_pos
np.ndarray
, default: UP Specifies the position of
__mob_index
- index_gap
float
, default: 0.25 Specifies the distance between
__mob_square
and__mob_index
- label_pos
np.ndarray
, default: LEFT Specifies the position of
__mob_label
- label_gap
float
, default: 0.5 Specifies the distance between
__mob_square
and__mob_label
- next_to_mob
MArrayElement
, default: None Specifies placement for
__mob_square
- next_to_dir
np.ndarray
, default: RIGHT Specifies direction of placement for
__mob_square
Attributes#
- __mob_square_props
dict
Default arguments passed to
manim.Square
that represents the element body.- __mob_value_props
dict
Default arguments passed to
manim.Text
that represents the element value.- __mob_index_props
dict
Default arguments passed to
manim.Text
that represents the element index.- __mob_square
manim.Square
manim.Mobject
that represents the element body.- __mob_value
manim.Text
manim.Mobject
that represents the element index.- __mob_index
manim.Text
manim.Mobject
that represents the element value.- __index_pos
np.ndarray
Specifies the position of
__mob_index
- __index_gap
float
Specifies the distance between
__mob_square
and__mob_index
- __label_pos
np.ndarray
, default: LEFT Specifies the position of
__mob_label
- __label_gap
float
, default: 0.5 Specifies the distance between
__mob_square
and__mob_label
Methods
Invokes the
manim.Text.animate()
property ofmanim.Text
for the element index.Invokes the
manim.Text.animate()
property ofmanim.Text
for the element label.Invokes the
manim.Square.animate()
property ofmanim.Square
for the element body.Invokes the
manim.Text.animate()
property ofmanim.Text
for the element value.Fetches
manim.Mobject
based on enumm_enum.MArrayElementComp
.Fetches the
manim.Text
that represents the element index.Fetches the
manim.Text
that represents the element label.Fetches the
manim.Square
that represents the element body.Fetches the
manim.Text
that represents the element value.Re-intializes the
manim.Text
that represents the element index.Re-intializes the
manim.Text
that represents the element label.Re-intializes the
manim.Text
that represents the element value.Inherited Attributes
animate
Used to animate the application of any method of
self
.color
depth
The depth of the mobject.
fill_color
If there are multiple colors (for gradient) this returns the first one
height
The height of the mobject.
n_points_per_curve
sheen_factor
stroke_color
width
The width of the mobject.
- animate_mob_index() _AnimationBuilder #
Invokes the
manim.Text.animate()
property ofmanim.Text
for the element index.Returns#
_AnimationBuilder
Value returned by
manim.Text.animate()
property ofmanim.Text
.
- animate_mob_label() _AnimationBuilder #
Invokes the
manim.Text.animate()
property ofmanim.Text
for the element label.Returns#
_AnimationBuilder
Value returned by
manim.Text.animate()
property ofmanim.Text
.
- animate_mob_square() _AnimationBuilder #
Invokes the
manim.Square.animate()
property ofmanim.Square
for the element body.Returns#
_AnimationBuilder
Value returned by
manim.Square.animate()
property ofmanim.Square
.
- animate_mob_value() _AnimationBuilder #
Invokes the
manim.Text.animate()
property ofmanim.Text
for the element value.Returns#
_AnimationBuilder
Value returned by
manim.Text.animate()
property ofmanim.Text
.
- fetch_mob(mob_target: MArrayElementComp) Mobject #
Fetches
manim.Mobject
based on enumm_enum.MArrayElementComp
.Parameters#
- mob_target
m_enum.MArrayElementComp
Specifies the component of
MArrayElement
to fetch.
Returns#
manim.Mobject
Represents the component of
MArrayElement
.
- mob_target
- fetch_mob_index() Text #
Fetches the
manim.Text
that represents the element index.Returns#
manim.Text
Represents the element index.
- fetch_mob_label() Text #
Fetches the
manim.Text
that represents the element label.Returns#
manim.Text
Represents the element label.
- fetch_mob_square() Square #
Fetches the
manim.Square
that represents the element body.Returns#
manim.Square
Represents the element body.
- fetch_mob_value() Text #
Fetches the
manim.Text
that represents the element value.Returns#
manim.Text
Represents the element value.
- update_mob_index(mob_index_args: dict = {}) Text #
Re-intializes the
manim.Text
that represents the element index.Parameters#
- mob_index_args
dict
, default: {} Arguments for
manim.Text
that represents the element index.
Returns#
manim.Text
Represents the updated element index.
- mob_index_args
- mob_square_args