'Generates a folder at the given path containing an index.html
that visualizes the graph using the HTML5 <canvas> tag.'

def export(self, path, encoding='utf-8'):

    if os.path.exists(path):
        rmtree(path)
    os.mkdir(path)
    if (self.javascript is None):
        for (p, f) in (('..', 'canvas.js'), ('.', 'graph.js')):
            a = open(os.path.join(MODULE, p, f), 'r')
            b = open(os.path.join(path, f), 'w')
            b.write(minify(a.read()))
            b.close()
    if (self.stylesheet == DEFAULT):
        f = open(os.path.join(path, 'style.css'), 'w')
        f.write(self.style)
        f.close()
    f = open(os.path.join(path, 'index.html'), 'w', encoding=encoding)
    f.write(self.html)
    f.close()
