def __init__ (self, canvasType, **attr):
        if attr.has_key ('settings') and attr['settings']:
            self.applySettings (attr['settings'])
        else:
            self.formatSettings (blank ())
        if attr.has_key ('width'):
            self.settings.width = attr['width']
        if attr.has_key ('height'):
            self.settings.height = attr['height']
        
        view = ViewBox (0, 0, self.settings.width, self.settings.height)
        PrintableCanvas.__init__ (self, viewBox = view, **attr)

        self.addScript (self.jsUtils ())
        self.addScript (self.jsHighlight ())

        self.dataGroup = Grouping ()
        if canvasType:
            self.attachCanvas (canvasType, **attr)
        else:
            self.canvas = None
        self.draw (self.dataGroup)
        self.initialFormatting ()
dataset/ETHPy150Open dotskapes/dotSkapes/modules/savage/graph/base.py/BaseGraph.__init__/original