Skip to content

Commit 1537c0d

Browse files
committed
document delaunay
1 parent 61ae5f3 commit 1537c0d

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

src/marks/delaunay.d.ts

+56
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,74 @@ import type {CurveOptions} from "../curve.js";
33
import type {Data, MarkOptions, RenderableMark} from "../mark.js";
44
import type {MarkerOptions} from "../marker.js";
55

6+
/** Options for the Delaunay marks. */
67
export interface DelaunayOptions extends MarkOptions, MarkerOptions, CurveOptions {
8+
/** A channel for the horizontal position, typically bound to the *x* scale. */
79
x?: ChannelValueSpec;
10+
/** A channel for the vertical position, typically bound to the *y* scale. */
811
y?: ChannelValueSpec;
12+
/** Groups points into series, constructing a mark for each group. */
913
z?: ChannelValue;
1014
}
1115

16+
/**
17+
* Draws links for each edge of the Delaunay triangulation of the *data* points
18+
* given by the **x** and **y** channels. Supports the same options as the
19+
* **link**, except that **x1**, **y1**, **x2**, and **y2** are derived
20+
* automatically from **x** and **y**. When an aesthetic channel is specified
21+
* (such as **stroke** or **strokeWidth**), the link inherits the corresponding
22+
* channel value from one of its two endpoints arbitrarily.
23+
*
24+
* If a **z** channel is specified, the input points are grouped by *z*, and
25+
* separate Delaunay triangulations are constructed for each group.
26+
*/
1227
export function delaunayLink(data?: Data, options?: DelaunayOptions): RenderableMark;
1328

29+
/**
30+
* Draws a mesh of the Delaunay triangulation of the points given by the **x**
31+
* and **y** channels. The **stroke** option defaults to _currentColor_, and the
32+
* **strokeOpacity** defaults to 0.2. The **fill** option is not supported. When
33+
* an aesthetic channel is specified (such as **stroke** or **strokeWidth**),
34+
* the mesh inherits the corresponding channel value from one of its constituent
35+
* points arbitrarily.
36+
*
37+
* If a **z** channel is specified, the input points are grouped by *z*, and
38+
* separate Delaunay triangulations are constructed for each group.
39+
*/
1440
export function delaunayMesh(data?: Data, options?: DelaunayOptions): RenderableMark;
1541

42+
/**
43+
* Draws a convex hull around the points given by the **x** and **y** channels.
44+
* The **stroke** option defaults to _currentColor_ and the **fill** option
45+
* defaults to _none_. When an aesthetic channel is specified (such as
46+
* **stroke** or **strokeWidth**), the hull inherits the corresponding channel
47+
* value from one of its constituent points arbitrarily.
48+
*
49+
* If a **z** channel is specified, the input points are grouped by *z*, and
50+
* separate convex hulls are constructed for each group. If the **z** channel is
51+
* not specified, it defaults to either the **fill** channel, if any, or the
52+
* **stroke** channel, if any.
53+
*/
1654
export function hull(data?: Data, options?: DelaunayOptions): RenderableMark;
1755

56+
/**
57+
* Draws polygons for each cell of the Voronoi tesselation of the points given
58+
* by the **x** and **y** channels.
59+
*
60+
* If a **z** channel is specified, the input points are grouped by *z*, and
61+
* separate Voronoi tesselations are constructed for each group.
62+
*/
1863
export function voronoi(data?: Data, options?: DelaunayOptions): RenderableMark;
1964

65+
/**
66+
* Draws a mesh for the cell boundaries of the Voronoi tesselation of the points
67+
* given by the **x** and **y** channels. The **stroke** option defaults to
68+
* _currentColor_, and the **strokeOpacity** defaults to 0.2. The **fill**
69+
* option is not supported. When an aesthetic channel is specified (such as
70+
* **stroke** or **strokeWidth**), the mesh inherits the corresponding channel
71+
* value from one of its constituent points arbitrarily.
72+
*
73+
* If a **z** channel is specified, the input points are grouped by *z*, and
74+
* separate Voronoi tesselations are constructed for each group.
75+
*/
2076
export function voronoiMesh(data?: Data, options?: DelaunayOptions): RenderableMark;

0 commit comments

Comments
 (0)