@@ -54,7 +54,7 @@ export type RenderFunction = (
54
54
* A mark implementation or mark-like object; one of:
55
55
*
56
56
* - a renderable mark, extending Mark and implementing *mark*.render
57
- * - a bare render function, for a one-off custom mark
57
+ * - a bare render function, for a custom functional mark
58
58
* - an array of mark implementations or mark-like objects
59
59
* - null or undefined, to render nothing
60
60
*/
@@ -83,7 +83,7 @@ export interface MarkOptions {
83
83
reverse ?: boolean ;
84
84
85
85
/**
86
- * Either applies a transform to sort the mark’s render index by the specified
86
+ * Either applies a transform to sort the mark’s index by the specified
87
87
* channel values, or imputes ordinal scale domains from this mark’s channels.
88
88
*
89
89
* When imputing ordinal scale domains from channel values, the **sort**
@@ -103,8 +103,7 @@ export interface MarkOptions {
103
103
* sort: {y: {value: "x", reverse: true}}
104
104
* ```
105
105
*
106
- * When sorting the mark’s render index, the **sort** option is instead one
107
- * of:
106
+ * When sorting the mark’s index, the **sort** option is instead one of:
108
107
*
109
108
* - a function for comparing data, returning a signed number
110
109
* - a channel value definition for sorting given values in ascending order
@@ -128,14 +127,14 @@ export interface MarkOptions {
128
127
initializer ?: InitializerFunction ;
129
128
130
129
/**
131
- * The horizontal facet position, an optional channel for mark-level faceting
132
- * bound to the *fx* scale.
130
+ * The horizontal facet position, a channel for mark-level faceting bound to
131
+ * the *fx* scale.
133
132
*/
134
133
fx ?: ChannelValue ;
135
134
136
135
/**
137
- * The vertical facet position, an optional channel for mark-level faceting
138
- * bound to the *fy* scale.
136
+ * The vertical facet position, a channel for mark-level faceting bound to the
137
+ * *fy* scale.
139
138
*/
140
139
fy ?: ChannelValue ;
141
140
@@ -231,37 +230,213 @@ export interface MarkOptions {
231
230
*/
232
231
marginLeft ?: number ;
233
232
234
- // accessibility and interaction
233
+ /**
234
+ * The [aria-description][1]; a constant textual description.
235
+ *
236
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-description
237
+ */
235
238
ariaDescription ?: string ;
239
+
240
+ /**
241
+ * The [aria-hidden][1] state; a constant indicating whether the element is
242
+ * exposed to an accessibility API.
243
+ *
244
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden
245
+ */
236
246
ariaHidden ?: string ;
247
+
248
+ /**
249
+ * The [aria-label][1]; a channel specifying short textual labels representing
250
+ * the value in the accessibility tree.
251
+ *
252
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label
253
+ */
237
254
ariaLabel ?: ChannelValue ;
255
+
256
+ /**
257
+ * The [pointer-events][1] property; a constant string such as *none*.
258
+ *
259
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events
260
+ */
238
261
pointerEvents ?: string ;
262
+
263
+ /**
264
+ * The [title][1]; a channel specifying accessible, short textual descriptions
265
+ * as strings (possibly with newlines).
266
+ *
267
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title
268
+ */
239
269
title ?: ChannelValue ;
240
270
241
- // aesthetics
271
+ /**
272
+ * How to clip the mark; one of:
273
+ *
274
+ * - *frame* or true - clip to the plot’s frame (inner area)
275
+ * - *sphere* - clip to the projected sphere (*e.g.*, front hemisphere)
276
+ * - null or false - do not clip
277
+ *
278
+ * The *sphere* clip option requires a geographic projection.
279
+ */
242
280
clip ?: "frame" | "sphere" | boolean | null ;
281
+
282
+ /**
283
+ * The horizontal offset in pixels; a constant option. On low-density screens,
284
+ * an additional 0.5px offset may be applied for crisp edges.
285
+ */
243
286
dx ?: number ;
287
+
288
+ /**
289
+ * The vertical offset in pixels; a constant option. On low-density screens,
290
+ * an additional 0.5px offset may be applied for crisp edges.
291
+ */
244
292
dy ?: number ;
293
+
294
+ /**
295
+ * The [fill][1]; a constant CSS color string, or a channel typically bound to
296
+ * the *color* scale. If all channel values are valid CSS colors, by default
297
+ * the channel will not be bound to the *color* scale, interpreting the colors
298
+ * literally.
299
+ *
300
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill
301
+ */
245
302
fill ?: ChannelValueSpec ;
303
+
304
+ /**
305
+ * The [fill-opacity][1]; a constant number between 0 and 1, or a channel
306
+ * typically bound to the *opacity* scale. If all channel values are numbers
307
+ * in [0, 1], by default the channel will not be bound to the *opacity* scale,
308
+ * interpreting the opacities literally.
309
+ *
310
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-opacity
311
+ */
246
312
fillOpacity ?: ChannelValueSpec ;
313
+
314
+ /**
315
+ * The [stroke][1]; a constant CSS color string, or a channel typically bound
316
+ * to the *color* scale. If all channel values are valid CSS colors, by
317
+ * default the channel will not be bound to the *color* scale, interpreting
318
+ * the colors literally.
319
+ *
320
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke
321
+ */
247
322
stroke ?: ChannelValueSpec ;
323
+
324
+ /**
325
+ * The [stroke-dasharray][1]; a constant number indicating the length in
326
+ * pixels of alternating dashes and gaps, or a constant string of numbers
327
+ * separated by spaces or commas (_e.g._, *10 2* for dashes of 10 pixels
328
+ * separated by gaps of 2 pixels), or *none* (the default) for no dashing
329
+ *
330
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray
331
+ */
248
332
strokeDasharray ?: string | number ;
333
+
334
+ /**
335
+ * The [stroke-dashoffset][1]; a constant indicating the offset in pixels of
336
+ * the first dash along the stroke; defaults to zero.
337
+ *
338
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset
339
+ */
249
340
strokeDashoffset ?: string | number ;
341
+
342
+ /**
343
+ * The [stroke-linecap][1]; a constant specifying how to cap stroked paths,
344
+ * such as *butt*, *round*, or *square*.
345
+ *
346
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap
347
+ */
250
348
strokeLinecap ?: string ;
349
+
350
+ /**
351
+ * The [stroke-linejoin][1]; a constant specifying how to join stroked paths,
352
+ * such as *bevel*, *miter*, *miter-clip*, or *round*.
353
+ *
354
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linejoin
355
+ */
251
356
strokeLinejoin ?: string ;
357
+
358
+ /**
359
+ * The [stroke-miterlimit][1]; a constant number specifying how to limit the
360
+ * length of *miter* joins on stroked paths.
361
+ *
362
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit
363
+ */
252
364
strokeMiterlimit ?: number ;
365
+
366
+ /**
367
+ * The [stroke-opacity][1]; a constant between 0 and 1, or a channel typically
368
+ * bound to the *opacity* scale. If all channel values are numbers in [0, 1],
369
+ * by default the channel will not be bound to the *opacity* scale,
370
+ * interpreting the opacities literally.
371
+ *
372
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-opacity
373
+ */
253
374
strokeOpacity ?: ChannelValueSpec ;
375
+
376
+ /**
377
+ * The [stroke-width][1]; a constant number in pixels, or a channel.
378
+ *
379
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width
380
+ */
254
381
strokeWidth ?: ChannelValueSpec ;
382
+
383
+ /**
384
+ * The [opacity][1]; a constant between 0 and 1, or a channel typically bound
385
+ * to the *opacity* scale. If all channel values are numbers in [0, 1], by
386
+ * default the channel will not be bound to the *opacity* scale, interpreting
387
+ * the opacities literally. For faster rendering, prefer the **strokeOpacity**
388
+ * or **fillOpacity** option.
389
+ *
390
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/opacity
391
+ */
255
392
opacity ?: ChannelValueSpec ;
393
+
394
+ /**
395
+ * The [mix-blend-mode][1]; a constant string specifying how to blend content
396
+ * such as *multiply*.
397
+ *
398
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode
399
+ */
256
400
mixBlendMode ?: string ;
401
+
402
+ /**
403
+ * The [paint-order][1]; a constant string specifying the order in which the
404
+ * **fill**, **stroke**, and any markers are drawn; defaults to *normal*,
405
+ * which draws the fill, then stroke, then markers; defaults to *stroke* for
406
+ * the text mark to create a “halo” around text to improve legibility.
407
+ *
408
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/paint-order
409
+ */
257
410
paintOrder ?: string ;
411
+
412
+ /**
413
+ * The [shape-rendering][1]; a constant string such as *crispEdges*.
414
+ *
415
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering
416
+ */
258
417
shapeRendering ?: string ;
259
418
260
- // links
419
+ /**
420
+ * The [href][1]; a channel specifying URLs for clickable links. May be used
421
+ * in conjunction with the **target** option to open links in another window.
422
+ *
423
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/href
424
+ */
261
425
href ?: ChannelValue ;
426
+
427
+ /**
428
+ * The [target][1]; a constant string specifying the target window (_e.g._,
429
+ * *_blank*) for clickable links; used in conjunction with the **href**
430
+ * option.
431
+ *
432
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/target
433
+ */
262
434
target ?: string ;
263
435
264
- // custom channels
436
+ /**
437
+ * An object defining additional custom channels. This meta option may be used
438
+ * by an **initializer** to declare extra channels.
439
+ */
265
440
channels ?: Channels ;
266
441
}
267
442
0 commit comments