Constructs a new CsvDataProvider instance.
A unique provider id to associate with the provider (e.g. "my-datasource-csv"). This ID can be used from a MetricDataReference in a metric to reference the data from this provider.
Options to configure the provider. The regionColumn must match the region identifier in Act Now Coalition's regions package. (e.g. a nation's identifier in the regions package is the ISO 3 code. So data for a nation must have ISO 3 code as its identifier.)
Private
dataPrivate
Optional
Readonly
dateReadonly
idA unique provider id to associate with the provider (e.g. "mock"). This ID can be used from a MetricDataReference in a metric to reference the data from this provider.
Private
Optional
Readonly
longPrivate
Readonly
regionPrivate
Readonly
regionPrivate
Optional
Readonly
urlPrivate
fetchFetches all of the data for the specified regions and metrics, optionally including timeseries metric data if available.
The fetched data for the specified regions and metrics.
One or more regions to fetch data for.
One or more metrics to fetch data for.
Whether to fetch timeseries data.
The metric catalog using this data provider. The data provider can call back into the catalog if it needs to fetch dependent data.
Method to be overridden by subclasses to fetch the specified MetricData.
The MetricData
for the given metric
and region
.
Private
getGenerated using TypeDoc
Data Provider for importing data from wide- or long-format CSV files.
For wide-format CSVs, metrics should specify Metric.dataReference.column with the name of the column containing the metric's data.
For long-format CSVs, metrics should specify Metric.dataReference.variable. This value should be present in the CSV's variableColumn.
Example wide-format CSV:
Example long-format CSV: