我正在学习 d3 drag,我被这条线卡住了  d3.event.dx。当我在控制台中输出这个值时,它会在我拖动点时返回一些 int 值,我不知道这个返回值遵循什么模式。谁能解释一下?
vis.selectAll("circle.control")
    .data(function(d) { return points.slice(0, d) }) // array contains 2 3 ... 5 points respectively 
  .enter().append("circle")
    .attr("class", "control")
    .attr("r", 7)
    .attr("cx", x)
    .attr("cy", y)
    .call(d3.behavior.drag()
      .on("dragstart", function(d) {
        this.__origin__ = [d.x, d.y];
        //alert(this.__origin__);
      })
      .on("drag", function(d) {
        d.x = Math.min(w, Math.max(0, this.__origin__[0] += d3.event.dx));
        //alert(this.__origin__[0]);
        //alert(d3.event.dx);
        console.log(d3.event.dx);
       // console.log (d.x);
        d.y = Math.min(h, Math.max(0, this.__origin__[1] += d3.event.dy));
        //alert(this.__origin__[1]);
        bezier = {};
        update();
        vis.selectAll("circle.control")
          .attr("cx", x)
          .attr("cy", y);
      })
      .on("dragend", function() {
        delete this.__origin__;
      }));