(self)
| 111 | |
| 112 | class UpdatersExample(Scene): |
| 113 | def construct(self): |
| 114 | decimal = DecimalNumber( |
| 115 | 0, |
| 116 | show_ellipsis=True, |
| 117 | num_decimal_places=3, |
| 118 | include_sign=True, |
| 119 | ) |
| 120 | square = Square().to_edge(UP) |
| 121 | |
| 122 | decimal.add_updater(lambda d: d.next_to(square, RIGHT)) |
| 123 | decimal.add_updater(lambda d: d.set_value(square.get_center()[1])) |
| 124 | self.add(square, decimal) |
| 125 | self.play( |
| 126 | square.animate.to_edge(DOWN), |
| 127 | rate_func=there_and_back, |
| 128 | run_time=5, |
| 129 | ) |
| 130 | self.wait() |
| 131 | |
| 132 | |
| 133 | class SpiralInExample(Scene): |
nothing calls this directly
no test coverage detected