MCPcopy
hub / github.com/jipegit/OSXAuditor / line

Function line

d3-3.2.8/d3.js:3996–4011  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

3994 function d3_svg_line(projection) {
3995 var x = d3_svg_lineX, y = d3_svg_lineY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7;
3996 function line(data) {
3997 var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y);
3998 function segment() {
3999 segments.push("M", interpolate(projection(points), tension));
4000 }
4001 while (++i < n) {
4002 if (defined.call(this, d = data[i], i)) {
4003 points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]);
4004 } else if (points.length) {
4005 segment();
4006 points = [];
4007 }
4008 }
4009 if (points.length) segment();
4010 return segments.length ? segments.join("") : null;
4011 }
4012 line.x = function(_) {
4013 if (!arguments.length) return x;
4014 x = _;

Callers 2

line-test.jsFile · 0.85

Calls 2

d3_functorFunction · 0.85
segmentFunction · 0.85

Tested by

no test coverage detected