Skip to content

RangeVertexId

Vertex ID representing a range in a sheet. Note: the range can be 1x1. Such a vertex ID is still not equivalent to the corresponding CellVertexId (though each overlaps and contains the other).

new RangeVertexId(
workbookKey,
sheetIndex,
top,
left,
bottom,
right): RangeVertexId;

number

The dependency graph key of the workbook

number

Zero-based sheet index

number

Zero-based row index

number

Zero-based column index

number

Zero-based row index

number

Zero-based column index

RangeVertexId

VertexId.constructor

bottom: number;

Zero-based index of the bottom row of this range (3 for B2:D4)


key: string;

Underlying string encoding of the identifier. Guaranteed to be identical for two vertex ID instances that identify the same thing within a model, and to be distinct for instances that don’t.

VertexId.key


left: number;

Zero-based index of the leftmost column of this range (1 for B2:D4)


right: number;

Zero-based index of the rightmost column of this range (3 for B2:D4)


sheetIndex: number;

Zero-based index of the worksheet containing this cell


top: number;

Zero-based index of the top row of this range (1 for B2:D4)


workbookKey: number;

Key identifying a workbook in this model. Although it is numeric, the number does not necessarily indicate its ordering in the model.

VertexId.workbookKey

bottomRight(): CellVertexId;

Get a vertex ID representing the bottom-right cell of this range

CellVertexId


contains(other): boolean;

Check whether this range fully contains another vertex ID (meaning all cells of the other vertex ID are within this one).

False if not the same workbook and sheet.

KnownVertexId

boolean

VertexId.contains


offset(rows, cols): RangeVertexId;

Get a range vertex ID at the given offset from this one, in the same sheet, with the same width and height.

number

the number of rows to offset (negative for upward offset)

number

the number of columns to offset (negative for leftward offset)

RangeVertexId


overlaps(otherId): boolean;

Check whether this range overlaps another vertex ID (meaning at least one cell of the other vertex ID is within this one).

False if not the same workbook and sheet.

KnownVertexId

boolean

VertexId.overlaps


topLeft(): CellVertexId;

Get a vertex ID representing the top-left cell of this range

CellVertexId


toRange(): Range;

Derive a bare Range for the range represented by this vertex ID, without workbook or sheet attachment.

Range

VertexId.toRange


toString(): string;

string

VertexId.toString


visitCells(callback, bounds?): void;

Visit a cell vertex ID representing each cell of the range represented by this vertex ID, not exceeding the given bottom-right bounds.

CallbackWithStop<CellVertexId>

function to call with each cell vertex ID

the maximum 0-based x and y coordinates to visit. If not specified, then all coordinates of this range vertex ID are visited.

number

number

void


static fromKey(key): KnownVertexId;

Make a VertexId instance for the given key. Two calls with the same key will return distinct but equivalent instances.

string

KnownVertexId

VertexId.fromKey