Skip to content

Commit 419f499

Browse files
authored
Merge branch 'main' into fil/ts-rect
2 parents 70e54ad + 45d0c97 commit 419f499

File tree

2 files changed

+188
-13
lines changed

2 files changed

+188
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ All marks support the following optional channels:
786786
* **strokeOpacity** - a stroke opacity; bound to the *opacity* scale
787787
* **strokeWidth** - a stroke width (in pixels)
788788
* **opacity** - an object opacity; bound to the *opacity* scale
789-
* **title** - a tooltip (a string of text, possibly with newlines)
789+
* **title** - an accessible, short-text description (a string of text, possibly with newlines)
790790
* **href** - a URL to link to
791791
* **ariaLabel** - a short label representing the value in the accessibility tree
792792

src/mark.d.ts

Lines changed: 187 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export type RenderFunction = (
5454
* A mark implementation or mark-like object; one of:
5555
*
5656
* - 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
5858
* - an array of mark implementations or mark-like objects
5959
* - null or undefined, to render nothing
6060
*/
@@ -83,7 +83,7 @@ export interface MarkOptions {
8383
reverse?: boolean;
8484

8585
/**
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
8787
* channel values, or imputes ordinal scale domains from this mark’s channels.
8888
*
8989
* When imputing ordinal scale domains from channel values, the **sort**
@@ -103,8 +103,7 @@ export interface MarkOptions {
103103
* sort: {y: {value: "x", reverse: true}}
104104
* ```
105105
*
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:
108107
*
109108
* - a function for comparing data, returning a signed number
110109
* - a channel value definition for sorting given values in ascending order
@@ -128,14 +127,14 @@ export interface MarkOptions {
128127
initializer?: InitializerFunction;
129128

130129
/**
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.
133132
*/
134133
fx?: ChannelValue;
135134

136135
/**
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.
139138
*/
140139
fy?: ChannelValue;
141140

@@ -231,37 +230,213 @@ export interface MarkOptions {
231230
*/
232231
marginLeft?: number;
233232

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+
*/
235238
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+
*/
236246
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+
*/
237254
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+
*/
238261
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+
*/
239269
title?: ChannelValue;
240270

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+
*/
242280
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+
*/
243286
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+
*/
244292
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+
*/
245302
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+
*/
246312
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+
*/
247322
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+
*/
248332
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+
*/
249340
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+
*/
250348
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+
*/
251356
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+
*/
252364
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+
*/
253374
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+
*/
254381
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+
*/
255392
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+
*/
256400
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+
*/
257410
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+
*/
258417
shapeRendering?: string;
259418

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+
*/
261425
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+
*/
262434
target?: string;
263435

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+
*/
265440
channels?: Channels;
266441
}
267442

0 commit comments

Comments
 (0)