File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ node_modules
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " trianglify" ,
3
+ "version" : " 0.0.1" ,
4
+ "description" : " Trianglify is a javascript library for generating colorful triangle meshes that can be used as SVG images and CSS backgrounds." ,
5
+ "main" : " trianglify.js" ,
6
+ "dependencies" : {
7
+ "d3" : " 3" ,
8
+ "jsdom" : " 0.10" ,
9
+ "xmldom" : " 0.1" ,
10
+ "btoa" : " 1"
11
+ },
12
+ "directories" : {
13
+ "example" : " examples"
14
+ },
15
+ "repository" : {
16
+ "type" : " git" ,
17
+ "url" : " git://github.com/qrohlf/trianglify.git"
18
+ },
19
+ "keywords" : [
20
+ " svg" ,
21
+ " d3.js" ,
22
+ " visualization"
23
+ ],
24
+ "author" : " Quinn Rohlf <qr@qrohlf.com>" ,
25
+ "license" : " GPLv3" ,
26
+ "bugs" : {
27
+ "url" : " https://github.com/qrohlf/trianglify/issues"
28
+ },
29
+ "homepage" : " https://github.com/qrohlf/trianglify"
30
+ }
Original file line number Diff line number Diff line change @@ -16,6 +16,15 @@ function Trianglify(options) {
16
16
}
17
17
}
18
18
19
+ //nodejs stuff
20
+ if ( typeof module !== 'undefined' && module . exports ) {
21
+ d3 = require ( "d3" ) ;
22
+ document = require ( "jsdom" ) . jsdom ( ) ;
23
+ XMLSerializer = require ( "xmldom" ) . XMLSerializer ;
24
+ btoa = require ( 'btoa' ) ;
25
+ module . exports = Trianglify ;
26
+ }
27
+
19
28
Trianglify . randomColor = function ( ) {
20
29
var keys = Object . keys ( colorbrewer ) ;
21
30
var palette = colorbrewer [ keys [ Math . floor ( Math . random ( ) * keys . length ) ] ] ;
You can’t perform that action at this time.
0 commit comments