Skip to content

Instantly share code, notes, and snippets.

@skrat
Created August 14, 2012 19:26
Show Gist options
  • Save skrat/3351977 to your computer and use it in GitHub Desktop.
Save skrat/3351977 to your computer and use it in GitHub Desktop.
class Path {
Path() {}
Path.parse(String data) {
return null; // mock
}
}
Document SVG = null;
Document ensureSvg(Function cb(Document svg)) {
if (SVG != null) {
cb(SVG)
}
var req = new XMLHttpRequest();
req.on.load.add((_) {
SVG = req.response;
cb(SVG);
});
req.responseType = 'document';
req.open('get', 'carp.svg');
req.send();
}
SVGElement make(svg, Function cb) {
ensureSvg((Document svgDoc) {
var pathData = new Path.parse(svgDoc.query('#body').attributes['d']);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment