Skip to content

blank

Creates invisible positioning guides. Use blank when you need to define positions for other marks (like line or ribbon) without rendering visible shapes.

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?, stroke?, strokeWidth?, rx?, ry?, debug? })

Parameters

OptionTypeDescription
wnumber | string | Value<number> | FieldExprWidth — same channel-value shapes as a leaf mark's "size" channel (e.g. rect's w): a number for fixed, a field name to encode data, or a field(...) pipeline like field("count").sum() for an aggregate (default 0)
hnumber | string | Value<number> | FieldExprHeight — same shapes as w (default 0)
fillstringFill color (invisible by default)
strokestringStroke color
strokeWidthnumberStroke width
rxnumberHorizontal border radius
rynumberVertical border radius
debugbooleanWhen true, renders visibly for debugging

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"))

// Debug mode to see blank positions
.mark(blank({ debug: true }).name("guides"))