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)
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
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
def __init__(self, lumpy, parent, child, **options): self.lumpy = lumpy self.parent = parent self.child = child underride(options, fill='blue') self.options = options
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)