MVariable#

Qualified name: manim\_data\_structures.m\_variable.MVariable

class manim_data_structures.m_variable.MVariable(value='', index='', label='', mob_value_args: dict = {'text': 10}, mob_index_args: dict = {'text': 0}, mob_label_args: dict = {'text': 'Var'}, **kwargs)#

Bases: MArrayElement

A class that represents a variable.

Parameters#

value

Specifies the value of the variable.

index

Specifies the index of the variable.

label

Specifies the label of the variable.

mob_square_argsdict, default: {}

Arguments for manim.Square that represents the element body.

mob_value_argsdict, default: {}

Arguments for manim.Text that represents the element value.

mob_index_argsdict, default: {}

Arguments for manim.Text that represents the element index.

Attributes#

__value

Specifies the value of the variable.

__index

Specifies the index of the variable.

__label

Specifies the label of the variable.

Methods

fetch_index

Fetches __index.

fetch_label

Fetches __label.

fetch_value

Fetches __value.

update_index

Updates __index and the manim.Text that represents the element index.

update_label

Updates __label and the manim.Text that represents the element label.

update_value

Updates __value and 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.

fetch_index()#

Fetches __index.

Returns#

Any

Index of MVariable.

fetch_label()#

Fetches __label.

Returns#

Any

Label of MVariable.

fetch_value()#

Fetches __value.

Returns#

Any

Value of MVariable.

update_index(index, mob_index_args: dict = {}) Text#

Updates __index and the manim.Text that represents the element index.

Parameters#

mob_index_argsdict, default: {}

Arguments for manim.Text that represents the element index.

Returns#

manim.Text

Represents the updated element index.

update_label(label, mob_label_args: dict = {}) Text#

Updates __label and the manim.Text that represents the element label.

Parameters#

mob_label_argsdict, default: {}

Arguments for manim.Text that represents the element label.

Returns#

manim.Text

Represents the updated element label.

update_value(value, mob_value_args: dict = {}) Text#

Updates __value and the manim.Text that represents the element value.

Parameters#

mob_value_argsdict, default: {}

Arguments for manim.Text that represents the element value.

Returns#

manim.Text

Represents the updated element value.