Пример #1
0
    def offset_text(self, pos, text, dx=0, dy=0, **options):
        """Draws the given text at the given position.

        Args:
            pos: Point or coordinate pair
            text: string
            dx, dy: offset
        """
        underride(options, fill='black', font=FONT, anchor=W)
        x, y = pos
        x += dx
        y += dy
        return self.text([x, y], text, **options)
Пример #2
0
    def offset_text(self, pos, text, dx=0, dy=0, **options):
        """Draws the given text at the given position.

        Args:
            pos: Point or coordinate pair
            text: string
            dx, dy: offset
        """
        underride(options, fill='black', font=FONT, anchor=W)
        x, y = pos
        x += dx
        y += dy
        return self.text([x, y], text, **options)
Пример #3
0
    def box(self, box, padx=0.4, pady=0.2, **options):
        """Draws a rectangle with the given bounding box.

        Args:
            box: BBox object or list of coordinate pairs.
            padx, pady: padding
        """

        # underride sets default values only if the called hasn't
        underride(options, outline='black')
        box.left -= padx
        box.top -= pady
        box.right += padx
        box.bottom += pady
        item = self.rectangle(box, **options)
        return item
Пример #4
0
    def box(self, box, padx=0.4, pady=0.2, **options):
        """Draws a rectangle with the given bounding box.

        Args:
            box: BBox object or list of coordinate pairs.
            padx, pady: padding
        """

        # underride sets default values only if the called hasn't
        underride(options, outline='black')
        box.left -= padx
        box.top -= pady
        box.right += padx
        box.bottom += pady
        item = self.rectangle(box, **options)
        return item
Пример #5
0
 def __init__(self, lumpy, parent, child, **options):
     self.lumpy = lumpy
     self.parent = parent
     self.child = child
     underride(options, fill='orange', arrow=LAST)
     self.options = options
Пример #6
0
 def __init__(self, lumpy, parent, child, **options):
     self.lumpy = lumpy
     self.parent = parent
     self.child = child
     underride(options, fill='blue')
     self.options = options
Пример #7
0
 def dot(self, pos, r=0.2, **options):
     """Draws a dot at the given position with radius r."""
     underride(options, fill='white', outline='orange')
     return self.circle(pos, r, **options)
Пример #8
0
 def __init__(self, lumpy, parent, child, **options):
     self.lumpy = lumpy
     self.parent = parent
     self.child = child
     underride(options, fill='orange', arrow=LAST)
     self.options = options
Пример #9
0
 def __init__(self, lumpy, parent, child, **options):
     self.lumpy = lumpy
     self.parent = parent
     self.child = child
     underride(options, fill='blue')
     self.options = options
Пример #10
0
 def dot(self, pos, r=0.2, **options):
     """Draws a dot at the given position with radius r."""
     underride(options, fill='white', outline='orange')
     return self.circle(pos, r, **options)