-
Notifications
You must be signed in to change notification settings - Fork 29.8k
/
d3-path-tests.ts
38 lines (25 loc) · 1.11 KB
/
d3-path-tests.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Typescript definition tests for d3/d3-path module
*
* Note: These tests are intended to test the definitions only
* in the sense of typing and call signature consistency. They
* are not intended as functional tests.
*/
import * as d3Path from 'd3-path';
// -----------------------------------------------------------------------------------------
// Test create new path serializer
// -----------------------------------------------------------------------------------------
const context: d3Path.Path = d3Path.path();
// -----------------------------------------------------------------------------------------
// Test path serializer methods
// -----------------------------------------------------------------------------------------
context.moveTo(50, 50);
context.lineTo(100, 100);
context.quadraticCurveTo(150, 200, 200, 100);
context.bezierCurveTo(300, 50, 400, 200, 500, 100);
context.arcTo(250, 250, 300, 300, 60);
context.arc(400, 400, 50, 0, Math.PI / 2);
context.arc(400, 400, 50, 0, Math.PI / 2, true);
context.rect(60, 60, 100, 200);
context.closePath();
const pathString: string = context.toString();