Skip to content

Commit

Permalink
Simpler default instantiation.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Nov 19, 2015
1 parent 7f1c1d4 commit b33245d
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 39 deletions.
1 change: 1 addition & 0 deletions src/interpolate/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import basis from "./basis";
import linear from "./linear";

function bundle(beta) {
if (beta && beta.moveTo) return basis(beta);
return beta == null || (beta = +beta) === 1 ? basis
: function(context) { return new Bundle(context, beta); };
}
Expand Down
1 change: 1 addition & 0 deletions src/interpolate/cardinal-closed.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {point} from "./cardinal";

function cardinalClosed(tension) {
if (tension && tension.moveTo) return new CardinalClosed(tension, 1 / 6);
var k = (tension == null ? 1 : 1 - tension) / 6;
return function(context) {
return new CardinalClosed(context, k);
Expand Down
1 change: 1 addition & 0 deletions src/interpolate/cardinal-open.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {point} from "./cardinal";

function cardinalOpen(tension) {
if (tension && tension.moveTo) return new CardinalOpen(tension, 1 / 6);
var k = (tension == null ? 1 : 1 - tension) / 6;
return function(context) {
return new CardinalOpen(context, k);
Expand Down
3 changes: 1 addition & 2 deletions src/interpolate/cardinal.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ export function point(that, x, y) {
);
};


// TODO cardinal(context) returns new Cardinal(context, 0)?
function cardinal(tension) {
if (tension && tension.moveTo) return new Cardinal(tension, 1 / 6);
var k = (tension == null ? 1 : 1 - tension) / 6;
return function(context) {
return new Cardinal(context, k);
Expand Down
1 change: 1 addition & 0 deletions src/interpolate/catmull-rom-closed.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import cardinalClosed from "./cardinal-closed";
import {point} from "./catmull-rom";

function catmullRomClosed(alpha) {
if (alpha && alpha.moveTo) return cardinalClosed(alpha);
return alpha == null || !(alpha = +alpha) ? cardinalClosed(0) : function(context) {
return new CatmullRomClosed(context, alpha);
};
Expand Down
1 change: 1 addition & 0 deletions src/interpolate/catmull-rom-open.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import cardinalOpen from "./cardinal-open";
import {point} from "./catmull-rom";

function catmullRomOpen(alpha) {
if (alpha && alpha.moveTo) return cardinalOpen(alpha);
return alpha == null || !(alpha = +alpha) ? cardinalOpen(0) : function(context) {
return new CatmullRomOpen(context, alpha);
};
Expand Down
1 change: 1 addition & 0 deletions src/interpolate/catmull-rom.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export function point(that, x, y) {
};

function catmullRom(alpha) {
if (alpha && alpha.moveTo) return cardinal(alpha);
return alpha == null || !(alpha = +alpha) ? cardinal(0) : function(context) {
return new CatmullRom(context, alpha);
};
Expand Down
40 changes: 38 additions & 2 deletions test/area-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ tape("area.interpolate(basisOpen)(data) generates the expected path", function(t
});

tape("area.interpolate(cardinal)(data) generates the expected path", function(test) {
var a = shape.area().interpolate(shape.cardinal()); // TODO no empty invocation?
var a = shape.area().interpolate(shape.cardinal);
test.equal(a([]), null);
test.equal(a([[0, 1]]), "M0,1L0,0Z");
test.equal(a([[0, 1], [1, 3]]), "M0,1L1,3L1,0L0,0Z");
Expand All @@ -93,7 +93,7 @@ tape("area.interpolate(cardinal)(data) generates the expected path", function(te
});

tape("area.interpolate(cardinalOpen)(data) generates the expected path", function(test) {
var a = shape.area().interpolate(shape.cardinalOpen()); // TODO no empty invocation?
var a = shape.area().interpolate(shape.cardinalOpen);
test.equal(a([]), null);
test.equal(a([[0, 1]]), null);
test.equal(a([[0, 1], [1, 3]]), null);
Expand Down Expand Up @@ -158,3 +158,39 @@ tape("area.interpolate(natural)(data) generates the expected path", function(tes
test.equal(a([[0, 1], [1, 3], [2, 1], [3, 3]]), "M0,1C0.33333333333333326,2.111111111111111,0.6666666666666665,3.2222222222222223,1,3C1.3333333333333335,2.7777777777777777,1.666666666666667,1.2222222222222223,2,1C2.333333333333333,0.7777777777777778,2.6666666666666665,1.8888888888888888,3,3L3,0C2.666666666666667,0,2.3333333333333335,0,2,0C1.6666666666666665,0,1.3333333333333333,0,1,0C0.6666666666666667,0,0.33333333333333337,0,0,0Z");
test.end();
});

tape("area.interpolate(cardinal) uses a default tension of zero", function(test) {
var a = shape.area().interpolate(shape.cardinal(0));
test.equal(shape.area().interpolate(shape.cardinal)([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.area().interpolate(shape.cardinal())([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.area().interpolate(shape.cardinal(null))([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.area().interpolate(shape.cardinal(undefined))([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.end();
});

tape("area.interpolate(cardinalOpen) uses a default tension of zero", function(test) {
var a = shape.area().interpolate(shape.cardinalOpen(0));
test.equal(shape.area().interpolate(shape.cardinalOpen)([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.area().interpolate(shape.cardinalOpen())([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.area().interpolate(shape.cardinalOpen(null))([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.area().interpolate(shape.cardinalOpen(undefined))([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.end();
});

tape("area.interpolate(catmullRom) uses a default alpha of zero", function(test) {
var a = shape.area().interpolate(shape.catmullRom(0));
test.equal(shape.area().interpolate(shape.catmullRom)([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.area().interpolate(shape.catmullRom())([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.area().interpolate(shape.catmullRom(null))([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.area().interpolate(shape.catmullRom(undefined))([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.end();
});

tape("area.interpolate(catmullRomOpen) uses a default alpha of zero", function(test) {
var a = shape.area().interpolate(shape.catmullRomOpen(0));
test.equal(shape.area().interpolate(shape.catmullRomOpen)([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.area().interpolate(shape.catmullRomOpen())([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.area().interpolate(shape.catmullRomOpen(null))([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.area().interpolate(shape.catmullRomOpen(undefined))([[0, 1], [1, 3], [2, 1], [3, 3]]), a([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.end();
});
117 changes: 82 additions & 35 deletions test/line-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,6 @@ tape("line.interpolate(cardinal(tension)) coerces the specified tension to a num
test.end();
});

tape("line.interpolate(cardinal()) implicitly uses a tension of zero", function(test) {
var l = shape.line().interpolate(shape.cardinal(0));
test.equal(shape.line().interpolate(shape.cardinal())([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]])); // TODO no empty invocation?
test.equal(shape.line().interpolate(shape.cardinal(null))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.cardinal(undefined))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.end();
});

tape("line.interpolate(cardinalOpen()) implicitly uses a tension of zero", function(test) {
var l = shape.line().interpolate(shape.cardinalOpen(0));
test.equal(shape.line().interpolate(shape.cardinalOpen())([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]])); // TODO no empty invocation?
test.equal(shape.line().interpolate(shape.cardinalOpen(null))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.cardinalOpen(undefined))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.end();
});

tape("line.interpolate(linear)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.linear);
test.equal(l([]), null);
Expand All @@ -88,7 +72,7 @@ tape("line.interpolate(linear)(data) generates the expected path", function(test
test.end();
});

tape("line.interpolate(linear-closed)(data) generates the expected path", function(test) {
tape("line.interpolate(linearClosed)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.linearClosed);
test.equal(l([]), null);
test.equal(l([[0, 1]]), "M0,1Z");
Expand All @@ -106,7 +90,7 @@ tape("line.interpolate(step)(data) generates the expected path", function(test)
test.end();
});

tape("line.interpolate(step-before)(data) generates the expected path", function(test) {
tape("line.interpolate(stepBefore)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.stepBefore);
test.equal(l([]), null);
test.equal(l([[0, 1]]), "M0,1Z");
Expand All @@ -115,7 +99,7 @@ tape("line.interpolate(step-before)(data) generates the expected path", function
test.end();
});

tape("line.interpolate(step-after)(data) generates the expected path", function(test) {
tape("line.interpolate(stepAfter)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.stepAfter);
test.equal(l([]), null);
test.equal(l([[0, 1]]), "M0,1Z");
Expand All @@ -133,7 +117,7 @@ tape("line.interpolate(basis)(data) generates the expected path", function(test)
test.end();
});

tape("line.interpolate(basis-open)(data) generates the expected path", function(test) {
tape("line.interpolate(basisOpen)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.basisOpen);
test.equal(l([]), null);
test.equal(l([[0, 0]]), null);
Expand All @@ -144,7 +128,7 @@ tape("line.interpolate(basis-open)(data) generates the expected path", function(
test.end();
});

tape("line.interpolate(basis-closed)(data) generates the expected path", function(test) {
tape("line.interpolate(basisClosed)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.basisClosed);
test.equal(l([]), null);
test.equal(l([[0, 0]]), "M0,0Z");
Expand All @@ -156,7 +140,7 @@ tape("line.interpolate(basis-closed)(data) generates the expected path", functio
});

tape("line.interpolate(cardinal)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.cardinal()); // TODO no empty invocation?
var l = shape.line().interpolate(shape.cardinal);
test.equal(l([]), null);
test.equal(l([[0, 1]]), "M0,1Z");
test.equal(l([[0, 1], [1, 3]]), "M0,1L1,3");
Expand All @@ -165,8 +149,8 @@ tape("line.interpolate(cardinal)(data) generates the expected path", function(te
test.end();
});

tape("line.interpolate(cardinal-open)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.cardinalOpen()); // TODO no empty invocation?
tape("line.interpolate(cardinalOpen)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.cardinalOpen);
test.equal(l([]), null);
test.equal(l([[0, 1]]), null);
test.equal(l([[0, 1], [1, 3]]), null);
Expand All @@ -175,8 +159,8 @@ tape("line.interpolate(cardinal-open)(data) generates the expected path", functi
test.end();
});

tape("line.interpolate(cardinal-closed)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.cardinalClosed()); // TODO no empty invocation?
tape("line.interpolate(cardinalClosed)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.cardinalClosed);
test.equal(l([]), null);
test.equal(l([[0, 1]]), "M0,1Z");
test.equal(l([[0, 1], [1, 3]]), "M1,3L0,1Z");
Expand All @@ -185,8 +169,8 @@ tape("line.interpolate(cardinal-closed)(data) generates the expected path", func
test.end();
});

tape("line.interpolate(catmull-rom)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.catmullRom()); // TODO no empty invocation?
tape("line.interpolate(catmullRom)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.catmullRom);
test.equal(l([]), null);
test.equal(l([[0, 1]]), "M0,1Z");
test.equal(l([[0, 1], [1, 3]]), "M0,1L1,3");
Expand All @@ -195,8 +179,8 @@ tape("line.interpolate(catmull-rom)(data) generates the expected path", function
test.end();
});

tape("line.interpolate(catmull-rom-open)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.catmullRomOpen()); // TODO no empty invocation?
tape("line.interpolate(catmullRomOpen)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.catmullRomOpen);
test.equal(l([]), null);
test.equal(l([[0, 1]]), null);
test.equal(l([[0, 1], [1, 3]]), null);
Expand All @@ -205,8 +189,8 @@ tape("line.interpolate(catmull-rom-open)(data) generates the expected path", fun
test.end();
});

tape("line.interpolate(catmull-rom-closed)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.catmullRomClosed()); // TODO no empty invocation?
tape("line.interpolate(catmullRomClosed)(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.catmullRomClosed);
test.equal(l([]), null);
test.equal(l([[0, 1]]), "M0,1Z");
test.equal(l([[0, 1], [1, 3]]), "M1,3L0,1Z");
Expand All @@ -215,7 +199,7 @@ tape("line.interpolate(catmull-rom-closed)(data) generates the expected path", f
test.end();
});

tape("line.interpolate(catmull-rom, 1)(data) generates the expected path", function(test) {
tape("line.interpolate(catmullRom(1))(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.catmullRom(1));
test.equal(l([]), null);
test.equal(l([[0, 1]]), "M0,1Z");
Expand All @@ -225,7 +209,7 @@ tape("line.interpolate(catmull-rom, 1)(data) generates the expected path", funct
test.end();
});

tape("line.interpolate(catmull-rom-open, 1)(data) generates the expected path", function(test) {
tape("line.interpolate(catmullRomOpen(1))(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.catmullRomOpen(1));
test.equal(l([]), null);
test.equal(l([[0, 1]]), null);
Expand All @@ -235,7 +219,7 @@ tape("line.interpolate(catmull-rom-open, 1)(data) generates the expected path",
test.end();
});

tape("line.interpolate(catmull-rom-closed, 1)(data) generates the expected path", function(test) {
tape("line.interpolate(catmullRomClosed(1))(data) generates the expected path", function(test) {
var l = shape.line().interpolate(shape.catmullRomClosed(1));
test.equal(l([]), null);
test.equal(l([[0, 1]]), "M0,1Z");
Expand All @@ -254,3 +238,66 @@ tape("line.interpolate(natural)(data) generates the expected path", function(tes
test.equal(l([[0, 1], [1, 3], [2, 1], [3, 3]]), "M0,1C0.33333333333333326,2.111111111111111,0.6666666666666665,3.2222222222222223,1,3C1.3333333333333335,2.7777777777777777,1.666666666666667,1.2222222222222223,2,1C2.333333333333333,0.7777777777777778,2.6666666666666665,1.8888888888888888,3,3");
test.end();
});

tape("line.interpolate(cardinal) uses a default tension of zero", function(test) {
var l = shape.line().interpolate(shape.cardinal(0));
test.equal(shape.line().interpolate(shape.cardinal)([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.cardinal())([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.cardinal(null))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.cardinal(undefined))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.end();
});

tape("line.interpolate(cardinalOpen) uses a default tension of zero", function(test) {
var l = shape.line().interpolate(shape.cardinalOpen(0));
test.equal(shape.line().interpolate(shape.cardinalOpen)([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.cardinalOpen())([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.cardinalOpen(null))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.cardinalOpen(undefined))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.end();
});

tape("line.interpolate(cardinalClosed) uses a default tension of zero", function(test) {
var l = shape.line().interpolate(shape.cardinalClosed(0));
test.equal(shape.line().interpolate(shape.cardinalClosed)([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.cardinalClosed())([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.cardinalClosed(null))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.cardinalClosed(undefined))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.end();
});

tape("line.interpolate(catmullRom) uses a default alpha of zero", function(test) {
var l = shape.line().interpolate(shape.catmullRom(0));
test.equal(shape.line().interpolate(shape.catmullRom)([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.catmullRom())([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.catmullRom(null))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.catmullRom(undefined))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.end();
});

tape("line.interpolate(catmullRomOpen) uses a default alpha of zero", function(test) {
var l = shape.line().interpolate(shape.catmullRomOpen(0));
test.equal(shape.line().interpolate(shape.catmullRomOpen)([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.catmullRomOpen())([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.catmullRomOpen(null))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.catmullRomOpen(undefined))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.end();
});

tape("line.interpolate(catmullRomClosed) uses a default alpha of zero", function(test) {
var l = shape.line().interpolate(shape.catmullRomClosed(0));
test.equal(shape.line().interpolate(shape.catmullRomClosed)([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.catmullRomClosed())([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.catmullRomClosed(null))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.catmullRomClosed(undefined))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.end();
});

tape("line.interpolate(bundle) uses a default beta of one", function(test) {
var l = shape.line().interpolate(shape.bundle(1));
test.equal(shape.line().interpolate(shape.bundle)([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.bundle())([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.bundle(null))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.equal(shape.line().interpolate(shape.bundle(undefined))([[0, 1], [1, 3], [2, 1], [3, 3]]), l([[0, 1], [1, 3], [2, 1], [3, 3]]));
test.end();
});

0 comments on commit b33245d

Please sign in to comment.