Skip to content
This repository has been archived by the owner on Mar 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #83 from Caged/commonjs
Browse files Browse the repository at this point in the history
Add commonjs support
  • Loading branch information
Justin Palmer committed Oct 21, 2014
2 parents d61b2d3 + 4c2a248 commit 81b1e43
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "d3-tip",
"version": "0.6.5",
"version": "0.6.6",
"main": "index.js",
"ignore": [
"**/.*",
Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module with d3 as a dependency.
define(['d3'], factory)
} else if (typeof module === 'object' && module.exports) {
// CommonJS
module.exports = function(d3) {
d3.tip = factory(d3)
return d3.tip
}
} else {
// Browser global.
root.d3.tip = factory(root.d3)
Expand Down
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "d3-tip",
"version": "0.6.6",
"description": "Tooltips for d3 svg visualizations",
"author": "Justin Palmer <[email protected]> (http://labratrevenge.com/d3-tip)",
"main": "index.js",
"directories": {
"doc": "docs",
"example": "examples"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/Caged/d3-tip"
},
"keywords": [
"d3",
"tooltip"
],
"author": "Justin Palmer",
"license": "MIT",
"bugs": {
"url": "https://github.com/Caged/d3-tip/issues"
},
"homepage": "https://github.com/Caged/d3-tip"
}

0 comments on commit 81b1e43

Please sign in to comment.