range
Creates a fixed-shape period matrix range builder; only .fill(value)
materializes the matrix.
API Reference
Signature
Parameters
Accepted boundary formats: year → YYYY; quarter → YYYY or YYYY-Qn;
month → YYYY or YYYY-MM; day → YYYY, YYYY-MM, or YYYY-MM-DD.
Returns
A builder; .fill(value) returns the period matrix (YearMatrix /
QuarterMatrix / MonthMatrix / DayMatrix) with out-of-range and
non-existent positions set to "-".
Throws
MATRIX_INVALID_RANGE_OPTIONS—bymissing or not one of the four.MATRIX_INVALID_RANGE_BOUNDARY— invalid date/quarter, granularity mismatch (e.g.YYYY-MMwithby: "quarter"), orstartlater thanend.
Agent Contract
Agent Notes
- The matrix only exists after
.fill(value);Matrix.range(...)alone returns a builder. - Match the boundary format to
by; do not mix granularities (e.g. noYYYY-Qnwithby: "month"). - See period-shapes for the resulting shapes.