Advertisement
Guest User

Untitled

a guest
Oct 5th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. var circle = this.vis.select("svg").selectAll("circle")
  2. .data(this.points, function(d) { return d; });
  3.  
  4. circle.enter().append("circle")
  5. .attr("class", function(d) { return d === self.selected ? "selected" : null; })
  6. .attr("cx", function(d) { return self.x(d.x); })
  7. .attr("cy", function(d) { return self.y(d.y); })
  8. .attr("r", 10.0)
  9. .style("cursor", "ns-resize")
  10. .on("mousedown.drag", self.datapoint_drag())
  11. .on("touchstart.drag", self.datapoint_drag());
  12.  
  13. circle
  14. .attr("class", function(d) { return d === self.selected ? "selected" : null; })
  15. .attr("cx", function(d) {
  16. return self.x(d.x); })
  17. .attr("cy", function(d) { return self.y(d.y); });
  18.  
  19. circle.exit().remove();
  20.  
  21. hr_circles = self.graph_gps.svg.selectAll("hr_circles")
  22. .data(self.graph_gps.datay1); // , function(d){return d;}
  23.  
  24. hr_circles.enter().append("circle")
  25. .style("z-index", 3)
  26. .attr("class", "y1")
  27. .attr("r", 1)
  28. .attr("cx", function (d, i) {
  29. return xScale(d.time)
  30. })
  31. .attr("cy", function (d, i) {
  32. return yScale(d.vy)
  33. })
  34. .on("mouseover",
  35. function (d) {...displays a tooltip...})
  36. .on("mouseout", function (d) {
  37. });
  38.  
  39. hr_circles.attr("class", "y1")
  40. .attr("cx", function (d, i) {
  41. return xScale(d.time)
  42. })
  43. .attr("cy", function (d, i) {
  44. return yScale(d.vy)
  45. })
  46.  
  47. hr_circles.exit().remove();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement