Skip to content

Commit

Permalink
shorter
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jan 16, 2022
1 parent af6230a commit ae24023
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/marks/arrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ export class Arrow extends Mark {

// If the radius is very large (or even infinite, as when the bend
// angle is zero), then render a straight line.
return r < 1e5
? `M${x1},${y1}A${r},${r} 0,0,${bendAngle > 0 ? 1 : 0} ${x2},${y2}M${x3},${y3}L${x2},${y2}L${x4},${y4}`
: `M${x1},${y1}L${x2},${y2}M${x3},${y3}L${x2},${y2}L${x4},${y4}`;
return `M${x1},${y1}${r < 1e5 ? `A${r},${r} 0,0,${bendAngle > 0 ? 1 : 0} ` : `L`}${x2},${y2}M${x3},${y3}L${x2},${y2}L${x4},${y4}`;
})
.call(applyChannelStyles, this, channels))
.node();
Expand Down

0 comments on commit ae24023

Please sign in to comment.