Skip to content

Commit

Permalink
document box
Browse files Browse the repository at this point in the history
  • Loading branch information
Fil authored and mbostock committed Mar 31, 2023
1 parent 814d2cd commit 093dfd7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
42 changes: 42 additions & 0 deletions src/marks/box.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 093dfd7

Please sign in to comment.