From 5a007d99f1740add9aa1a54fbe36070c9a44aee8 Mon Sep 17 00:00:00 2001 From: Andres Date: Sat, 10 Jun 2023 23:19:28 -0400 Subject: [PATCH 01/25] feat: added two new classes LabeledLine and LabeledArrow --- manim/mobject/geometry/line.py | 138 +++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/manim/mobject/geometry/line.py b/manim/mobject/geometry/line.py index 695881ae9b..ba67b85407 100644 --- a/manim/mobject/geometry/line.py +++ b/manim/mobject/geometry/line.py @@ -366,6 +366,99 @@ def __init__( self.scale(self.length / self.get_length()) +class LabeledLine(Line): + """Constructs a line containing a label box somewhere along its length. + + Parameters + ---------- + label : str | Tex | MathTex | Text + Label that will be displayed on the line. + label_position : float | optional + A ratio in the range [0-1] to indicate the position of the label with respect to the length of the line. Default value is 0.5. + font_size : int | float | optional + Control font size for the label. This parameter is only used when `label` is of type `str`. + label_color: numpy.ndarray | optional + The color of the label's text. This parameter is only used when `label` is of type `str`. + label_frame : Bool | optional + Add a `SurroundingRectangle` frame to the label box. + frame_fill_color : numpy.ndarray | optional + Background color to fill the label box. If no value is provided, the background color of the canvas will be used. + frame_fill_opacity : float | optional + Determine the opacity of the label box by passing a value in the range [0-1], where 0 indicates complete transparency and 1 means full opacity. + + .. seealso:: + :class:`LabeledArrow` + + Examples + -------- + .. manim:: LabeledLineExample + :save_last_frame: + + class LabeledLineExample(Scene): + def construct(self): + line = LabeledLine( + label = '0.5', + label_position = 0.8, + font_size = 20, + label_color = WHITE, + label_frame = True, + + start=LEFT+DOWN, + end=RIGHT+UP) + + + line.set_length(line.get_length() * 2) + self.add(line) + """ + + def __init__( + self, + label, + label_position: float = 0.5, + font_size=15, + label_color=WHITE, + label_frame=True, + frame_fill_color=None, + frame_fill_opacity=1, + *args, + **kwargs, + ) -> None: + if isinstance(label, str): + from manim import MathTex + + rendered_label = MathTex(label, color=label_color, font_size=font_size) + else: + rendered_label = label + + super().__init__(*args, **kwargs) + + # calculating the vector for the label position + line_start, line_end = self.get_start_and_end() + new_vec = (line_end - line_start) * label_position + label_coords = line_start + new_vec + + # rendered_label.move_to(self.get_vector() * label_position) + rendered_label.move_to(label_coords) + + box = BackgroundRectangle( + rendered_label, + buff=0.05, + color=frame_fill_color, + fill_opacity=frame_fill_opacity, + stroke_width=0.5, + ) + self.add(box) + + if label_frame: + box_frame = SurroundingRectangle( + rendered_label, buff=0.05, color=label_color, stroke_width=0.5 + ) + + self.add(box_frame) + + self.add(rendered_label) + + class Elbow(VMobject, metaclass=ConvertToOpenGL): """Two lines that create a right angle about each other: L-shape. @@ -760,6 +853,51 @@ def __init__(self, *args: Any, **kwargs): self.add_tip(at_start=True, tip_shape=tip_shape_start) +class LabeledArrow(LabeledLine, Arrow): + """Constructs an arrow containing a label box somewhere along its length. + This class inherits its label properties from `LabeledLine`, so the main parameters controlling it are the same. + + Parameters + ---------- + label : str | Tex | MathTex | Text + Label that will be displayed on the line. + label_position : float | optional + A ratio in the range [0-1] to indicate the position of the label with respect to the length of the line. Default value is 0.5. + font_size : int | float | optional + Control font size for the label. This parameter is only used when `label` is of type `str`. + label_color: numpy.ndarray | optional + The color of the label's text. This parameter is only used when `label` is of type `str`. + label_frame : Bool | optional + Add a `SurroundingRectangle` frame to the label box. + frame_fill_color : numpy.ndarray | optional + Background color to fill the label box. If no value is provided, the background color of the canvas will be used. + frame_fill_opacity : float | optional + Determine the opacity of the label box by passing a value in the range [0-1], where 0 indicates complete transparency and 1 means full opacity. + + + .. seealso:: + :class:`LabeledLine` + + Examples + -------- + .. manim:: LabeledArrowExample + :save_last_frame: + + class LabeledArrowExample(Scene): + def construct(self): + l_arrow = LabeledArrow("0.5", start=LEFT*3, end=RIGHT*3 + UP*2, label_position=0.5) + + self.add(l_arrow) + """ + + def __init__( + self, + *args, + **kwargs, + ) -> None: + super().__init__(*args, **kwargs) + + class Angle(VMobject, metaclass=ConvertToOpenGL): """A circular arc or elbow-type mobject representing an angle of two lines. From 0e0ca6635ef0568cf6ba30ab9f826bdfbf070df3 Mon Sep 17 00:00:00 2001 From: Andres Date: Sat, 10 Jun 2023 23:30:13 -0400 Subject: [PATCH 02/25] test: added tests for new LabeledLine and LabeledArrow for the geometry module testing suite --- tests/test_graphical_units/test_geometry.py | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test_graphical_units/test_geometry.py b/tests/test_graphical_units/test_geometry.py index 6f6ab72e13..75f6b42ea3 100644 --- a/tests/test_graphical_units/test_geometry.py +++ b/tests/test_graphical_units/test_geometry.py @@ -247,3 +247,25 @@ def test_CurvedArrowCustomTip(scene): tip_shape_end=ArrowSquareFilledTip, ) scene.add(arrow, double_arrow) + + +@frames_comparison +def test_LabeledLine(scene): + line = LabeledLine( + label="0.5", + label_position=0.8, + font_size=20, + label_color=WHITE, + label_frame=True, + start=LEFT + DOWN, + end=RIGHT + UP, + ) + scene.add(line) + + +@frames_comparison +def test_LabeledArrow(scene): + l_arrow = LabeledArrow( + "0.5", start=LEFT * 3, end=RIGHT * 3 + UP * 2, label_position=0.5 + ) + scene.add(l_arrow) From 0993475b7ef76fbd47d74b0791375daa6553acc5 Mon Sep 17 00:00:00 2001 From: Andres Date: Fri, 16 Jun 2023 12:24:55 -0400 Subject: [PATCH 03/25] feat: added new class names to '__all__' module attribute --- manim/mobject/geometry/line.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manim/mobject/geometry/line.py b/manim/mobject/geometry/line.py index ba67b85407..d6e8d86783 100644 --- a/manim/mobject/geometry/line.py +++ b/manim/mobject/geometry/line.py @@ -6,10 +6,12 @@ "Line", "DashedLine", "TangentLine", + "LabeledLine", "Elbow", "Arrow", "Vector", "DoubleArrow", + "LabeledArrow", "Angle", "RightAngle", ] From de8ecb327126f54837e4a6f48a701a42bd0bb46b Mon Sep 17 00:00:00 2001 From: Andres Date: Tue, 20 Jun 2023 13:56:07 -0400 Subject: [PATCH 04/25] fix: added missing import line for new classes --- manim/mobject/geometry/line.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manim/mobject/geometry/line.py b/manim/mobject/geometry/line.py index d6e8d86783..9526555816 100644 --- a/manim/mobject/geometry/line.py +++ b/manim/mobject/geometry/line.py @@ -24,6 +24,10 @@ from manim import config from manim.constants import * from manim.mobject.geometry.arc import Arc, ArcBetweenPoints, Dot, TipableVMobject +from manim.mobject.geometry.shape_matchers import ( + BackgroundRectangle, + SurroundingRectangle, +) from manim.mobject.geometry.tips import ArrowTriangleFilledTip from manim.mobject.mobject import Mobject from manim.mobject.opengl.opengl_compatibility import ConvertToOpenGL From e6bd732231c4c23fa0c943e35778712e3941514e Mon Sep 17 00:00:00 2001 From: Andres Date: Tue, 20 Jun 2023 14:26:59 -0400 Subject: [PATCH 05/25] fix: removed import lines causing cyclic import error --- manim/mobject/geometry/line.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/manim/mobject/geometry/line.py b/manim/mobject/geometry/line.py index 9526555816..d6e8d86783 100644 --- a/manim/mobject/geometry/line.py +++ b/manim/mobject/geometry/line.py @@ -24,10 +24,6 @@ from manim import config from manim.constants import * from manim.mobject.geometry.arc import Arc, ArcBetweenPoints, Dot, TipableVMobject -from manim.mobject.geometry.shape_matchers import ( - BackgroundRectangle, - SurroundingRectangle, -) from manim.mobject.geometry.tips import ArrowTriangleFilledTip from manim.mobject.mobject import Mobject from manim.mobject.opengl.opengl_compatibility import ConvertToOpenGL From 5f92410616bc4948761a5b2338ab987144a3d1f8 Mon Sep 17 00:00:00 2001 From: Andres Date: Sat, 24 Jun 2023 22:47:27 -0400 Subject: [PATCH 06/25] new file containing two new classes --- manim/mobject/geometry/labeled_shapes.py | 152 +++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 manim/mobject/geometry/labeled_shapes.py diff --git a/manim/mobject/geometry/labeled_shapes.py b/manim/mobject/geometry/labeled_shapes.py new file mode 100644 index 0000000000..94208df102 --- /dev/null +++ b/manim/mobject/geometry/labeled_shapes.py @@ -0,0 +1,152 @@ +r"""Mobjects that are lines or variations of them.""" + +from __future__ import annotations + +__all__ = ["LabeledLine", "LabeledArrow"] + +from manim.constants import * +from manim.mobject.geometry.line import Arrow, Line +from manim.mobject.geometry.shape_matchers import ( + BackgroundRectangle, + SurroundingRectangle, +) +from manim.utils.color import * +from manim.utils.color import Colors + + +class LabeledLine(Line): + """Constructs a line containing a label box somewhere along its length. + + Parameters + ---------- + label : str | Tex | MathTex | Text + Label that will be displayed on the line. + label_position : float | optional + A ratio in the range [0-1] to indicate the position of the label with respect to the length of the line. Default value is 0.5. + font_size : int | float | optional + Control font size for the label. This parameter is only used when `label` is of type `str`. + label_color: numpy.ndarray | optional + The color of the label's text. This parameter is only used when `label` is of type `str`. + label_frame : Bool | optional + Add a `SurroundingRectangle` frame to the label box. + frame_fill_color : numpy.ndarray | optional + Background color to fill the label box. If no value is provided, the background color of the canvas will be used. + frame_fill_opacity : float | optional + Determine the opacity of the label box by passing a value in the range [0-1], where 0 indicates complete transparency and 1 means full opacity. + + .. seealso:: + :class:`LabeledArrow` + + Examples + -------- + .. manim:: LabeledLineExample + :save_last_frame: + + class LabeledLineExample(Scene): + def construct(self): + line = LabeledLine( + label = '0.5', + label_position = 0.8, + font_size = 20, + label_color = WHITE, + label_frame = True, + + start=LEFT+DOWN, + end=RIGHT+UP) + + + line.set_length(line.get_length() * 2) + self.add(line) + """ + + def __init__( + self, + label, + label_position: float = 0.5, + font_size=15, + label_color=WHITE, + label_frame=True, + frame_fill_color=None, + frame_fill_opacity=1, + *args, + **kwargs, + ) -> None: + if isinstance(label, str): + from manim import MathTex + + rendered_label = MathTex(label, color=label_color, font_size=font_size) + else: + rendered_label = label + + super().__init__(*args, **kwargs) + + # calculating the vector for the label position + line_start, line_end = self.get_start_and_end() + new_vec = (line_end - line_start) * label_position + label_coords = line_start + new_vec + + # rendered_label.move_to(self.get_vector() * label_position) + rendered_label.move_to(label_coords) + + box = BackgroundRectangle( + rendered_label, + buff=0.05, + color=frame_fill_color, + fill_opacity=frame_fill_opacity, + stroke_width=0.5, + ) + self.add(box) + + if label_frame: + box_frame = SurroundingRectangle( + rendered_label, buff=0.05, color=label_color, stroke_width=0.5 + ) + + self.add(box_frame) + + self.add(rendered_label) + + +class LabeledArrow(LabeledLine, Arrow): + """Constructs an arrow containing a label box somewhere along its length. + This class inherits its label properties from `LabeledLine`, so the main parameters controlling it are the same. + + Parameters + ---------- + label : str | Tex | MathTex | Text + Label that will be displayed on the line. + label_position : float | optional + A ratio in the range [0-1] to indicate the position of the label with respect to the length of the line. Default value is 0.5. + font_size : int | float | optional + Control font size for the label. This parameter is only used when `label` is of type `str`. + label_color: numpy.ndarray | optional + The color of the label's text. This parameter is only used when `label` is of type `str`. + label_frame : Bool | optional + Add a `SurroundingRectangle` frame to the label box. + frame_fill_color : numpy.ndarray | optional + Background color to fill the label box. If no value is provided, the background color of the canvas will be used. + frame_fill_opacity : float | optional + Determine the opacity of the label box by passing a value in the range [0-1], where 0 indicates complete transparency and 1 means full opacity. + + + .. seealso:: + :class:`LabeledLine` + + Examples + -------- + .. manim:: LabeledArrowExample + :save_last_frame: + + class LabeledArrowExample(Scene): + def construct(self): + l_arrow = LabeledArrow("0.5", start=LEFT*3, end=RIGHT*3 + UP*2, label_position=0.5) + + self.add(l_arrow) + """ + + def __init__( + self, + *args, + **kwargs, + ) -> None: + super().__init__(*args, **kwargs) From fbeead5ef549cf33185ff2f73d04982dedbb9505 Mon Sep 17 00:00:00 2001 From: Andres Date: Sat, 24 Jun 2023 22:52:22 -0400 Subject: [PATCH 07/25] modified files to correctly load new classes when manim is imported --- manim/__init__.py | 1 + manim/mobject/geometry/__init__.py | 1 + manim/mobject/geometry/labeled_shapes.py | 2 +- manim/mobject/geometry/line.py | 2 -- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manim/__init__.py b/manim/__init__.py index a697122752..3af8ea6b7e 100644 --- a/manim/__init__.py +++ b/manim/__init__.py @@ -46,6 +46,7 @@ from .mobject.frame import * from .mobject.geometry.arc import * from .mobject.geometry.boolean_ops import * +from .mobject.geometry.labeled_shapes import * from .mobject.geometry.line import * from .mobject.geometry.polygram import * from .mobject.geometry.shape_matchers import * diff --git a/manim/mobject/geometry/__init__.py b/manim/mobject/geometry/__init__.py index abae9c0da0..393526daef 100644 --- a/manim/mobject/geometry/__init__.py +++ b/manim/mobject/geometry/__init__.py @@ -8,6 +8,7 @@ ~arc ~boolean_ops + ~labeled_shapes ~line ~polygram ~shape_matchers diff --git a/manim/mobject/geometry/labeled_shapes.py b/manim/mobject/geometry/labeled_shapes.py index 94208df102..f8433bc100 100644 --- a/manim/mobject/geometry/labeled_shapes.py +++ b/manim/mobject/geometry/labeled_shapes.py @@ -1,4 +1,4 @@ -r"""Mobjects that are lines or variations of them.""" +r"""Mobjects that inherit from lines and contain a label along the length.""" from __future__ import annotations diff --git a/manim/mobject/geometry/line.py b/manim/mobject/geometry/line.py index d6e8d86783..ba67b85407 100644 --- a/manim/mobject/geometry/line.py +++ b/manim/mobject/geometry/line.py @@ -6,12 +6,10 @@ "Line", "DashedLine", "TangentLine", - "LabeledLine", "Elbow", "Arrow", "Vector", "DoubleArrow", - "LabeledArrow", "Angle", "RightAngle", ] From 994f95a91f85137a01d691f0a11710cb8314c28e Mon Sep 17 00:00:00 2001 From: Andres Date: Mon, 26 Jun 2023 20:06:34 -0400 Subject: [PATCH 08/25] commented out new classes in line.py --- manim/mobject/geometry/line.py | 268 ++++++++++++++++----------------- 1 file changed, 134 insertions(+), 134 deletions(-) diff --git a/manim/mobject/geometry/line.py b/manim/mobject/geometry/line.py index ba67b85407..a084766365 100644 --- a/manim/mobject/geometry/line.py +++ b/manim/mobject/geometry/line.py @@ -366,97 +366,97 @@ def __init__( self.scale(self.length / self.get_length()) -class LabeledLine(Line): - """Constructs a line containing a label box somewhere along its length. - - Parameters - ---------- - label : str | Tex | MathTex | Text - Label that will be displayed on the line. - label_position : float | optional - A ratio in the range [0-1] to indicate the position of the label with respect to the length of the line. Default value is 0.5. - font_size : int | float | optional - Control font size for the label. This parameter is only used when `label` is of type `str`. - label_color: numpy.ndarray | optional - The color of the label's text. This parameter is only used when `label` is of type `str`. - label_frame : Bool | optional - Add a `SurroundingRectangle` frame to the label box. - frame_fill_color : numpy.ndarray | optional - Background color to fill the label box. If no value is provided, the background color of the canvas will be used. - frame_fill_opacity : float | optional - Determine the opacity of the label box by passing a value in the range [0-1], where 0 indicates complete transparency and 1 means full opacity. - - .. seealso:: - :class:`LabeledArrow` - - Examples - -------- - .. manim:: LabeledLineExample - :save_last_frame: - - class LabeledLineExample(Scene): - def construct(self): - line = LabeledLine( - label = '0.5', - label_position = 0.8, - font_size = 20, - label_color = WHITE, - label_frame = True, - - start=LEFT+DOWN, - end=RIGHT+UP) - - - line.set_length(line.get_length() * 2) - self.add(line) - """ - - def __init__( - self, - label, - label_position: float = 0.5, - font_size=15, - label_color=WHITE, - label_frame=True, - frame_fill_color=None, - frame_fill_opacity=1, - *args, - **kwargs, - ) -> None: - if isinstance(label, str): - from manim import MathTex - - rendered_label = MathTex(label, color=label_color, font_size=font_size) - else: - rendered_label = label - - super().__init__(*args, **kwargs) - - # calculating the vector for the label position - line_start, line_end = self.get_start_and_end() - new_vec = (line_end - line_start) * label_position - label_coords = line_start + new_vec - - # rendered_label.move_to(self.get_vector() * label_position) - rendered_label.move_to(label_coords) - - box = BackgroundRectangle( - rendered_label, - buff=0.05, - color=frame_fill_color, - fill_opacity=frame_fill_opacity, - stroke_width=0.5, - ) - self.add(box) - - if label_frame: - box_frame = SurroundingRectangle( - rendered_label, buff=0.05, color=label_color, stroke_width=0.5 - ) - - self.add(box_frame) - - self.add(rendered_label) +# class LabeledLine(Line): +# """Constructs a line containing a label box somewhere along its length. + +# Parameters +# ---------- +# label : str | Tex | MathTex | Text +# Label that will be displayed on the line. +# label_position : float | optional +# A ratio in the range [0-1] to indicate the position of the label with respect to the length of the line. Default value is 0.5. +# font_size : int | float | optional +# Control font size for the label. This parameter is only used when `label` is of type `str`. +# label_color: numpy.ndarray | optional +# The color of the label's text. This parameter is only used when `label` is of type `str`. +# label_frame : Bool | optional +# Add a `SurroundingRectangle` frame to the label box. +# frame_fill_color : numpy.ndarray | optional +# Background color to fill the label box. If no value is provided, the background color of the canvas will be used. +# frame_fill_opacity : float | optional +# Determine the opacity of the label box by passing a value in the range [0-1], where 0 indicates complete transparency and 1 means full opacity. + +# .. seealso:: +# :class:`LabeledArrow` + +# Examples +# -------- +# .. manim:: LabeledLineExample +# :save_last_frame: + +# class LabeledLineExample(Scene): +# def construct(self): +# line = LabeledLine( +# label = '0.5', +# label_position = 0.8, +# font_size = 20, +# label_color = WHITE, +# label_frame = True, + +# start=LEFT+DOWN, +# end=RIGHT+UP) + + +# line.set_length(line.get_length() * 2) +# self.add(line) +# """ + +# def __init__( +# self, +# label, +# label_position: float = 0.5, +# font_size=15, +# label_color=WHITE, +# label_frame=True, +# frame_fill_color=None, +# frame_fill_opacity=1, +# *args, +# **kwargs, +# ) -> None: +# if isinstance(label, str): +# from manim import MathTex + +# rendered_label = MathTex(label, color=label_color, font_size=font_size) +# else: +# rendered_label = label + +# super().__init__(*args, **kwargs) + +# # calculating the vector for the label position +# line_start, line_end = self.get_start_and_end() +# new_vec = (line_end - line_start) * label_position +# label_coords = line_start + new_vec + +# # rendered_label.move_to(self.get_vector() * label_position) +# rendered_label.move_to(label_coords) + +# box = BackgroundRectangle( +# rendered_label, +# buff=0.05, +# color=frame_fill_color, +# fill_opacity=frame_fill_opacity, +# stroke_width=0.5, +# ) +# self.add(box) + +# if label_frame: +# box_frame = SurroundingRectangle( +# rendered_label, buff=0.05, color=label_color, stroke_width=0.5 +# ) + +# self.add(box_frame) + +# self.add(rendered_label) class Elbow(VMobject, metaclass=ConvertToOpenGL): @@ -853,49 +853,49 @@ def __init__(self, *args: Any, **kwargs): self.add_tip(at_start=True, tip_shape=tip_shape_start) -class LabeledArrow(LabeledLine, Arrow): - """Constructs an arrow containing a label box somewhere along its length. - This class inherits its label properties from `LabeledLine`, so the main parameters controlling it are the same. - - Parameters - ---------- - label : str | Tex | MathTex | Text - Label that will be displayed on the line. - label_position : float | optional - A ratio in the range [0-1] to indicate the position of the label with respect to the length of the line. Default value is 0.5. - font_size : int | float | optional - Control font size for the label. This parameter is only used when `label` is of type `str`. - label_color: numpy.ndarray | optional - The color of the label's text. This parameter is only used when `label` is of type `str`. - label_frame : Bool | optional - Add a `SurroundingRectangle` frame to the label box. - frame_fill_color : numpy.ndarray | optional - Background color to fill the label box. If no value is provided, the background color of the canvas will be used. - frame_fill_opacity : float | optional - Determine the opacity of the label box by passing a value in the range [0-1], where 0 indicates complete transparency and 1 means full opacity. - - - .. seealso:: - :class:`LabeledLine` - - Examples - -------- - .. manim:: LabeledArrowExample - :save_last_frame: - - class LabeledArrowExample(Scene): - def construct(self): - l_arrow = LabeledArrow("0.5", start=LEFT*3, end=RIGHT*3 + UP*2, label_position=0.5) - - self.add(l_arrow) - """ - - def __init__( - self, - *args, - **kwargs, - ) -> None: - super().__init__(*args, **kwargs) +# class LabeledArrow(LabeledLine, Arrow): +# """Constructs an arrow containing a label box somewhere along its length. +# This class inherits its label properties from `LabeledLine`, so the main parameters controlling it are the same. + +# Parameters +# ---------- +# label : str | Tex | MathTex | Text +# Label that will be displayed on the line. +# label_position : float | optional +# A ratio in the range [0-1] to indicate the position of the label with respect to the length of the line. Default value is 0.5. +# font_size : int | float | optional +# Control font size for the label. This parameter is only used when `label` is of type `str`. +# label_color: numpy.ndarray | optional +# The color of the label's text. This parameter is only used when `label` is of type `str`. +# label_frame : Bool | optional +# Add a `SurroundingRectangle` frame to the label box. +# frame_fill_color : numpy.ndarray | optional +# Background color to fill the label box. If no value is provided, the background color of the canvas will be used. +# frame_fill_opacity : float | optional +# Determine the opacity of the label box by passing a value in the range [0-1], where 0 indicates complete transparency and 1 means full opacity. + + +# .. seealso:: +# :class:`LabeledLine` + +# Examples +# -------- +# .. manim:: LabeledArrowExample +# :save_last_frame: + +# class LabeledArrowExample(Scene): +# def construct(self): +# l_arrow = LabeledArrow("0.5", start=LEFT*3, end=RIGHT*3 + UP*2, label_position=0.5) + +# self.add(l_arrow) +# """ + +# def __init__( +# self, +# *args, +# **kwargs, +# ) -> None: +# super().__init__(*args, **kwargs) class Angle(VMobject, metaclass=ConvertToOpenGL): From 0553b6c767b6f9ed21ba92d70b66d1bc64d38fa3 Mon Sep 17 00:00:00 2001 From: Andres Date: Mon, 26 Jun 2023 20:38:22 -0400 Subject: [PATCH 09/25] created control frames for LabeledLine and LabeledArrow --- .../control_data/geometry/LabeledArrow.npz | Bin 0 -> 2884 bytes .../control_data/geometry/LabeledLine.npz | Bin 0 -> 2669 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/test_graphical_units/control_data/geometry/LabeledArrow.npz create mode 100644 tests/test_graphical_units/control_data/geometry/LabeledLine.npz diff --git a/tests/test_graphical_units/control_data/geometry/LabeledArrow.npz b/tests/test_graphical_units/control_data/geometry/LabeledArrow.npz new file mode 100644 index 0000000000000000000000000000000000000000..43baefcbc5e09386f61e3ae344937d6f5f47c08d GIT binary patch literal 2884 zcmWIWW@Zs#U|`??Vnv1tqE1^jaWOD7uu3xUF^Djv6(#1T#-}8fB*&^vO2Ob`g7gVac!0IZ(#JGK`jFy_x-VT8(gKaLV8G^h*n?pE!J93$p ziSkzo@;iN0c=cbQ!l+tMWKYFsosI?dP3*!ouX8+SsLXnn9ae7so5v=_$k->X`1gkQ zd*0jc=lOHze|Gk1m(w914}Dm=@Z+O?*`xda-HCtmN@JSa@&6L`|9?Mt@uT(On;-tq z-Sv3uZR%cb|D1eSzW#q+eYpGgh4QglH@#>Sg-bHwXfg3^V_?3@9If+mFxXMZZesie7rC8sT|0`8DUpntO7=H zHqgZjGIigr>XkNMmb7ukwe|7)pWJd<81Qpv<>zNxGA}Rt`S|<$``3X!b+~-0{OYx} z(U-4W3Aweewt839*Q}`Rd3T$#-{0Fid!9|@q;)YnCq+d^Kkt9O+Y1yPXVvb9Ha9n~ zT)%$(CVNA}jVX3ri{1O{KFLLfgF(He^D~;?Qyu7^p^1HjcFQ1)l zF22Wo>1v=gTeDQNzdqZoHTmrPedX`(sTMP)ndRJ=0L+QgZ{4~jCUZR$m}jCkO`3M< zd}rO`W4)pOePclpuq(s+>2sI$Zo)6MfZi8eyKL#F?aZ*~^zN!DWJX>hsf2i?pVCtqjn( z@@FS7uwEUVrW<`}clrAoePHNr;Nq9Fxc~~b)djDvXeR#wvPQvZ2#kgR-Vj*f{huko pn~_O`8CdRMZSx|uHvlso16m6>z?+o~B+3YcHbD9luy$c!002d)o)Q26 literal 0 HcmV?d00001 diff --git a/tests/test_graphical_units/control_data/geometry/LabeledLine.npz b/tests/test_graphical_units/control_data/geometry/LabeledLine.npz new file mode 100644 index 0000000000000000000000000000000000000000..b431dde19b4b915df5eb27a98e189f5d79088cc5 GIT binary patch literal 2669 zcmWIWW@Zs#U|`??Vnqh&%4DD0oD2*Ntdb0T3?d9^MTxno@hOQViF$bjm5dAmU>TrN z29PQcczf3|J0x7@*uyKW9;~9J%QFO0q&R{O9=Ku9t>GpT&1K{v7G<)mEO53(S=X|+ z_m&2fJZ2Y&*%cJCQ;3tXSN=f1f=Wv5E7=zUZzNu8o2J$1*%X{teSUuKQ~or+f4|oK zeEVHEp68F*hw8VFu3SAC_ICEcTk>z4w>~_0tN-%a_~_^LKNEMA7OtwYtNZtSb@2N6 z@qb_bIdkRp*KqcBcK)mT<>c1%%T(2xo7nt#{-8Q8o{xtI{TmCeektlZht+q?FsH6u`w_$)3428HD- zfl7)fWj36T+#9EVHqH22*49&Z?!-h!L}+~e{CVl!yz;blU!OBEF#L${n`^aIFAd17 zSydv+z;K}b^^p`RT#I=66*!HG6ET zzPyO9_M2l7=r`Z)Zftn9nwnY_%(RT-eX>taPFBBL`gQMt*VosVzbk)tC-U37ySI1F zpE>j89LXQ&@9(YnxQK_B_bWJz-UGu(JA7TqyxjZy_5z)DNt)KT;)&IS=HhS*w zRr~c~c3gP5=Ja&^>DkxUt+f(nU|2B!Yu18SJ^Rc5#y{|#ZB|-WA3AsIzj#o*d|CZ} zaU&>dK3HB11*Qu5WpV4Lhpi5M_UzfILx-GZ&Y!RUwrsb_?6VQ3#cS=wfl+we$jT~8 zOkCW%R99br`o@hLP3zTxLH*S!7?{AGm;jA(@Ec_gpKv(PK6CEew Date: Mon, 26 Jun 2023 20:48:45 -0400 Subject: [PATCH 10/25] removed commented out classes --- manim/mobject/geometry/line.py | 138 --------------------------------- 1 file changed, 138 deletions(-) diff --git a/manim/mobject/geometry/line.py b/manim/mobject/geometry/line.py index a084766365..695881ae9b 100644 --- a/manim/mobject/geometry/line.py +++ b/manim/mobject/geometry/line.py @@ -366,99 +366,6 @@ def __init__( self.scale(self.length / self.get_length()) -# class LabeledLine(Line): -# """Constructs a line containing a label box somewhere along its length. - -# Parameters -# ---------- -# label : str | Tex | MathTex | Text -# Label that will be displayed on the line. -# label_position : float | optional -# A ratio in the range [0-1] to indicate the position of the label with respect to the length of the line. Default value is 0.5. -# font_size : int | float | optional -# Control font size for the label. This parameter is only used when `label` is of type `str`. -# label_color: numpy.ndarray | optional -# The color of the label's text. This parameter is only used when `label` is of type `str`. -# label_frame : Bool | optional -# Add a `SurroundingRectangle` frame to the label box. -# frame_fill_color : numpy.ndarray | optional -# Background color to fill the label box. If no value is provided, the background color of the canvas will be used. -# frame_fill_opacity : float | optional -# Determine the opacity of the label box by passing a value in the range [0-1], where 0 indicates complete transparency and 1 means full opacity. - -# .. seealso:: -# :class:`LabeledArrow` - -# Examples -# -------- -# .. manim:: LabeledLineExample -# :save_last_frame: - -# class LabeledLineExample(Scene): -# def construct(self): -# line = LabeledLine( -# label = '0.5', -# label_position = 0.8, -# font_size = 20, -# label_color = WHITE, -# label_frame = True, - -# start=LEFT+DOWN, -# end=RIGHT+UP) - - -# line.set_length(line.get_length() * 2) -# self.add(line) -# """ - -# def __init__( -# self, -# label, -# label_position: float = 0.5, -# font_size=15, -# label_color=WHITE, -# label_frame=True, -# frame_fill_color=None, -# frame_fill_opacity=1, -# *args, -# **kwargs, -# ) -> None: -# if isinstance(label, str): -# from manim import MathTex - -# rendered_label = MathTex(label, color=label_color, font_size=font_size) -# else: -# rendered_label = label - -# super().__init__(*args, **kwargs) - -# # calculating the vector for the label position -# line_start, line_end = self.get_start_and_end() -# new_vec = (line_end - line_start) * label_position -# label_coords = line_start + new_vec - -# # rendered_label.move_to(self.get_vector() * label_position) -# rendered_label.move_to(label_coords) - -# box = BackgroundRectangle( -# rendered_label, -# buff=0.05, -# color=frame_fill_color, -# fill_opacity=frame_fill_opacity, -# stroke_width=0.5, -# ) -# self.add(box) - -# if label_frame: -# box_frame = SurroundingRectangle( -# rendered_label, buff=0.05, color=label_color, stroke_width=0.5 -# ) - -# self.add(box_frame) - -# self.add(rendered_label) - - class Elbow(VMobject, metaclass=ConvertToOpenGL): """Two lines that create a right angle about each other: L-shape. @@ -853,51 +760,6 @@ def __init__(self, *args: Any, **kwargs): self.add_tip(at_start=True, tip_shape=tip_shape_start) -# class LabeledArrow(LabeledLine, Arrow): -# """Constructs an arrow containing a label box somewhere along its length. -# This class inherits its label properties from `LabeledLine`, so the main parameters controlling it are the same. - -# Parameters -# ---------- -# label : str | Tex | MathTex | Text -# Label that will be displayed on the line. -# label_position : float | optional -# A ratio in the range [0-1] to indicate the position of the label with respect to the length of the line. Default value is 0.5. -# font_size : int | float | optional -# Control font size for the label. This parameter is only used when `label` is of type `str`. -# label_color: numpy.ndarray | optional -# The color of the label's text. This parameter is only used when `label` is of type `str`. -# label_frame : Bool | optional -# Add a `SurroundingRectangle` frame to the label box. -# frame_fill_color : numpy.ndarray | optional -# Background color to fill the label box. If no value is provided, the background color of the canvas will be used. -# frame_fill_opacity : float | optional -# Determine the opacity of the label box by passing a value in the range [0-1], where 0 indicates complete transparency and 1 means full opacity. - - -# .. seealso:: -# :class:`LabeledLine` - -# Examples -# -------- -# .. manim:: LabeledArrowExample -# :save_last_frame: - -# class LabeledArrowExample(Scene): -# def construct(self): -# l_arrow = LabeledArrow("0.5", start=LEFT*3, end=RIGHT*3 + UP*2, label_position=0.5) - -# self.add(l_arrow) -# """ - -# def __init__( -# self, -# *args, -# **kwargs, -# ) -> None: -# super().__init__(*args, **kwargs) - - class Angle(VMobject, metaclass=ConvertToOpenGL): """A circular arc or elbow-type mobject representing an angle of two lines. From 442debcff4ee42e40459a53f7e963683a9190960 Mon Sep 17 00:00:00 2001 From: Andres Date: Fri, 7 Jul 2023 21:43:57 -0400 Subject: [PATCH 11/25] removed unused import of 'Colors' --- manim/mobject/geometry/labeled_shapes.py | 1 - 1 file changed, 1 deletion(-) diff --git a/manim/mobject/geometry/labeled_shapes.py b/manim/mobject/geometry/labeled_shapes.py index f8433bc100..38340e4154 100644 --- a/manim/mobject/geometry/labeled_shapes.py +++ b/manim/mobject/geometry/labeled_shapes.py @@ -11,7 +11,6 @@ SurroundingRectangle, ) from manim.utils.color import * -from manim.utils.color import Colors class LabeledLine(Line): From 2806d4ae110ec3a62ddebd31667f22ebe7c52931 Mon Sep 17 00:00:00 2001 From: Andres Berejnoi Date: Thu, 27 Jul 2023 14:56:11 -0400 Subject: [PATCH 12/25] Update manim/mobject/geometry/labeled_shapes.py Co-authored-by: Jason Villanueva --- manim/mobject/geometry/labeled_shapes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manim/mobject/geometry/labeled_shapes.py b/manim/mobject/geometry/labeled_shapes.py index 38340e4154..4d66e5ebdb 100644 --- a/manim/mobject/geometry/labeled_shapes.py +++ b/manim/mobject/geometry/labeled_shapes.py @@ -22,7 +22,7 @@ class LabeledLine(Line): Label that will be displayed on the line. label_position : float | optional A ratio in the range [0-1] to indicate the position of the label with respect to the length of the line. Default value is 0.5. - font_size : int | float | optional + font_size : float | optional Control font size for the label. This parameter is only used when `label` is of type `str`. label_color: numpy.ndarray | optional The color of the label's text. This parameter is only used when `label` is of type `str`. From 54ed3f723a1c34b440c02be9981942a206505097 Mon Sep 17 00:00:00 2001 From: Andres Berejnoi Date: Thu, 27 Jul 2023 14:56:20 -0400 Subject: [PATCH 13/25] Update manim/mobject/geometry/labeled_shapes.py Co-authored-by: Jason Villanueva --- manim/mobject/geometry/labeled_shapes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manim/mobject/geometry/labeled_shapes.py b/manim/mobject/geometry/labeled_shapes.py index 4d66e5ebdb..4cbba0d0df 100644 --- a/manim/mobject/geometry/labeled_shapes.py +++ b/manim/mobject/geometry/labeled_shapes.py @@ -116,7 +116,7 @@ class LabeledArrow(LabeledLine, Arrow): Label that will be displayed on the line. label_position : float | optional A ratio in the range [0-1] to indicate the position of the label with respect to the length of the line. Default value is 0.5. - font_size : int | float | optional + font_size : float | optional Control font size for the label. This parameter is only used when `label` is of type `str`. label_color: numpy.ndarray | optional The color of the label's text. This parameter is only used when `label` is of type `str`. From d7ec30a65ceaeb17c45bcb3a5cb6c1ae09d2c28f Mon Sep 17 00:00:00 2001 From: Andres Berejnoi Date: Thu, 27 Jul 2023 14:57:03 -0400 Subject: [PATCH 14/25] Update manim/mobject/geometry/labeled_shapes.py Co-authored-by: Jason Villanueva --- manim/mobject/geometry/labeled_shapes.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manim/mobject/geometry/labeled_shapes.py b/manim/mobject/geometry/labeled_shapes.py index 4cbba0d0df..404382e96d 100644 --- a/manim/mobject/geometry/labeled_shapes.py +++ b/manim/mobject/geometry/labeled_shapes.py @@ -60,13 +60,13 @@ def construct(self): def __init__( self, - label, + label: str | Tex | MathTex | Text, label_position: float = 0.5, - font_size=15, - label_color=WHITE, - label_frame=True, - frame_fill_color=None, - frame_fill_opacity=1, + font_size: float = 15, + label_color: Color | str | None = WHITE, + label_frame: bool = True, + frame_fill_color: Color | str | None = None, + frame_fill_opacity: float = 1, *args, **kwargs, ) -> None: From 7acdf0fa17405699447901ed38e58939aba218ff Mon Sep 17 00:00:00 2001 From: Andres Berejnoi Date: Thu, 27 Jul 2023 14:57:45 -0400 Subject: [PATCH 15/25] Update manim/mobject/geometry/labeled_shapes.py Co-authored-by: Jason Villanueva --- manim/mobject/geometry/labeled_shapes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manim/mobject/geometry/labeled_shapes.py b/manim/mobject/geometry/labeled_shapes.py index 404382e96d..0339eb1ab5 100644 --- a/manim/mobject/geometry/labeled_shapes.py +++ b/manim/mobject/geometry/labeled_shapes.py @@ -11,7 +11,9 @@ SurroundingRectangle, ) from manim.utils.color import * - +from manim.mobject.text.tex_mobject import Tex, MathTex +from manim.mobject.text.text_mobject import Text +from manim.utils.color import Color class LabeledLine(Line): """Constructs a line containing a label box somewhere along its length. From 1feaa9e27ae8b90cf9e39c15e103999b31f67860 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 27 Jul 2023 18:58:41 +0000 Subject: [PATCH 16/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- manim/mobject/geometry/labeled_shapes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manim/mobject/geometry/labeled_shapes.py b/manim/mobject/geometry/labeled_shapes.py index 0339eb1ab5..495f2598be 100644 --- a/manim/mobject/geometry/labeled_shapes.py +++ b/manim/mobject/geometry/labeled_shapes.py @@ -10,11 +10,12 @@ BackgroundRectangle, SurroundingRectangle, ) -from manim.utils.color import * -from manim.mobject.text.tex_mobject import Tex, MathTex +from manim.mobject.text.tex_mobject import MathTex, Tex from manim.mobject.text.text_mobject import Text +from manim.utils.color import * from manim.utils.color import Color + class LabeledLine(Line): """Constructs a line containing a label box somewhere along its length. From 14effa2379b3b2ffec5f77d108824bfa242b1f12 Mon Sep 17 00:00:00 2001 From: Andres Berejnoi Date: Thu, 27 Jul 2023 15:01:27 -0400 Subject: [PATCH 17/25] Update __init__.py will change name of labeled_shapes.py to labeled.py --- manim/mobject/geometry/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manim/mobject/geometry/__init__.py b/manim/mobject/geometry/__init__.py index 393526daef..cf3283bc69 100644 --- a/manim/mobject/geometry/__init__.py +++ b/manim/mobject/geometry/__init__.py @@ -8,7 +8,7 @@ ~arc ~boolean_ops - ~labeled_shapes + ~labeled ~line ~polygram ~shape_matchers From cd8356385584bcd932bfd435db01690ef4d5e391 Mon Sep 17 00:00:00 2001 From: Andres Berejnoi Date: Thu, 27 Jul 2023 15:02:02 -0400 Subject: [PATCH 18/25] Rename labeled_shapes.py to labeled.py --- manim/mobject/geometry/{labeled_shapes.py => labeled.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename manim/mobject/geometry/{labeled_shapes.py => labeled.py} (100%) diff --git a/manim/mobject/geometry/labeled_shapes.py b/manim/mobject/geometry/labeled.py similarity index 100% rename from manim/mobject/geometry/labeled_shapes.py rename to manim/mobject/geometry/labeled.py From f55eddf9d20cb2c6a9bac9e8fcf6721ac47f2ed3 Mon Sep 17 00:00:00 2001 From: Andres Berejnoi Date: Thu, 27 Jul 2023 15:03:08 -0400 Subject: [PATCH 19/25] Update __init__.py Changed name of file from labeled_shapes.py to labeled.py and updated __init__.py to import from the correct location. --- manim/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manim/__init__.py b/manim/__init__.py index 3af8ea6b7e..cae45fcc42 100644 --- a/manim/__init__.py +++ b/manim/__init__.py @@ -46,7 +46,7 @@ from .mobject.frame import * from .mobject.geometry.arc import * from .mobject.geometry.boolean_ops import * -from .mobject.geometry.labeled_shapes import * +from .mobject.geometry.labeled import * from .mobject.geometry.line import * from .mobject.geometry.polygram import * from .mobject.geometry.shape_matchers import * From f264bd7f518a8ec8141f847fd18b07bffa0d03f5 Mon Sep 17 00:00:00 2001 From: Andres Berejnoi Date: Thu, 27 Jul 2023 15:57:01 -0400 Subject: [PATCH 20/25] Update manim/mobject/geometry/labeled.py Removed color import line because of redundancy. Co-authored-by: Jason Villanueva --- manim/mobject/geometry/labeled.py | 1 - 1 file changed, 1 deletion(-) diff --git a/manim/mobject/geometry/labeled.py b/manim/mobject/geometry/labeled.py index 495f2598be..6568896931 100644 --- a/manim/mobject/geometry/labeled.py +++ b/manim/mobject/geometry/labeled.py @@ -12,7 +12,6 @@ ) from manim.mobject.text.tex_mobject import MathTex, Tex from manim.mobject.text.text_mobject import Text -from manim.utils.color import * from manim.utils.color import Color From 0b605300c8d6ea5631d11a11855c757a259a3862 Mon Sep 17 00:00:00 2001 From: Andres Berejnoi Date: Thu, 27 Jul 2023 16:00:40 -0400 Subject: [PATCH 21/25] Update labeled.py default label_color parameter is now set to `None` instead of `WHITE`. --- manim/mobject/geometry/labeled.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manim/mobject/geometry/labeled.py b/manim/mobject/geometry/labeled.py index 6568896931..490ed0f330 100644 --- a/manim/mobject/geometry/labeled.py +++ b/manim/mobject/geometry/labeled.py @@ -65,7 +65,7 @@ def __init__( label: str | Tex | MathTex | Text, label_position: float = 0.5, font_size: float = 15, - label_color: Color | str | None = WHITE, + label_color: Color | str | None = None, label_frame: bool = True, frame_fill_color: Color | str | None = None, frame_fill_opacity: float = 1, From b7062cffd8d14b728c62f339e38a3049a5c4f0dd Mon Sep 17 00:00:00 2001 From: Andres Berejnoi Date: Thu, 27 Jul 2023 16:05:55 -0400 Subject: [PATCH 22/25] Update manim/mobject/geometry/labeled.py Co-authored-by: Jason Villanueva --- manim/mobject/geometry/labeled.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manim/mobject/geometry/labeled.py b/manim/mobject/geometry/labeled.py index 490ed0f330..36466e2e09 100644 --- a/manim/mobject/geometry/labeled.py +++ b/manim/mobject/geometry/labeled.py @@ -64,7 +64,7 @@ def __init__( self, label: str | Tex | MathTex | Text, label_position: float = 0.5, - font_size: float = 15, + font_size: float = DEFAULT_FONT_SIZE, label_color: Color | str | None = None, label_frame: bool = True, frame_fill_color: Color | str | None = None, From def82183889884f8a56b2a65b7a0c7f530411eb6 Mon Sep 17 00:00:00 2001 From: Andres Berejnoi Date: Thu, 27 Jul 2023 16:15:22 -0400 Subject: [PATCH 23/25] Update tests/test_graphical_units/test_geometry.py Co-authored-by: Jason Villanueva --- tests/test_graphical_units/test_geometry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_graphical_units/test_geometry.py b/tests/test_graphical_units/test_geometry.py index 75f6b42ea3..10ea6094e9 100644 --- a/tests/test_graphical_units/test_geometry.py +++ b/tests/test_graphical_units/test_geometry.py @@ -266,6 +266,6 @@ def test_LabeledLine(scene): @frames_comparison def test_LabeledArrow(scene): l_arrow = LabeledArrow( - "0.5", start=LEFT * 3, end=RIGHT * 3 + UP * 2, label_position=0.5 + "0.5", start=LEFT * 3, end=RIGHT * 3 + UP * 2, label_position=0.5, font_size=15 ) scene.add(l_arrow) From 5b428e8c3a8988b762f61227ecb10ff515e70429 Mon Sep 17 00:00:00 2001 From: Jason Villanueva Date: Thu, 27 Jul 2023 13:51:19 -0700 Subject: [PATCH 24/25] Revert changes related to WHITE and it's import SurroundingRectangle uses label_color as well and using a default of None removes the rectangle. --- manim/mobject/geometry/labeled.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manim/mobject/geometry/labeled.py b/manim/mobject/geometry/labeled.py index 36466e2e09..e73f52ddfd 100644 --- a/manim/mobject/geometry/labeled.py +++ b/manim/mobject/geometry/labeled.py @@ -12,7 +12,7 @@ ) from manim.mobject.text.tex_mobject import MathTex, Tex from manim.mobject.text.text_mobject import Text -from manim.utils.color import Color +from manim.utils.color import Color, WHITE class LabeledLine(Line): @@ -65,7 +65,7 @@ def __init__( label: str | Tex | MathTex | Text, label_position: float = 0.5, font_size: float = DEFAULT_FONT_SIZE, - label_color: Color | str | None = None, + label_color: Color | str | None = WHITE, label_frame: bool = True, frame_fill_color: Color | str | None = None, frame_fill_opacity: float = 1, From 4577c592466fb340631959501b9daa6da34f36bb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 27 Jul 2023 20:52:13 +0000 Subject: [PATCH 25/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- manim/mobject/geometry/labeled.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manim/mobject/geometry/labeled.py b/manim/mobject/geometry/labeled.py index e73f52ddfd..91f8cb0912 100644 --- a/manim/mobject/geometry/labeled.py +++ b/manim/mobject/geometry/labeled.py @@ -12,7 +12,7 @@ ) from manim.mobject.text.tex_mobject import MathTex, Tex from manim.mobject.text.text_mobject import Text -from manim.utils.color import Color, WHITE +from manim.utils.color import WHITE, Color class LabeledLine(Line):