Skip to content

Commit

Permalink
Add support for browserify.
Browse files Browse the repository at this point in the history
This includes a new optional canvas accessor for use with Node.js, and
removes the dependency on a specific canvas library for Node.js.

Fixes #70, fixes #72, and fixes #76.
  • Loading branch information
jasondavies committed Sep 24, 2015
1 parent 0e8c6ba commit 85ff7b7
Show file tree
Hide file tree
Showing 12 changed files with 937 additions and 9,952 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
npm-debug.log
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,16 @@ the spiral for each word. This should return a number in the range `[0, 1)`.

If not specified, returns the current random number generator, which defaults
to `Math.random`.

<a name="canvas" href="#canvas">#</a> <b>canvas</b>([<i>canvas</i>])

If specified, sets the **canvas** generator function, which is used internally
to draw text. If not specified, returns the current generator function, which
defaults to:

```js
function() { return document.createElement("canvas"); }
```

When using Node.js, you will almost definitely override this default, e.g.
using the [canvas module](https://www.npmjs.com/package/canvas).
8 changes: 2 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
{
"name": "d3-cloud",
"version": "1.1.2",
"main": "d3.layout.cloud.js",
"scripts": [
"d3.layout.cloud.js"
],
"version": "1.2.0",
"main": "build/d3.layout.cloud.js",
"ignore": [
".DS_Store",
".git",
".gitignore",
".npmignore",
"examples",
"index.js",
"lib",
"node_modules",
"package.json"
]
Expand Down
Loading

0 comments on commit 85ff7b7

Please sign in to comment.