Box Plot Recipe
Minimal flow
Runnable: install ggaction and provide the named data array as plain row objects.
import { chart } from "ggaction";
const program = chart()
.createCanvas()
.createData({ values })
.createBoxPlot({
x: { field: "category", fieldType: "nominal" },
y: { field: "value" },
guides: { legend: false }
});
You must decide
- One categorical field and one quantitative field
- Whether the categorical field belongs on x or y
The library infers
- The current dataset and Cartesian coordinate
- Vertical or horizontal orientation from the complete field pair
- Tukey quartiles and
1.5 × IQRobserved whiskers - A ranged-bar body, median rule, whiskers, caps, and optional outlier points
- Compatible scales, axes, and the perpendicular grid
Use whisker: { type: "minmax" } for observed minimum and maximum whiskers
without an outlier layer. Use editBoxPlot to revise statistics, width, or
component appearance through the stable box-plot owner.