Sha256: 4a36a7068374e83b1dd49e49eb3cdfe69942c8dd642aecc0e0df83b8eb08bbfe

Contents?: true

Size: 985 Bytes

Versions: 5

Compression:

Stored size: 985 Bytes

Contents

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];
}

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
mdarray-sol-0.1.0-java node_modules/dc/node_modules/d3/src/svg/diagonal.js
stripchart-0.0.3 lib/stripchart/public/components/d3/src/svg/diagonal.js
stripmem-0.0.3 lib/stripmem/public/components/d3/src/svg/diagonal.js
stripmem-0.0.2 lib/stripmem/public/components/d3/src/svg/diagonal.js
stripmem-0.0.1 lib/stripmem/public/components/d3/src/svg/diagonal.js