4
4
5
5
6
6
from ..constants import *
7
- from ..mobject .svg .tex_mobject import MathTex , SingleStringMathTex , Tex
8
- from ..mobject .svg .text_mobject import Text
9
- from ..mobject .types .vectorized_mobject import VDict , VMobject
7
+ from ..mobject .svg .tex_mobject import MathTex , SingleStringMathTex
8
+ from ..mobject .types .vectorized_mobject import VMobject
10
9
from ..mobject .value_tracker import ValueTracker
11
10
12
11
@@ -158,8 +157,8 @@ class Variable(VMobject):
158
157
----------
159
158
var : Union[:class:`int`, :class:`float`]
160
159
The python variable you need to keep track of and display.
161
- label : Union[:class:`str`, :class:`~.Tex`, :class:`~.MathTex`, :class:`Text`]
162
- The label for your variable, for example `x = ...`. To use math mode, for e.g.
160
+ label : Union[:class:`str`, :class:`~.Tex`, :class:`~.MathTex`, :class:`Text`, :class:`TexSymbol`, :class:`SingleStringMathTex`, :class:`MathTexFromPresetString` ]
161
+ The label for your variable, for example `` x = ...` `. To use math mode, for e.g.
163
162
subscripts, superscripts, etc. simply pass in a raw string.
164
163
var_type : Union[:class:`DecimalNumber`, :class:`Integer`], optional
165
164
The class used for displaying the number. Defaults to :class:`DecimalNumber`.
@@ -171,8 +170,8 @@ class Variable(VMobject):
171
170
172
171
Attributes
173
172
----------
174
- label : Union[:class:`str`, :class:`~.Tex`, :class:`~.MathTex`, :class:`Text`]
175
- The label for your variable, for example `x = ...`.
173
+ label : Union[:class:`str`, :class:`~.Tex`, :class:`~.MathTex`, :class:`Text`, :class:`TexSymbol`, :class:`SingleStringMathTex`, :class:`MathTexFromPresetString` ]
174
+ The label for your variable, for example `` x = ...` `.
176
175
tracker : :class:`~.ValueTracker`
177
176
Useful in updating the value of your variable on-screen.
178
177
value : Union[:class:`DecimalNumber`, :class:`Integer`]
@@ -181,6 +180,7 @@ class Variable(VMobject):
181
180
Examples
182
181
--------
183
182
Normal usage::
183
+
184
184
# DecimalNumber type
185
185
var = 0.5
186
186
on_screen_var = Variable(var, "var", num_decimal_places=3)
0 commit comments