2
首先我用npm install d3-tip
v0.6.7安裝d3-tip,然後瀏覽我的項目沒有任何問題。d3-tip npm模塊不能與browserify一起使用
我的JS如下所示
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>";
});
我得到的錯誤是:
TypeError: d3 is undefined in my bundle.js yet
我使用D3其他地方在我的代碼沒有問題,這使我相信錯誤是在npm模塊爲d3提示,但我可能是錯的。
任何想法?
謝謝!這解決了我的問題 –