Skip to content

Commit

Permalink
Fix d3#403 - big chords.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Dec 11, 2011
1 parent 05d871b commit 6477daa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions d3.js
Original file line number Diff line number Diff line change
Expand Up @@ -3503,10 +3503,10 @@ d3.svg.chord = function() {
var s = subgroup(this, source, d, i),
t = subgroup(this, target, d, i);
return "M" + s.p0
+ arc(s.r, s.p1) + (equals(s, t)
+ arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t)
? curve(s.r, s.p1, s.r, s.p0)
: curve(s.r, s.p1, t.r, t.p0)
+ arc(t.r, t.p1)
+ arc(t.r, t.p1, t.a1 - t.a0)
+ curve(t.r, t.p1, s.r, s.p0))
+ "Z";
}
Expand All @@ -3529,8 +3529,8 @@ d3.svg.chord = function() {
return a.a0 == b.a0 && a.a1 == b.a1;
}

function arc(r, p) {
return "A" + r + "," + r + " 0 0,1 " + p;
function arc(r, p, a) {
return "A" + r + "," + r + " 0 " + +(a > Math.PI) + ",1 " + p;
}

function curve(r0, p0, r1, p1) {
Expand Down
Loading

0 comments on commit 6477daa

Please sign in to comment.