Skip to content

blank

Creates invisible positioning guides. Use blank when you need to define positions for other marks (like line or area) 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.select("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 | stringWidth — number for fixed, field name to encode data (default 0)
hnumber | stringHeight — number for fixed, field name to encode data (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"))