Skip to content

Instantly share code, notes, and snippets.

@jfsiii
Created November 14, 2011 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfsiii/1364431 to your computer and use it in GitHub Desktop.
Save jfsiii/1364431 to your computer and use it in GitHub Desktop.
Flot 0.7 updated to support node-canvas
42a43,44
> width: null,
> height: null,
137c139,141
< hooks: {}
---
> hooks: {},
> width: null,
> height: null
687c691,696
< var c = document.createElement('canvas');
---
> var c;
> if (window.Canvas){ // node-canvas is installed
> c = new Canvas(canvasWidth, canvasHeight);
> } else {
> c = document.createElement('canvas');
> }
697c706
< if (!c.getContext) // excanvas hack
---
> if (window.G_vmlCanvasManager) // excanvas hack
707,708c716,717
< canvasWidth = placeholder.width();
< canvasHeight = placeholder.height();
---
> canvasWidth = placeholder.width() || options.width;
> canvasHeight = placeholder.height() || options.height;
748d756
<
751d758
<
862c869
< if (w == null)
---
> if (!w)
866c873
< if (h == null) {
---
> if (!h) {
902c909
< if (w == null)
---
> if (!w)
904c911
< if (h == null)
---
> if (!h)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment