Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff of changes required to SVN version of Flot 0.6 to get it running on Node (with node-canvas)
39a40,41
> width: null,
> height: null,
701c703,709
< var c = document.createElement('canvas');
---
> var c;
> if (typeof Canvas !== "undefined"){
> c = new Canvas(width, height);
> } else {
> c = document.createElement('canvas');
> }
>
704c712,713
< if (!c.getContext) // excanvas hack
---
>
> if (window.G_vmlCanvasManager) // excanvas hack
709,710c718,720
< canvasWidth = placeholder.width();
< canvasHeight = placeholder.height();
---
> canvasWidth = placeholder.width() || options.width;
> canvasHeight = placeholder.height() || options.height;
>
722c732,733
< canvas = $(makeCanvas(canvasWidth, canvasHeight)).appendTo(placeholder).get(0);
---
> canvas = makeCanvas(canvasWidth, canvasHeight);
> if (placeholder.length) $(canvas).appendTo(placeholder);
726c737,739
< overlay = $(makeCanvas(canvasWidth, canvasHeight)).css({ position: 'absolute', left: 0, top: 0 }).appendTo(placeholder).get(0);
---
> overlay = makeCanvas(canvasWidth, canvasHeight);
> if (placeholder.length)
> $(overlay).css({ position: 'absolute', left: 0, top: 0 }).appendTo(placeholder);
846c859
< if (w == null)
---
> if (!w)
848c861
< if (h == null)
---
> if (!h)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.