1
function d3_svg_area(projection) {
7
interpolate = d3_svg_lineInterpolatorDefault,
8
i0 = d3_svg_lineLinear,
9
i1 = d3_svg_lineLinear,
22
fx1 = x0 === x1 ? function() { return x; } : d3_functor(x1),
23
fy1 = y0 === y1 ? function() { return y; } : d3_functor(y1),
28
segments.push("M", i0(projection(points1), tension),
29
L, i1(projection(points0.reverse()), tension),
34
if (defined.call(this, d = data[i], i)) {
35
points0.push([x = +fx0.call(this, d, i), y = +fy0.call(this, d, i)]);
36
points1.push([+fx1.call(this, d, i), +fy1.call(this, d, i)]);
37
} else if (points0.length) {
44
if (points0.length) segment();
46
return segments.length ? segments.join("") : null;
49
area.x = function(_) {
50
if (!arguments.length) return x1;
55
area.x0 = function(_) {
56
if (!arguments.length) return x0;
61
area.x1 = function(_) {
62
if (!arguments.length) return x1;
67
area.y = function(_) {
68
if (!arguments.length) return y1;
73
area.y0 = function(_) {
74
if (!arguments.length) return y0;
79
area.y1 = function(_) {
80
if (!arguments.length) return y1;
85
area.defined = function(_) {
86
if (!arguments.length) return defined;
91
area.interpolate = function(_) {
92
if (!arguments.length) return interpolate;
93
if (!d3_svg_lineInterpolators.has(_ += "")) _ = d3_svg_lineInterpolatorDefault;
94
i0 = d3_svg_lineInterpolators.get(interpolate = _);
95
i1 = i0.reverse || i0;
96
L = /-closed$/.test(_) ? "M" : "L";
100
area.tension = function(_) {
101
if (!arguments.length) return tension;
109
d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter;
110
d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore;
112
d3.svg.area = function() {
113
return d3_svg_area(Object);