From 093dfd71bef09fc67291716894faa58517ea828b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Sun, 26 Mar 2023 17:03:47 +0200 Subject: [PATCH] document box --- README.md | 2 +- src/marks/box.d.ts | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c2386207d..5395202b4e 100644 --- a/README.md +++ b/README.md @@ -1185,7 +1185,7 @@ The box mark is a composite mark consisting of four marks: * a [rule](#rule) representing the extreme values (not including outliers) * a [bar](#bar) representing the interquartile range (trimmed to the data) -* a [tick](#tick) represent the median value, and +* a [tick](#tick) representing the median value, and * a [dot](#dot) representing outliers, if any The given *options* are passed through to these underlying marks, with the exception of the following options: diff --git a/src/marks/box.d.ts b/src/marks/box.d.ts index 1a55e72309..6bb726cc58 100644 --- a/src/marks/box.d.ts +++ b/src/marks/box.d.ts @@ -4,10 +4,52 @@ import type {DotOptions} from "./dot.js"; import type {RuleXOptions, RuleYOptions} from "./rule.js"; import type {TickXOptions, TickYOptions} from "./tick.js"; +/** Options for the boxX mark. */ export type BoxXOptions = DotOptions & BarXOptions & TickXOptions & RuleXOptions; +/** Options for the boxY mark. */ export type BoxYOptions = DotOptions & BarYOptions & TickYOptions & RuleYOptions; +/** + * Draws horizontal boxplots where *x* is quantitative and *y* is ordinal (if + * present). The box mark is a composite mark consisting of four marks: + * + * - a **ruleY** representing the extreme values (not including outliers) + * - a **barX** representing the interquartile range (trimmed to the data) + * - a **tickX** representing the median value, and + * - a **dot** representing outliers, if any + * + * The given *options* are passed through to these underlying marks, with the + * exception of the following options: + * + * - **fill** - the fill color of the bar; defaults to gray + * - **fillOpacity** - the fill opacity of the bar; defaults to 1 + * - **stroke** - the stroke color of the rule, tick, and dot; defaults to + * *currentColor* + * - **strokeOpacity** - the stroke opacity of the rule, tick, and dot; defaults + * to 1 + * - **strokeWidth** - the stroke width of the tick; defaults to 1 + */ export function boxX(data?: Data, options?: BoxXOptions): CompoundMark; +/** + * Draws vertical boxplots where *y* is quantitative and *x* is ordinal (if + * present). The box mark is a composite mark consisting of four marks: + * + * - a **ruleX** representing the extreme values (not including outliers) + * - a **barY** representing the interquartile range (trimmed to the data) + * - a **tickY** representing the median value, and + * - a **dot** representing outliers, if any + * + * The given *options* are passed through to these underlying marks, with the + * exception of the following options: + * + * - **fill** - the fill color of the bar; defaults to gray + * - **fillOpacity** - the fill opacity of the bar; defaults to 1 + * - **stroke** - the stroke color of the rule, tick, and dot; defaults to + * *currentColor* + * - **strokeOpacity** - the stroke opacity of the rule, tick, and dot; defaults + * to 1 + * - **strokeWidth** - the stroke width of the tick; defaults to 1 + */ export function boxY(data?: Data, options?: BoxYOptions): CompoundMark;