d3鱼眼未定义

时间:2013-04-16 20:28:08

标签: d3.js

我正在尝试使用d3鱼眼插件。

但是,我收到了这个错误:d3.fisheye未定义

这很奇怪。

//initialize fisheye
    var fisheye = d3.fisheye.circular()
        .radius(200)
        .distortion(2);

    this.chart.on("mousemove", function() {
      fisheye.focus(d3.mouse(this));
    });

我认为这可能是因为我使用的是d3.v2,但我将其更新为d3.v3并且我仍然遇到同样的问题。 它甚至在那个文件中。我确实看到一个fisheye.js漂浮在: https://github.com/d3/d3-plugins/tree/master/fisheye 我也有点困惑,因为在API文档中绝对没有提到鱼眼。

1 个答案:

答案 0 :(得分:2)

Fisheye是一个插件,您还需要包含文件fisheye.js和d3库。