Manim: table with partial borders

In the video on numbering systems I needed to place the numbers in a table. And I had to show only some parts of the borders, so as to represent the chain of divisions.

I have set up a TableHelper class that gives me a Line with the desired extremes, ready to be drawn.

The TableHelper class could be merged into a future Manim plugin.

Manim: table with partial borders
class TableWithPartialBorders(Scene):

    def construct(self):

        problem = MathTex(r"1322", r"_{10} =~?", r"_4").scale(2).to_edge(UR)
        problem.set_color_by_tex("4", YELLOW)
        self.play(Write(problem))

        table = MathTable(
            [[1322, 4, 0, 0, 0, 0],
            [2, 330, 4, 0, 0, 0],
            [0, 2, 82, 4, 0, 0],
            [0, 0, 2, 20, 4, 0],
            [0, 0, 0, 0, 5, 4],
            [0, 0, 0, 0, 1, 1]]
        )
        table.get_entries((6, 6)).set_color(GREEN)
        
        helper = TableHelper(table)

        number = problem[0].copy()
        number.target = table.get_entries((1, 1))
        self.play(MoveToTarget(number))
        # self.play(Write(table.get_entries((1, 1))))
        
        for step in range(5):
            self.play(Create(VGroup(
                helper.get_vertical_line(step + 1, start = step, end = step + 2),
                helper.get_horizontal_line(step + 1, start = step + 1, end = step + 2)
            )))
            base = problem[2].copy()
            base.target = table.get_entries((step + 1, step + 2)).set_color(YELLOW)
            self.play(MoveToTarget(base))
            self.play(Write(table.get_entries((step + 2, step + 2))))
            self.play(Write(table.get_entries((step + 2, step + 1)).set_color(GREEN)))
            
        response = MathTex("1","1","0","2","2","2", "_4").scale(2).to_edge(DL)

        for step in range(6):
            y = 6 - step
            if step == 0:
                x = y
            else:
                x = 7 - step
            self.play(table.get_entries((x, y)).copy().animate.scale(2).move_to(response[step]))

        base = problem[2].copy()
        base.target = response[6].set_color(YELLOW)
        self.play(MoveToTarget(base))
        
        self.wait(5)

class TableHelper():
    
    def __init__(self, 
            table: Table):
        self.table = table
            
    def get_horizontal_line(self, 
            row, 
            start = None, 
            end = None):
        if start is None and end is None:
            return self.table.get_horizontal_lines()[row-1]
        else:
            start_point = self.table.get_cell((row, start + 1)).get_corner(DL)
            end_point = self.table.get_cell((row, end)).get_corner(DR)
            return Line(start = start_point, end = end_point)
            
    def get_vertical_line(self, 
            col, 
            start = None, 
            end = None):
        if start is None and end is None:
            return self.table.get_vertical_lines()[col-1]
        else:
            start_point = self.table.get_cell((start + 1, col)).get_corner(UR)
            end_point = self.table.get_cell((end, col)).get_corner(DR)
            return Line(start = start_point, end = end_point)