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

Lack of document/example for CommonJS project #105

Closed
DreamHouse opened this issue Mar 25, 2015 · 5 comments
Closed

Lack of document/example for CommonJS project #105

DreamHouse opened this issue Mar 25, 2015 · 5 comments

Comments

@DreamHouse
Copy link

It would have saved me a couple of hours if there is some instructions about how to require this module in a CommonJS project. I almost switched to other tools because I was not able to load the module.

@karstenpackmohr
Copy link

How did you do it?

@DreamHouse
Copy link
Author

I have to require the library first, then invoke it with a d3 variable before using d3.tip(). Below is my coffeescript code:

d3tip_module = require 'd3-tip'
// d3.tip is defined with the following call
d3tip_module(d3)
// then you can use d3.tip()
d3.tip().attr('class', 'd3-tip')...

@darrenatyurgosky
Copy link

Same problem, thanks for the solution

@pdechery
Copy link

I was having the same problem and that worked. Thanks a lot for sharing.

@caged
Copy link
Owner

caged commented Aug 24, 2016

I don't use commonjs. If someone wants to submit a documentation update for this I'd be happy to accept it.

@caged caged closed this as completed Aug 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants