source: Dev/trunk/d3/src/svg/line-radial.js @ 76

Last change on this file since 76 was 76, checked in by fpvanagthoven, 14 years ago

d3

File size: 467 bytes
Line 
1d3.svg.line.radial = function() {
2  var line = d3_svg_line(d3_svg_lineRadial);
3  line.radius = line.x, delete line.x;
4  line.angle = line.y, delete line.y;
5  return line;
6};
7
8function d3_svg_lineRadial(points) {
9  var point,
10      i = -1,
11      n = points.length,
12      r,
13      a;
14  while (++i < n) {
15    point = points[i];
16    r = point[0];
17    a = point[1] + d3_svg_arcOffset;
18    point[0] = r * Math.cos(a);
19    point[1] = r * Math.sin(a);
20  }
21  return points;
22}
Note: See TracBrowser for help on using the repository browser.