| import "../core/functor"; | |
| import "../core/source"; | |
| import "../core/target"; | |
| import "svg"; | |
| d3.svg.diagonal = function() { | |
| var source = d3_source, | |
| target = d3_target, | |
| projection = d3_svg_diagonalProjection; | |
| function diagonal(d, i) { | |
| var p0 = source.call(this, d, i), | |
| p3 = target.call(this, d, i), | |
| m = (p0.y + p3.y) / 2, | |
| p = [p0, {x: p0.x, y: m}, {x: p3.x, y: m}, p3]; | |
| p = p.map(projection); | |
| return "M" + p[0] + "C" + p[1] + " " + p[2] + " " + p[3]; | |
| } | |
| diagonal.source = function(x) { | |
| if (!arguments.length) return source; | |
| source = d3_functor(x); | |
| return diagonal; | |
| }; | |
| diagonal.target = function(x) { | |
| if (!arguments.length) return target; | |
| target = d3_functor(x); | |
| return diagonal; | |
| }; | |
| diagonal.projection = function(x) { | |
| if (!arguments.length) return projection; | |
| projection = x; | |
| return diagonal; | |
| }; | |
| return diagonal; | |
| }; | |
| function d3_svg_diagonalProjection(d) { | |
| return [d.x, d.y]; | |
| } | |
Xet Storage Details
- Size:
- 985 Bytes
- Xet hash:
- 84e6973793647418be60f2d6d2b609cd0d52cc94dd42a427964dce8c3b4e77d1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.