blank
Creates invisible positioning guides. Use blank when you need to define positions for other marks (like line or ribbon) without rendering visible shapes.
A blank draws nothing at all: it takes part in layout, carries its datum, can be named and selected with selectAll, and feeds the color scale, but it produces no SVG element and no hover target. That is unconditional — there is no option that makes a blank paint.
js
const locations = Object.entries(lakeLocations).map(([lake, { x, y }]) => ({
lake,
x,
y,
}));
gf.layer([
gf
.chart(locations)
.flow(gf.scatter({ by: "lake", x: "x", y: "y" }))
.mark(gf.blank().name("points")),
gf
.chart(gf.selectAll("points"))
.mark(gf.line({ stroke: "steelblue", strokeWidth: 2 })),
]).render(root, { w: 400, h: 250, axes: true });Signature
ts
blank({ w?, h?, fill?, debug? })Parameters
An invisible sizing/positioning guide — a rect that emits no display items at all, with a restricted channel set (no x/y/cx/cy/x2/y2/theta/r — position it via a layout operator).
| Option | Type | Default | Description |
|---|---|---|---|
emX | boolean | Embed x in the parent's x space. | |
emY | boolean | Embed y in the parent's y space. | |
w | number | string | FieldExpr | 0 | Width. |
h | number | string | FieldExpr | 0 | Height. |
fill | string | FieldExpr | Fill color. A blank never paints; fill only seeds the shared color scale. | |
debug | boolean | Dev-only flag: logs this mark's key and datum to the console as it is built. It changes nothing about what is drawn. |
Examples
ts
// Create invisible anchor points for a line chart
.mark(blank().name("points"))
// Blank with height encoding for area charts
.mark(blank({ h: "value" }).name("bars"))
// Log each blank's key and datum to the console (it still draws nothing)
.mark(blank({ debug: true }).name("guides"))