d3.js - d3-tip npm module not working with browserify -


first installed d3-tip npm install d3-tip v0.6.7 browserify'd project without issues.

my js looks following

var d3 = require("d3"); var d3tip = require("d3-tip");      var tip = d3tip()               .attr('class', 'd3-tip')               .offset([-10, 0])               .html(function(d) {                 return "<strong>hello world:</strong>";               }); 

the error is:

typeerror: d3 undefined in bundle.js yet 

i'm using d3 elsewhere in code without issue makes me believe error in npm module d3 tip wrong.

any ideas?

i found question , exact same problem had, after trying lot of things found can pass arguments require.

i solved problem using:

var d3 = require("d3"); var d3tip = require('d3-tip')(d3); 

and can call d3tip have.


Comments

Popular posts from this blog

ios - UITEXTFIELD InputView Uipicker not working in swift -

php - Tinymce Editor not coming up on Croogo on server -

Hatching array of circles in AutoCAD using c# -