Skip to content

Instantly share code, notes, and snippets.

@jfsiii
Created May 4, 2011 22:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfsiii/956218 to your computer and use it in GitHub Desktop.
Save jfsiii/956218 to your computer and use it in GitHub Desktop.
diff of changes to Flot 0.7 to support being run on node (with node-canvas)
137c137,139
< hooks: {}
---
> hooks: {},
> width: null,
> height: null
687c689,694
< var c = document.createElement('canvas');
---
> var c;
> if (window.Canvas){ // node-canvas is installed
> c = new Canvas(canvasWidth, canvasHeight);
> } else {
> c = document.createElement('canvas');
> }
697c704
< if (!c.getContext) // excanvas hack
---
> if (window.G_vmlCanvasManager) // excanvas hack
707,708c714,715
< canvasWidth = placeholder.width();
< canvasHeight = placeholder.height();
---
> canvasWidth = placeholder.width() || options.width;
> canvasHeight = placeholder.height() || options.height;
748d754
<
751d756
<
862c867
< if (w == null)
---
> if (!w)
866c871
< if (h == null) {
---
> if (!h) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment