MCPcopy Create free account
hub / github.com/idank/explainshell / line

Function line

explainshell/web/static/js/d3.v3.js:3683–3698  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

3681 function d3_svg_line(projection) {
3682 var x = d3_svg_lineX, y = d3_svg_lineY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7;
3683 function line(data) {
3684 var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y);
3685 function segment() {
3686 segments.push("M", interpolate(projection(points), tension));
3687 }
3688 while (++i < n) {
3689 if (defined.call(this, d = data[i], i)) {
3690 points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]);
3691 } else if (points.length) {
3692 segment();
3693 points = [];
3694 }
3695 }
3696 if (points.length) segment();
3697 return segments.length ? segments.join("") : null;
3698 }
3699 line.x = function(_) {
3700 if (!arguments.length) return x;
3701 x = _;

Callers

nothing calls this directly

Calls 3

d3_functorFunction · 0.85
segmentFunction · 0.85
callMethod · 0.45

Tested by

no test coverage detected