Constructor
new FilterSet(year, scenario, application, substance, metric, dimension, baseline, attributeImporter, customDefinitions)
Create a new filter set.
Parameters:
| Name | Type | Description |
|---|---|---|
year |
number | null | Year for which data will be filtered. |
scenario |
string | null | Name of scenario for which to filter. |
application |
string | null | Name of application for which to filter. |
substance |
string | null | Name of substance which to filter. |
metric |
string | null | Metric name for which to display. Note that this is the full metric names like sales or sales:import. |
dimension |
string | null | Dimension type for which to filter. |
baseline |
string | null | Baseline scenario for comparison. |
attributeImporter |
boolean | null | Whether to attribute imported equipment initial charge to importer (true) or exporter (false). |
customDefinitions |
Object | null | Custom metric definitions object with keys 'emissions' and 'sales' mapping to arrays of submetrics. |
- Source:
Methods
getApplication() → {string|null}
Get the application filter.
- Source:
Returns:
The application for which to filter like commercial
refrigerant.
- Type
- string | null
getAttributeImporter() → {boolean|null}
Get the attribute importer setting.
- Source:
Returns:
Whether to attribute imported equipment initial
charge to importer (true) or exporter (false), or null if not set.
- Type
- boolean | null
getBaseline() → {string|null}
Get the baseline scenario.
- Source:
Returns:
The baseline scenario name for comparison.
- Type
- string | null
getCustomDefinition(metricFamily) → {Array.<string>|null}
Get custom metric definition for a specific metric family.
Parameters:
| Name | Type | Description |
|---|---|---|
metricFamily |
string | The metric family ('emissions' or 'sales'). |
- Source:
Returns:
Array of selected submetrics or null if none.
- Type
- Array.<string> | null
getDimension() → {string|null}
Get the dimension filter.
- Source:
Returns:
The dimension for which to filter like simulations.
- Type
- string | null
getFullMetricName() → {string|null}
Get the full name of the metric to display.
- Source:
Returns:
The metric to display like sales. Note that this is
the full name like sales:manufacture or sales:all.
- Type
- string | null
getMetric() → {string|null}
Get the type of metric to display like sales.
- Source:
Returns:
The metric family to display like sales.
- Type
- string | null
getScenario() → {string|null}
Get the scenario filter.
- Source:
Returns:
The scenario for which to filter like Business as
Usual.
- Type
- string | null
getSubMetric() → {string|null}
Get the substream of the metric to dsiplay.
- Source:
Returns:
The submetric to display like import or null if no
submetric.
- Type
- string | null
getSubstance() → {string|null}
Get the substance filter.
- Source:
Returns:
The substance for which to filter like HFC-134a.
- Type
- string | null
getUnits() → {string|null}
Get the units of the metric to dsiplay.
- Source:
Returns:
The units desired or null if not given.
- Type
- string | null
getWithApplication(newApplication) → {FilterSet}
Get a new filter set with updated application.
Parameters:
| Name | Type | Description |
|---|---|---|
newApplication |
string | The new application value. |
- Source:
Returns:
New filter set with updated application.
- Type
- FilterSet
getWithAttributeImporter(newAttributeImporter) → {FilterSet}
Get a new filter set with updated attribute importer setting.
Parameters:
| Name | Type | Description |
|---|---|---|
newAttributeImporter |
boolean | The new attribute importer value. |
- Source:
Returns:
New filter set with updated attribute importer.
- Type
- FilterSet
getWithBaseline(newBaseline) → {FilterSet}
Get a new filter set with updated baseline.
Parameters:
| Name | Type | Description |
|---|---|---|
newBaseline |
string | The new baseline scenario value. |
- Source:
Returns:
New filter set with updated baseline.
- Type
- FilterSet
getWithCustomDefinition(metricFamily, definition) → {FilterSet}
Get a new filter set with updated custom definition for a metric family.
Parameters:
| Name | Type | Description |
|---|---|---|
metricFamily |
string | The metric family ('emissions' or 'sales'). |
definition |
Array.<string> | null | Array of submetrics or null. |
- Source:
Returns:
New filter set with updated custom definition.
- Type
- FilterSet
getWithDimension(newDimension) → {FilterSet}
Get a new filter set with updated dimension.
Parameters:
| Name | Type | Description |
|---|---|---|
newDimension |
string | The new dimension value. |
- Source:
Returns:
New filter set with updated dimension.
- Type
- FilterSet
getWithDimensionValue(value) → {FilterSet}
Get a new filter set with updated dimension value.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
* | The new dimension value (simulations, applications, substances). |
- Source:
Returns:
New filter set with updated dimension.
- Type
- FilterSet
getWithMetric(newMetric) → {FilterSet}
Get a new filter set with updated metric.
Parameters:
| Name | Type | Description |
|---|---|---|
newMetric |
string | The new metric value. |
- Source:
Returns:
New filter set with updated metric.
- Type
- FilterSet
getWithScenario(newScenario) → {FilterSet}
Get a new filter set with updated scenario.
Parameters:
| Name | Type | Description |
|---|---|---|
newScenario |
string | The new scenario value. |
- Source:
Returns:
New filter set with updated scenario.
- Type
- FilterSet
getWithSubstance(newSubstance) → {FilterSet}
Get a new filter set with updated substance.
Parameters:
| Name | Type | Description |
|---|---|---|
newSubstance |
string | The new substance value. |
- Source:
Returns:
New filter set with updated substance.
- Type
- FilterSet
getWithYear(newYear) → {FilterSet}
Get a new filter set with updated year.
Parameters:
| Name | Type | Description |
|---|---|---|
newYear |
number | The new year value. |
- Source:
Returns:
New filter set with updated year.
- Type
- FilterSet
getYear() → {number|null}
Get the year filter.
- Source:
Returns:
The year for which to filter like 10.
- Type
- number | null
hasSingleScenario(scenarios) → {boolean}
Check if there is a single scenario selected or available.
Parameters:
| Name | Type | Description |
|---|---|---|
scenarios |
Set.<string> | Set of available scenarios. |
- Source:
Returns:
True if single scenario.
- Type
- boolean
isCustomMetric() → {boolean}
Check if the current metric is a custom metric.
- Source:
Returns:
True if current metric uses custom submetric.
- Type
- boolean