Constructs a Metric from the given definition and optional catalogOptions.
The JSON definition of the metric.
Optional
catalogOptions: MetricCatalogOptionsCatalog options that should be applied to all metrics
in a catalog. These are typically provided to the MetricCatalog
when it is constructed which passes them down to here when constructing
the Metric
objects.
Optional
Readonly
categoryThe set of categories used to categorize metric values. Populated from categorySetId.
Optional
Readonly
categoryReferences a set of categories that this metric should use for grading / categorizing values (e.g. "vaccine-categories"). The available CategorySet definitions are defined when constructing the MetricCatalog via categorySets.
Use with either categoryThresholds or categoryValues.
Optional
Readonly
categoryThresholds used for grading the metric. These correspond to the categories specified by categorySetId and there should be one fewer threshold than there are categories.
Optional
Readonly
categoryA list of discrete metric values to be used for categorizing this metric's values (e.g. value 0 should be categorized as "fail" category, 1 categorized as "pass" category).
Optional
Readonly
dataSpecifies how to fetch data for this metric. See MetricDataReference and MetricDataProvider
Readonly
extendedA longer name for the metric used when space is not a concern (e.g. "Cases per 100k population")
Optional
Readonly
extraArbitrary extra metadata related to the metric. This is not used by any bultin
Readonly
formatSpecifies options used to format the metric value when it is displayed.
Readonly
idA unique ID that can be used to reference this metric (e.g. "cases_per_100k").
Optional
Readonly
maxMaximum possible value for the given metric.
Optional
Readonly
minMinimum possible value for the given metric.
Readonly
nameThe default user-facing display name of the metric (e.g. "Cases per 100k").
Returns true if this metric supports categorizing values by calling getCategory.
Formats the provided value for display purposes, using this metric's formatting logic.
The formatted value.
The value to be formatted.
Optional copy to be used if the value is null, else an empty string will be used.
Uses this metric's categorization logic (based on categoryThresholds or categoryValues) to categorize the provided value to a
Category
.
The category that the value falls into.
The value to be categorized.
Private
getPrivate
getGenerated using TypeDoc
Represents something that can be measured, often over a period of time (to create a timeseries). Apps will typically use many different metrics stored in a MetricCatalog.
The
Metric
itself does not contain any data. It only contains the metadata that defines the metric (name, data source, thresholds, etc.). To fetch data, see e.g. fetchData.