Skip to content

Commit

Permalink
added some simple svg support so you can load raphaeljs in envjs and …
Browse files Browse the repository at this point in the history
…write out the resulting svg document. itegrated suggested patch from richard frankel. awesome fun stuff
  • Loading branch information
thatcher committed Aug 19, 2010
1 parent f381242 commit 94c414c
Show file tree
Hide file tree
Showing 14 changed files with 3,804 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build.properties
Expand Up @@ -2,7 +2,7 @@
PROJECT: env-js
BUILD_MAJOR: 1
BUILD_MINOR: 2
BUILD_ID: 30
BUILD_ID: 31
BUILD_VERSION: ${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_ID}
BUILD: ${PROJECT}.${BUILD_VERSION}
VERSION: ${BUILD} ${DSTAMP}
Expand Down
19 changes: 19 additions & 0 deletions plugins/env.svg.js
@@ -0,0 +1,19 @@
/**
* @author thatcher
*/
load('dist/env.rhino.js');
load('plugins/jquery.js');
load('plugins/vendor/raphael.js');

// Creates canvas 320 × 200 at 10, 50
var paper = Raphael(10, 50, 320, 200);

// Creates circle at x = 50, y = 40, with radius 10
var circle = paper.circle(50, 40, 10);
// Sets the fill attribute of the circle to red (#f00)
circle.attr("fill", "#f00");

// Sets the stroke attribute of the circle to white
circle.attr("stroke", "#fff");

Envjs.writeToFile(document.body.innerHTML, Envjs.uri('reports/svg.html'));

0 comments on commit 94c414c

Please sign in to comment.