|
1 | 1 | import assert from "assert";
|
2 | 2 | import {path} from "d3-path";
|
3 |
| -import {link, linkHorizontal, linkVertical} from "../src/index.js"; |
| 3 | +import {link, linkHorizontal, linkVertical, linkRadial} from "../src/index.js"; |
4 | 4 | import {curveLinear, curveBumpX, curveBumpY} from "../src/index.js";
|
5 | 5 | import {assertPathEqual} from "./asserts.js";
|
6 | 6 |
|
@@ -112,3 +112,13 @@ it("link.context(context) sets the context", () => {
|
112 | 112 | assert.strictEqual(l({source: [0, 1], target: [2, 3]}), undefined);
|
113 | 113 | assertPathEqual(p, "M0,1L2,3");
|
114 | 114 | });
|
| 115 | + |
| 116 | +it("linkRadial() works as expected", () => { |
| 117 | + const l = linkRadial(), l2 = link(); |
| 118 | + assert.strictEqual(l.source(), l2.source()); |
| 119 | + assert.strictEqual(l.target(), l2.target()); |
| 120 | + assert.strictEqual(l.angle(), l2.x()); |
| 121 | + assert.strictEqual(l.radius(), l2.y()); |
| 122 | + assert.strictEqual(l.context(), l2.context()); |
| 123 | + assertPathEqual(l({source: [0, 1], target: [Math.PI/2, 3]}), "M0,-1C0,-2,2,0,3,0"); |
| 124 | +}); |
0 commit comments