MArrayElement#
Qualified name: manim\_data\_structures.m\_array.MArrayElement
- class MArrayElement(scene, mob_square_args={}, mob_value_args={}, mob_index_args={}, mob_label_args={}, index_pos=array([0., 1., 0.]), index_gap=0.25, label_pos=array([-1., 0., 0.]), label_gap=0.5, next_to_mob=None, next_to_dir=array([1., 0., 0.]), **kwargs)[source]#
Bases:
VGroup
A class that represents an array element.
- Parameters:
scene (
Scene
) – Specifies the scene where the object is to be rendered.mob_square_args (
dict
, default:{}
) – Arguments forSquare
that represents the element body.mob_value_args (
dict
, default:{}
) – Arguments forText
that represents the element value.mob_index_args (
dict
, default:{}
) – Arguments forText
that represents the element index.mob_label_args (
dict
, default:{}
) – Arguments forText
that represents the element label.index_pos (
ndarray
, default:array([0., 1., 0.])
) – Specifies the position of__mob_index
w.r.t__mob_square
index_gap (
float
, default:0.25
) – Specifies the distance between__mob_index
and__mob_square
.label_pos (
ndarray
, default:array([-1., 0., 0.])
) – Specifies the position of__mob_label
w.r.t__mob_square
.label_gap (
float
, default:0.5
) – Specifies the distance between__mob_label
and__mob_square
.next_to_mob (
Optional
[MArrayElement
], default:None
) – Specifies the placement for__mob_square
w.r.t anotherMArrayElement
.next_to_dir (
ndarray
, default:array([1., 0., 0.])
) – Specifies the direction of placement for__mob_square
w.r.t anotherMArrayElement
.
- __index_pos#
The position of
__mob_index
w.r.t__mob_square
- Type:
np.ndarray
- __index_gap#
The distance between
__mob_index
and__mob_square
.- Type:
- __label_pos#
The position of
__mob_label
w.r.t__mob_square
.- Type:
np.ndarray
- __label_gap#
The distance between
__mob_label
and__mob_square
.- Type:
Methods
Invokes the animate property over index mobject.
Invokes the animate property over label mobject.
Invokes the animate property over square mobject.
Invokes the animate property over value mobject.
Fetches the mobject based on the specified enum.
Fetches the index mobject.
Fetches the label mobject.
Fetches the square mobject.
Fetches the value mobject.
Re-intializes the index mobject.
Re-intializes the label mobject.
Re-intializes the value mobject.
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()[source]#
Invokes the animate property over index mobject.
- Returns:
Animate property of
__mob_index
.- Return type:
_AnimationBuilder
- animate_mob_label()[source]#
Invokes the animate property over label mobject.
- Returns:
Animate property of
__mob_label
.- Return type:
_AnimationBuilder
- animate_mob_square()[source]#
Invokes the animate property over square mobject.
- Returns:
Animate property of
__mob_square
.- Return type:
_AnimationBuilder
- animate_mob_value()[source]#
Invokes the animate property over value mobject.
- Returns:
Animate property of
__mob_value
.- Return type:
_AnimationBuilder
- fetch_mob(mob_target)[source]#
Fetches the mobject based on the specified enum.
- Parameters:
mob_target (
MArrayElementComp
) – Specifies theMobject
to fetch.- Returns:
Mobject of the class.
- Return type:
- update_mob_index(mob_index_args={}, update_anim=<class 'manim.animation.creation.Write'>, update_anim_args={}, play_anim=True, play_anim_args={})[source]#
Re-intializes the index mobject.
- Parameters:
mob_index_args (
dict
, default:{}
) – Arguments forText
that represents the element index.update_anim (
Animation
, default:<class 'manim.animation.creation.Write'>
) – Animation to be applied to the updated__mob_index
.update_anim_args (
dict
, default:{}
) – Arguments for updateAnimation
.play_anim (
bool
, default:True
) – If True, plays the animation(s).play_anim_args (
dict
, default:{}
) – Arguments forScene.play()
.
- Returns:
Updated
__mob_index
.- Return type:
- update_mob_label(mob_label_args={}, update_anim=<class 'manim.animation.creation.Write'>, update_anim_args={}, play_anim=True, play_anim_args={})[source]#
Re-intializes the label mobject.
- Parameters:
mob_label_args (
dict
, default:{}
) – Arguments forText
that represents the element label.update_anim (
Animation
, default:<class 'manim.animation.creation.Write'>
) – Animation to be applied to the updated__mob_label
.update_anim_args (
dict
, default:{}
) – Arguments for updateAnimation
.play_anim (
bool
, default:True
) – If True, plays the animation(s).play_anim_args (
dict
, default:{}
) – Arguments forScene.play()
.
- Returns:
Updated
__mob_label
.- Return type:
- update_mob_value(mob_value_args={}, update_anim=<class 'manim.animation.creation.Write'>, update_anim_args={}, play_anim=True, play_anim_args={})[source]#
Re-intializes the value mobject.
- Parameters:
mob_value_args (
dict
, default:{}
) – Arguments forText
that represents the element value.update_anim (
Animation
, default:<class 'manim.animation.creation.Write'>
) – Animation to be applied to the updated__mob_value
.update_anim_args (
dict
, default:{}
) – Arguments for updateAnimation
.play_anim (
bool
, default:True
) – If True, plays the animation(s).play_anim_args (
dict
, default:{}
) – Arguments forScene.play()
.
- Returns:
Updated
__mob_value
.- Return type: