IGranularityDescriptor
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Canonical, calendar-independent metadata for a single date granularity.
export interface IGranularityDescriptor
Remarks
This is the single source of truth for classification, ordering and standard/fiscal relations. It intentionally does NOT carry i18n labels — those stay in the consuming apps, keyed off this descriptor.
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
(ALPHA) Which calendar the granularity belongs to. | |||
(ALPHA) (Optional) For generic granularities, the chronological granularity they are derived from (e.g. month_in_year → month). | |||
(ALPHA) (Optional) Standard↔fiscal equivalent of the same period length (year↔fiscal_year, …), when one exists. | |||
(ALPHA) Structural family. | |||
(ALPHA) The canonical SDK granularity token. | |||
readonly string[] | (ALPHA) Uppercase tokens that may appear on execution attribute headers for this granularity ( | ||
boolean | (ALPHA) Whether the granularity is offered to users by default. | ||
number | (ALPHA) Canonical coarse→fine display/drill-down order. Fiscal granularities are ranked immediately after their standard sibling, so filtering to a single calendar reproduces each consumer’s historical order. | ||
boolean | (ALPHA) Whether the granularity is at the time-of-day scale (hour/minute/second and their generic forms). |
Property details
IGranularityDescriptor.affinitypropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Which calendar the granularity belongs to.
affinity: CalendarAffinity;
IGranularityDescriptor.chronologicalOriginpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
For generic granularities, the chronological granularity they are derived from (e.g. month_in_year → month).
chronologicalOrigin?: DateAttributeGranularity;
IGranularityDescriptor.counterpartpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Standard↔fiscal equivalent of the same period length (year↔fiscal_year, …), when one exists.
counterpart?: DateAttributeGranularity;
IGranularityDescriptor.familypropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Structural family.
family: GranularityFamily;
IGranularityDescriptor.granularitypropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
The canonical SDK granularity token.
granularity: DateAttributeGranularity;
IGranularityDescriptor.headerTokenspropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Uppercase tokens that may appear on execution attribute headers for this granularity (IAttributeDescriptorBody.granularity). Catalog/filter paths convert via toSdkGranularity; headers often keep the raw backend token — include every accepted alias (e.g. "DATE" and "DAY"). Empty when the backend does not emit a header token for this granularity.
headerTokens: readonly string[];
IGranularityDescriptor.offeredByDefaultpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Whether the granularity is offered to users by default. false for tokens that exist in the type/backend but are not surfaced in any picker today (the GDC.time.week alias and the EU-week generic variants). Descriptors still exist for them so classification/lookup works; they are just excluded from getGranularities() output unless explicitly requested.
offeredByDefault: boolean;
IGranularityDescriptor.orderpropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Canonical coarse→fine display/drill-down order. Fiscal granularities are ranked immediately after their standard sibling, so filtering to a single calendar reproduces each consumer’s historical order.
order: number;
IGranularityDescriptor.timeScalepropertyAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Whether the granularity is at the time-of-day scale (hour/minute/second and their generic forms).
timeScale: boolean;