Skip to content

Commit 3b5889f

Browse files
authored
document delaunay (#1393)
1 parent c76aba1 commit 3b5889f

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

src/marks/delaunay.d.ts

Lines changed: 56 additions & 0 deletions
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+
/** An optional ordinal channel for grouping to produce multiple (possibly overlapping) triangulations. */
913
z?: ChannelValue;
1014
}
1115

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

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

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

55+
/**
56+
* Returns a mark that draws polygons for each cell of the Voronoi tesselation
57+
* of the points given by the **x** and **y** channels.
58+
*
59+
* If **z** is specified, the input points are grouped by *z*, producing a
60+
* separate Voronoi tesselation for each group.
61+
*/
1862
export function voronoi(data?: Data, options?: DelaunayOptions): RenderableMark;
1963

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

0 commit comments

Comments
 (0)